1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! Introduce a new actor.
//!
//! This is required for any actor
//! before it can be used.
//!
//! # Motivation
//!
//! While the explicit creation does create some typing churn,
//! it has 2 advantages:
//!
//! 1. It reduces the likelihood of typos causing damage.
//! Money handling applications
//! are definitely not ones
//! where one wants to have some
//! payment not included
//! because the finger slipped one key.
//! 2. It allows post-reference.
//! For example,
//! [`Concept`] can store a default price
//! to use when none is specified and
//! a GTIN it is referred to by.
//! This allows using the default price
//! when just scanning a GTIN!
//!
//! # Structure
//!
//! Since there are 3 different actors with different arguments
//! that can be created,
//! they are split into 3 different commands.
//! This is especially ergonomic with the [`crate::cmd_args`] macro,
//! since that means no `create` needs to write its own [`Resolve`] impl.
//! They all can use themselves as argument type.
//!
//! # Caveats
//!
//! Creating another actor with the same name
//! (or other handle, e.g. GTIN)
//! replaces the previous actor with that name
//! while also replacing all references for future actions.
//! Previously done payments or deliveries are unaffected!
pub use CreateConcept;
pub use CreateEntity;
pub use CreateObject;