@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,179 +1,173 @@
1
- import { StabilityEnum, definePresentation } from "@contractspec/lib.contracts";
2
-
3
- //#region src/presentations.ts
4
- const ServiceDashboardPresentation = definePresentation({
5
- meta: {
6
- key: "service-business-os.dashboard",
7
- version: "1.0.0",
8
- title: "Service Dashboard",
9
- description: "Service business dashboard with overview metrics",
10
- domain: "services",
11
- owners: ["@service-os"],
12
- tags: ["services", "dashboard"],
13
- stability: StabilityEnum.Experimental,
14
- goal: "Overview of service business metrics",
15
- context: "Service home page"
16
- },
17
- source: {
18
- type: "component",
19
- framework: "react",
20
- componentKey: "ServiceDashboard"
21
- },
22
- targets: ["react", "markdown"],
23
- policy: { flags: ["service.dashboard.enabled"] }
1
+ // @bun
2
+ // src/presentations.ts
3
+ import { definePresentation, StabilityEnum } from "@contractspec/lib.contracts";
4
+ var ServiceDashboardPresentation = definePresentation({
5
+ meta: {
6
+ key: "service-business-os.dashboard",
7
+ version: "1.0.0",
8
+ title: "Service Dashboard",
9
+ description: "Service business dashboard with overview metrics",
10
+ domain: "services",
11
+ owners: ["@service-os"],
12
+ tags: ["services", "dashboard"],
13
+ stability: StabilityEnum.Experimental,
14
+ goal: "Overview of service business metrics",
15
+ context: "Service home page"
16
+ },
17
+ source: {
18
+ type: "component",
19
+ framework: "react",
20
+ componentKey: "ServiceDashboard"
21
+ },
22
+ targets: ["react", "markdown"],
23
+ policy: {
24
+ flags: ["service.dashboard.enabled"]
25
+ }
24
26
  });
25
- const ClientListPresentation = definePresentation({
26
- meta: {
27
- key: "service-business-os.client.list",
28
- version: "1.0.0",
29
- title: "Client List",
30
- description: "List of service clients",
31
- domain: "services",
32
- owners: ["@service-os"],
33
- tags: [
34
- "services",
35
- "clients",
36
- "list"
37
- ],
38
- stability: StabilityEnum.Experimental,
39
- goal: "Browse and manage service clients",
40
- context: "Client management"
41
- },
42
- source: {
43
- type: "component",
44
- framework: "react",
45
- componentKey: "ClientList"
46
- },
47
- targets: ["react", "markdown"],
48
- policy: { flags: ["service.clients.enabled"] }
27
+ var ClientListPresentation = definePresentation({
28
+ meta: {
29
+ key: "service-business-os.client.list",
30
+ version: "1.0.0",
31
+ title: "Client List",
32
+ description: "List of service clients",
33
+ domain: "services",
34
+ owners: ["@service-os"],
35
+ tags: ["services", "clients", "list"],
36
+ stability: StabilityEnum.Experimental,
37
+ goal: "Browse and manage service clients",
38
+ context: "Client management"
39
+ },
40
+ source: {
41
+ type: "component",
42
+ framework: "react",
43
+ componentKey: "ClientList"
44
+ },
45
+ targets: ["react", "markdown"],
46
+ policy: {
47
+ flags: ["service.clients.enabled"]
48
+ }
49
49
  });
50
- const QuoteListPresentation = definePresentation({
51
- meta: {
52
- key: "service-business-os.quote.list",
53
- version: "1.0.0",
54
- title: "Quote List",
55
- description: "List of quotes with status",
56
- domain: "services",
57
- owners: ["@service-os"],
58
- tags: [
59
- "services",
60
- "quotes",
61
- "list"
62
- ],
63
- stability: StabilityEnum.Experimental,
64
- goal: "Track and manage quotes",
65
- context: "Quote management"
66
- },
67
- source: {
68
- type: "component",
69
- framework: "react",
70
- componentKey: "QuoteList"
71
- },
72
- targets: ["react", "markdown"],
73
- policy: { flags: ["service.quotes.enabled"] }
50
+ var QuoteListPresentation = definePresentation({
51
+ meta: {
52
+ key: "service-business-os.quote.list",
53
+ version: "1.0.0",
54
+ title: "Quote List",
55
+ description: "List of quotes with status",
56
+ domain: "services",
57
+ owners: ["@service-os"],
58
+ tags: ["services", "quotes", "list"],
59
+ stability: StabilityEnum.Experimental,
60
+ goal: "Track and manage quotes",
61
+ context: "Quote management"
62
+ },
63
+ source: {
64
+ type: "component",
65
+ framework: "react",
66
+ componentKey: "QuoteList"
67
+ },
68
+ targets: ["react", "markdown"],
69
+ policy: {
70
+ flags: ["service.quotes.enabled"]
71
+ }
74
72
  });
75
- const QuoteDetailPresentation = definePresentation({
76
- meta: {
77
- key: "service-business-os.quote.detail",
78
- version: "1.0.0",
79
- title: "Quote Details",
80
- description: "Quote detail with line items",
81
- domain: "services",
82
- owners: ["@service-os"],
83
- tags: [
84
- "services",
85
- "quote",
86
- "detail"
87
- ],
88
- stability: StabilityEnum.Experimental,
89
- goal: "View and edit quote details",
90
- context: "Quote inspection"
91
- },
92
- source: {
93
- type: "component",
94
- framework: "react",
95
- componentKey: "QuoteDetail"
96
- },
97
- targets: ["react", "markdown"],
98
- policy: { flags: ["service.quotes.enabled"] }
73
+ var QuoteDetailPresentation = definePresentation({
74
+ meta: {
75
+ key: "service-business-os.quote.detail",
76
+ version: "1.0.0",
77
+ title: "Quote Details",
78
+ description: "Quote detail with line items",
79
+ domain: "services",
80
+ owners: ["@service-os"],
81
+ tags: ["services", "quote", "detail"],
82
+ stability: StabilityEnum.Experimental,
83
+ goal: "View and edit quote details",
84
+ context: "Quote inspection"
85
+ },
86
+ source: {
87
+ type: "component",
88
+ framework: "react",
89
+ componentKey: "QuoteDetail"
90
+ },
91
+ targets: ["react", "markdown"],
92
+ policy: {
93
+ flags: ["service.quotes.enabled"]
94
+ }
99
95
  });
100
- const JobBoardPresentation = definePresentation({
101
- meta: {
102
- key: "service-business-os.job.board",
103
- version: "1.0.0",
104
- title: "Job Board",
105
- description: "Job board with kanban view",
106
- domain: "services",
107
- owners: ["@service-os"],
108
- tags: [
109
- "services",
110
- "jobs",
111
- "board",
112
- "kanban"
113
- ],
114
- stability: StabilityEnum.Experimental,
115
- goal: "Visual job management",
116
- context: "Field service scheduling"
117
- },
118
- source: {
119
- type: "component",
120
- framework: "react",
121
- componentKey: "JobBoard"
122
- },
123
- targets: ["react"],
124
- policy: { flags: ["service.jobs.enabled"] }
96
+ var JobBoardPresentation = definePresentation({
97
+ meta: {
98
+ key: "service-business-os.job.board",
99
+ version: "1.0.0",
100
+ title: "Job Board",
101
+ description: "Job board with kanban view",
102
+ domain: "services",
103
+ owners: ["@service-os"],
104
+ tags: ["services", "jobs", "board", "kanban"],
105
+ stability: StabilityEnum.Experimental,
106
+ goal: "Visual job management",
107
+ context: "Field service scheduling"
108
+ },
109
+ source: {
110
+ type: "component",
111
+ framework: "react",
112
+ componentKey: "JobBoard"
113
+ },
114
+ targets: ["react"],
115
+ policy: {
116
+ flags: ["service.jobs.enabled"]
117
+ }
125
118
  });
126
- const InvoiceListPresentation = definePresentation({
127
- meta: {
128
- key: "service-business-os.invoice.list",
129
- version: "1.0.0",
130
- title: "Invoice List",
131
- description: "List of invoices with payment status",
132
- domain: "services",
133
- owners: ["@service-os"],
134
- tags: [
135
- "services",
136
- "invoices",
137
- "list"
138
- ],
139
- stability: StabilityEnum.Experimental,
140
- goal: "Track invoices and payments",
141
- context: "Billing management"
142
- },
143
- source: {
144
- type: "component",
145
- framework: "react",
146
- componentKey: "InvoiceList"
147
- },
148
- targets: ["react", "markdown"],
149
- policy: { flags: ["service.invoices.enabled"] }
119
+ var InvoiceListPresentation = definePresentation({
120
+ meta: {
121
+ key: "service-business-os.invoice.list",
122
+ version: "1.0.0",
123
+ title: "Invoice List",
124
+ description: "List of invoices with payment status",
125
+ domain: "services",
126
+ owners: ["@service-os"],
127
+ tags: ["services", "invoices", "list"],
128
+ stability: StabilityEnum.Experimental,
129
+ goal: "Track invoices and payments",
130
+ context: "Billing management"
131
+ },
132
+ source: {
133
+ type: "component",
134
+ framework: "react",
135
+ componentKey: "InvoiceList"
136
+ },
137
+ targets: ["react", "markdown"],
138
+ policy: {
139
+ flags: ["service.invoices.enabled"]
140
+ }
150
141
  });
151
- const PaymentListPresentation = definePresentation({
152
- meta: {
153
- key: "service-business-os.payment.list",
154
- version: "1.0.0",
155
- title: "Payment List",
156
- description: "List of payments received",
157
- domain: "services",
158
- owners: ["@service-os"],
159
- tags: [
160
- "services",
161
- "payments",
162
- "list"
163
- ],
164
- stability: StabilityEnum.Experimental,
165
- goal: "Track received payments",
166
- context: "Payment reconciliation"
167
- },
168
- source: {
169
- type: "component",
170
- framework: "react",
171
- componentKey: "PaymentList"
172
- },
173
- targets: ["react", "markdown"],
174
- policy: { flags: ["service.payments.enabled"] }
142
+ var PaymentListPresentation = definePresentation({
143
+ meta: {
144
+ key: "service-business-os.payment.list",
145
+ version: "1.0.0",
146
+ title: "Payment List",
147
+ description: "List of payments received",
148
+ domain: "services",
149
+ owners: ["@service-os"],
150
+ tags: ["services", "payments", "list"],
151
+ stability: StabilityEnum.Experimental,
152
+ goal: "Track received payments",
153
+ context: "Payment reconciliation"
154
+ },
155
+ source: {
156
+ type: "component",
157
+ framework: "react",
158
+ componentKey: "PaymentList"
159
+ },
160
+ targets: ["react", "markdown"],
161
+ policy: {
162
+ flags: ["service.payments.enabled"]
163
+ }
175
164
  });
176
-
177
- //#endregion
178
- export { ClientListPresentation, InvoiceListPresentation, JobBoardPresentation, PaymentListPresentation, QuoteDetailPresentation, QuoteListPresentation, ServiceDashboardPresentation };
179
- //# sourceMappingURL=presentations.js.map
165
+ export {
166
+ ServiceDashboardPresentation,
167
+ QuoteListPresentation,
168
+ QuoteDetailPresentation,
169
+ PaymentListPresentation,
170
+ JobBoardPresentation,
171
+ InvoiceListPresentation,
172
+ ClientListPresentation
173
+ };
@@ -1,3 +1,6 @@
1
- import { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel } from "./quote.schema.js";
2
- import { AcceptQuoteContract, CreateQuoteContract } from "./quote.operations.js";
3
- export { AcceptQuoteContract, AcceptQuoteInputModel, CreateQuoteContract, CreateQuoteInputModel, QuoteModel };
1
+ /**
2
+ * Quote domain - Quote/proposal management.
3
+ */
4
+ export { QuoteModel, CreateQuoteInputModel, AcceptQuoteInputModel, } from './quote.schema';
5
+ export { CreateQuoteContract, AcceptQuoteContract } from './quote.operations';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/quote/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,4 +1,123 @@
1
- import { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel } from "./quote.schema.js";
2
- import { AcceptQuoteContract, CreateQuoteContract } from "./quote.operations.js";
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
+ }
32
+ });
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
+ }
41
+ });
3
42
 
4
- export { AcceptQuoteContract, AcceptQuoteInputModel, CreateQuoteContract, CreateQuoteInputModel, QuoteModel };
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
+ QuoteModel,
119
+ CreateQuoteInputModel,
120
+ CreateQuoteContract,
121
+ AcceptQuoteInputModel,
122
+ AcceptQuoteContract
123
+ };