@contractspec/example.service-business-os 0.0.0-canary-20260113162409

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 (94) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +16 -0
  3. package/dist/client/client.operations.d.ts +65 -0
  4. package/dist/client/client.operations.d.ts.map +1 -0
  5. package/dist/client/client.operations.js +53 -0
  6. package/dist/client/client.operations.js.map +1 -0
  7. package/dist/client/client.schema.d.ts +68 -0
  8. package/dist/client/client.schema.d.ts.map +1 -0
  9. package/dist/client/client.schema.js +77 -0
  10. package/dist/client/client.schema.js.map +1 -0
  11. package/dist/client/index.d.ts +3 -0
  12. package/dist/client/index.js +4 -0
  13. package/dist/docs/index.d.ts +1 -0
  14. package/dist/docs/index.js +1 -0
  15. package/dist/docs/service-business-os.docblock.d.ts +1 -0
  16. package/dist/docs/service-business-os.docblock.js +109 -0
  17. package/dist/docs/service-business-os.docblock.js.map +1 -0
  18. package/dist/entities/index.d.ts +168 -0
  19. package/dist/entities/index.d.ts.map +1 -0
  20. package/dist/entities/index.js +289 -0
  21. package/dist/entities/index.js.map +1 -0
  22. package/dist/events.d.ts +337 -0
  23. package/dist/events.d.ts.map +1 -0
  24. package/dist/events.js +230 -0
  25. package/dist/events.js.map +1 -0
  26. package/dist/example.d.ts +7 -0
  27. package/dist/example.d.ts.map +1 -0
  28. package/dist/example.js +53 -0
  29. package/dist/example.js.map +1 -0
  30. package/dist/handlers/index.d.ts +17 -0
  31. package/dist/handlers/index.d.ts.map +1 -0
  32. package/dist/handlers/index.js +6 -0
  33. package/dist/handlers/index.js.map +1 -0
  34. package/dist/index.d.ts +18 -0
  35. package/dist/index.js +19 -0
  36. package/dist/invoice/index.d.ts +3 -0
  37. package/dist/invoice/index.js +4 -0
  38. package/dist/invoice/invoice.operations.d.ts +65 -0
  39. package/dist/invoice/invoice.operations.d.ts.map +1 -0
  40. package/dist/invoice/invoice.operations.js +57 -0
  41. package/dist/invoice/invoice.operations.js.map +1 -0
  42. package/dist/invoice/invoice.schema.d.ts +68 -0
  43. package/dist/invoice/invoice.schema.d.ts.map +1 -0
  44. package/dist/invoice/invoice.schema.js +77 -0
  45. package/dist/invoice/invoice.schema.js.map +1 -0
  46. package/dist/job/index.d.ts +3 -0
  47. package/dist/job/index.js +4 -0
  48. package/dist/job/job.operations.d.ts +238 -0
  49. package/dist/job/job.operations.d.ts.map +1 -0
  50. package/dist/job/job.operations.js +175 -0
  51. package/dist/job/job.operations.js.map +1 -0
  52. package/dist/job/job.schema.d.ts +85 -0
  53. package/dist/job/job.schema.d.ts.map +1 -0
  54. package/dist/job/job.schema.js +98 -0
  55. package/dist/job/job.schema.js.map +1 -0
  56. package/dist/operations/index.d.ts +16 -0
  57. package/dist/operations/index.js +17 -0
  58. package/dist/payment/index.d.ts +3 -0
  59. package/dist/payment/index.js +4 -0
  60. package/dist/payment/payment.operations.d.ts +61 -0
  61. package/dist/payment/payment.operations.d.ts.map +1 -0
  62. package/dist/payment/payment.operations.js +53 -0
  63. package/dist/payment/payment.operations.js.map +1 -0
  64. package/dist/payment/payment.schema.d.ts +64 -0
  65. package/dist/payment/payment.schema.d.ts.map +1 -0
  66. package/dist/payment/payment.schema.js +73 -0
  67. package/dist/payment/payment.schema.js.map +1 -0
  68. package/dist/presentations/index.d.ts +9 -0
  69. package/dist/presentations/index.d.ts.map +1 -0
  70. package/dist/presentations/index.js +18 -0
  71. package/dist/presentations/index.js.map +1 -0
  72. package/dist/presentations.d.ts +13 -0
  73. package/dist/presentations.d.ts.map +1 -0
  74. package/dist/presentations.js +179 -0
  75. package/dist/presentations.js.map +1 -0
  76. package/dist/quote/index.d.ts +3 -0
  77. package/dist/quote/index.js +4 -0
  78. package/dist/quote/quote.operations.d.ts +135 -0
  79. package/dist/quote/quote.operations.d.ts.map +1 -0
  80. package/dist/quote/quote.operations.js +99 -0
  81. package/dist/quote/quote.operations.js.map +1 -0
  82. package/dist/quote/quote.schema.d.ts +101 -0
  83. package/dist/quote/quote.schema.d.ts.map +1 -0
  84. package/dist/quote/quote.schema.js +114 -0
  85. package/dist/quote/quote.schema.js.map +1 -0
  86. package/dist/service-business-os.capability.d.ts +8 -0
  87. package/dist/service-business-os.capability.d.ts.map +1 -0
  88. package/dist/service-business-os.capability.js +29 -0
  89. package/dist/service-business-os.capability.js.map +1 -0
  90. package/dist/service.feature.d.ts +7 -0
  91. package/dist/service.feature.d.ts.map +1 -0
  92. package/dist/service.feature.js +166 -0
  93. package/dist/service.feature.js.map +1 -0
  94. package/package.json +100 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentations.js","names":[],"sources":["../src/presentations.ts"],"sourcesContent":["import { definePresentation, StabilityEnum } from '@contractspec/lib.contracts';\n\nexport const ServiceDashboardPresentation = definePresentation({\n meta: {\n key: 'service-business-os.dashboard',\n version: '1.0.0',\n title: 'Service Dashboard',\n description: 'Service business dashboard with overview metrics',\n domain: 'services',\n owners: ['@service-os'],\n tags: ['services', 'dashboard'],\n stability: StabilityEnum.Experimental,\n goal: 'Overview of service business metrics',\n context: 'Service home page',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ServiceDashboard',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['service.dashboard.enabled'],\n },\n});\n\nexport const ClientListPresentation = definePresentation({\n meta: {\n key: 'service-business-os.client.list',\n version: '1.0.0',\n title: 'Client List',\n description: 'List of service clients',\n domain: 'services',\n owners: ['@service-os'],\n tags: ['services', 'clients', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Browse and manage service clients',\n context: 'Client management',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ClientList',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['service.clients.enabled'],\n },\n});\n\nexport const QuoteListPresentation = definePresentation({\n meta: {\n key: 'service-business-os.quote.list',\n version: '1.0.0',\n title: 'Quote List',\n description: 'List of quotes with status',\n domain: 'services',\n owners: ['@service-os'],\n tags: ['services', 'quotes', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Track and manage quotes',\n context: 'Quote management',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'QuoteList',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['service.quotes.enabled'],\n },\n});\n\nexport const QuoteDetailPresentation = definePresentation({\n meta: {\n key: 'service-business-os.quote.detail',\n version: '1.0.0',\n title: 'Quote Details',\n description: 'Quote detail with line items',\n domain: 'services',\n owners: ['@service-os'],\n tags: ['services', 'quote', 'detail'],\n stability: StabilityEnum.Experimental,\n goal: 'View and edit quote details',\n context: 'Quote inspection',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'QuoteDetail',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['service.quotes.enabled'],\n },\n});\n\nexport const JobBoardPresentation = definePresentation({\n meta: {\n key: 'service-business-os.job.board',\n version: '1.0.0',\n title: 'Job Board',\n description: 'Job board with kanban view',\n domain: 'services',\n owners: ['@service-os'],\n tags: ['services', 'jobs', 'board', 'kanban'],\n stability: StabilityEnum.Experimental,\n goal: 'Visual job management',\n context: 'Field service scheduling',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'JobBoard',\n },\n targets: ['react'],\n policy: {\n flags: ['service.jobs.enabled'],\n },\n});\n\nexport const InvoiceListPresentation = definePresentation({\n meta: {\n key: 'service-business-os.invoice.list',\n version: '1.0.0',\n title: 'Invoice List',\n description: 'List of invoices with payment status',\n domain: 'services',\n owners: ['@service-os'],\n tags: ['services', 'invoices', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Track invoices and payments',\n context: 'Billing management',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'InvoiceList',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['service.invoices.enabled'],\n },\n});\n\nexport const PaymentListPresentation = definePresentation({\n meta: {\n key: 'service-business-os.payment.list',\n version: '1.0.0',\n title: 'Payment List',\n description: 'List of payments received',\n domain: 'services',\n owners: ['@service-os'],\n tags: ['services', 'payments', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Track received payments',\n context: 'Payment reconciliation',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'PaymentList',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['service.payments.enabled'],\n },\n});\n"],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ import { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel } from "./quote.schema.js";
2
+ import { AcceptQuoteContract, CreateQuoteContract } from "./quote.operations.js";
3
+ export { AcceptQuoteContract, AcceptQuoteInputModel, CreateQuoteContract, CreateQuoteInputModel, QuoteModel };
@@ -0,0 +1,4 @@
1
+ import { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel } from "./quote.schema.js";
2
+ import { AcceptQuoteContract, CreateQuoteContract } from "./quote.operations.js";
3
+
4
+ export { AcceptQuoteContract, AcceptQuoteInputModel, CreateQuoteContract, CreateQuoteInputModel, QuoteModel };
@@ -0,0 +1,135 @@
1
+ import * as _contractspec_lib_schema402 from "@contractspec/lib.schema";
2
+ import * as _contractspec_lib_contracts28 from "@contractspec/lib.contracts";
3
+
4
+ //#region src/quote/quote.operations.d.ts
5
+ /**
6
+ * Create a new quote.
7
+ */
8
+ declare const CreateQuoteContract: _contractspec_lib_contracts28.OperationSpec<_contractspec_lib_schema402.SchemaModel<{
9
+ clientId: {
10
+ type: _contractspec_lib_schema402.FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ title: {
14
+ type: _contractspec_lib_schema402.FieldType<string, string>;
15
+ isOptional: false;
16
+ };
17
+ description: {
18
+ type: _contractspec_lib_schema402.FieldType<string, string>;
19
+ isOptional: true;
20
+ };
21
+ amount: {
22
+ type: _contractspec_lib_schema402.FieldType<number, number>;
23
+ isOptional: false;
24
+ };
25
+ currency: {
26
+ type: _contractspec_lib_schema402.FieldType<string, string>;
27
+ isOptional: true;
28
+ };
29
+ validUntil: {
30
+ type: _contractspec_lib_schema402.FieldType<Date, string>;
31
+ isOptional: true;
32
+ };
33
+ orgId: {
34
+ type: _contractspec_lib_schema402.FieldType<string, string>;
35
+ isOptional: false;
36
+ };
37
+ ownerId: {
38
+ type: _contractspec_lib_schema402.FieldType<string, string>;
39
+ isOptional: false;
40
+ };
41
+ }>, _contractspec_lib_schema402.SchemaModel<{
42
+ id: {
43
+ type: _contractspec_lib_schema402.FieldType<string, string>;
44
+ isOptional: false;
45
+ };
46
+ clientId: {
47
+ type: _contractspec_lib_schema402.FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ title: {
51
+ type: _contractspec_lib_schema402.FieldType<string, string>;
52
+ isOptional: false;
53
+ };
54
+ description: {
55
+ type: _contractspec_lib_schema402.FieldType<string, string>;
56
+ isOptional: true;
57
+ };
58
+ amount: {
59
+ type: _contractspec_lib_schema402.FieldType<number, number>;
60
+ isOptional: false;
61
+ };
62
+ currency: {
63
+ type: _contractspec_lib_schema402.FieldType<string, string>;
64
+ isOptional: false;
65
+ };
66
+ status: {
67
+ type: _contractspec_lib_schema402.FieldType<string, string>;
68
+ isOptional: false;
69
+ };
70
+ validUntil: {
71
+ type: _contractspec_lib_schema402.FieldType<Date, string>;
72
+ isOptional: true;
73
+ };
74
+ createdAt: {
75
+ type: _contractspec_lib_schema402.FieldType<Date, string>;
76
+ isOptional: false;
77
+ };
78
+ }>, undefined>;
79
+ /**
80
+ * Accept a quote.
81
+ */
82
+ declare const AcceptQuoteContract: _contractspec_lib_contracts28.OperationSpec<_contractspec_lib_schema402.SchemaModel<{
83
+ quoteId: {
84
+ type: _contractspec_lib_schema402.FieldType<string, string>;
85
+ isOptional: false;
86
+ };
87
+ acceptedBy: {
88
+ type: _contractspec_lib_schema402.FieldType<string, string>;
89
+ isOptional: false;
90
+ };
91
+ notes: {
92
+ type: _contractspec_lib_schema402.FieldType<string, string>;
93
+ isOptional: true;
94
+ };
95
+ }>, _contractspec_lib_schema402.SchemaModel<{
96
+ id: {
97
+ type: _contractspec_lib_schema402.FieldType<string, string>;
98
+ isOptional: false;
99
+ };
100
+ clientId: {
101
+ type: _contractspec_lib_schema402.FieldType<string, string>;
102
+ isOptional: false;
103
+ };
104
+ title: {
105
+ type: _contractspec_lib_schema402.FieldType<string, string>;
106
+ isOptional: false;
107
+ };
108
+ description: {
109
+ type: _contractspec_lib_schema402.FieldType<string, string>;
110
+ isOptional: true;
111
+ };
112
+ amount: {
113
+ type: _contractspec_lib_schema402.FieldType<number, number>;
114
+ isOptional: false;
115
+ };
116
+ currency: {
117
+ type: _contractspec_lib_schema402.FieldType<string, string>;
118
+ isOptional: false;
119
+ };
120
+ status: {
121
+ type: _contractspec_lib_schema402.FieldType<string, string>;
122
+ isOptional: false;
123
+ };
124
+ validUntil: {
125
+ type: _contractspec_lib_schema402.FieldType<Date, string>;
126
+ isOptional: true;
127
+ };
128
+ createdAt: {
129
+ type: _contractspec_lib_schema402.FieldType<Date, string>;
130
+ isOptional: false;
131
+ };
132
+ }>, undefined>;
133
+ //#endregion
134
+ export { AcceptQuoteContract, CreateQuoteContract };
135
+ //# sourceMappingURL=quote.operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote.operations.d.ts","names":[],"sources":["../../src/quote/quote.operations.ts"],"sourcesContent":[],"mappings":";;;;;;;cAYa,mDAAmB,0CAAA;EAAnB,QAAA,EAAA;IAoCX,IAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;EApC8B,CAAA;;;;;;;;;;;;;EAAA,KAAA,EAAA;IAyCnB,IAAA,uCAiCX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;+CAjC8B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;UAzCA,2BAAA,CAAA;;;;;;;;+CAyCA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAnB,mDAAmB,0CAAA;;UAiC9B,2BAAA,CAAA;;;;;;;;;;;;;UAjC8B,2BAAA,CAAA"}
@@ -0,0 +1,99 @@
1
+ import { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel } from "./quote.schema.js";
2
+ import { defineCommand } from "@contractspec/lib.contracts";
3
+
4
+ //#region src/quote/quote.operations.ts
5
+ const OWNERS = ["@examples.service-business-os"];
6
+ /**
7
+ * Create a new quote.
8
+ */
9
+ const CreateQuoteContract = defineCommand({
10
+ meta: {
11
+ key: "service.quote.create",
12
+ version: "1.0.0",
13
+ stability: "stable",
14
+ owners: [...OWNERS],
15
+ tags: [
16
+ "service-business-os",
17
+ "quote",
18
+ "create"
19
+ ],
20
+ description: "Create a quote/proposal.",
21
+ goal: "Quote clients.",
22
+ context: "Quote creation."
23
+ },
24
+ io: {
25
+ input: CreateQuoteInputModel,
26
+ output: QuoteModel
27
+ },
28
+ policy: { auth: "user" },
29
+ acceptance: {
30
+ scenarios: [{
31
+ key: "create-quote-happy-path",
32
+ given: ["Client exists"],
33
+ when: ["User creates quote"],
34
+ then: ["Quote is created"]
35
+ }],
36
+ examples: [{
37
+ key: "create-proposal",
38
+ input: {
39
+ clientId: "client-123",
40
+ items: [{
41
+ description: "Project A",
42
+ price: 5e3
43
+ }]
44
+ },
45
+ output: {
46
+ id: "quote-123",
47
+ status: "draft",
48
+ total: 5e3
49
+ }
50
+ }]
51
+ }
52
+ });
53
+ /**
54
+ * Accept a quote.
55
+ */
56
+ const AcceptQuoteContract = defineCommand({
57
+ meta: {
58
+ key: "service.quote.accept",
59
+ version: "1.0.0",
60
+ stability: "stable",
61
+ owners: [...OWNERS],
62
+ tags: [
63
+ "service-business-os",
64
+ "quote",
65
+ "accept"
66
+ ],
67
+ description: "Accept a quote.",
68
+ goal: "Confirm quote.",
69
+ context: "Quote acceptance."
70
+ },
71
+ io: {
72
+ input: AcceptQuoteInputModel,
73
+ output: QuoteModel
74
+ },
75
+ policy: { auth: "user" },
76
+ acceptance: {
77
+ scenarios: [{
78
+ key: "accept-quote-happy-path",
79
+ given: ["Quote is open"],
80
+ when: ["Client accepts quote"],
81
+ then: ["Quote status becomes ACCEPTED"]
82
+ }],
83
+ examples: [{
84
+ key: "client-accepts",
85
+ input: {
86
+ quoteId: "quote-123",
87
+ signature: "John Doe"
88
+ },
89
+ output: {
90
+ id: "quote-123",
91
+ status: "accepted"
92
+ }
93
+ }]
94
+ }
95
+ });
96
+
97
+ //#endregion
98
+ export { AcceptQuoteContract, CreateQuoteContract };
99
+ //# sourceMappingURL=quote.operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote.operations.js","names":[],"sources":["../../src/quote/quote.operations.ts"],"sourcesContent":["import { defineCommand } from '@contractspec/lib.contracts';\nimport {\n AcceptQuoteInputModel,\n CreateQuoteInputModel,\n QuoteModel,\n} from './quote.schema';\n\nconst OWNERS = ['@examples.service-business-os'] as const;\n\n/**\n * Create a new quote.\n */\nexport const CreateQuoteContract = defineCommand({\n meta: {\n key: 'service.quote.create',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['service-business-os', 'quote', 'create'],\n description: 'Create a quote/proposal.',\n goal: 'Quote clients.',\n context: 'Quote creation.',\n },\n io: {\n input: CreateQuoteInputModel,\n output: QuoteModel,\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'create-quote-happy-path',\n given: ['Client exists'],\n when: ['User creates quote'],\n then: ['Quote is created'],\n },\n ],\n examples: [\n {\n key: 'create-proposal',\n input: {\n clientId: 'client-123',\n items: [{ description: 'Project A', price: 5000 }],\n },\n output: { id: 'quote-123', status: 'draft', total: 5000 },\n },\n ],\n },\n});\n\n/**\n * Accept a quote.\n */\nexport const AcceptQuoteContract = defineCommand({\n meta: {\n key: 'service.quote.accept',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['service-business-os', 'quote', 'accept'],\n description: 'Accept a quote.',\n goal: 'Confirm quote.',\n context: 'Quote acceptance.',\n },\n io: {\n input: AcceptQuoteInputModel,\n output: QuoteModel,\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'accept-quote-happy-path',\n given: ['Quote is open'],\n when: ['Client accepts quote'],\n then: ['Quote status becomes ACCEPTED'],\n },\n ],\n examples: [\n {\n key: 'client-accepts',\n input: { quoteId: 'quote-123', signature: 'John Doe' },\n output: { id: 'quote-123', status: 'accepted' },\n },\n ],\n },\n});\n"],"mappings":";;;;AAOA,MAAM,SAAS,CAAC,gCAAgC;;;;AAKhD,MAAa,sBAAsB,cAAc;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAuB;GAAS;GAAS;EAChD,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,gBAAgB;GACxB,MAAM,CAAC,qBAAqB;GAC5B,MAAM,CAAC,mBAAmB;GAC3B,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IACL,UAAU;IACV,OAAO,CAAC;KAAE,aAAa;KAAa,OAAO;KAAM,CAAC;IACnD;GACD,QAAQ;IAAE,IAAI;IAAa,QAAQ;IAAS,OAAO;IAAM;GAC1D,CACF;EACF;CACF,CAAC;;;;AAKF,MAAa,sBAAsB,cAAc;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAuB;GAAS;GAAS;EAChD,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EAAE,MAAM,QAAQ;CACxB,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,gBAAgB;GACxB,MAAM,CAAC,uBAAuB;GAC9B,MAAM,CAAC,gCAAgC;GACxC,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IAAE,SAAS;IAAa,WAAW;IAAY;GACtD,QAAQ;IAAE,IAAI;IAAa,QAAQ;IAAY;GAChD,CACF;EACF;CACF,CAAC"}
@@ -0,0 +1,101 @@
1
+ import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
2
+
3
+ //#region src/quote/quote.schema.d.ts
4
+ /**
5
+ * Quote/proposal.
6
+ */
7
+ declare const QuoteModel: _contractspec_lib_schema0.SchemaModel<{
8
+ id: {
9
+ type: _contractspec_lib_schema0.FieldType<string, string>;
10
+ isOptional: false;
11
+ };
12
+ clientId: {
13
+ type: _contractspec_lib_schema0.FieldType<string, string>;
14
+ isOptional: false;
15
+ };
16
+ title: {
17
+ type: _contractspec_lib_schema0.FieldType<string, string>;
18
+ isOptional: false;
19
+ };
20
+ description: {
21
+ type: _contractspec_lib_schema0.FieldType<string, string>;
22
+ isOptional: true;
23
+ };
24
+ amount: {
25
+ type: _contractspec_lib_schema0.FieldType<number, number>;
26
+ isOptional: false;
27
+ };
28
+ currency: {
29
+ type: _contractspec_lib_schema0.FieldType<string, string>;
30
+ isOptional: false;
31
+ };
32
+ status: {
33
+ type: _contractspec_lib_schema0.FieldType<string, string>;
34
+ isOptional: false;
35
+ };
36
+ validUntil: {
37
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
38
+ isOptional: true;
39
+ };
40
+ createdAt: {
41
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
42
+ isOptional: false;
43
+ };
44
+ }>;
45
+ /**
46
+ * Input for creating a quote.
47
+ */
48
+ declare const CreateQuoteInputModel: _contractspec_lib_schema0.SchemaModel<{
49
+ clientId: {
50
+ type: _contractspec_lib_schema0.FieldType<string, string>;
51
+ isOptional: false;
52
+ };
53
+ title: {
54
+ type: _contractspec_lib_schema0.FieldType<string, string>;
55
+ isOptional: false;
56
+ };
57
+ description: {
58
+ type: _contractspec_lib_schema0.FieldType<string, string>;
59
+ isOptional: true;
60
+ };
61
+ amount: {
62
+ type: _contractspec_lib_schema0.FieldType<number, number>;
63
+ isOptional: false;
64
+ };
65
+ currency: {
66
+ type: _contractspec_lib_schema0.FieldType<string, string>;
67
+ isOptional: true;
68
+ };
69
+ validUntil: {
70
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
71
+ isOptional: true;
72
+ };
73
+ orgId: {
74
+ type: _contractspec_lib_schema0.FieldType<string, string>;
75
+ isOptional: false;
76
+ };
77
+ ownerId: {
78
+ type: _contractspec_lib_schema0.FieldType<string, string>;
79
+ isOptional: false;
80
+ };
81
+ }>;
82
+ /**
83
+ * Input for accepting a quote.
84
+ */
85
+ declare const AcceptQuoteInputModel: _contractspec_lib_schema0.SchemaModel<{
86
+ quoteId: {
87
+ type: _contractspec_lib_schema0.FieldType<string, string>;
88
+ isOptional: false;
89
+ };
90
+ acceptedBy: {
91
+ type: _contractspec_lib_schema0.FieldType<string, string>;
92
+ isOptional: false;
93
+ };
94
+ notes: {
95
+ type: _contractspec_lib_schema0.FieldType<string, string>;
96
+ isOptional: true;
97
+ };
98
+ }>;
99
+ //#endregion
100
+ export { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel };
101
+ //# sourceMappingURL=quote.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote.schema.d.ts","names":[],"sources":["../../src/quote/quote.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,UAcX,4BAdqB,WAcrB,CAAA;EAAA,EAAA,EAAA;UAAA,yBAAA,CAAA;;;;;;;;;;;EAdqB,WAAA,EAAA;IAmBV,IAAA,qCAaX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;;;;;;;EAbgC,MAAA,EAAA;IAkBrB,IAAA,qCAQX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;6CARgC,KAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;;;;;;;cAlBrB,iDAAqB;;UAahC,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,iDAAqB;;UAQhC,yBAAA,CAAA"}
@@ -0,0 +1,114 @@
1
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+
3
+ //#region src/quote/quote.schema.ts
4
+ /**
5
+ * Quote/proposal.
6
+ */
7
+ const QuoteModel = defineSchemaModel({
8
+ name: "Quote",
9
+ description: "Quote/proposal",
10
+ fields: {
11
+ id: {
12
+ type: ScalarTypeEnum.String_unsecure(),
13
+ isOptional: false
14
+ },
15
+ clientId: {
16
+ type: ScalarTypeEnum.String_unsecure(),
17
+ isOptional: false
18
+ },
19
+ title: {
20
+ type: ScalarTypeEnum.String_unsecure(),
21
+ isOptional: false
22
+ },
23
+ description: {
24
+ type: ScalarTypeEnum.String_unsecure(),
25
+ isOptional: true
26
+ },
27
+ amount: {
28
+ type: ScalarTypeEnum.Float_unsecure(),
29
+ isOptional: false
30
+ },
31
+ currency: {
32
+ type: ScalarTypeEnum.String_unsecure(),
33
+ isOptional: false
34
+ },
35
+ status: {
36
+ type: ScalarTypeEnum.String_unsecure(),
37
+ isOptional: false
38
+ },
39
+ validUntil: {
40
+ type: ScalarTypeEnum.DateTime(),
41
+ isOptional: true
42
+ },
43
+ createdAt: {
44
+ type: ScalarTypeEnum.DateTime(),
45
+ isOptional: false
46
+ }
47
+ }
48
+ });
49
+ /**
50
+ * Input for creating a quote.
51
+ */
52
+ const CreateQuoteInputModel = defineSchemaModel({
53
+ name: "CreateQuoteInput",
54
+ description: "Input for creating a quote",
55
+ fields: {
56
+ clientId: {
57
+ type: ScalarTypeEnum.String_unsecure(),
58
+ isOptional: false
59
+ },
60
+ title: {
61
+ type: ScalarTypeEnum.String_unsecure(),
62
+ isOptional: false
63
+ },
64
+ description: {
65
+ type: ScalarTypeEnum.String_unsecure(),
66
+ isOptional: true
67
+ },
68
+ amount: {
69
+ type: ScalarTypeEnum.Float_unsecure(),
70
+ isOptional: false
71
+ },
72
+ currency: {
73
+ type: ScalarTypeEnum.String_unsecure(),
74
+ isOptional: true
75
+ },
76
+ validUntil: {
77
+ type: ScalarTypeEnum.DateTime(),
78
+ isOptional: true
79
+ },
80
+ orgId: {
81
+ type: ScalarTypeEnum.String_unsecure(),
82
+ isOptional: false
83
+ },
84
+ ownerId: {
85
+ type: ScalarTypeEnum.String_unsecure(),
86
+ isOptional: false
87
+ }
88
+ }
89
+ });
90
+ /**
91
+ * Input for accepting a quote.
92
+ */
93
+ const AcceptQuoteInputModel = defineSchemaModel({
94
+ name: "AcceptQuoteInput",
95
+ description: "Input for accepting a quote",
96
+ fields: {
97
+ quoteId: {
98
+ type: ScalarTypeEnum.String_unsecure(),
99
+ isOptional: false
100
+ },
101
+ acceptedBy: {
102
+ type: ScalarTypeEnum.String_unsecure(),
103
+ isOptional: false
104
+ },
105
+ notes: {
106
+ type: ScalarTypeEnum.String_unsecure(),
107
+ isOptional: true
108
+ }
109
+ }
110
+ });
111
+
112
+ //#endregion
113
+ export { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel };
114
+ //# sourceMappingURL=quote.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote.schema.js","names":[],"sources":["../../src/quote/quote.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\n\n/**\n * Quote/proposal.\n */\nexport const QuoteModel = defineSchemaModel({\n name: 'Quote',\n description: 'Quote/proposal',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * Input for creating a quote.\n */\nexport const CreateQuoteInputModel = defineSchemaModel({\n name: 'CreateQuoteInput',\n description: 'Input for creating a quote',\n fields: {\n clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\n/**\n * Input for accepting a quote.\n */\nexport const AcceptQuoteInputModel = defineSchemaModel({\n name: 'AcceptQuoteInput',\n description: 'Input for accepting a quote',\n fields: {\n quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n acceptedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n"],"mappings":";;;;;;AAKA,MAAa,aAAa,kBAAkB;CAC1C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,QAAQ;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EACpE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,YAAY;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EACjE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,QAAQ;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EACpE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE,YAAY;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EACjE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACzE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACpE;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ import * as _contractspec_lib_contracts20 from "@contractspec/lib.contracts";
2
+
3
+ //#region src/service-business-os.capability.d.ts
4
+ declare const QuotesCapability: _contractspec_lib_contracts20.CapabilitySpec;
5
+ declare const InvoicesCapability: _contractspec_lib_contracts20.CapabilitySpec;
6
+ //#endregion
7
+ export { InvoicesCapability, QuotesCapability };
8
+ //# sourceMappingURL=service-business-os.capability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-business-os.capability.d.ts","names":[],"sources":["../src/service-business-os.capability.ts"],"sourcesContent":[],"mappings":";;;cAEa,kBAUX,6BAAA,CAV2B;cAYhB,oBAUX,6BAAA,CAV6B"}
@@ -0,0 +1,29 @@
1
+ import { StabilityEnum, defineCapability } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/service-business-os.capability.ts
4
+ const QuotesCapability = defineCapability({ 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: [
12
+ "quotes",
13
+ "service",
14
+ "business"
15
+ ]
16
+ } });
17
+ const InvoicesCapability = defineCapability({ meta: {
18
+ key: "invoices",
19
+ version: "1.0.0",
20
+ kind: "api",
21
+ stability: StabilityEnum.Experimental,
22
+ description: "Invoice creation and payment tracking",
23
+ owners: ["platform.finance"],
24
+ tags: ["invoices", "billing"]
25
+ } });
26
+
27
+ //#endregion
28
+ export { InvoicesCapability, QuotesCapability };
29
+ //# sourceMappingURL=service-business-os.capability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-business-os.capability.js","names":[],"sources":["../src/service-business-os.capability.ts"],"sourcesContent":["import { defineCapability, StabilityEnum } from '@contractspec/lib.contracts';\n\nexport const QuotesCapability = defineCapability({\n meta: {\n key: 'quotes',\n version: '1.0.0',\n kind: 'api',\n stability: StabilityEnum.Experimental,\n description: 'Quote generation and management for service businesses',\n owners: ['platform.core'],\n tags: ['quotes', 'service', 'business'],\n },\n});\n\nexport const InvoicesCapability = defineCapability({\n meta: {\n key: 'invoices',\n version: '1.0.0',\n kind: 'api',\n stability: StabilityEnum.Experimental,\n description: 'Invoice creation and payment tracking',\n owners: ['platform.finance'],\n tags: ['invoices', 'billing'],\n },\n});\n"],"mappings":";;;AAEA,MAAa,mBAAmB,iBAAiB,EAC/C,MAAM;CACJ,KAAK;CACL,SAAS;CACT,MAAM;CACN,WAAW,cAAc;CACzB,aAAa;CACb,QAAQ,CAAC,gBAAgB;CACzB,MAAM;EAAC;EAAU;EAAW;EAAW;CACxC,EACF,CAAC;AAEF,MAAa,qBAAqB,iBAAiB,EACjD,MAAM;CACJ,KAAK;CACL,SAAS;CACT,MAAM;CACN,WAAW,cAAc;CACzB,aAAa;CACb,QAAQ,CAAC,mBAAmB;CAC5B,MAAM,CAAC,YAAY,UAAU;CAC9B,EACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import * as _contractspec_lib_contracts22 from "@contractspec/lib.contracts";
2
+
3
+ //#region src/service.feature.d.ts
4
+ declare const ServiceBusinessFeature: _contractspec_lib_contracts22.FeatureModuleSpec;
5
+ //#endregion
6
+ export { ServiceBusinessFeature };
7
+ //# sourceMappingURL=service.feature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.feature.d.ts","names":[],"sources":["../src/service.feature.ts"],"sourcesContent":[],"mappings":";;;cAEa,wBAqEX,6BAAA,CArEiC"}