@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
@@ -0,0 +1,172 @@
1
+ // src/presentations.ts
2
+ import { definePresentation, StabilityEnum } from "@contractspec/lib.contracts";
3
+ var ServiceDashboardPresentation = definePresentation({
4
+ meta: {
5
+ key: "service-business-os.dashboard",
6
+ version: "1.0.0",
7
+ title: "Service Dashboard",
8
+ description: "Service business dashboard with overview metrics",
9
+ domain: "services",
10
+ owners: ["@service-os"],
11
+ tags: ["services", "dashboard"],
12
+ stability: StabilityEnum.Experimental,
13
+ goal: "Overview of service business metrics",
14
+ context: "Service home page"
15
+ },
16
+ source: {
17
+ type: "component",
18
+ framework: "react",
19
+ componentKey: "ServiceDashboard"
20
+ },
21
+ targets: ["react", "markdown"],
22
+ policy: {
23
+ flags: ["service.dashboard.enabled"]
24
+ }
25
+ });
26
+ var ClientListPresentation = definePresentation({
27
+ meta: {
28
+ key: "service-business-os.client.list",
29
+ version: "1.0.0",
30
+ title: "Client List",
31
+ description: "List of service clients",
32
+ domain: "services",
33
+ owners: ["@service-os"],
34
+ tags: ["services", "clients", "list"],
35
+ stability: StabilityEnum.Experimental,
36
+ goal: "Browse and manage service clients",
37
+ context: "Client management"
38
+ },
39
+ source: {
40
+ type: "component",
41
+ framework: "react",
42
+ componentKey: "ClientList"
43
+ },
44
+ targets: ["react", "markdown"],
45
+ policy: {
46
+ flags: ["service.clients.enabled"]
47
+ }
48
+ });
49
+ var QuoteListPresentation = definePresentation({
50
+ meta: {
51
+ key: "service-business-os.quote.list",
52
+ version: "1.0.0",
53
+ title: "Quote List",
54
+ description: "List of quotes with status",
55
+ domain: "services",
56
+ owners: ["@service-os"],
57
+ tags: ["services", "quotes", "list"],
58
+ stability: StabilityEnum.Experimental,
59
+ goal: "Track and manage quotes",
60
+ context: "Quote management"
61
+ },
62
+ source: {
63
+ type: "component",
64
+ framework: "react",
65
+ componentKey: "QuoteList"
66
+ },
67
+ targets: ["react", "markdown"],
68
+ policy: {
69
+ flags: ["service.quotes.enabled"]
70
+ }
71
+ });
72
+ var QuoteDetailPresentation = definePresentation({
73
+ meta: {
74
+ key: "service-business-os.quote.detail",
75
+ version: "1.0.0",
76
+ title: "Quote Details",
77
+ description: "Quote detail with line items",
78
+ domain: "services",
79
+ owners: ["@service-os"],
80
+ tags: ["services", "quote", "detail"],
81
+ stability: StabilityEnum.Experimental,
82
+ goal: "View and edit quote details",
83
+ context: "Quote inspection"
84
+ },
85
+ source: {
86
+ type: "component",
87
+ framework: "react",
88
+ componentKey: "QuoteDetail"
89
+ },
90
+ targets: ["react", "markdown"],
91
+ policy: {
92
+ flags: ["service.quotes.enabled"]
93
+ }
94
+ });
95
+ var JobBoardPresentation = definePresentation({
96
+ meta: {
97
+ key: "service-business-os.job.board",
98
+ version: "1.0.0",
99
+ title: "Job Board",
100
+ description: "Job board with kanban view",
101
+ domain: "services",
102
+ owners: ["@service-os"],
103
+ tags: ["services", "jobs", "board", "kanban"],
104
+ stability: StabilityEnum.Experimental,
105
+ goal: "Visual job management",
106
+ context: "Field service scheduling"
107
+ },
108
+ source: {
109
+ type: "component",
110
+ framework: "react",
111
+ componentKey: "JobBoard"
112
+ },
113
+ targets: ["react"],
114
+ policy: {
115
+ flags: ["service.jobs.enabled"]
116
+ }
117
+ });
118
+ var InvoiceListPresentation = definePresentation({
119
+ meta: {
120
+ key: "service-business-os.invoice.list",
121
+ version: "1.0.0",
122
+ title: "Invoice List",
123
+ description: "List of invoices with payment status",
124
+ domain: "services",
125
+ owners: ["@service-os"],
126
+ tags: ["services", "invoices", "list"],
127
+ stability: StabilityEnum.Experimental,
128
+ goal: "Track invoices and payments",
129
+ context: "Billing management"
130
+ },
131
+ source: {
132
+ type: "component",
133
+ framework: "react",
134
+ componentKey: "InvoiceList"
135
+ },
136
+ targets: ["react", "markdown"],
137
+ policy: {
138
+ flags: ["service.invoices.enabled"]
139
+ }
140
+ });
141
+ var PaymentListPresentation = definePresentation({
142
+ meta: {
143
+ key: "service-business-os.payment.list",
144
+ version: "1.0.0",
145
+ title: "Payment List",
146
+ description: "List of payments received",
147
+ domain: "services",
148
+ owners: ["@service-os"],
149
+ tags: ["services", "payments", "list"],
150
+ stability: StabilityEnum.Experimental,
151
+ goal: "Track received payments",
152
+ context: "Payment reconciliation"
153
+ },
154
+ source: {
155
+ type: "component",
156
+ framework: "react",
157
+ componentKey: "PaymentList"
158
+ },
159
+ targets: ["react", "markdown"],
160
+ policy: {
161
+ flags: ["service.payments.enabled"]
162
+ }
163
+ });
164
+ export {
165
+ ServiceDashboardPresentation,
166
+ QuoteListPresentation,
167
+ QuoteDetailPresentation,
168
+ PaymentListPresentation,
169
+ JobBoardPresentation,
170
+ InvoiceListPresentation,
171
+ ClientListPresentation
172
+ };
@@ -0,0 +1,122 @@
1
+ // src/quote/quote.schema.ts
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
+ var QuoteModel = defineSchemaModel({
4
+ name: "Quote",
5
+ description: "Quote/proposal",
6
+ fields: {
7
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
8
+ clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
9
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
10
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
11
+ amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
12
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
13
+ status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
14
+ validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },
15
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
16
+ }
17
+ });
18
+ var CreateQuoteInputModel = defineSchemaModel({
19
+ name: "CreateQuoteInput",
20
+ description: "Input for creating a quote",
21
+ fields: {
22
+ clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
23
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
24
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
25
+ amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
26
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
27
+ validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },
28
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
29
+ ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
30
+ }
31
+ });
32
+ var AcceptQuoteInputModel = defineSchemaModel({
33
+ name: "AcceptQuoteInput",
34
+ description: "Input for accepting a quote",
35
+ fields: {
36
+ quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
37
+ acceptedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
38
+ notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
39
+ }
40
+ });
41
+
42
+ // src/quote/quote.operations.ts
43
+ import { defineCommand } from "@contractspec/lib.contracts";
44
+ var OWNERS = ["@examples.service-business-os"];
45
+ var CreateQuoteContract = defineCommand({
46
+ meta: {
47
+ key: "service.quote.create",
48
+ version: "1.0.0",
49
+ stability: "stable",
50
+ owners: [...OWNERS],
51
+ tags: ["service-business-os", "quote", "create"],
52
+ description: "Create a quote/proposal.",
53
+ goal: "Quote clients.",
54
+ context: "Quote creation."
55
+ },
56
+ io: {
57
+ input: CreateQuoteInputModel,
58
+ output: QuoteModel
59
+ },
60
+ policy: { auth: "user" },
61
+ acceptance: {
62
+ scenarios: [
63
+ {
64
+ key: "create-quote-happy-path",
65
+ given: ["Client exists"],
66
+ when: ["User creates quote"],
67
+ then: ["Quote is created"]
68
+ }
69
+ ],
70
+ examples: [
71
+ {
72
+ key: "create-proposal",
73
+ input: {
74
+ clientId: "client-123",
75
+ items: [{ description: "Project A", price: 5000 }]
76
+ },
77
+ output: { id: "quote-123", status: "draft", total: 5000 }
78
+ }
79
+ ]
80
+ }
81
+ });
82
+ var AcceptQuoteContract = defineCommand({
83
+ meta: {
84
+ key: "service.quote.accept",
85
+ version: "1.0.0",
86
+ stability: "stable",
87
+ owners: [...OWNERS],
88
+ tags: ["service-business-os", "quote", "accept"],
89
+ description: "Accept a quote.",
90
+ goal: "Confirm quote.",
91
+ context: "Quote acceptance."
92
+ },
93
+ io: {
94
+ input: AcceptQuoteInputModel,
95
+ output: QuoteModel
96
+ },
97
+ policy: { auth: "user" },
98
+ acceptance: {
99
+ scenarios: [
100
+ {
101
+ key: "accept-quote-happy-path",
102
+ given: ["Quote is open"],
103
+ when: ["Client accepts quote"],
104
+ then: ["Quote status becomes ACCEPTED"]
105
+ }
106
+ ],
107
+ examples: [
108
+ {
109
+ key: "client-accepts",
110
+ input: { quoteId: "quote-123", signature: "John Doe" },
111
+ output: { id: "quote-123", status: "accepted" }
112
+ }
113
+ ]
114
+ }
115
+ });
116
+ export {
117
+ QuoteModel,
118
+ CreateQuoteInputModel,
119
+ CreateQuoteContract,
120
+ AcceptQuoteInputModel,
121
+ AcceptQuoteContract
122
+ };
@@ -0,0 +1,119 @@
1
+ // src/quote/quote.schema.ts
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
+ var QuoteModel = defineSchemaModel({
4
+ name: "Quote",
5
+ description: "Quote/proposal",
6
+ fields: {
7
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
8
+ clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
9
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
10
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
11
+ amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
12
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
13
+ status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
14
+ validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },
15
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
16
+ }
17
+ });
18
+ var CreateQuoteInputModel = defineSchemaModel({
19
+ name: "CreateQuoteInput",
20
+ description: "Input for creating a quote",
21
+ fields: {
22
+ clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
23
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
24
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
25
+ amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
26
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
27
+ validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },
28
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
29
+ ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
30
+ }
31
+ });
32
+ var AcceptQuoteInputModel = defineSchemaModel({
33
+ name: "AcceptQuoteInput",
34
+ description: "Input for accepting a quote",
35
+ fields: {
36
+ quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
37
+ acceptedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
38
+ notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
39
+ }
40
+ });
41
+
42
+ // src/quote/quote.operations.ts
43
+ import { defineCommand } from "@contractspec/lib.contracts";
44
+ var OWNERS = ["@examples.service-business-os"];
45
+ var CreateQuoteContract = defineCommand({
46
+ meta: {
47
+ key: "service.quote.create",
48
+ version: "1.0.0",
49
+ stability: "stable",
50
+ owners: [...OWNERS],
51
+ tags: ["service-business-os", "quote", "create"],
52
+ description: "Create a quote/proposal.",
53
+ goal: "Quote clients.",
54
+ context: "Quote creation."
55
+ },
56
+ io: {
57
+ input: CreateQuoteInputModel,
58
+ output: QuoteModel
59
+ },
60
+ policy: { auth: "user" },
61
+ acceptance: {
62
+ scenarios: [
63
+ {
64
+ key: "create-quote-happy-path",
65
+ given: ["Client exists"],
66
+ when: ["User creates quote"],
67
+ then: ["Quote is created"]
68
+ }
69
+ ],
70
+ examples: [
71
+ {
72
+ key: "create-proposal",
73
+ input: {
74
+ clientId: "client-123",
75
+ items: [{ description: "Project A", price: 5000 }]
76
+ },
77
+ output: { id: "quote-123", status: "draft", total: 5000 }
78
+ }
79
+ ]
80
+ }
81
+ });
82
+ var AcceptQuoteContract = defineCommand({
83
+ meta: {
84
+ key: "service.quote.accept",
85
+ version: "1.0.0",
86
+ stability: "stable",
87
+ owners: [...OWNERS],
88
+ tags: ["service-business-os", "quote", "accept"],
89
+ description: "Accept a quote.",
90
+ goal: "Confirm quote.",
91
+ context: "Quote acceptance."
92
+ },
93
+ io: {
94
+ input: AcceptQuoteInputModel,
95
+ output: QuoteModel
96
+ },
97
+ policy: { auth: "user" },
98
+ acceptance: {
99
+ scenarios: [
100
+ {
101
+ key: "accept-quote-happy-path",
102
+ given: ["Quote is open"],
103
+ when: ["Client accepts quote"],
104
+ then: ["Quote status becomes ACCEPTED"]
105
+ }
106
+ ],
107
+ examples: [
108
+ {
109
+ key: "client-accepts",
110
+ input: { quoteId: "quote-123", signature: "John Doe" },
111
+ output: { id: "quote-123", status: "accepted" }
112
+ }
113
+ ]
114
+ }
115
+ });
116
+ export {
117
+ CreateQuoteContract,
118
+ AcceptQuoteContract
119
+ };
@@ -0,0 +1,45 @@
1
+ // src/quote/quote.schema.ts
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
+ var QuoteModel = defineSchemaModel({
4
+ name: "Quote",
5
+ description: "Quote/proposal",
6
+ fields: {
7
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
8
+ clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
9
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
10
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
11
+ amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
12
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
13
+ status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
14
+ validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },
15
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
16
+ }
17
+ });
18
+ var CreateQuoteInputModel = defineSchemaModel({
19
+ name: "CreateQuoteInput",
20
+ description: "Input for creating a quote",
21
+ fields: {
22
+ clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
23
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
24
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
25
+ amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
26
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
27
+ validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },
28
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
29
+ ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
30
+ }
31
+ });
32
+ var AcceptQuoteInputModel = defineSchemaModel({
33
+ name: "AcceptQuoteInput",
34
+ description: "Input for accepting a quote",
35
+ fields: {
36
+ quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
37
+ acceptedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
38
+ notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
39
+ }
40
+ });
41
+ export {
42
+ QuoteModel,
43
+ CreateQuoteInputModel,
44
+ AcceptQuoteInputModel
45
+ };
@@ -0,0 +1,28 @@
1
+ // src/service-business-os.capability.ts
2
+ import { defineCapability, StabilityEnum } from "@contractspec/lib.contracts";
3
+ var QuotesCapability = defineCapability({
4
+ meta: {
5
+ key: "quotes",
6
+ version: "1.0.0",
7
+ kind: "api",
8
+ stability: StabilityEnum.Experimental,
9
+ description: "Quote generation and management for service businesses",
10
+ owners: ["platform.core"],
11
+ tags: ["quotes", "service", "business"]
12
+ }
13
+ });
14
+ var InvoicesCapability = defineCapability({
15
+ meta: {
16
+ key: "invoices",
17
+ version: "1.0.0",
18
+ kind: "api",
19
+ stability: StabilityEnum.Experimental,
20
+ description: "Invoice creation and payment tracking",
21
+ owners: ["platform.finance"],
22
+ tags: ["invoices", "billing"]
23
+ }
24
+ });
25
+ export {
26
+ QuotesCapability,
27
+ InvoicesCapability
28
+ };
@@ -0,0 +1,74 @@
1
+ // src/service.feature.ts
2
+ import { defineFeature } from "@contractspec/lib.contracts";
3
+ var ServiceBusinessFeature = defineFeature({
4
+ meta: {
5
+ key: "service-business-os",
6
+ title: "Service Business OS",
7
+ description: "Quotes → jobs → invoices → payments for field services and agencies.",
8
+ domain: "services",
9
+ owners: ["@service-os"],
10
+ tags: ["services", "quotes", "jobs", "invoices", "payments"],
11
+ stability: "experimental",
12
+ version: "1.0.0"
13
+ },
14
+ operations: [
15
+ { key: "service.client.create", version: "1.0.0" },
16
+ { key: "service.quote.create", version: "1.0.0" },
17
+ { key: "service.quote.accept", version: "1.0.0" },
18
+ { key: "service.job.schedule", version: "1.0.0" },
19
+ { key: "service.job.complete", version: "1.0.0" },
20
+ { key: "service.invoice.issue", version: "1.0.0" },
21
+ { key: "service.payment.record", version: "1.0.0" },
22
+ { key: "service.job.list", version: "1.0.0" }
23
+ ],
24
+ events: [
25
+ { key: "service.quote.sent", version: "1.0.0" },
26
+ { key: "service.quote.accepted", version: "1.0.0" },
27
+ { key: "service.job.scheduled", version: "1.0.0" },
28
+ { key: "service.job.completed", version: "1.0.0" },
29
+ { key: "service.invoice.issued", version: "1.0.0" },
30
+ { key: "service.payment.received", version: "1.0.0" }
31
+ ],
32
+ presentations: [
33
+ { key: "service-business-os.dashboard", version: "1.0.0" },
34
+ { key: "service-business-os.client.list", version: "1.0.0" },
35
+ { key: "service-business-os.quote.list", version: "1.0.0" },
36
+ { key: "service-business-os.quote.detail", version: "1.0.0" },
37
+ { key: "service-business-os.job.board", version: "1.0.0" },
38
+ { key: "service-business-os.invoice.list", version: "1.0.0" },
39
+ { key: "service-business-os.payment.list", version: "1.0.0" }
40
+ ],
41
+ presentationsTargets: [
42
+ {
43
+ key: "service-business-os.dashboard",
44
+ version: "1.0.0",
45
+ targets: ["react", "markdown"]
46
+ },
47
+ {
48
+ key: "service-business-os.quote.list",
49
+ version: "1.0.0",
50
+ targets: ["react", "markdown"]
51
+ },
52
+ {
53
+ key: "service-business-os.invoice.list",
54
+ version: "1.0.0",
55
+ targets: ["react", "markdown"]
56
+ }
57
+ ],
58
+ capabilities: {
59
+ requires: [
60
+ { key: "identity", version: "1.0.0" },
61
+ { key: "audit-trail", version: "1.0.0" },
62
+ { key: "notifications", version: "1.0.0" },
63
+ { key: "files", version: "1.0.0" }
64
+ ],
65
+ provides: [
66
+ { key: "quotes", version: "1.0.0" },
67
+ { key: "jobs", version: "1.0.0" },
68
+ { key: "invoices", version: "1.0.0" }
69
+ ]
70
+ }
71
+ });
72
+ export {
73
+ ServiceBusinessFeature
74
+ };
@@ -1,65 +1,59 @@
1
- import * as _contractspec_lib_schema264 from "@contractspec/lib.schema";
2
- import * as _contractspec_lib_contracts22 from "@contractspec/lib.contracts";
3
-
4
- //#region src/client/client.operations.d.ts
5
1
  /**
6
2
  * Create a new client.
7
3
  */
