@contractspec/example.service-business-os 1.44.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 (90) 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 +37 -0
  27. package/dist/example.d.ts.map +1 -0
  28. package/dist/example.js +46 -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.feature.d.ts +7 -0
  87. package/dist/service.feature.d.ts.map +1 -0
  88. package/dist/service.feature.js +164 -0
  89. package/dist/service.feature.js.map +1 -0
  90. package/package.json +108 -0
@@ -0,0 +1,98 @@
1
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+
3
+ //#region src/job/job.schema.ts
4
+ /**
5
+ * Scheduled job.
6
+ */
7
+ const JobModel = defineSchemaModel({
8
+ name: "Job",
9
+ description: "Scheduled job",
10
+ fields: {
11
+ id: {
12
+ type: ScalarTypeEnum.String_unsecure(),
13
+ isOptional: false
14
+ },
15
+ quoteId: {
16
+ type: ScalarTypeEnum.String_unsecure(),
17
+ isOptional: false
18
+ },
19
+ clientId: {
20
+ type: ScalarTypeEnum.String_unsecure(),
21
+ isOptional: false
22
+ },
23
+ title: {
24
+ type: ScalarTypeEnum.String_unsecure(),
25
+ isOptional: false
26
+ },
27
+ status: {
28
+ type: ScalarTypeEnum.String_unsecure(),
29
+ isOptional: false
30
+ },
31
+ scheduledAt: {
32
+ type: ScalarTypeEnum.DateTime(),
33
+ isOptional: true
34
+ },
35
+ completedAt: {
36
+ type: ScalarTypeEnum.DateTime(),
37
+ isOptional: true
38
+ },
39
+ assignedTo: {
40
+ type: ScalarTypeEnum.String_unsecure(),
41
+ isOptional: true
42
+ }
43
+ }
44
+ });
45
+ /**
46
+ * Input for scheduling a job.
47
+ */
48
+ const ScheduleJobInputModel = defineSchemaModel({
49
+ name: "ScheduleJobInput",
50
+ description: "Input for scheduling a job",
51
+ fields: {
52
+ quoteId: {
53
+ type: ScalarTypeEnum.String_unsecure(),
54
+ isOptional: false
55
+ },
56
+ scheduledAt: {
57
+ type: ScalarTypeEnum.DateTime(),
58
+ isOptional: false
59
+ },
60
+ assignedTo: {
61
+ type: ScalarTypeEnum.String_unsecure(),
62
+ isOptional: true
63
+ },
64
+ location: {
65
+ type: ScalarTypeEnum.JSON(),
66
+ isOptional: true
67
+ },
68
+ title: {
69
+ type: ScalarTypeEnum.String_unsecure(),
70
+ isOptional: true
71
+ }
72
+ }
73
+ });
74
+ /**
75
+ * Input for completing a job.
76
+ */
77
+ const CompleteJobInputModel = defineSchemaModel({
78
+ name: "CompleteJobInput",
79
+ description: "Input for completing a job",
80
+ fields: {
81
+ jobId: {
82
+ type: ScalarTypeEnum.String_unsecure(),
83
+ isOptional: false
84
+ },
85
+ completedAt: {
86
+ type: ScalarTypeEnum.DateTime(),
87
+ isOptional: true
88
+ },
89
+ notes: {
90
+ type: ScalarTypeEnum.String_unsecure(),
91
+ isOptional: true
92
+ }
93
+ }
94
+ });
95
+
96
+ //#endregion
97
+ export { CompleteJobInputModel, JobModel, ScheduleJobInputModel };
98
+ //# sourceMappingURL=job.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job.schema.js","names":[],"sources":["../../src/job/job.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\n\n/**\n * Scheduled job.\n */\nexport const JobModel = defineSchemaModel({\n name: 'Job',\n description: 'Scheduled job',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n scheduledAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n assignedTo: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\n/**\n * Input for scheduling a job.\n */\nexport const ScheduleJobInputModel = defineSchemaModel({\n name: 'ScheduleJobInput',\n description: 'Input for scheduling a job',\n fields: {\n quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n scheduledAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n assignedTo: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n location: { type: ScalarTypeEnum.JSON(), isOptional: true },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\n/**\n * Input for completing a job.\n */\nexport const CompleteJobInputModel = defineSchemaModel({\n name: 'CompleteJobInput',\n description: 'Input for completing a job',\n fields: {\n jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n"],"mappings":";;;;;;AAKA,MAAa,WAAW,kBAAkB;CACxC,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,aAAa;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAClE,aAAa;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAClE,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,aAAa;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACnE,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACxE,UAAU;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAM;EAC3D,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACpE;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,aAAa;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAClE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACpE;CACF,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { CreateClientContract } from "../client/client.operations.js";
2
+ import { ClientModel, CreateClientInputModel } from "../client/client.schema.js";
3
+ import "../client/index.js";
4
+ import { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel } from "../quote/quote.schema.js";
5
+ import { AcceptQuoteContract, CreateQuoteContract } from "../quote/quote.operations.js";
6
+ import "../quote/index.js";
7
+ import { CompleteJobInputModel, JobModel, ScheduleJobInputModel } from "../job/job.schema.js";
8
+ import { CompleteJobContract, ScheduleJobContract } from "../job/job.operations.js";
9
+ import "../job/index.js";
10
+ import { InvoiceModel, IssueInvoiceInputModel } from "../invoice/invoice.schema.js";
11
+ import { IssueInvoiceContract } from "../invoice/invoice.operations.js";
12
+ import "../invoice/index.js";
13
+ import { PaymentModel, RecordPaymentInputModel } from "../payment/payment.schema.js";
14
+ import { RecordPaymentContract } from "../payment/payment.operations.js";
15
+ import "../payment/index.js";
16
+ export { AcceptQuoteContract, AcceptQuoteInputModel, ClientModel, CompleteJobContract, CompleteJobInputModel, CreateClientContract, CreateClientInputModel, CreateQuoteContract, CreateQuoteInputModel, InvoiceModel, IssueInvoiceContract, IssueInvoiceInputModel, JobModel, PaymentModel, QuoteModel, RecordPaymentContract, RecordPaymentInputModel, ScheduleJobContract, ScheduleJobInputModel };
@@ -0,0 +1,17 @@
1
+ import { ClientModel, CreateClientInputModel } from "../client/client.schema.js";
2
+ import { CreateClientContract } from "../client/client.operations.js";
3
+ import "../client/index.js";
4
+ import { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel } from "../quote/quote.schema.js";
5
+ import { AcceptQuoteContract, CreateQuoteContract } from "../quote/quote.operations.js";
6
+ import "../quote/index.js";
7
+ import { CompleteJobInputModel, JobModel, ScheduleJobInputModel } from "../job/job.schema.js";
8
+ import { CompleteJobContract, ScheduleJobContract } from "../job/job.operations.js";
9
+ import "../job/index.js";
10
+ import { InvoiceModel, IssueInvoiceInputModel } from "../invoice/invoice.schema.js";
11
+ import { IssueInvoiceContract } from "../invoice/invoice.operations.js";
12
+ import "../invoice/index.js";
13
+ import { PaymentModel, RecordPaymentInputModel } from "../payment/payment.schema.js";
14
+ import { RecordPaymentContract } from "../payment/payment.operations.js";
15
+ import "../payment/index.js";
16
+
17
+ export { AcceptQuoteContract, AcceptQuoteInputModel, ClientModel, CompleteJobContract, CompleteJobInputModel, CreateClientContract, CreateClientInputModel, CreateQuoteContract, CreateQuoteInputModel, InvoiceModel, IssueInvoiceContract, IssueInvoiceInputModel, JobModel, PaymentModel, QuoteModel, RecordPaymentContract, RecordPaymentInputModel, ScheduleJobContract, ScheduleJobInputModel };
@@ -0,0 +1,3 @@
1
+ import { PaymentModel, RecordPaymentInputModel } from "./payment.schema.js";
2
+ import { RecordPaymentContract } from "./payment.operations.js";
3
+ export { PaymentModel, RecordPaymentContract, RecordPaymentInputModel };
@@ -0,0 +1,4 @@
1
+ import { PaymentModel, RecordPaymentInputModel } from "./payment.schema.js";
2
+ import { RecordPaymentContract } from "./payment.operations.js";
3
+
4
+ export { PaymentModel, RecordPaymentContract, RecordPaymentInputModel };
@@ -0,0 +1,61 @@
1
+ import * as _contractspec_lib_schema403 from "@contractspec/lib.schema";
2
+ import * as _contractspec_lib_contracts16 from "@contractspec/lib.contracts";
3
+
4
+ //#region src/payment/payment.operations.d.ts
5
+ /**
6
+ * Record a payment.
7
+ */
8
+ declare const RecordPaymentContract: _contractspec_lib_contracts16.OperationSpec<_contractspec_lib_schema403.SchemaModel<{
9
+ invoiceId: {
10
+ type: _contractspec_lib_schema403.FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ amount: {
14
+ type: _contractspec_lib_schema403.FieldType<number, number>;
15
+ isOptional: false;
16
+ };
17
+ method: {
18
+ type: _contractspec_lib_schema403.FieldType<string, string>;
19
+ isOptional: false;
20
+ };
21
+ reference: {
22
+ type: _contractspec_lib_schema403.FieldType<string, string>;
23
+ isOptional: true;
24
+ };
25
+ receivedAt: {
26
+ type: _contractspec_lib_schema403.FieldType<Date, string>;
27
+ isOptional: true;
28
+ };
29
+ }>, _contractspec_lib_schema403.SchemaModel<{
30
+ id: {
31
+ type: _contractspec_lib_schema403.FieldType<string, string>;
32
+ isOptional: false;
33
+ };
34
+ invoiceId: {
35
+ type: _contractspec_lib_schema403.FieldType<string, string>;
36
+ isOptional: false;
37
+ };
38
+ amount: {
39
+ type: _contractspec_lib_schema403.FieldType<number, number>;
40
+ isOptional: false;
41
+ };
42
+ currency: {
43
+ type: _contractspec_lib_schema403.FieldType<string, string>;
44
+ isOptional: false;
45
+ };
46
+ method: {
47
+ type: _contractspec_lib_schema403.FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ reference: {
51
+ type: _contractspec_lib_schema403.FieldType<string, string>;
52
+ isOptional: true;
53
+ };
54
+ receivedAt: {
55
+ type: _contractspec_lib_schema403.FieldType<Date, string>;
56
+ isOptional: false;
57
+ };
58
+ }>, undefined>;
59
+ //#endregion
60
+ export { RecordPaymentContract };
61
+ //# sourceMappingURL=payment.operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.operations.d.ts","names":[],"sources":["../../src/payment/payment.operations.ts"],"sourcesContent":[],"mappings":";;;;;;;cAQa,qDAAqB,0CAAA;EAArB,SAAA,EAAA;IAiCX,IAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;EAjCgC,MAAA,EAAA;;;;;;;;;+CAAA,KAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;UAAA,2BAAA,CAAA"}
@@ -0,0 +1,53 @@
1
+ import { PaymentModel, RecordPaymentInputModel } from "./payment.schema.js";
2
+ import { defineCommand } from "@contractspec/lib.contracts";
3
+
4
+ //#region src/payment/payment.operations.ts
5
+ const OWNERS = ["@examples.service-business-os"];
6
+ /**
7
+ * Record a payment.
8
+ */
9
+ const RecordPaymentContract = defineCommand({
10
+ meta: {
11
+ key: "service.payment.record",
12
+ version: 1,
13
+ stability: "stable",
14
+ owners: [...OWNERS],
15
+ tags: [
16
+ "service-business-os",
17
+ "payment",
18
+ "record"
19
+ ],
20
+ description: "Record a payment.",
21
+ goal: "Track payments.",
22
+ context: "Billing."
23
+ },
24
+ io: {
25
+ input: RecordPaymentInputModel,
26
+ output: PaymentModel
27
+ },
28
+ policy: { auth: "user" },
29
+ acceptance: {
30
+ scenarios: [{
31
+ key: "record-payment-happy-path",
32
+ given: ["Invoice exists"],
33
+ when: ["User records payment"],
34
+ then: ["Payment is recorded"]
35
+ }],
36
+ examples: [{
37
+ key: "record-check",
38
+ input: {
39
+ invoiceId: "inv-456",
40
+ amount: 100,
41
+ method: "check"
42
+ },
43
+ output: {
44
+ id: "pay-123",
45
+ status: "completed"
46
+ }
47
+ }]
48
+ }
49
+ });
50
+
51
+ //#endregion
52
+ export { RecordPaymentContract };
53
+ //# sourceMappingURL=payment.operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.operations.js","names":[],"sources":["../../src/payment/payment.operations.ts"],"sourcesContent":["import { defineCommand } from '@contractspec/lib.contracts';\nimport { PaymentModel, RecordPaymentInputModel } from './payment.schema';\n\nconst OWNERS = ['@examples.service-business-os'] as const;\n\n/**\n * Record a payment.\n */\nexport const RecordPaymentContract = defineCommand({\n meta: {\n key: 'service.payment.record',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['service-business-os', 'payment', 'record'],\n description: 'Record a payment.',\n goal: 'Track payments.',\n context: 'Billing.',\n },\n io: {\n input: RecordPaymentInputModel,\n output: PaymentModel,\n },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'record-payment-happy-path',\n given: ['Invoice exists'],\n when: ['User records payment'],\n then: ['Payment is recorded'],\n },\n ],\n examples: [\n {\n key: 'record-check',\n input: { invoiceId: 'inv-456', amount: 100, method: 'check' },\n output: { id: 'pay-123', status: 'completed' },\n },\n ],\n },\n});\n"],"mappings":";;;;AAGA,MAAM,SAAS,CAAC,gCAAgC;;;;AAKhD,MAAa,wBAAwB,cAAc;CACjD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAuB;GAAW;GAAS;EAClD,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,iBAAiB;GACzB,MAAM,CAAC,uBAAuB;GAC9B,MAAM,CAAC,sBAAsB;GAC9B,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IAAE,WAAW;IAAW,QAAQ;IAAK,QAAQ;IAAS;GAC7D,QAAQ;IAAE,IAAI;IAAW,QAAQ;IAAa;GAC/C,CACF;EACF;CACF,CAAC"}
@@ -0,0 +1,64 @@
1
+ import * as _contractspec_lib_schema417 from "@contractspec/lib.schema";
2
+
3
+ //#region src/payment/payment.schema.d.ts
4
+ /**
5
+ * Payment applied to invoice.
6
+ */
7
+ declare const PaymentModel: _contractspec_lib_schema417.SchemaModel<{
8
+ id: {
9
+ type: _contractspec_lib_schema417.FieldType<string, string>;
10
+ isOptional: false;
11
+ };
12
+ invoiceId: {
13
+ type: _contractspec_lib_schema417.FieldType<string, string>;
14
+ isOptional: false;
15
+ };
16
+ amount: {
17
+ type: _contractspec_lib_schema417.FieldType<number, number>;
18
+ isOptional: false;
19
+ };
20
+ currency: {
21
+ type: _contractspec_lib_schema417.FieldType<string, string>;
22
+ isOptional: false;
23
+ };
24
+ method: {
25
+ type: _contractspec_lib_schema417.FieldType<string, string>;
26
+ isOptional: false;
27
+ };
28
+ reference: {
29
+ type: _contractspec_lib_schema417.FieldType<string, string>;
30
+ isOptional: true;
31
+ };
32
+ receivedAt: {
33
+ type: _contractspec_lib_schema417.FieldType<Date, string>;
34
+ isOptional: false;
35
+ };
36
+ }>;
37
+ /**
38
+ * Input for recording a payment.
39
+ */
40
+ declare const RecordPaymentInputModel: _contractspec_lib_schema417.SchemaModel<{
41
+ invoiceId: {
42
+ type: _contractspec_lib_schema417.FieldType<string, string>;
43
+ isOptional: false;
44
+ };
45
+ amount: {
46
+ type: _contractspec_lib_schema417.FieldType<number, number>;
47
+ isOptional: false;
48
+ };
49
+ method: {
50
+ type: _contractspec_lib_schema417.FieldType<string, string>;
51
+ isOptional: false;
52
+ };
53
+ reference: {
54
+ type: _contractspec_lib_schema417.FieldType<string, string>;
55
+ isOptional: true;
56
+ };
57
+ receivedAt: {
58
+ type: _contractspec_lib_schema417.FieldType<Date, string>;
59
+ isOptional: true;
60
+ };
61
+ }>;
62
+ //#endregion
63
+ export { PaymentModel, RecordPaymentInputModel };
64
+ //# sourceMappingURL=payment.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.schema.d.ts","names":[],"sources":["../../src/payment/payment.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,YAYX,8BAZuB,WAYvB,CAAA;EAAA,EAAA,EAAA;UAAA,2BAAA,CAAA;;;;;;;;IAZuB,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAiBZ,UAAA,EAAA,KAAA;EAUX,CAAA;;;;;;+CAVkC,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;cAAvB,qDAAuB;;UAUlC,2BAAA,CAAA"}
@@ -0,0 +1,73 @@
1
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+
3
+ //#region src/payment/payment.schema.ts
4
+ /**
5
+ * Payment applied to invoice.
6
+ */
7
+ const PaymentModel = defineSchemaModel({
8
+ name: "Payment",
9
+ description: "Payment applied to invoice",
10
+ fields: {
11
+ id: {
12
+ type: ScalarTypeEnum.String_unsecure(),
13
+ isOptional: false
14
+ },
15
+ invoiceId: {
16
+ type: ScalarTypeEnum.String_unsecure(),
17
+ isOptional: false
18
+ },
19
+ amount: {
20
+ type: ScalarTypeEnum.Float_unsecure(),
21
+ isOptional: false
22
+ },
23
+ currency: {
24
+ type: ScalarTypeEnum.String_unsecure(),
25
+ isOptional: false
26
+ },
27
+ method: {
28
+ type: ScalarTypeEnum.String_unsecure(),
29
+ isOptional: false
30
+ },
31
+ reference: {
32
+ type: ScalarTypeEnum.String_unsecure(),
33
+ isOptional: true
34
+ },
35
+ receivedAt: {
36
+ type: ScalarTypeEnum.DateTime(),
37
+ isOptional: false
38
+ }
39
+ }
40
+ });
41
+ /**
42
+ * Input for recording a payment.
43
+ */
44
+ const RecordPaymentInputModel = defineSchemaModel({
45
+ name: "RecordPaymentInput",
46
+ description: "Input for recording a payment",
47
+ fields: {
48
+ invoiceId: {
49
+ type: ScalarTypeEnum.String_unsecure(),
50
+ isOptional: false
51
+ },
52
+ amount: {
53
+ type: ScalarTypeEnum.Float_unsecure(),
54
+ isOptional: false
55
+ },
56
+ method: {
57
+ type: ScalarTypeEnum.String_unsecure(),
58
+ isOptional: false
59
+ },
60
+ reference: {
61
+ type: ScalarTypeEnum.String_unsecure(),
62
+ isOptional: true
63
+ },
64
+ receivedAt: {
65
+ type: ScalarTypeEnum.DateTime(),
66
+ isOptional: true
67
+ }
68
+ }
69
+ });
70
+
71
+ //#endregion
72
+ export { PaymentModel, RecordPaymentInputModel };
73
+ //# sourceMappingURL=payment.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment.schema.js","names":[],"sources":["../../src/payment/payment.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\n\n/**\n * Payment applied to invoice.\n */\nexport const PaymentModel = defineSchemaModel({\n name: 'Payment',\n description: 'Payment applied to invoice',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n invoiceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n method: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n reference: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n receivedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * Input for recording a payment.\n */\nexport const RecordPaymentInputModel = defineSchemaModel({\n name: 'RecordPaymentInput',\n description: 'Input for recording a payment',\n fields: {\n invoiceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n method: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n reference: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n receivedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n"],"mappings":";;;;;;AAKA,MAAa,eAAe,kBAAkB;CAC5C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,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,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACvE,YAAY;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACnE;CACF,CAAC;;;;AAKF,MAAa,0BAA0B,kBAAkB;CACvD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,QAAQ;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EACpE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACvE,YAAY;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAClE;CACF,CAAC"}
@@ -0,0 +1,9 @@
1
+ //#region src/presentations/index.d.ts
2
+ /**
3
+ * Presentation descriptors for Service Business OS.
4
+ * These names map to renderers in Studio (react/markdown) to keep specs multi-surface.
5
+ */
6
+ declare const ServiceBusinessPresentations: string[];
7
+ //#endregion
8
+ export { ServiceBusinessPresentations };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/presentations/index.ts"],"sourcesContent":[],"mappings":";;AAIA;;;cAAa"}
@@ -0,0 +1,18 @@
1
+ //#region src/presentations/index.ts
2
+ /**
3
+ * Presentation descriptors for Service Business OS.
4
+ * These names map to renderers in Studio (react/markdown) to keep specs multi-surface.
5
+ */
6
+ const ServiceBusinessPresentations = [
7
+ "service-business-os.dashboard",
8
+ "service-business-os.client.list",
9
+ "service-business-os.quote.list",
10
+ "service-business-os.quote.detail",
11
+ "service-business-os.job.board",
12
+ "service-business-os.invoice.list",
13
+ "service-business-os.payment.list"
14
+ ];
15
+
16
+ //#endregion
17
+ export { ServiceBusinessPresentations };
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/presentations/index.ts"],"sourcesContent":["/**\n * Presentation descriptors for Service Business OS.\n * These names map to renderers in Studio (react/markdown) to keep specs multi-surface.\n */\nexport const ServiceBusinessPresentations = [\n 'service-business-os.dashboard',\n 'service-business-os.client.list',\n 'service-business-os.quote.list',\n 'service-business-os.quote.detail',\n 'service-business-os.job.board',\n 'service-business-os.invoice.list',\n 'service-business-os.payment.list',\n];\n"],"mappings":";;;;;AAIA,MAAa,+BAA+B;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
@@ -0,0 +1,13 @@
1
+ import { PresentationSpec } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/presentations.d.ts
4
+ declare const ServiceDashboardPresentation: PresentationSpec;
5
+ declare const ClientListPresentation: PresentationSpec;
6
+ declare const QuoteListPresentation: PresentationSpec;
7
+ declare const QuoteDetailPresentation: PresentationSpec;
8
+ declare const JobBoardPresentation: PresentationSpec;
9
+ declare const InvoiceListPresentation: PresentationSpec;
10
+ declare const PaymentListPresentation: PresentationSpec;
11
+ //#endregion
12
+ export { ClientListPresentation, InvoiceListPresentation, JobBoardPresentation, PaymentListPresentation, QuoteDetailPresentation, QuoteListPresentation, ServiceDashboardPresentation };
13
+ //# sourceMappingURL=presentations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentations.d.ts","names":[],"sources":["../src/presentations.ts"],"sourcesContent":[],"mappings":";;;cAGa,8BAA8B;cAwB9B,wBAAwB;AAxBxB,cAgDA,qBA1BZ,EA0BmC,gBAhDO;AAwB9B,cAgDA,uBAhDwB,EAgDC,gBA1BrC;AAEY,cAgDA,oBAhDuB,EAgDD,gBA1BlC;AAEY,cAgDA,uBAhDyB,EAgDA,gBA1BrC;AAEY,cAgDA,uBAhDsB,EAgDG,gBA1BrC"}
@@ -0,0 +1,179 @@
1
+ import { StabilityEnum } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/presentations.ts
4
+ const ServiceDashboardPresentation = {
5
+ meta: {
6
+ key: "service-business-os.dashboard",
7
+ version: 1,
8
+ title: "Service Dashboard",
9
+ description: "Service business dashboard with overview metrics",
10
+ domain: "services",
11
+ owners: ["@service-os"],
12
+ tags: ["services", "dashboard"],
13
+ stability: StabilityEnum.Experimental,
14
+ goal: "Overview of service business metrics",
15
+ context: "Service home page"
16
+ },
17
+ source: {
18
+ type: "component",
19
+ framework: "react",
20
+ componentKey: "ServiceDashboard"
21
+ },
22
+ targets: ["react", "markdown"],
23
+ policy: { flags: ["service.dashboard.enabled"] }
24
+ };
25
+ const ClientListPresentation = {
26
+ meta: {
27
+ key: "service-business-os.client.list",
28
+ version: 1,
29
+ title: "Client List",
30
+ description: "List of service clients",
31
+ domain: "services",
32
+ owners: ["@service-os"],
33
+ tags: [
34
+ "services",
35
+ "clients",
36
+ "list"
37
+ ],
38
+ stability: StabilityEnum.Experimental,
39
+ goal: "Browse and manage service clients",
40
+ context: "Client management"
41
+ },
42
+ source: {
43
+ type: "component",
44
+ framework: "react",
45
+ componentKey: "ClientList"
46
+ },
47
+ targets: ["react", "markdown"],
48
+ policy: { flags: ["service.clients.enabled"] }
49
+ };
50
+ const QuoteListPresentation = {
51
+ meta: {
52
+ key: "service-business-os.quote.list",
53
+ version: 1,
54
+ title: "Quote List",
55
+ description: "List of quotes with status",
56
+ domain: "services",
57
+ owners: ["@service-os"],
58
+ tags: [
59
+ "services",
60
+ "quotes",
61
+ "list"
62
+ ],
63
+ stability: StabilityEnum.Experimental,
64
+ goal: "Track and manage quotes",
65
+ context: "Quote management"
66
+ },
67
+ source: {
68
+ type: "component",
69
+ framework: "react",
70
+ componentKey: "QuoteList"
71
+ },
72
+ targets: ["react", "markdown"],
73
+ policy: { flags: ["service.quotes.enabled"] }
74
+ };
75
+ const QuoteDetailPresentation = {
76
+ meta: {
77
+ key: "service-business-os.quote.detail",
78
+ version: 1,
79
+ title: "Quote Details",
80
+ description: "Quote detail with line items",
81
+ domain: "services",
82
+ owners: ["@service-os"],
83
+ tags: [
84
+ "services",
85
+ "quote",
86
+ "detail"
87
+ ],
88
+ stability: StabilityEnum.Experimental,
89
+ goal: "View and edit quote details",
90
+ context: "Quote inspection"
91
+ },
92
+ source: {
93
+ type: "component",
94
+ framework: "react",
95
+ componentKey: "QuoteDetail"
96
+ },
97
+ targets: ["react", "markdown"],
98
+ policy: { flags: ["service.quotes.enabled"] }
99
+ };
100
+ const JobBoardPresentation = {
101
+ meta: {
102
+ key: "service-business-os.job.board",
103
+ version: 1,
104
+ title: "Job Board",
105
+ description: "Job board with kanban view",
106
+ domain: "services",
107
+ owners: ["@service-os"],
108
+ tags: [
109
+ "services",
110
+ "jobs",
111
+ "board",
112
+ "kanban"
113
+ ],
114
+ stability: StabilityEnum.Experimental,
115
+ goal: "Visual job management",
116
+ context: "Field service scheduling"
117
+ },
118
+ source: {
119
+ type: "component",
120
+ framework: "react",
121
+ componentKey: "JobBoard"
122
+ },
123
+ targets: ["react"],
124
+ policy: { flags: ["service.jobs.enabled"] }
125
+ };
126
+ const InvoiceListPresentation = {
127
+ meta: {
128
+ key: "service-business-os.invoice.list",
129
+ version: 1,
130
+ title: "Invoice List",
131
+ description: "List of invoices with payment status",
132
+ domain: "services",
133
+ owners: ["@service-os"],
134
+ tags: [
135
+ "services",
136
+ "invoices",
137
+ "list"
138
+ ],
139
+ stability: StabilityEnum.Experimental,
140
+ goal: "Track invoices and payments",
141
+ context: "Billing management"
142
+ },
143
+ source: {
144
+ type: "component",
145
+ framework: "react",
146
+ componentKey: "InvoiceList"
147
+ },
148
+ targets: ["react", "markdown"],
149
+ policy: { flags: ["service.invoices.enabled"] }
150
+ };
151
+ const PaymentListPresentation = {
152
+ meta: {
153
+ key: "service-business-os.payment.list",
154
+ version: 1,
155
+ title: "Payment List",
156
+ description: "List of payments received",
157
+ domain: "services",
158
+ owners: ["@service-os"],
159
+ tags: [
160
+ "services",
161
+ "payments",
162
+ "list"
163
+ ],
164
+ stability: StabilityEnum.Experimental,
165
+ goal: "Track received payments",
166
+ context: "Payment reconciliation"
167
+ },
168
+ source: {
169
+ type: "component",
170
+ framework: "react",
171
+ componentKey: "PaymentList"
172
+ },
173
+ targets: ["react", "markdown"],
174
+ policy: { flags: ["service.payments.enabled"] }
175
+ };
176
+
177
+ //#endregion
178
+ export { ClientListPresentation, InvoiceListPresentation, JobBoardPresentation, PaymentListPresentation, QuoteDetailPresentation, QuoteListPresentation, ServiceDashboardPresentation };
179
+ //# sourceMappingURL=presentations.js.map