@contractspec/example.service-business-os 1.56.1 → 1.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/browser/client/client.operations.js +72 -0
  2. package/dist/browser/client/client.schema.js +31 -0
  3. package/dist/browser/client/index.js +74 -0
  4. package/dist/browser/docs/index.js +96 -0
  5. package/dist/browser/docs/service-business-os.docblock.js +96 -0
  6. package/dist/browser/entities/index.js +246 -0
  7. package/dist/browser/events.js +135 -0
  8. package/dist/browser/example.js +39 -0
  9. package/dist/browser/handlers/index.js +5 -0
  10. package/dist/browser/index.js +752 -0
  11. package/dist/browser/invoice/index.js +77 -0
  12. package/dist/browser/invoice/invoice.operations.js +75 -0
  13. package/dist/browser/invoice/invoice.schema.js +34 -0
  14. package/dist/browser/job/index.js +175 -0
  15. package/dist/browser/job/job.operations.js +172 -0
  16. package/dist/browser/job/job.schema.js +41 -0
  17. package/dist/browser/operations/index.js +506 -0
  18. package/dist/browser/payment/index.js +69 -0
  19. package/dist/browser/payment/payment.operations.js +67 -0
  20. package/dist/browser/payment/payment.schema.js +30 -0
  21. package/dist/browser/presentations/index.js +13 -0
  22. package/dist/browser/presentations.js +172 -0
  23. package/dist/browser/quote/index.js +122 -0
  24. package/dist/browser/quote/quote.operations.js +119 -0
  25. package/dist/browser/quote/quote.schema.js +45 -0
  26. package/dist/browser/service-business-os.capability.js +28 -0
  27. package/dist/browser/service.feature.js +74 -0
  28. package/dist/client/client.operations.d.ts +54 -60
  29. package/dist/client/client.operations.d.ts.map +1 -1
  30. package/dist/client/client.operations.js +71 -51
  31. package/dist/client/client.schema.d.ts +54 -59
  32. package/dist/client/client.schema.d.ts.map +1 -1
  33. package/dist/client/client.schema.js +30 -75
  34. package/dist/client/index.d.ts +6 -3
  35. package/dist/client/index.d.ts.map +1 -0
  36. package/dist/client/index.js +74 -3
  37. package/dist/docs/index.d.ts +2 -1
  38. package/dist/docs/index.d.ts.map +1 -0
  39. package/dist/docs/index.js +97 -1
  40. package/dist/docs/service-business-os.docblock.d.ts +2 -1
  41. package/dist/docs/service-business-os.docblock.d.ts.map +1 -0
  42. package/dist/docs/service-business-os.docblock.js +52 -64
  43. package/dist/entities/index.d.ts +156 -161
  44. package/dist/entities/index.d.ts.map +1 -1
  45. package/dist/entities/index.js +236 -278
  46. package/dist/events.d.ts +253 -259
  47. package/dist/events.d.ts.map +1 -1
  48. package/dist/events.js +123 -217
  49. package/dist/example.d.ts +2 -6
  50. package/dist/example.d.ts.map +1 -1
  51. package/dist/example.js +37 -50
  52. package/dist/handlers/index.d.ts +11 -16
  53. package/dist/handlers/index.d.ts.map +1 -1
  54. package/dist/handlers/index.js +5 -5
  55. package/dist/index.d.ts +13 -18
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +752 -18
  58. package/dist/invoice/index.d.ts +6 -3
  59. package/dist/invoice/index.d.ts.map +1 -0
  60. package/dist/invoice/index.js +77 -3
  61. package/dist/invoice/invoice.operations.d.ts +54 -60
  62. package/dist/invoice/invoice.operations.d.ts.map +1 -1
  63. package/dist/invoice/invoice.operations.js +74 -55
  64. package/dist/invoice/invoice.schema.d.ts +54 -59
  65. package/dist/invoice/invoice.schema.d.ts.map +1 -1
  66. package/dist/invoice/invoice.schema.js +33 -75
  67. package/dist/job/index.d.ts +6 -3
  68. package/dist/job/index.d.ts.map +1 -0
  69. package/dist/job/index.js +175 -3
  70. package/dist/job/job.operations.d.ts +220 -226
  71. package/dist/job/job.operations.d.ts.map +1 -1
  72. package/dist/job/job.operations.js +167 -169
  73. package/dist/job/job.schema.d.ts +67 -72
  74. package/dist/job/job.schema.d.ts.map +1 -1
  75. package/dist/job/job.schema.js +39 -95
  76. package/dist/node/client/client.operations.js +72 -0
  77. package/dist/node/client/client.schema.js +31 -0
  78. package/dist/node/client/index.js +74 -0
  79. package/dist/node/docs/index.js +96 -0
  80. package/dist/node/docs/service-business-os.docblock.js +96 -0
  81. package/dist/node/entities/index.js +246 -0
  82. package/dist/node/events.js +135 -0
  83. package/dist/node/example.js +39 -0
  84. package/dist/node/handlers/index.js +5 -0
  85. package/dist/node/index.js +752 -0
  86. package/dist/node/invoice/index.js +77 -0
  87. package/dist/node/invoice/invoice.operations.js +75 -0
  88. package/dist/node/invoice/invoice.schema.js +34 -0
  89. package/dist/node/job/index.js +175 -0
  90. package/dist/node/job/job.operations.js +172 -0
  91. package/dist/node/job/job.schema.js +41 -0
  92. package/dist/node/operations/index.js +506 -0
  93. package/dist/node/payment/index.js +69 -0
  94. package/dist/node/payment/payment.operations.js +67 -0
  95. package/dist/node/payment/payment.schema.js +30 -0
  96. package/dist/node/presentations/index.js +13 -0
  97. package/dist/node/presentations.js +172 -0
  98. package/dist/node/quote/index.js +122 -0
  99. package/dist/node/quote/quote.operations.js +119 -0
  100. package/dist/node/quote/quote.schema.js +45 -0
  101. package/dist/node/service-business-os.capability.js +28 -0
  102. package/dist/node/service.feature.js +74 -0
  103. package/dist/operations/index.d.ts +6 -16
  104. package/dist/operations/index.d.ts.map +1 -0
  105. package/dist/operations/index.js +506 -16
  106. package/dist/payment/index.d.ts +6 -3
  107. package/dist/payment/index.d.ts.map +1 -0
  108. package/dist/payment/index.js +69 -3
  109. package/dist/payment/payment.operations.d.ts +50 -56
  110. package/dist/payment/payment.operations.d.ts.map +1 -1
  111. package/dist/payment/payment.operations.js +66 -51
  112. package/dist/payment/payment.schema.d.ts +50 -55
  113. package/dist/payment/payment.schema.d.ts.map +1 -1
  114. package/dist/payment/payment.schema.js +29 -71
  115. package/dist/presentations/index.d.ts +1 -4
  116. package/dist/presentations/index.d.ts.map +1 -1
  117. package/dist/presentations/index.js +13 -17
  118. package/dist/presentations.d.ts +7 -12
  119. package/dist/presentations.d.ts.map +1 -1
  120. package/dist/presentations.js +166 -172
  121. package/dist/quote/index.d.ts +6 -3
  122. package/dist/quote/index.d.ts.map +1 -0
  123. package/dist/quote/index.js +122 -3
  124. package/dist/quote/quote.operations.d.ts +120 -126
  125. package/dist/quote/quote.operations.d.ts.map +1 -1
  126. package/dist/quote/quote.operations.js +117 -96
  127. package/dist/quote/quote.schema.d.ts +83 -88
  128. package/dist/quote/quote.schema.d.ts.map +1 -1
  129. package/dist/quote/quote.schema.js +43 -111
  130. package/dist/service-business-os.capability.d.ts +2 -7
  131. package/dist/service-business-os.capability.d.ts.map +1 -1
  132. package/dist/service-business-os.capability.js +29 -29
  133. package/dist/service.feature.d.ts +1 -6
  134. package/dist/service.feature.d.ts.map +1 -1
  135. package/dist/service.feature.js +73 -164
  136. package/package.json +301 -64
  137. package/dist/client/client.operations.js.map +0 -1
  138. package/dist/client/client.schema.js.map +0 -1
  139. package/dist/docs/service-business-os.docblock.js.map +0 -1
  140. package/dist/entities/index.js.map +0 -1
  141. package/dist/events.js.map +0 -1
  142. package/dist/example.js.map +0 -1
  143. package/dist/handlers/index.js.map +0 -1
  144. package/dist/invoice/invoice.operations.js.map +0 -1
  145. package/dist/invoice/invoice.schema.js.map +0 -1
  146. package/dist/job/job.operations.js.map +0 -1
  147. package/dist/job/job.schema.js.map +0 -1
  148. package/dist/payment/payment.operations.js.map +0 -1
  149. package/dist/payment/payment.schema.js.map +0 -1
  150. package/dist/presentations/index.js.map +0 -1
  151. package/dist/presentations.js.map +0 -1
  152. package/dist/quote/quote.operations.js.map +0 -1
  153. package/dist/quote/quote.schema.js.map +0 -1
  154. package/dist/service-business-os.capability.js.map +0 -1
  155. package/dist/service.feature.js.map +0 -1