8
- declare const CreateClientContract: _contractspec_lib_contracts22.OperationSpec<_contractspec_lib_schema264.SchemaModel<{
9
- name: {
10
- type: _contractspec_lib_schema264.FieldType<string, string>;
11
- isOptional: false;
12
- };
13
- contactEmail: {
14
- type: _contractspec_lib_schema264.FieldType<string, string>;
15
- isOptional: true;
16
- };
17
- phone: {
18
- type: _contractspec_lib_schema264.FieldType<string, string>;
19
- isOptional: true;
20
- };
21
- orgId: {
22
- type: _contractspec_lib_schema264.FieldType<string, string>;
23
- isOptional: false;
24
- };
25
- ownerId: {
26
- type: _contractspec_lib_schema264.FieldType<string, string>;
27
- isOptional: false;
28
- };
29
- metadata: {
30
- type: _contractspec_lib_schema264.FieldType<unknown, unknown>;
31
- isOptional: true;
32
- };
33
- }>, _contractspec_lib_schema264.SchemaModel<{
34
- id: {
35
- type: _contractspec_lib_schema264.FieldType<string, string>;
36
- isOptional: false;
37
- };
38
- name: {
39
- type: _contractspec_lib_schema264.FieldType<string, string>;
40
- isOptional: false;
41
- };
42
- contactEmail: {
43
- type: _contractspec_lib_schema264.FieldType<string, string>;
44
- isOptional: true;
45
- };
46
- phone: {
47
- type: _contractspec_lib_schema264.FieldType<string, string>;
48
- isOptional: true;
49
- };
50
- orgId: {
51
- type: _contractspec_lib_schema264.FieldType<string, string>;
52
- isOptional: false;
53
- };
54
- ownerId: {
55
- type: _contractspec_lib_schema264.FieldType<string, string>;
56
- isOptional: false;
57
- };
58
- createdAt: {
59
- type: _contractspec_lib_schema264.FieldType<Date, string>;
60
- isOptional: false;
61
- };
4
+ export declare const CreateClientContract: import("@contractspec/lib.contracts").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
5
+ name: {
6
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
7
+ isOptional: false;
8
+ };
9
+ contactEmail: {
10
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
11
+ isOptional: true;
12
+ };
13
+ phone: {
14
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
15
+ isOptional: true;
16
+ };
17
+ orgId: {
18
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
19
+ isOptional: false;
20
+ };
21
+ ownerId: {
22
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
23
+ isOptional: false;
24
+ };
25
+ metadata: {
26
+ type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
27
+ isOptional: true;
28
+ };
29
+ }>, import("@contractspec/lib.schema").SchemaModel<{
30
+ id: {
31
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
32
+ isOptional: false;
33
+ };
34
+ name: {
35
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
36
+ isOptional: false;
37
+ };
38
+ contactEmail: {
39
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
40
+ isOptional: true;
41
+ };
42
+ phone: {
43
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
44
+ isOptional: true;
45
+ };
46
+ orgId: {
47
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ ownerId: {
51
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
52
+ isOptional: false;
53
+ };
54
+ createdAt: {
55
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
56
+ isOptional: false;
57
+ };
62
58
  }>, undefined>;
63
- //#endregion
64
- export { CreateClientContract };
65
59
  //# sourceMappingURL=client.operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.operations.d.ts","names":[],"sources":["../../src/client/client.operations.ts"],"sourcesContent":[],"mappings":";;;;;;;cAQa,oDAAoB,0CAAA;EAApB,IAAA,EAAA;IAqCX,IAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;EArC+B,KAAA,EAAA;;;;;;;;;+CAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;UAAA,2BAAA,CAAA"}
1
+ {"version":3,"file":"client.operations.d.ts","sourceRoot":"","sources":["../../src/client/client.operations.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqC/B,CAAC"}