@contractspec/example.service-business-os 3.7.17 → 3.7.19

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 (82) hide show
  1. package/dist/browser/client/client.operations.js +1 -72
  2. package/dist/browser/client/client.schema.js +1 -31
  3. package/dist/browser/client/index.js +1 -74
  4. package/dist/browser/docs/index.js +5 -49
  5. package/dist/browser/docs/service-business-os.docblock.js +5 -49
  6. package/dist/browser/entities/index.js +1 -246
  7. package/dist/browser/events.js +1 -135
  8. package/dist/browser/example.js +1 -39
  9. package/dist/browser/handlers/index.js +1 -5
  10. package/dist/browser/index.js +1 -766
  11. package/dist/browser/invoice/index.js +1 -77
  12. package/dist/browser/invoice/invoice.operations.js +1 -75
  13. package/dist/browser/invoice/invoice.schema.js +1 -34
  14. package/dist/browser/job/index.js +1 -175
  15. package/dist/browser/job/job.operations.js +1 -172
  16. package/dist/browser/job/job.schema.js +1 -41
  17. package/dist/browser/operations/index.js +1 -506
  18. package/dist/browser/payment/index.js +1 -69
  19. package/dist/browser/payment/payment.operations.js +1 -67
  20. package/dist/browser/payment/payment.schema.js +1 -30
  21. package/dist/browser/presentations/index.js +1 -13
  22. package/dist/browser/presentations.js +1 -175
  23. package/dist/browser/quote/index.js +1 -122
  24. package/dist/browser/quote/quote.operations.js +1 -119
  25. package/dist/browser/quote/quote.schema.js +1 -45
  26. package/dist/browser/service-business-os.capability.js +1 -31
  27. package/dist/browser/service.feature.js +1 -85
  28. package/dist/client/client.operations.js +1 -72
  29. package/dist/client/client.schema.js +1 -31
  30. package/dist/client/index.js +1 -74
  31. package/dist/docs/index.js +5 -49
  32. package/dist/docs/service-business-os.docblock.js +5 -49
  33. package/dist/entities/index.js +1 -246
  34. package/dist/events.js +1 -135
  35. package/dist/example.js +1 -39
  36. package/dist/handlers/index.js +1 -5
  37. package/dist/index.js +1 -766
  38. package/dist/invoice/index.js +1 -77
  39. package/dist/invoice/invoice.operations.js +1 -75
  40. package/dist/invoice/invoice.schema.js +1 -34
  41. package/dist/job/index.js +1 -175
  42. package/dist/job/job.operations.js +1 -172
  43. package/dist/job/job.schema.js +1 -41
  44. package/dist/node/client/client.operations.js +1 -72
  45. package/dist/node/client/client.schema.js +1 -31
  46. package/dist/node/client/index.js +1 -74
  47. package/dist/node/docs/index.js +5 -49
  48. package/dist/node/docs/service-business-os.docblock.js +5 -49
  49. package/dist/node/entities/index.js +1 -246
  50. package/dist/node/events.js +1 -135
  51. package/dist/node/example.js +1 -39
  52. package/dist/node/handlers/index.js +1 -5
  53. package/dist/node/index.js +1 -766
  54. package/dist/node/invoice/index.js +1 -77
  55. package/dist/node/invoice/invoice.operations.js +1 -75
  56. package/dist/node/invoice/invoice.schema.js +1 -34
  57. package/dist/node/job/index.js +1 -175
  58. package/dist/node/job/job.operations.js +1 -172
  59. package/dist/node/job/job.schema.js +1 -41
  60. package/dist/node/operations/index.js +1 -506
  61. package/dist/node/payment/index.js +1 -69
  62. package/dist/node/payment/payment.operations.js +1 -67
  63. package/dist/node/payment/payment.schema.js +1 -30
  64. package/dist/node/presentations/index.js +1 -13
  65. package/dist/node/presentations.js +1 -175
  66. package/dist/node/quote/index.js +1 -122
  67. package/dist/node/quote/quote.operations.js +1 -119
  68. package/dist/node/quote/quote.schema.js +1 -45
  69. package/dist/node/service-business-os.capability.js +1 -31
  70. package/dist/node/service.feature.js +1 -85
  71. package/dist/operations/index.js +1 -506
  72. package/dist/payment/index.js +1 -69
  73. package/dist/payment/payment.operations.js +1 -67
  74. package/dist/payment/payment.schema.js +1 -30
  75. package/dist/presentations/index.js +1 -13
  76. package/dist/presentations.js +1 -175
  77. package/dist/quote/index.js +1 -122
  78. package/dist/quote/quote.operations.js +1 -119
  79. package/dist/quote/quote.schema.js +1 -45
  80. package/dist/service-business-os.capability.js +1 -31
  81. package/dist/service.feature.js +1 -85
  82. package/package.json +5 -5
