Skip to content

Commit 03b72e8

Browse files
authored
Merge pull request cosmicpython#339 from isidroas/patch-1
Appendix validation - command classes
2 parents 667b2fd + 268add8 commit 03b72e8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

appendix_validation.asciidoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ from schema import And, Schema, Use
6363
class Allocate(Command):
6464
6565
_schema = Schema({ #<1>
66-
'orderid': int,
67-
sku: str,
68-
qty: And(Use(int), lambda n: n > 0)
66+
'orderid': str,
67+
'sku': str,
68+
'qty': And(Use(int), lambda n: n > 0)
6969
}, ignore_extra_keys=True)
7070
7171
orderid: str
@@ -111,12 +111,14 @@ def greater_than_zero(x):
111111
quantity = And(Use(int), greater_than_zero) #<4>
112112
113113
Allocate = command( #<5>
114+
'Allocate',
114115
orderid=int,
115116
sku=str,
116117
qty=quantity
117118
)
118119
119120
AddStock = command(
121+
'AddStock',
120122
sku=str,
121123
qty=quantity
122124
----

0 commit comments

Comments
 (0)