@@ -1,135 +1,129 @@
1
- import * as _contractspec_lib_schema431 from "@contractspec/lib.schema";
2
- import * as _contractspec_lib_contracts28 from "@contractspec/lib.contracts";
3
-
4
- //#region src/quote/quote.operations.d.ts
5
1
  /**
6
2
  * Create a new quote.
7
3
  */
8
- declare const CreateQuoteContract: _contractspec_lib_contracts28.OperationSpec<_contractspec_lib_schema431.SchemaModel<{
9
- clientId: {
10
- type: _contractspec_lib_schema431.FieldType<string, string>;
11
- isOptional: false;
12
- };
13
- title: {
14
- type: _contractspec_lib_schema431.FieldType<string, string>;
15
- isOptional: false;
16
- };
17
- description: {
18
- type: _contractspec_lib_schema431.FieldType<string, string>;
19
- isOptional: true;
20
- };
21
- amount: {
22
- type: _contractspec_lib_schema431.FieldType<number, number>;
23
- isOptional: false;
24
- };
25
- currency: {
26
- type: _contractspec_lib_schema431.FieldType<string, string>;
27
- isOptional: true;
28
- };
29
- validUntil: {
30
- type: _contractspec_lib_schema431.FieldType<Date, string>;
31
- isOptional: true;
32
- };
33
- orgId: {
34
- type: _contractspec_lib_schema431.FieldType<string, string>;
35
- isOptional: false;
36
- };
37
- ownerId: {
38
- type: _contractspec_lib_schema431.FieldType<string, string>;
39
- isOptional: false;
40
- };
41
- }>, _contractspec_lib_schema431.SchemaModel<{
42
- id: {
43
- type: _contractspec_lib_schema431.FieldType<string, string>;
44
- isOptional: false;
45
- };
46
- clientId: {
47
- type: _contractspec_lib_schema431.FieldType<string, string>;
48
- isOptional: false;
49
- };
50
- title: {
51
- type: _contractspec_lib_schema431.FieldType<string, string>;
52
- isOptional: false;
53
- };
54
- description: {
55
- type: _contractspec_lib_schema431.FieldType<string, string>;
56
- isOptional: true;
57
- };
58
- amount: {
59
- type: _contractspec_lib_schema431.FieldType<number, number>;
60
- isOptional: false;
61
- };
62
- currency: {
63
- type: _contractspec_lib_schema431.FieldType<string, string>;
64
- isOptional: false;
65
- };
66
- status: {
67
- type: _contractspec_lib_schema431.FieldType<string, string>;
68
- isOptional: false;
69
- };
70
- validUntil: {
71
- type: _contractspec_lib_schema431.FieldType<Date, string>;
72
- isOptional: true;
73
- };
74
- createdAt: {
75
- type: _contractspec_lib_schema431.FieldType<Date, string>;
76
- isOptional: false;
77
- };
4
+ export declare const CreateQuoteContract: import("@contractspec/lib.contracts").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
5
+ clientId: {
6
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
7
+ isOptional: false;
8
+ };
9
+ title: {
10
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ description: {
14
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
15
+ isOptional: true;
16
+ };
17
+ amount: {
18
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
19
+ isOptional: false;
20
+ };
21
+ currency: {
22
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
23
+ isOptional: true;
24
+ };
25
+ validUntil: {
26
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
27
+ isOptional: true;
28
+ };
29
+ orgId: {
30
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
31
+ isOptional: false;
32
+ };
33
+ ownerId: {
34
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
35
+ isOptional: false;
36
+ };
37
+ }>, import("@contractspec/lib.schema").SchemaModel<{
38
+ id: {
39
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
40
+ isOptional: false;
41
+ };
42
+ clientId: {
43
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
44
+ isOptional: false;
45
+ };
46
+ title: {
47
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ description: {
51
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
52
+ isOptional: true;
53
+ };
54
+ amount: {
55
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
56
+ isOptional: false;
57
+ };
58
+ currency: {
59
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
60
+ isOptional: false;
61
+ };
62
+ status: {
63
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
64
+ isOptional: false;
65
+ };
66
+ validUntil: {
67
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
68
+ isOptional: true;
69
+ };
70
+ createdAt: {
71
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
72
+ isOptional: false;
73
+ };
78
74
  }>, undefined>;
79
75
  /**
80
76
  * Accept a quote.
81
77
  */
82
- declare const AcceptQuoteContract: _contractspec_lib_contracts28.OperationSpec<_contractspec_lib_schema431.SchemaModel<{
83
- quoteId: {
84
- type: _contractspec_lib_schema431.FieldType<string, string>;
85
- isOptional: false;
86
- };
87
- acceptedBy: {
88
- type: _contractspec_lib_schema431.FieldType<string, string>;
89
- isOptional: false;
90
- };
91
- notes: {
92
- type: _contractspec_lib_schema431.FieldType<string, string>;
93
- isOptional: true;
94
- };
95
- }>, _contractspec_lib_schema431.SchemaModel<{
96
- id: {
97
- type: _contractspec_lib_schema431.FieldType<string, string>;
98
- isOptional: false;
99
- };
100
- clientId: {
101
- type: _contractspec_lib_schema431.FieldType<string, string>;
102
- isOptional: false;
103
- };
104
- title: {
105
- type: _contractspec_lib_schema431.FieldType<string, string>;
106
- isOptional: false;
107
- };
108
- description: {
109
- type: _contractspec_lib_schema431.FieldType<string, string>;
110
- isOptional: true;
111
- };
112
- amount: {
113
- type: _contractspec_lib_schema431.FieldType<number, number>;
114
- isOptional: false;
115
- };
116
- currency: {
117
- type: _contractspec_lib_schema431.FieldType<string, string>;
118
- isOptional: false;
119
- };
120
- status: {
121
- type: _contractspec_lib_schema431.FieldType<string, string>;
122
- isOptional: false;
123
- };
124
- validUntil: {
125
- type: _contractspec_lib_schema431.FieldType<Date, string>;
126
- isOptional: true;
127
- };
128
- createdAt: {
129
- type: _contractspec_lib_schema431.FieldType<Date, string>;
130
- isOptional: false;
131
- };
78
+ export declare const AcceptQuoteContract: import("@contractspec/lib.contracts").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
79
+ quoteId: {
80
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
81
+ isOptional: false;
82
+ };
83
+ acceptedBy: {
84
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
85
+ isOptional: false;
86
+ };
87
+ notes: {
88
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
89
+ isOptional: true;
90
+ };
91
+ }>, import("@contractspec/lib.schema").SchemaModel<{
92
+ id: {
93
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
94
+ isOptional: false;
95
+ };
96
+ clientId: {
97
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
98
+ isOptional: false;
99
+ };
100
+ title: {
101
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
102
+ isOptional: false;
103
+ };
104
+ description: {
105
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
106
+ isOptional: true;
107
+ };
108
+ amount: {
109
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
110
+ isOptional: false;
111
+ };
112
+ currency: {
113
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
114
+ isOptional: false;
115
+ };
116
+ status: {
117
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
118
+ isOptional: false;
119
+ };
120
+ validUntil: {
121
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
122
+ isOptional: true;
123
+ };
124
+ createdAt: {
125
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
126
+ isOptional: false;
127
+ };
132
128
  }>, undefined>;
133
- //#endregion
134
- export { AcceptQuoteContract, CreateQuoteContract };
135
129
  //# sourceMappingURL=quote.operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"quote.operations.d.ts","names":[],"sources":["../../src/quote/quote.operations.ts"],"sourcesContent":[],"mappings":";;;;;;;cAYa,mDAAmB,0CAAA;EAAnB,QAAA,EAAA;IAoCX,IAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;EApC8B,CAAA;;;;;;;;;;;;;EAAA,KAAA,EAAA;IAyCnB,IAAA,uCAiCX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;+CAjC8B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;UAzCA,2BAAA,CAAA;;;;;;;;+CAyCA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAnB,mDAAmB,0CAAA;;UAiC9B,2BAAA,CAAA;;;;;;;;;;;;;UAjC8B,2BAAA,CAAA"}
1
+ {"version":3,"file":"quote.operations.d.ts","sourceRoot":"","sources":["../../src/quote/quote.operations.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoC9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiC9B,CAAC"}
@@ -1,99 +1,120 @@
1
- import { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel } from "./quote.schema.js";
2
- import { defineCommand } from "@contractspec/lib.contracts";
3
-
4
- //#region src/quote/quote.operations.ts
5
- const OWNERS = ["@examples.service-business-os"];
6
- /**
7
- * Create a new quote.
8
- */
9
- const CreateQuoteContract = defineCommand({
10
- meta: {
11
- key: "service.quote.create",
12
- version: "1.0.0",
13
- stability: "stable",
14
- owners: [...OWNERS],
15
- tags: [
16
- "service-business-os",
17
- "quote",
18
- "create"
19
- ],
20
- description: "Create a quote/proposal.",
21
- goal: "Quote clients.",
22
- context: "Quote creation."
23
- },
24
- io: {
25
- input: CreateQuoteInputModel,
26
- output: QuoteModel
27
- },
28
- policy: { auth: "user" },
29
- acceptance: {
30
- scenarios: [{
31
- key: "create-quote-happy-path",
32
- given: ["Client exists"],
33
- when: ["User creates quote"],
34
- then: ["Quote is created"]
35
- }],
36
- examples: [{
37
- key: "create-proposal",
38
- input: {
39
- clientId: "client-123",
40
- items: [{
41
- description: "Project A",
42
- price: 5e3
43
- }]
44
- },
45
- output: {
46
- id: "quote-123",
47
- status: "draft",
48
- total: 5e3
49
- }
50
- }]
51
- }
1
+ // @bun
2
+ // src/quote/quote.schema.ts
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
+ var QuoteModel = defineSchemaModel({
5
+ name: "Quote",
6
+ description: "Quote/proposal",
7
+ fields: {
8
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
9
+ clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
10
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
11
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
12
+ amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
13
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
14
+ status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
15
+ validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },
16
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
17
+ }
18
+ });
19
+ var CreateQuoteInputModel = defineSchemaModel({
20
+ name: "CreateQuoteInput",
21
+ description: "Input for creating a quote",
22
+ fields: {
23
+ clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
24
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
25
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
26
+ amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
27
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
28
+ validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },
29
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
30
+ ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
31
+ }
52
32
  });
53
- /**
54
- * Accept a quote.
55
- */
56
- const AcceptQuoteContract = defineCommand({
57
- meta: {
58
- key: "service.quote.accept",
59
- version: "1.0.0",
60
- stability: "stable",
61
- owners: [...OWNERS],
62
- tags: [
63
- "service-business-os",
64
- "quote",
65
- "accept"
66
- ],
67
- description: "Accept a quote.",
68
- goal: "Confirm quote.",
69
- context: "Quote acceptance."
70
- },
71
- io: {
72
- input: AcceptQuoteInputModel,
73
- output: QuoteModel
74
- },
75
- policy: { auth: "user" },
76
- acceptance: {
77
- scenarios: [{
78
- key: "accept-quote-happy-path",
79
- given: ["Quote is open"],
80
- when: ["Client accepts quote"],
81
- then: ["Quote status becomes ACCEPTED"]
82
- }],
83
- examples: [{
84
- key: "client-accepts",
85
- input: {
86
- quoteId: "quote-123",
87
- signature: "John Doe"
88
- },
89
- output: {
90
- id: "quote-123",
91
- status: "accepted"
92
- }
93
- }]
94
- }
33
+ var AcceptQuoteInputModel = defineSchemaModel({
34
+ name: "AcceptQuoteInput",
35
+ description: "Input for accepting a quote",
36
+ fields: {
37
+ quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
38
+ acceptedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
39
+ notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
40
+ }
95
41
  });
96
42
 
97
- //#endregion
98
- export { AcceptQuoteContract, CreateQuoteContract };
99
- //# sourceMappingURL=quote.operations.js.map
43
+ // src/quote/quote.operations.ts
44
+ import { defineCommand } from "@contractspec/lib.contracts";
45
+ var OWNERS = ["@examples.service-business-os"];
46
+ var CreateQuoteContract = defineCommand({
47
+ meta: {
48
+ key: "service.quote.create",
49
+ version: "1.0.0",
50
+ stability: "stable",
51
+ owners: [...OWNERS],
52
+ tags: ["service-business-os", "quote", "create"],
53
+ description: "Create a quote/proposal.",
54
+ goal: "Quote clients.",
55
+ context: "Quote creation."
56
+ },
57
+ io: {
58
+ input: CreateQuoteInputModel,
59
+ output: QuoteModel
60
+ },
61
+ policy: { auth: "user" },
62
+ acceptance: {
63
+ scenarios: [
64
+ {
65
+ key: "create-quote-happy-path",
66
+ given: ["Client exists"],
67
+ when: ["User creates quote"],
68
+ then: ["Quote is created"]
69
+ }
70
+ ],
71
+ examples: [
72
+ {
73
+ key: "create-proposal",
74
+ input: {
75
+ clientId: "client-123",
76
+ items: [{ description: "Project A", price: 5000 }]
77
+ },
78
+ output: { id: "quote-123", status: "draft", total: 5000 }
79
+ }
80
+ ]
81
+ }
82
+ });
83
+ var AcceptQuoteContract = defineCommand({
84
+ meta: {
85
+ key: "service.quote.accept",
86
+ version: "1.0.0",
87
+ stability: "stable",
88
+ owners: [...OWNERS],
89
+ tags: ["service-business-os", "quote", "accept"],
90
+ description: "Accept a quote.",
91
+ goal: "Confirm quote.",
92
+ context: "Quote acceptance."
93
+ },
94
+ io: {
95
+ input: AcceptQuoteInputModel,
96
+ output: QuoteModel
97
+ },
98
+ policy: { auth: "user" },
99
+ acceptance: {
100
+ scenarios: [
101
+ {
102
+ key: "accept-quote-happy-path",
103
+ given: ["Quote is open"],
104
+ when: ["Client accepts quote"],
105
+ then: ["Quote status becomes ACCEPTED"]
106
+ }
107
+ ],
108
+ examples: [
109
+ {
110
+ key: "client-accepts",
111
+ input: { quoteId: "quote-123", signature: "John Doe" },
112
+ output: { id: "quote-123", status: "accepted" }
113
+ }
114
+ ]
115
+ }
116
+ });
117
+ export {
118
+ CreateQuoteContract,
119
+ AcceptQuoteContract
120
+ };
@@ -1,101 +1,96 @@
1
- import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
2
-
3
- //#region src/quote/quote.schema.d.ts
4
1
  /**
5
2
  * Quote/proposal.
6
3
  */
7
- declare const QuoteModel: _contractspec_lib_schema0.SchemaModel<{
8
- id: {
9
- type: _contractspec_lib_schema0.FieldType<string, string>;
10
- isOptional: false;
11
- };
12
- clientId: {
13
- type: _contractspec_lib_schema0.FieldType<string, string>;
14
- isOptional: false;
15
- };
16
- title: {
17
- type: _contractspec_lib_schema0.FieldType<string, string>;
18
- isOptional: false;
19
- };
20
- description: {
21
- type: _contractspec_lib_schema0.FieldType<string, string>;
22
- isOptional: true;
23
- };
24
- amount: {
25
- type: _contractspec_lib_schema0.FieldType<number, number>;
26
- isOptional: false;
27
- };
28
- currency: {
29
- type: _contractspec_lib_schema0.FieldType<string, string>;
30
- isOptional: false;
31
- };
32
- status: {
33
- type: _contractspec_lib_schema0.FieldType<string, string>;
34
- isOptional: false;
35
- };
36
- validUntil: {
37
- type: _contractspec_lib_schema0.FieldType<Date, string>;
38
- isOptional: true;
39
- };
40
- createdAt: {
41
- type: _contractspec_lib_schema0.FieldType<Date, string>;
42
- isOptional: false;
43
- };
4
+ export declare const QuoteModel: import("@contractspec/lib.schema").SchemaModel<{
5
+ id: {
6
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
7
+ isOptional: false;
8
+ };
9
+ clientId: {
10
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ title: {
14
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
15
+ isOptional: false;
16
+ };
17
+ description: {
18
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
19
+ isOptional: true;
20
+ };
21
+ amount: {
22
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
23
+ isOptional: false;
24
+ };
25
+ currency: {
26
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
27
+ isOptional: false;
28
+ };
29
+ status: {
30
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
31
+ isOptional: false;
32
+ };
33
+ validUntil: {
34
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
35
+ isOptional: true;
36
+ };
37
+ createdAt: {
38
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
39
+ isOptional: false;
40
+ };
44
41
  }>;
45
42
  /**
46
43
  * Input for creating a quote.
47
44
  */
48
- declare const CreateQuoteInputModel: _contractspec_lib_schema0.SchemaModel<{
49
- clientId: {
50
- type: _contractspec_lib_schema0.FieldType<string, string>;
51
- isOptional: false;
52
- };
53
- title: {
54
- type: _contractspec_lib_schema0.FieldType<string, string>;
55
- isOptional: false;
56
- };
57
- description: {
58
- type: _contractspec_lib_schema0.FieldType<string, string>;
59
- isOptional: true;
60
- };
61
- amount: {
62
- type: _contractspec_lib_schema0.FieldType<number, number>;
63
- isOptional: false;
64
- };
65
- currency: {
66
- type: _contractspec_lib_schema0.FieldType<string, string>;
67
- isOptional: true;
68
- };
69
- validUntil: {
70
- type: _contractspec_lib_schema0.FieldType<Date, string>;
71
- isOptional: true;
72
- };
73
- orgId: {
74
- type: _contractspec_lib_schema0.FieldType<string, string>;
75
- isOptional: false;
76
- };
77
- ownerId: {
78
- type: _contractspec_lib_schema0.FieldType<string, string>;
79
- isOptional: false;
80
- };
45
+ export declare const CreateQuoteInputModel: import("@contractspec/lib.schema").SchemaModel<{
46
+ clientId: {
47
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ title: {
51
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
52
+ isOptional: false;
53
+ };
54
+ description: {
55
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
56
+ isOptional: true;
57
+ };
58
+ amount: {
59
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
60
+ isOptional: false;
61
+ };
62
+ currency: {
63
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
64
+ isOptional: true;
65
+ };
66
+ validUntil: {
67
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
68
+ isOptional: true;
69
+ };
70
+ orgId: {
71
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
72
+ isOptional: false;
73
+ };
74
+ ownerId: {
75
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
76
+ isOptional: false;
77
+ };
81
78
  }>;
82
79
  /**
83
80
  * Input for accepting a quote.
84
81
  */
85
- declare const AcceptQuoteInputModel: _contractspec_lib_schema0.SchemaModel<{
86
- quoteId: {
87
- type: _contractspec_lib_schema0.FieldType<string, string>;
88
- isOptional: false;
89
- };
90
- acceptedBy: {
91
- type: _contractspec_lib_schema0.FieldType<string, string>;
92
- isOptional: false;
93
- };
94
- notes: {
95
- type: _contractspec_lib_schema0.FieldType<string, string>;
96
- isOptional: true;
97
- };
82
+ export declare const AcceptQuoteInputModel: import("@contractspec/lib.schema").SchemaModel<{
83
+ quoteId: {
84
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
85
+ isOptional: false;
86
+ };
87
+ acceptedBy: {
88
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
89
+ isOptional: false;
90
+ };
91
+ notes: {
92
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
93
+ isOptional: true;
94
+ };
98
95
  }>;
99
- //#endregion
100
- export { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel };
101
96
  //# sourceMappingURL=quote.schema.d.ts.map