@@ -1,31 +1,2 @@
1
1
  // @bun
2
- // src/payment/payment.schema.ts
3
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
- var PaymentModel = defineSchemaModel({
5
- name: "Payment",
6
- description: "Payment applied to invoice",
7
- fields: {
8
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
9
- invoiceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
10
- amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
11
- currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
12
- method: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
13
- reference: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
14
- receivedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
15
- }
16
- });
17
- var RecordPaymentInputModel = defineSchemaModel({
18
- name: "RecordPaymentInput",
19
- description: "Input for recording a payment",
20
- fields: {
21
- invoiceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
22
- amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
23
- method: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
24
- reference: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
25
- receivedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
26
- }
27
- });
28
- export {
29
- RecordPaymentInputModel,
30
- PaymentModel
31
- };
2
+ import{defineSchemaModel as k,ScalarTypeEnum as j}from"@contractspec/lib.schema";var v=k({name:"Payment",description:"Payment applied to invoice",fields:{id:{type:j.String_unsecure(),isOptional:!1},invoiceId:{type:j.String_unsecure(),isOptional:!1},amount:{type:j.Float_unsecure(),isOptional:!1},currency:{type:j.String_unsecure(),isOptional:!1},method:{type:j.String_unsecure(),isOptional:!1},reference:{type:j.String_unsecure(),isOptional:!0},receivedAt:{type:j.DateTime(),isOptional:!1}}}),w=k({name:"RecordPaymentInput",description:"Input for recording a payment",fields:{invoiceId:{type:j.String_unsecure(),isOptional:!1},amount:{type:j.Float_unsecure(),isOptional:!1},method:{type:j.String_unsecure(),isOptional:!1},reference:{type:j.String_unsecure(),isOptional:!0},receivedAt:{type:j.DateTime(),isOptional:!0}}});export{w as RecordPaymentInputModel,v as PaymentModel};
@@ -1,14 +1,2 @@
1
1
  // @bun
2
- // src/presentations/index.ts
3
- var ServiceBusinessPresentations = [
4
- "service-business-os.dashboard",
5
- "service-business-os.client.list",
6
- "service-business-os.quote.list",
7
- "service-business-os.quote.detail",
8
- "service-business-os.job.board",
9
- "service-business-os.invoice.list",
10
- "service-business-os.payment.list"
11
- ];
12
- export {
13
- ServiceBusinessPresentations
14
- };
2
+ var s=["service-business-os.dashboard","service-business-os.client.list","service-business-os.quote.list","service-business-os.quote.detail","service-business-os.job.board","service-business-os.invoice.list","service-business-os.payment.list"];export{s as ServiceBusinessPresentations};
@@ -1,176 +1,2 @@
1
1
  // @bun
