@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.
- package/dist/browser/client/client.operations.js +72 -0
- package/dist/browser/client/client.schema.js +31 -0
- package/dist/browser/client/index.js +74 -0
- package/dist/browser/docs/index.js +96 -0
- package/dist/browser/docs/service-business-os.docblock.js +96 -0
- package/dist/browser/entities/index.js +246 -0
- package/dist/browser/events.js +135 -0
- package/dist/browser/example.js +39 -0
- package/dist/browser/handlers/index.js +5 -0
- package/dist/browser/index.js +752 -0
- package/dist/browser/invoice/index.js +77 -0
- package/dist/browser/invoice/invoice.operations.js +75 -0
- package/dist/browser/invoice/invoice.schema.js +34 -0
- package/dist/browser/job/index.js +175 -0
- package/dist/browser/job/job.operations.js +172 -0
- package/dist/browser/job/job.schema.js +41 -0
- package/dist/browser/operations/index.js +506 -0
- package/dist/browser/payment/index.js +69 -0
- package/dist/browser/payment/payment.operations.js +67 -0
- package/dist/browser/payment/payment.schema.js +30 -0
- package/dist/browser/presentations/index.js +13 -0
- package/dist/browser/presentations.js +172 -0
- package/dist/browser/quote/index.js +122 -0
- package/dist/browser/quote/quote.operations.js +119 -0
- package/dist/browser/quote/quote.schema.js +45 -0
- package/dist/browser/service-business-os.capability.js +28 -0
- package/dist/browser/service.feature.js +74 -0
- package/dist/client/client.operations.d.ts +54 -60
- package/dist/client/client.operations.d.ts.map +1 -1
- package/dist/client/client.operations.js +71 -51
- package/dist/client/client.schema.d.ts +54 -59
- package/dist/client/client.schema.d.ts.map +1 -1
- package/dist/client/client.schema.js +30 -75
- package/dist/client/index.d.ts +6 -3
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +74 -3
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +97 -1
- package/dist/docs/service-business-os.docblock.d.ts +2 -1
- package/dist/docs/service-business-os.docblock.d.ts.map +1 -0
- package/dist/docs/service-business-os.docblock.js +52 -64
- package/dist/entities/index.d.ts +156 -161
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +236 -278
- package/dist/events.d.ts +253 -259
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +123 -217
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +37 -50
- package/dist/handlers/index.d.ts +11 -16
- package/dist/handlers/index.d.ts.map +1 -1
- package/dist/handlers/index.js +5 -5
- package/dist/index.d.ts +13 -18
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +752 -18
- package/dist/invoice/index.d.ts +6 -3
- package/dist/invoice/index.d.ts.map +1 -0
- package/dist/invoice/index.js +77 -3
- package/dist/invoice/invoice.operations.d.ts +54 -60
- package/dist/invoice/invoice.operations.d.ts.map +1 -1
- package/dist/invoice/invoice.operations.js +74 -55
- package/dist/invoice/invoice.schema.d.ts +54 -59
- package/dist/invoice/invoice.schema.d.ts.map +1 -1
- package/dist/invoice/invoice.schema.js +33 -75
- package/dist/job/index.d.ts +6 -3
- package/dist/job/index.d.ts.map +1 -0
- package/dist/job/index.js +175 -3
- package/dist/job/job.operations.d.ts +220 -226
- package/dist/job/job.operations.d.ts.map +1 -1
- package/dist/job/job.operations.js +167 -169
- package/dist/job/job.schema.d.ts +67 -72
- package/dist/job/job.schema.d.ts.map +1 -1
- package/dist/job/job.schema.js +39 -95
- package/dist/node/client/client.operations.js +72 -0
- package/dist/node/client/client.schema.js +31 -0
- package/dist/node/client/index.js +74 -0
- package/dist/node/docs/index.js +96 -0
- package/dist/node/docs/service-business-os.docblock.js +96 -0
- package/dist/node/entities/index.js +246 -0
- package/dist/node/events.js +135 -0
- package/dist/node/example.js +39 -0
- package/dist/node/handlers/index.js +5 -0
- package/dist/node/index.js +752 -0
- package/dist/node/invoice/index.js +77 -0
- package/dist/node/invoice/invoice.operations.js +75 -0
- package/dist/node/invoice/invoice.schema.js +34 -0
- package/dist/node/job/index.js +175 -0
- package/dist/node/job/job.operations.js +172 -0
- package/dist/node/job/job.schema.js +41 -0
- package/dist/node/operations/index.js +506 -0
- package/dist/node/payment/index.js +69 -0
- package/dist/node/payment/payment.operations.js +67 -0
- package/dist/node/payment/payment.schema.js +30 -0
- package/dist/node/presentations/index.js +13 -0
- package/dist/node/presentations.js +172 -0
- package/dist/node/quote/index.js +122 -0
- package/dist/node/quote/quote.operations.js +119 -0
- package/dist/node/quote/quote.schema.js +45 -0
- package/dist/node/service-business-os.capability.js +28 -0
- package/dist/node/service.feature.js +74 -0
- package/dist/operations/index.d.ts +6 -16
- package/dist/operations/index.d.ts.map +1 -0
- package/dist/operations/index.js +506 -16
- package/dist/payment/index.d.ts +6 -3
- package/dist/payment/index.d.ts.map +1 -0
- package/dist/payment/index.js +69 -3
- package/dist/payment/payment.operations.d.ts +50 -56
- package/dist/payment/payment.operations.d.ts.map +1 -1
- package/dist/payment/payment.operations.js +66 -51
- package/dist/payment/payment.schema.d.ts +50 -55
- package/dist/payment/payment.schema.d.ts.map +1 -1
- package/dist/payment/payment.schema.js +29 -71
- package/dist/presentations/index.d.ts +1 -4
- package/dist/presentations/index.d.ts.map +1 -1
- package/dist/presentations/index.js +13 -17
- package/dist/presentations.d.ts +7 -12
- package/dist/presentations.d.ts.map +1 -1
- package/dist/presentations.js +166 -172
- package/dist/quote/index.d.ts +6 -3
- package/dist/quote/index.d.ts.map +1 -0
- package/dist/quote/index.js +122 -3
- package/dist/quote/quote.operations.d.ts +120 -126
- package/dist/quote/quote.operations.d.ts.map +1 -1
- package/dist/quote/quote.operations.js +117 -96
- package/dist/quote/quote.schema.d.ts +83 -88
- package/dist/quote/quote.schema.d.ts.map +1 -1
- package/dist/quote/quote.schema.js +43 -111
- package/dist/service-business-os.capability.d.ts +2 -7
- package/dist/service-business-os.capability.d.ts.map +1 -1
- package/dist/service-business-os.capability.js +29 -29
- package/dist/service.feature.d.ts +1 -6
- package/dist/service.feature.d.ts.map +1 -1
- package/dist/service.feature.js +73 -164
- package/package.json +301 -64
- package/dist/client/client.operations.js.map +0 -1
- package/dist/client/client.schema.js.map +0 -1
- package/dist/docs/service-business-os.docblock.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/index.js.map +0 -1
- package/dist/invoice/invoice.operations.js.map +0 -1
- package/dist/invoice/invoice.schema.js.map +0 -1
- package/dist/job/job.operations.js.map +0 -1
- package/dist/job/job.schema.js.map +0 -1
- package/dist/payment/payment.operations.js.map +0 -1
- package/dist/payment/payment.schema.js.map +0 -1
- package/dist/presentations/index.js.map +0 -1
- package/dist/presentations.js.map +0 -1
- package/dist/quote/quote.operations.js.map +0 -1
- package/dist/quote/quote.schema.js.map +0 -1
- package/dist/service-business-os.capability.js.map +0 -1
- package/dist/service.feature.js.map +0 -1
package/dist/presentations.js
CHANGED
|
@@ -1,179 +1,173 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
165
|
+
export {
|
|
166
|
+
ServiceDashboardPresentation,
|
|
167
|
+
QuoteListPresentation,
|
|
168
|
+
QuoteDetailPresentation,
|
|
169
|
+
PaymentListPresentation,
|
|
170
|
+
JobBoardPresentation,
|
|
171
|
+
InvoiceListPresentation,
|
|
172
|
+
ClientListPresentation
|
|
173
|
+
};
|
package/dist/quote/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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"}
|
package/dist/quote/index.js
CHANGED
|
@@ -1,4 +1,123 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
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
|
+
};
|