@contractspec/example.service-business-os 1.56.1 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/client/client.operations.js +72 -0
- package/dist/browser/client/client.schema.js +31 -0
- package/dist/browser/client/index.js +74 -0
- package/dist/browser/docs/index.js +96 -0
- package/dist/browser/docs/service-business-os.docblock.js +96 -0
- package/dist/browser/entities/index.js +246 -0
- package/dist/browser/events.js +135 -0
- package/dist/browser/example.js +39 -0
- package/dist/browser/handlers/index.js +5 -0
- package/dist/browser/index.js +752 -0
- package/dist/browser/invoice/index.js +77 -0
- package/dist/browser/invoice/invoice.operations.js +75 -0
- package/dist/browser/invoice/invoice.schema.js +34 -0
- package/dist/browser/job/index.js +175 -0
- package/dist/browser/job/job.operations.js +172 -0
- package/dist/browser/job/job.schema.js +41 -0
- package/dist/browser/operations/index.js +506 -0
- package/dist/browser/payment/index.js +69 -0
- package/dist/browser/payment/payment.operations.js +67 -0
- package/dist/browser/payment/payment.schema.js +30 -0
- package/dist/browser/presentations/index.js +13 -0
- package/dist/browser/presentations.js +172 -0
- package/dist/browser/quote/index.js +122 -0
- package/dist/browser/quote/quote.operations.js +119 -0
- package/dist/browser/quote/quote.schema.js +45 -0
- package/dist/browser/service-business-os.capability.js +28 -0
- package/dist/browser/service.feature.js +74 -0
- package/dist/client/client.operations.d.ts +54 -60
- package/dist/client/client.operations.d.ts.map +1 -1
- package/dist/client/client.operations.js +71 -51
- package/dist/client/client.schema.d.ts +54 -59
- package/dist/client/client.schema.d.ts.map +1 -1
- package/dist/client/client.schema.js +30 -75
- package/dist/client/index.d.ts +6 -3
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +74 -3
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +97 -1
- package/dist/docs/service-business-os.docblock.d.ts +2 -1
- package/dist/docs/service-business-os.docblock.d.ts.map +1 -0
- package/dist/docs/service-business-os.docblock.js +52 -64
- package/dist/entities/index.d.ts +156 -161
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +236 -278
- package/dist/events.d.ts +253 -259
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +123 -217
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +37 -50
- package/dist/handlers/index.d.ts +11 -16
- package/dist/handlers/index.d.ts.map +1 -1
- package/dist/handlers/index.js +5 -5
- package/dist/index.d.ts +13 -18
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +752 -18
- package/dist/invoice/index.d.ts +6 -3
- package/dist/invoice/index.d.ts.map +1 -0
- package/dist/invoice/index.js +77 -3
- package/dist/invoice/invoice.operations.d.ts +54 -60
- package/dist/invoice/invoice.operations.d.ts.map +1 -1
- package/dist/invoice/invoice.operations.js +74 -55
- package/dist/invoice/invoice.schema.d.ts +54 -59
- package/dist/invoice/invoice.schema.d.ts.map +1 -1
- package/dist/invoice/invoice.schema.js +33 -75
- package/dist/job/index.d.ts +6 -3
- package/dist/job/index.d.ts.map +1 -0
- package/dist/job/index.js +175 -3
- package/dist/job/job.operations.d.ts +220 -226
- package/dist/job/job.operations.d.ts.map +1 -1
- package/dist/job/job.operations.js +167 -169
- package/dist/job/job.schema.d.ts +67 -72
- package/dist/job/job.schema.d.ts.map +1 -1
- package/dist/job/job.schema.js +39 -95
- package/dist/node/client/client.operations.js +72 -0
- package/dist/node/client/client.schema.js +31 -0
- package/dist/node/client/index.js +74 -0
- package/dist/node/docs/index.js +96 -0
- package/dist/node/docs/service-business-os.docblock.js +96 -0
- package/dist/node/entities/index.js +246 -0
- package/dist/node/events.js +135 -0
- package/dist/node/example.js +39 -0
- package/dist/node/handlers/index.js +5 -0
- package/dist/node/index.js +752 -0
- package/dist/node/invoice/index.js +77 -0
- package/dist/node/invoice/invoice.operations.js +75 -0
- package/dist/node/invoice/invoice.schema.js +34 -0
- package/dist/node/job/index.js +175 -0
- package/dist/node/job/job.operations.js +172 -0
- package/dist/node/job/job.schema.js +41 -0
- package/dist/node/operations/index.js +506 -0
- package/dist/node/payment/index.js +69 -0
- package/dist/node/payment/payment.operations.js +67 -0
- package/dist/node/payment/payment.schema.js +30 -0
- package/dist/node/presentations/index.js +13 -0
- package/dist/node/presentations.js +172 -0
- package/dist/node/quote/index.js +122 -0
- package/dist/node/quote/quote.operations.js +119 -0
- package/dist/node/quote/quote.schema.js +45 -0
- package/dist/node/service-business-os.capability.js +28 -0
- package/dist/node/service.feature.js +74 -0
- package/dist/operations/index.d.ts +6 -16
- package/dist/operations/index.d.ts.map +1 -0
- package/dist/operations/index.js +506 -16
- package/dist/payment/index.d.ts +6 -3
- package/dist/payment/index.d.ts.map +1 -0
- package/dist/payment/index.js +69 -3
- package/dist/payment/payment.operations.d.ts +50 -56
- package/dist/payment/payment.operations.d.ts.map +1 -1
- package/dist/payment/payment.operations.js +66 -51
- package/dist/payment/payment.schema.d.ts +50 -55
- package/dist/payment/payment.schema.d.ts.map +1 -1
- package/dist/payment/payment.schema.js +29 -71
- package/dist/presentations/index.d.ts +1 -4
- package/dist/presentations/index.d.ts.map +1 -1
- package/dist/presentations/index.js +13 -17
- package/dist/presentations.d.ts +7 -12
- package/dist/presentations.d.ts.map +1 -1
- package/dist/presentations.js +166 -172
- package/dist/quote/index.d.ts +6 -3
- package/dist/quote/index.d.ts.map +1 -0
- package/dist/quote/index.js +122 -3
- package/dist/quote/quote.operations.d.ts +120 -126
- package/dist/quote/quote.operations.d.ts.map +1 -1
- package/dist/quote/quote.operations.js +117 -96
- package/dist/quote/quote.schema.d.ts +83 -88
- package/dist/quote/quote.schema.d.ts.map +1 -1
- package/dist/quote/quote.schema.js +43 -111
- package/dist/service-business-os.capability.d.ts +2 -7
- package/dist/service-business-os.capability.d.ts.map +1 -1
- package/dist/service-business-os.capability.js +29 -29
- package/dist/service.feature.d.ts +1 -6
- package/dist/service.feature.d.ts.map +1 -1
- package/dist/service.feature.js +73 -164
- package/package.json +301 -64
- package/dist/client/client.operations.js.map +0 -1
- package/dist/client/client.schema.js.map +0 -1
- package/dist/docs/service-business-os.docblock.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/index.js.map +0 -1
- package/dist/invoice/invoice.operations.js.map +0 -1
- package/dist/invoice/invoice.schema.js.map +0 -1
- package/dist/job/job.operations.js.map +0 -1
- package/dist/job/job.schema.js.map +0 -1
- package/dist/payment/payment.operations.js.map +0 -1
- package/dist/payment/payment.schema.js.map +0 -1
- package/dist/presentations/index.js.map +0 -1
- package/dist/presentations.js.map +0 -1
- package/dist/quote/quote.operations.js.map +0 -1
- package/dist/quote/quote.schema.js.map +0 -1
- package/dist/service-business-os.capability.js.map +0 -1
- package/dist/service.feature.js.map +0 -1
package/dist/invoice/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Invoice domain - Invoice management.
|
|
3
|
+
*/
|
|
4
|
+
export { InvoiceModel, IssueInvoiceInputModel } from './invoice.schema';
|
|
5
|
+
export { IssueInvoiceContract } from './invoice.operations';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/invoice/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/invoice/index.js
CHANGED
|
@@ -1,4 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/invoice/invoice.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var InvoiceModel = defineSchemaModel({
|
|
5
|
+
name: "Invoice",
|
|
6
|
+
description: "Invoice issued for a job",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
invoiceNumber: {
|
|
11
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
12
|
+
isOptional: false
|
|
13
|
+
},
|
|
14
|
+
amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
15
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
16
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
17
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
18
|
+
issuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
19
|
+
paidAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var IssueInvoiceInputModel = defineSchemaModel({
|
|
23
|
+
name: "IssueInvoiceInput",
|
|
24
|
+
description: "Input for issuing an invoice",
|
|
25
|
+
fields: {
|
|
26
|
+
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
27
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
28
|
+
notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
29
|
+
lineItems: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
30
|
+
}
|
|
31
|
+
});
|
|
3
32
|
|
|
4
|
-
|
|
33
|
+
// src/invoice/invoice.operations.ts
|
|
34
|
+
import { defineCommand } from "@contractspec/lib.contracts";
|
|
35
|
+
var OWNERS = ["@examples.service-business-os"];
|
|
36
|
+
var IssueInvoiceContract = defineCommand({
|
|
37
|
+
meta: {
|
|
38
|
+
key: "service.invoice.issue",
|
|
39
|
+
version: "1.0.0",
|
|
40
|
+
stability: "stable",
|
|
41
|
+
owners: [...OWNERS],
|
|
42
|
+
tags: ["service-business-os", "invoice", "issue"],
|
|
43
|
+
description: "Issue an invoice for a job.",
|
|
44
|
+
goal: "Bill clients.",
|
|
45
|
+
context: "Billing."
|
|
46
|
+
},
|
|
47
|
+
io: {
|
|
48
|
+
input: IssueInvoiceInputModel,
|
|
49
|
+
output: InvoiceModel
|
|
50
|
+
},
|
|
51
|
+
policy: { auth: "user" },
|
|
52
|
+
acceptance: {
|
|
53
|
+
scenarios: [
|
|
54
|
+
{
|
|
55
|
+
key: "issue-invoice-happy-path",
|
|
56
|
+
given: ["Job is complete"],
|
|
57
|
+
when: ["User issues invoice"],
|
|
58
|
+
then: ["Invoice is created and sent"]
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
examples: [
|
|
62
|
+
{
|
|
63
|
+
key: "issue-standard",
|
|
64
|
+
input: {
|
|
65
|
+
jobId: "job-123",
|
|
66
|
+
dueDate: "2025-02-01",
|
|
67
|
+
items: [{ description: "Service", amount: 100 }]
|
|
68
|
+
},
|
|
69
|
+
output: { id: "inv-456", status: "issued", total: 100 }
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
IssueInvoiceInputModel,
|
|
76
|
+
IssueInvoiceContract,
|
|
77
|
+
InvoiceModel
|
|
78
|
+
};
|
|
@@ -1,65 +1,59 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema294 from "@contractspec/lib.schema";
|
|
2
|
-
import * as _contractspec_lib_contracts23 from "@contractspec/lib.contracts";
|
|
3
|
-
|
|
4
|
-
//#region src/invoice/invoice.operations.d.ts
|
|
5
1
|
/**
|
|
6
2
|
* Issue an invoice.
|
|
7
3
|
*/
|
|
8
|
-
declare const IssueInvoiceContract:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}>,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
4
|
+
export declare const IssueInvoiceContract: import("@contractspec/lib.contracts").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
5
|
+
jobId: {
|
|
6
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
dueDate: {
|
|
10
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
11
|
+
isOptional: true;
|
|
12
|
+
};
|
|
13
|
+
notes: {
|
|
14
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
15
|
+
isOptional: true;
|
|
16
|
+
};
|
|
17
|
+
lineItems: {
|
|
18
|
+
type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
|
|
19
|
+
isOptional: true;
|
|
20
|
+
};
|
|
21
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
22
|
+
id: {
|
|
23
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
24
|
+
isOptional: false;
|
|
25
|
+
};
|
|
26
|
+
jobId: {
|
|
27
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
28
|
+
isOptional: false;
|
|
29
|
+
};
|
|
30
|
+
invoiceNumber: {
|
|
31
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
32
|
+
isOptional: false;
|
|
33
|
+
};
|
|
34
|
+
amount: {
|
|
35
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
36
|
+
isOptional: false;
|
|
37
|
+
};
|
|
38
|
+
currency: {
|
|
39
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
41
|
+
};
|
|
42
|
+
status: {
|
|
43
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
44
|
+
isOptional: false;
|
|
45
|
+
};
|
|
46
|
+
dueDate: {
|
|
47
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
48
|
+
isOptional: true;
|
|
49
|
+
};
|
|
50
|
+
issuedAt: {
|
|
51
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
52
|
+
isOptional: true;
|
|
53
|
+
};
|
|
54
|
+
paidAt: {
|
|
55
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
56
|
+
isOptional: true;
|
|
57
|
+
};
|
|
62
58
|
}>, undefined>;
|
|
63
|
-
//#endregion
|
|
64
|
-
export { IssueInvoiceContract };
|
|
65
59
|
//# sourceMappingURL=invoice.operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.operations.d.ts","
|
|
1
|
+
{"version":3,"file":"invoice.operations.d.ts","sourceRoot":"","sources":["../../src/invoice/invoice.operations.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqC/B,CAAC"}
|
|
@@ -1,57 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
key: "issue-invoice-happy-path",
|
|
32
|
-
given: ["Job is complete"],
|
|
33
|
-
when: ["User issues invoice"],
|
|
34
|
-
then: ["Invoice is created and sent"]
|
|
35
|
-
}],
|
|
36
|
-
examples: [{
|
|
37
|
-
key: "issue-standard",
|
|
38
|
-
input: {
|
|
39
|
-
jobId: "job-123",
|
|
40
|
-
dueDate: "2025-02-01",
|
|
41
|
-
items: [{
|
|
42
|
-
description: "Service",
|
|
43
|
-
amount: 100
|
|
44
|
-
}]
|
|
45
|
-
},
|
|
46
|
-
output: {
|
|
47
|
-
id: "inv-456",
|
|
48
|
-
status: "issued",
|
|
49
|
-
total: 100
|
|
50
|
-
}
|
|
51
|
-
}]
|
|
52
|
-
}
|
|
1
|
+
// @bun
|
|
2
|
+
// src/invoice/invoice.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var InvoiceModel = defineSchemaModel({
|
|
5
|
+
name: "Invoice",
|
|
6
|
+
description: "Invoice issued for a job",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
invoiceNumber: {
|
|
11
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
12
|
+
isOptional: false
|
|
13
|
+
},
|
|
14
|
+
amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
15
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
16
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
17
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
18
|
+
issuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
19
|
+
paidAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var IssueInvoiceInputModel = defineSchemaModel({
|
|
23
|
+
name: "IssueInvoiceInput",
|
|
24
|
+
description: "Input for issuing an invoice",
|
|
25
|
+
fields: {
|
|
26
|
+
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
27
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
28
|
+
notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
29
|
+
lineItems: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
30
|
+
}
|
|
53
31
|
});
|
|
54
32
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
33
|
+
// src/invoice/invoice.operations.ts
|
|
34
|
+
import { defineCommand } from "@contractspec/lib.contracts";
|
|
35
|
+
var OWNERS = ["@examples.service-business-os"];
|
|
36
|
+
var IssueInvoiceContract = defineCommand({
|
|
37
|
+
meta: {
|
|
38
|
+
key: "service.invoice.issue",
|
|
39
|
+
version: "1.0.0",
|
|
40
|
+
stability: "stable",
|
|
41
|
+
owners: [...OWNERS],
|
|
42
|
+
tags: ["service-business-os", "invoice", "issue"],
|
|
43
|
+
description: "Issue an invoice for a job.",
|
|
44
|
+
goal: "Bill clients.",
|
|
45
|
+
context: "Billing."
|
|
46
|
+
},
|
|
47
|
+
io: {
|
|
48
|
+
input: IssueInvoiceInputModel,
|
|
49
|
+
output: InvoiceModel
|
|
50
|
+
},
|
|
51
|
+
policy: { auth: "user" },
|
|
52
|
+
acceptance: {
|
|
53
|
+
scenarios: [
|
|
54
|
+
{
|
|
55
|
+
key: "issue-invoice-happy-path",
|
|
56
|
+
given: ["Job is complete"],
|
|
57
|
+
when: ["User issues invoice"],
|
|
58
|
+
then: ["Invoice is created and sent"]
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
examples: [
|
|
62
|
+
{
|
|
63
|
+
key: "issue-standard",
|
|
64
|
+
input: {
|
|
65
|
+
jobId: "job-123",
|
|
66
|
+
dueDate: "2025-02-01",
|
|
67
|
+
items: [{ description: "Service", amount: 100 }]
|
|
68
|
+
},
|
|
69
|
+
output: { id: "inv-456", status: "issued", total: 100 }
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
IssueInvoiceContract
|
|
76
|
+
};
|
|
@@ -1,68 +1,63 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema309 from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
//#region src/invoice/invoice.schema.d.ts
|
|
4
1
|
/**
|
|
5
2
|
* Invoice issued for a job.
|
|
6
3
|
*/
|
|
7
|
-
declare const InvoiceModel:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
4
|
+
export declare const InvoiceModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
5
|
+
id: {
|
|
6
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
jobId: {
|
|
10
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
invoiceNumber: {
|
|
14
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
15
|
+
isOptional: false;
|
|
16
|
+
};
|
|
17
|
+
amount: {
|
|
18
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
19
|
+
isOptional: false;
|
|
20
|
+
};
|
|
21
|
+
currency: {
|
|
22
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
23
|
+
isOptional: false;
|
|
24
|
+
};
|
|
25
|
+
status: {
|
|
26
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
27
|
+
isOptional: false;
|
|
28
|
+
};
|
|
29
|
+
dueDate: {
|
|
30
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
31
|
+
isOptional: true;
|
|
32
|
+
};
|
|
33
|
+
issuedAt: {
|
|
34
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
35
|
+
isOptional: true;
|
|
36
|
+
};
|
|
37
|
+
paidAt: {
|
|
38
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
39
|
+
isOptional: true;
|
|
40
|
+
};
|
|
44
41
|
}>;
|
|
45
42
|
/**
|
|
46
43
|
* Input for issuing an invoice.
|
|
47
44
|
*/
|
|
48
|
-
declare const IssueInvoiceInputModel:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
45
|
+
export declare const IssueInvoiceInputModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
46
|
+
jobId: {
|
|
47
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
48
|
+
isOptional: false;
|
|
49
|
+
};
|
|
50
|
+
dueDate: {
|
|
51
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
52
|
+
isOptional: true;
|
|
53
|
+
};
|
|
54
|
+
notes: {
|
|
55
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
56
|
+
isOptional: true;
|
|
57
|
+
};
|
|
58
|
+
lineItems: {
|
|
59
|
+
type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
|
|
60
|
+
isOptional: true;
|
|
61
|
+
};
|
|
65
62
|
}>;
|
|
66
|
-
//#endregion
|
|
67
|
-
export { InvoiceModel, IssueInvoiceInputModel };
|
|
68
63
|
//# sourceMappingURL=invoice.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoice.schema.d.ts","
|
|
1
|
+
{"version":3,"file":"invoice.schema.d.ts","sourceRoot":"","sources":["../../src/invoice/invoice.schema.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;EASjC,CAAC"}
|
|
@@ -1,77 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
isOptional: false
|
|
22
|
-
},
|
|
23
|
-
amount: {
|
|
24
|
-
type: ScalarTypeEnum.Float_unsecure(),
|
|
25
|
-
isOptional: false
|
|
26
|
-
},
|
|
27
|
-
currency: {
|
|
28
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
29
|
-
isOptional: false
|
|
30
|
-
},
|
|
31
|
-
status: {
|
|
32
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
33
|
-
isOptional: false
|
|
34
|
-
},
|
|
35
|
-
dueDate: {
|
|
36
|
-
type: ScalarTypeEnum.DateTime(),
|
|
37
|
-
isOptional: true
|
|
38
|
-
},
|
|
39
|
-
issuedAt: {
|
|
40
|
-
type: ScalarTypeEnum.DateTime(),
|
|
41
|
-
isOptional: true
|
|
42
|
-
},
|
|
43
|
-
paidAt: {
|
|
44
|
-
type: ScalarTypeEnum.DateTime(),
|
|
45
|
-
isOptional: true
|
|
46
|
-
}
|
|
47
|
-
}
|
|
1
|
+
// @bun
|
|
2
|
+
// src/invoice/invoice.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var InvoiceModel = defineSchemaModel({
|
|
5
|
+
name: "Invoice",
|
|
6
|
+
description: "Invoice issued for a job",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
invoiceNumber: {
|
|
11
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
12
|
+
isOptional: false
|
|
13
|
+
},
|
|
14
|
+
amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
15
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
16
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
17
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
18
|
+
issuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
19
|
+
paidAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
20
|
+
}
|
|
48
21
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
isOptional: false
|
|
59
|
-
},
|
|
60
|
-
dueDate: {
|
|
61
|
-
type: ScalarTypeEnum.DateTime(),
|
|
62
|
-
isOptional: true
|
|
63
|
-
},
|
|
64
|
-
notes: {
|
|
65
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
66
|
-
isOptional: true
|
|
67
|
-
},
|
|
68
|
-
lineItems: {
|
|
69
|
-
type: ScalarTypeEnum.JSON(),
|
|
70
|
-
isOptional: true
|
|
71
|
-
}
|
|
72
|
-
}
|
|
22
|
+
var IssueInvoiceInputModel = defineSchemaModel({
|
|
23
|
+
name: "IssueInvoiceInput",
|
|
24
|
+
description: "Input for issuing an invoice",
|
|
25
|
+
fields: {
|
|
26
|
+
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
27
|
+
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
28
|
+
notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
29
|
+
lineItems: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
30
|
+
}
|
|
73
31
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
32
|
+
export {
|
|
33
|
+
IssueInvoiceInputModel,
|
|
34
|
+
InvoiceModel
|
|
35
|
+
};
|
package/dist/job/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Job domain - Job scheduling and management.
|
|
3
|
+
*/
|
|
4
|
+
export { JobModel, ScheduleJobInputModel, CompleteJobInputModel, } from './job.schema';
|
|
5
|
+
export { ScheduleJobContract, CompleteJobContract, ListJobsOperation, ListJobsInputModel, ListJobsOutputModel, } from './job.operations';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/job/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
|