2
- // src/presentations.ts
3
- import {
4
- definePresentation,
5
- StabilityEnum
6
- } from "@contractspec/lib.contracts-spec";
7
- var ServiceDashboardPresentation = definePresentation({
8
- meta: {
9
- key: "service-business-os.dashboard",
10
- version: "1.0.0",
11
- title: "Service Dashboard",
12
- description: "Service business dashboard with overview metrics",
13
- domain: "services",
14
- owners: ["@service-os"],
15
- tags: ["services", "dashboard"],
16
- stability: StabilityEnum.Experimental,
17
- goal: "Overview of service business metrics",
18
- context: "Service home page"
19
- },
20
- source: {
21
- type: "component",
22
- framework: "react",
23
- componentKey: "ServiceDashboard"
24
- },
25
- targets: ["react", "markdown"],
26
- policy: {
27
- flags: ["service.dashboard.enabled"]
28
- }
29
- });
30
- var ClientListPresentation = definePresentation({
31
- meta: {
32
- key: "service-business-os.client.list",
33
- version: "1.0.0",
34
- title: "Client List",
35
- description: "List of service clients",
36
- domain: "services",
37
- owners: ["@service-os"],
38
- tags: ["services", "clients", "list"],
39
- stability: StabilityEnum.Experimental,
40
- goal: "Browse and manage service clients",
41
- context: "Client management"
42
- },
43
- source: {
44
- type: "component",
45
- framework: "react",
46
- componentKey: "ClientList"
47
- },
48
- targets: ["react", "markdown"],
49
- policy: {
50
- flags: ["service.clients.enabled"]
51
- }
52
- });
53
- var QuoteListPresentation = definePresentation({
54
- meta: {
55
- key: "service-business-os.quote.list",
56
- version: "1.0.0",
57
- title: "Quote List",
58
- description: "List of quotes with status",
59
- domain: "services",
60
- owners: ["@service-os"],
61
- tags: ["services", "quotes", "list"],
62
- stability: StabilityEnum.Experimental,
63
- goal: "Track and manage quotes",
64
- context: "Quote management"
65
- },
66
- source: {
67
- type: "component",
68
- framework: "react",
69
- componentKey: "QuoteList"
70
- },
71
- targets: ["react", "markdown"],
72
- policy: {
73
- flags: ["service.quotes.enabled"]
74
- }
75
- });
76
- var QuoteDetailPresentation = definePresentation({
77
- meta: {
78
- key: "service-business-os.quote.detail",
79
- version: "1.0.0",
80
- title: "Quote Details",
81
- description: "Quote detail with line items",
82
- domain: "services",
83
- owners: ["@service-os"],
84
- tags: ["services", "quote", "detail"],
85
- stability: StabilityEnum.Experimental,
86
- goal: "View and edit quote details",
87
- context: "Quote inspection"
88
- },
89
- source: {
90
- type: "component",
91
- framework: "react",
92
- componentKey: "QuoteDetail"
93
- },
94
- targets: ["react", "markdown"],
95
- policy: {
96
- flags: ["service.quotes.enabled"]
97
- }
98
- });
99
- var JobBoardPresentation = definePresentation({
100
- meta: {
101
- key: "service-business-os.job.board",
102
- version: "1.0.0",
103
- title: "Job Board",
104
- description: "Job board with kanban view",
105
- domain: "services",
106
- owners: ["@service-os"],
107
- tags: ["services", "jobs", "board", "kanban"],
108
- stability: StabilityEnum.Experimental,
109
- goal: "Visual job management",
110
- context: "Field service scheduling"
111
- },
112
- source: {
113
- type: "component",
114
- framework: "react",
115
- componentKey: "JobBoard"
116
- },
117
- targets: ["react"],
118
- policy: {
119
- flags: ["service.jobs.enabled"]
120
- }
121
- });
122
- var InvoiceListPresentation = definePresentation({
123
- meta: {
124
- key: "service-business-os.invoice.list",
125
- version: "1.0.0",
126
- title: "Invoice List",
127
- description: "List of invoices with payment status",
128
- domain: "services",
129
- owners: ["@service-os"],
130
- tags: ["services", "invoices", "list"],
131
- stability: StabilityEnum.Experimental,
132
- goal: "Track invoices and payments",
133
- context: "Billing management"
134
- },
135
- source: {
136
- type: "component",
137
- framework: "react",
138
- componentKey: "InvoiceList"
139
- },
140
- targets: ["react", "markdown"],
141
- policy: {
142
- flags: ["service.invoices.enabled"]
143
- }
144
- });
145
- var PaymentListPresentation = definePresentation({
146
- meta: {
147
- key: "service-business-os.payment.list",
148
- version: "1.0.0",
149
- title: "Payment List",
150
- description: "List of payments received",
151
- domain: "services",
152
- owners: ["@service-os"],
153
- tags: ["services", "payments", "list"],
154
- stability: StabilityEnum.Experimental,
155
- goal: "Track received payments",
156
- context: "Payment reconciliation"
157
- },
158
- source: {
159
- type: "component",
160
- framework: "react",
161
- componentKey: "PaymentList"
162
- },
163
- targets: ["react", "markdown"],
164
- policy: {
165
- flags: ["service.payments.enabled"]
166
- }
167
- });
168
- export {
169
- ServiceDashboardPresentation,
170
- QuoteListPresentation,
171
- QuoteDetailPresentation,
172
- PaymentListPresentation,
173
- JobBoardPresentation,
174
- InvoiceListPresentation,
175
- ClientListPresentation
176
- };
2
+ import{definePresentation as g,StabilityEnum as h}from"@contractspec/lib.contracts-spec";var k=g({meta:{key:"service-business-os.dashboard",version:"1.0.0",title:"Service Dashboard",description:"Service business dashboard with overview metrics",domain:"services",owners:["@service-os"],tags:["services","dashboard"],stability:h.Experimental,goal:"Overview of service business metrics",context:"Service home page"},source:{type:"component",framework:"react",componentKey:"ServiceDashboard"},targets:["react","markdown"],policy:{flags:["service.dashboard.enabled"]}}),q=g({meta:{key:"service-business-os.client.list",version:"1.0.0",title:"Client List",description:"List of service clients",domain:"services",owners:["@service-os"],tags:["services","clients","list"],stability:h.Experimental,goal:"Browse and manage service clients",context:"Client management"},source:{type:"component",framework:"react",componentKey:"ClientList"},targets:["react","markdown"],policy:{flags:["service.clients.enabled"]}}),v=g({meta:{key:"service-business-os.quote.list",version:"1.0.0",title:"Quote List",description:"List of quotes with status",domain:"services",owners:["@service-os"],tags:["services","quotes","list"],stability:h.Experimental,goal:"Track and manage quotes",context:"Quote management"},source:{type:"component",framework:"react",componentKey:"QuoteList"},targets:["react","markdown"],policy:{flags:["service.quotes.enabled"]}}),w=g({meta:{key:"service-business-os.quote.detail",version:"1.0.0",title:"Quote Details",description:"Quote detail with line items",domain:"services",owners:["@service-os"],tags:["services","quote","detail"],stability:h.Experimental,goal:"View and edit quote details",context:"Quote inspection"},source:{type:"component",framework:"react",componentKey:"QuoteDetail"},targets:["react","markdown"],policy:{flags:["service.quotes.enabled"]}}),x=g({meta:{key:"service-business-os.job.board",version:"1.0.0",title:"Job Board",description:"Job board with kanban view",domain:"services",owners:["@service-os"],tags:["services","jobs","board","kanban"],stability:h.Experimental,goal:"Visual job management",context:"Field service scheduling"},source:{type:"component",framework:"react",componentKey:"JobBoard"},targets:["react"],policy:{flags:["service.jobs.enabled"]}}),z=g({meta:{key:"service-business-os.invoice.list",version:"1.0.0",title:"Invoice List",description:"List of invoices with payment status",domain:"services",owners:["@service-os"],tags:["services","invoices","list"],stability:h.Experimental,goal:"Track invoices and payments",context:"Billing management"},source:{type:"component",framework:"react",componentKey:"InvoiceList"},targets:["react","markdown"],policy:{flags:["service.invoices.enabled"]}}),A=g({meta:{key:"service-business-os.payment.list",version:"1.0.0",title:"Payment List",description:"List of payments received",domain:"services",owners:["@service-os"],tags:["services","payments","list"],stability:h.Experimental,goal:"Track received payments",context:"Payment reconciliation"},source:{type:"component",framework:"react",componentKey:"PaymentList"},targets:["react","markdown"],policy:{flags:["service.payments.enabled"]}});export{k as ServiceDashboardPresentation,v as QuoteListPresentation,w as QuoteDetailPresentation,A as PaymentListPresentation,x as JobBoardPresentation,z as InvoiceListPresentation,q as ClientListPresentation};
@@ -1,123 +1,2 @@
1
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
- });
42
-
43
- // src/quote/quote.operations.ts
44
- import { defineCommand } from "@contractspec/lib.contracts-spec";
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
- };
2
+ import{defineSchemaModel as x,ScalarTypeEnum as Q}from"@contractspec/lib.schema";var t=x({name:"Quote",description:"Quote/proposal",fields:{id:{type:Q.String_unsecure(),isOptional:!1},clientId:{type:Q.String_unsecure(),isOptional:!1},title:{type:Q.String_unsecure(),isOptional:!1},description:{type:Q.String_unsecure(),isOptional:!0},amount:{type:Q.Float_unsecure(),isOptional:!1},currency:{type:Q.String_unsecure(),isOptional:!1},status:{type:Q.String_unsecure(),isOptional:!1},validUntil:{type:Q.DateTime(),isOptional:!0},createdAt:{type:Q.DateTime(),isOptional:!1}}}),A=x({name:"CreateQuoteInput",description:"Input for creating a quote",fields:{clientId:{type:Q.String_unsecure(),isOptional:!1},title:{type:Q.String_unsecure(),isOptional:!1},description:{type:Q.String_unsecure(),isOptional:!0},amount:{type:Q.Float_unsecure(),isOptional:!1},currency:{type:Q.String_unsecure(),isOptional:!0},validUntil:{type:Q.DateTime(),isOptional:!0},orgId:{type:Q.String_unsecure(),isOptional:!1},ownerId:{type:Q.String_unsecure(),isOptional:!1}}}),C=x({name:"AcceptQuoteInput",description:"Input for accepting a quote",fields:{quoteId:{type:Q.String_unsecure(),isOptional:!1},acceptedBy:{type:Q.String_unsecure(),isOptional:!1},notes:{type:Q.String_unsecure(),isOptional:!0}}});import{defineCommand as g}from"@contractspec/lib.contracts-spec";var j=["@examples.service-business-os"],k=g({meta:{key:"service.quote.create",version:"1.0.0",stability:"stable",owners:[...j],tags:["service-business-os","quote","create"],description:"Create a quote/proposal.",goal:"Quote clients.",context:"Quote creation."},io:{input:A,output:t},policy:{auth:"user"},acceptance:{scenarios:[{key:"create-quote-happy-path",given:["Client exists"],when:["User creates quote"],then:["Quote is created"]}],examples:[{key:"create-proposal",input:{clientId:"client-123",items:[{description:"Project A",price:5000}]},output:{id:"quote-123",status:"draft",total:5000}}]}}),o=g({meta:{key:"service.quote.accept",version:"1.0.0",stability:"stable",owners:[...j],tags:["service-business-os","quote","accept"],description:"Accept a quote.",goal:"Confirm quote.",context:"Quote acceptance."},io:{input:C,output:t},policy:{auth:"user"},acceptance:{scenarios:[{key:"accept-quote-happy-path",given:["Quote is open"],when:["Client accepts quote"],then:["Quote status becomes ACCEPTED"]}],examples:[{key:"client-accepts",input:{quoteId:"quote-123",signature:"John Doe"},output:{id:"quote-123",status:"accepted"}}]}});export{t as QuoteModel,A as CreateQuoteInputModel,k as CreateQuoteContract,C as AcceptQuoteInputModel,o as AcceptQuoteContract};
@@ -1,120 +1,2 @@
1
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
- });
42
-
43
- // src/quote/quote.operations.ts
44
- import { defineCommand } from "@contractspec/lib.contracts-spec";
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
- };
2
+ import{defineSchemaModel as k,ScalarTypeEnum as j}from"@contractspec/lib.schema";var v=k({name:"Quote",description:"Quote/proposal",fields:{id:{type:j.String_unsecure(),isOptional:!1},clientId:{type:j.String_unsecure(),isOptional:!1},title:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},amount:{type:j.Float_unsecure(),isOptional:!1},currency:{type:j.String_unsecure(),isOptional:!1},status:{type:j.String_unsecure(),isOptional:!1},validUntil:{type:j.DateTime(),isOptional:!0},createdAt:{type:j.DateTime(),isOptional:!1}}}),w=k({name:"CreateQuoteInput",description:"Input for creating a quote",fields:{clientId:{type:j.String_unsecure(),isOptional:!1},title:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},amount:{type:j.Float_unsecure(),isOptional:!1},currency:{type:j.String_unsecure(),isOptional:!0},validUntil:{type:j.DateTime(),isOptional:!0},orgId:{type:j.String_unsecure(),isOptional:!1},ownerId:{type:j.String_unsecure(),isOptional:!1}}}),x=k({name:"AcceptQuoteInput",description:"Input for accepting a quote",fields:{quoteId:{type:j.String_unsecure(),isOptional:!1},acceptedBy:{type:j.String_unsecure(),isOptional:!1},notes:{type:j.String_unsecure(),isOptional:!0}}});import{defineCommand as z}from"@contractspec/lib.contracts-spec";var B=["@examples.service-business-os"],J=z({meta:{key:"service.quote.create",version:"1.0.0",stability:"stable",owners:[...B],tags:["service-business-os","quote","create"],description:"Create a quote/proposal.",goal:"Quote clients.",context:"Quote creation."},io:{input:w,output:v},policy:{auth:"user"},acceptance:{scenarios:[{key:"create-quote-happy-path",given:["Client exists"],when:["User creates quote"],then:["Quote is created"]}],examples:[{key:"create-proposal",input:{clientId:"client-123",items:[{description:"Project A",price:5000}]},output:{id:"quote-123",status:"draft",total:5000}}]}}),K=z({meta:{key:"service.quote.accept",version:"1.0.0",stability:"stable",owners:[...B],tags:["service-business-os","quote","accept"],description:"Accept a quote.",goal:"Confirm quote.",context:"Quote acceptance."},io:{input:x,output:v},policy:{auth:"user"},acceptance:{scenarios:[{key:"accept-quote-happy-path",given:["Quote is open"],when:["Client accepts quote"],then:["Quote status becomes ACCEPTED"]}],examples:[{key:"client-accepts",input:{quoteId:"quote-123",signature:"John Doe"},output:{id:"quote-123",status:"accepted"}}]}});export{J as CreateQuoteContract,K as AcceptQuoteContract};
@@ -1,46 +1,2 @@
1
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
- });
42
- export {
43
- QuoteModel,
44
- CreateQuoteInputModel,
45
- AcceptQuoteInputModel
46
- };
2
+ import{defineSchemaModel as k,ScalarTypeEnum as j}from"@contractspec/lib.schema";var w=k({name:"Quote",description:"Quote/proposal",fields:{id:{type:j.String_unsecure(),isOptional:!1},clientId:{type:j.String_unsecure(),isOptional:!1},title:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},amount:{type:j.Float_unsecure(),isOptional:!1},currency:{type:j.String_unsecure(),isOptional:!1},status:{type:j.String_unsecure(),isOptional:!1},validUntil:{type:j.DateTime(),isOptional:!0},createdAt:{type:j.DateTime(),isOptional:!1}}}),x=k({name:"CreateQuoteInput",description:"Input for creating a quote",fields:{clientId:{type:j.String_unsecure(),isOptional:!1},title:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!0},amount:{type:j.Float_unsecure(),isOptional:!1},currency:{type:j.String_unsecure(),isOptional:!0},validUntil:{type:j.DateTime(),isOptional:!0},orgId:{type:j.String_unsecure(),isOptional:!1},ownerId:{type:j.String_unsecure(),isOptional:!1}}}),z=k({name:"AcceptQuoteInput",description:"Input for accepting a quote",fields:{quoteId:{type:j.String_unsecure(),isOptional:!1},acceptedBy:{type:j.String_unsecure(),isOptional:!1},notes:{type:j.String_unsecure(),isOptional:!0}}});export{w as QuoteModel,x as CreateQuoteInputModel,z as AcceptQuoteInputModel};
@@ -1,32 +1,2 @@
1
1
  // @bun
2
- // src/service-business-os.capability.ts
3
- import {
4
- defineCapability,
5
- StabilityEnum
6
- } from "@contractspec/lib.contracts-spec";
7
- var QuotesCapability = defineCapability({
8
- meta: {
9
- key: "quotes",
10
- version: "1.0.0",
11
- kind: "api",
12
- stability: StabilityEnum.Experimental,
13
- description: "Quote generation and management for service businesses",
14
- owners: ["platform.core"],
15
- tags: ["quotes", "service", "business"]
16
- }
17
- });
18
- var InvoicesCapability = defineCapability({
19
- meta: {
20
- key: "invoices",
21
- version: "1.0.0",
22
- kind: "api",
23
- stability: StabilityEnum.Experimental,
24
- description: "Invoice creation and payment tracking",
25
- owners: ["platform.finance"],
26
- tags: ["invoices", "billing"]
27
- }
28
- });
29
- export {
30
- QuotesCapability,
31
- InvoicesCapability
32
- };
2
+ import{defineCapability as g,StabilityEnum as h}from"@contractspec/lib.contracts-spec";var k=g({meta:{key:"quotes",version:"1.0.0",kind:"api",stability:h.Experimental,description:"Quote generation and management for service businesses",owners:["platform.core"],tags:["quotes","service","business"]}}),q=g({meta:{key:"invoices",version:"1.0.0",kind:"api",stability:h.Experimental,description:"Invoice creation and payment tracking",owners:["platform.finance"],tags:["invoices","billing"]}});export{k as QuotesCapability,q as InvoicesCapability};
@@ -1,86 +1,2 @@
1
1
  // @bun
2
- // src/service.feature.ts
3
- import { defineFeature } from "@contractspec/lib.contracts-spec";
4
- var ServiceBusinessFeature = defineFeature({
5
- meta: {
6
- key: "service-business-os",
7
- title: "Service Business OS",
8
- description: "Quotes \u2192 jobs \u2192 invoices \u2192 payments for field services and agencies.",
9
- domain: "services",
10
- owners: ["@service-os"],
11
- tags: ["services", "quotes", "jobs", "invoices", "payments"],
12
- stability: "experimental",
13
- version: "1.0.0"
14
- },
15
- operations: [
16
- { key: "service.client.create", version: "1.0.0" },
17
- { key: "service.quote.create", version: "1.0.0" },
18
- { key: "service.quote.accept", version: "1.0.0" },
19
- { key: "service.job.schedule", version: "1.0.0" },
20
- { key: "service.job.complete", version: "1.0.0" },
21
- { key: "service.invoice.issue", version: "1.0.0" },
22
- { key: "service.payment.record", version: "1.0.0" },
23
- { key: "service.job.list", version: "1.0.0" }
24
- ],
25
- events: [
26
- { key: "service.quote.sent", version: "1.0.0" },
27
- { key: "service.quote.accepted", version: "1.0.0" },
28
- { key: "service.job.scheduled", version: "1.0.0" },
29
- { key: "service.job.completed", version: "1.0.0" },
30
- { key: "service.invoice.issued", version: "1.0.0" },
31
- { key: "service.payment.received", version: "1.0.0" }
32
- ],
33
- presentations: [
34
- { key: "service-business-os.dashboard", version: "1.0.0" },
35
- { key: "service-business-os.client.list", version: "1.0.0" },
36
- { key: "service-business-os.quote.list", version: "1.0.0" },
37
- { key: "service-business-os.quote.detail", version: "1.0.0" },
38
- { key: "service-business-os.job.board", version: "1.0.0" },
39
- { key: "service-business-os.invoice.list", version: "1.0.0" },
40
- { key: "service-business-os.payment.list", version: "1.0.0" }
41
- ],
42
- presentationsTargets: [
43
- {
44
- key: "service-business-os.dashboard",
45
- version: "1.0.0",
46
- targets: ["react", "markdown"]
47
- },
48
- {
49
- key: "service-business-os.quote.list",
50
- version: "1.0.0",
51
- targets: ["react", "markdown"]
52
- },
53
- {
54
- key: "service-business-os.invoice.list",
55
- version: "1.0.0",
56
- targets: ["react", "markdown"]
57
- }
58
- ],
59
- capabilities: {
60
- requires: [
61
- { key: "identity", version: "1.0.0" },
62
- { key: "audit-trail", version: "1.0.0" },
63
- { key: "notifications", version: "1.0.0" },
64
- { key: "files", version: "1.0.0" }
65
- ],
66
- provides: [
67
- { key: "quotes", version: "1.0.0" },
68
- { key: "jobs", version: "1.0.0" },
69
- { key: "invoices", version: "1.0.0" }
70
- ]
71
- },
72
- telemetry: [{ key: "service-business-os.telemetry", version: "1.0.0" }],
73
- jobs: [
74
- { key: "service-business-os.job.schedule-dispatch", version: "1.0.0" },
75
- { key: "service-business-os.job.invoice-reminder", version: "1.0.0" }
76
- ],
77
- docs: [
78
- "docs.examples.service-business-os",
79
- "docs.examples.service-business-os.goal",
80
- "docs.examples.service-business-os.usage",
81
- "docs.examples.service-business-os.constraints"
82
- ]
83
- });
84
- export {
85
- ServiceBusinessFeature
86
- };
2
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"service-business-os",title:"Service Business OS",description:"Quotes \u2192 jobs \u2192 invoices \u2192 payments for field services and agencies.",domain:"services",owners:["@service-os"],tags:["services","quotes","jobs","invoices","payments"],stability:"experimental",version:"1.0.0"},operations:[{key:"service.client.create",version:"1.0.0"},{key:"service.quote.create",version:"1.0.0"},{key:"service.quote.accept",version:"1.0.0"},{key:"service.job.schedule",version:"1.0.0"},{key:"service.job.complete",version:"1.0.0"},{key:"service.invoice.issue",version:"1.0.0"},{key:"service.payment.record",version:"1.0.0"},{key:"service.job.list",version:"1.0.0"}],events:[{key:"service.quote.sent",version:"1.0.0"},{key:"service.quote.accepted",version:"1.0.0"},{key:"service.job.scheduled",version:"1.0.0"},{key:"service.job.completed",version:"1.0.0"},{key:"service.invoice.issued",version:"1.0.0"},{key:"service.payment.received",version:"1.0.0"}],presentations:[{key:"service-business-os.dashboard",version:"1.0.0"},{key:"service-business-os.client.list",version:"1.0.0"},{key:"service-business-os.quote.list",version:"1.0.0"},{key:"service-business-os.quote.detail",version:"1.0.0"},{key:"service-business-os.job.board",version:"1.0.0"},{key:"service-business-os.invoice.list",version:"1.0.0"},{key:"service-business-os.payment.list",version:"1.0.0"}],presentationsTargets:[{key:"service-business-os.dashboard",version:"1.0.0",targets:["react","markdown"]},{key:"service-business-os.quote.list",version:"1.0.0",targets:["react","markdown"]},{key:"service-business-os.invoice.list",version:"1.0.0",targets:["react","markdown"]}],capabilities:{requires:[{key:"identity",version:"1.0.0"},{key:"audit-trail",version:"1.0.0"},{key:"notifications",version:"1.0.0"},{key:"files",version:"1.0.0"}],provides:[{key:"quotes",version:"1.0.0"},{key:"jobs",version:"1.0.0"},{key:"invoices",version:"1.0.0"}]},telemetry:[{key:"service-business-os.telemetry",version:"1.0.0"}],jobs:[{key:"service-business-os.job.schedule-dispatch",version:"1.0.0"},{key:"service-business-os.job.invoice-reminder",version:"1.0.0"}],docs:["docs.examples.service-business-os","docs.examples.service-business-os.goal","docs.examples.service-business-os.usage","docs.examples.service-business-os.constraints"]});export{j as ServiceBusinessFeature};