@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
|
@@ -1,135 +1,129 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema431 from "@contractspec/lib.schema";
|
|
2
|
-
import * as _contractspec_lib_contracts28 from "@contractspec/lib.contracts";
|
|
3
|
-
|
|
4
|
-
//#region src/quote/quote.operations.d.ts
|
|
5
1
|
/**
|
|
6
2
|
* Create a new quote.
|
|
7
3
|
*/
|
|
8
|
-
declare const CreateQuoteContract:
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
4
|
+
export declare const CreateQuoteContract: import("@contractspec/lib.contracts").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
5
|
+
clientId: {
|
|
6
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
title: {
|
|
10
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
description: {
|
|
14
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
15
|
+
isOptional: true;
|
|
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: true;
|
|
24
|
+
};
|
|
25
|
+
validUntil: {
|
|
26
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
27
|
+
isOptional: true;
|
|
28
|
+
};
|
|
29
|
+
orgId: {
|
|
30
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
31
|
+
isOptional: false;
|
|
32
|
+
};
|
|
33
|
+
ownerId: {
|
|
34
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
35
|
+
isOptional: false;
|
|
36
|
+
};
|
|
37
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
38
|
+
id: {
|
|
39
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
41
|
+
};
|
|
42
|
+
clientId: {
|
|
43
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
44
|
+
isOptional: false;
|
|
45
|
+
};
|
|
46
|
+
title: {
|
|
47
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
48
|
+
isOptional: false;
|
|
49
|
+
};
|
|
50
|
+
description: {
|
|
51
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
52
|
+
isOptional: true;
|
|
53
|
+
};
|
|
54
|
+
amount: {
|
|
55
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
56
|
+
isOptional: false;
|
|
57
|
+
};
|
|
58
|
+
currency: {
|
|
59
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
60
|
+
isOptional: false;
|
|
61
|
+
};
|
|
62
|
+
status: {
|
|
63
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
64
|
+
isOptional: false;
|
|
65
|
+
};
|
|
66
|
+
validUntil: {
|
|
67
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
68
|
+
isOptional: true;
|
|
69
|
+
};
|
|
70
|
+
createdAt: {
|
|
71
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
72
|
+
isOptional: false;
|
|
73
|
+
};
|
|
78
74
|
}>, undefined>;
|
|
79
75
|
/**
|
|
80
76
|
* Accept a quote.
|
|
81
77
|
*/
|
|
82
|
-
declare const AcceptQuoteContract:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}>,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
78
|
+
export declare const AcceptQuoteContract: import("@contractspec/lib.contracts").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
79
|
+
quoteId: {
|
|
80
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
81
|
+
isOptional: false;
|
|
82
|
+
};
|
|
83
|
+
acceptedBy: {
|
|
84
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
85
|
+
isOptional: false;
|
|
86
|
+
};
|
|
87
|
+
notes: {
|
|
88
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
89
|
+
isOptional: true;
|
|
90
|
+
};
|
|
91
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
92
|
+
id: {
|
|
93
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
94
|
+
isOptional: false;
|
|
95
|
+
};
|
|
96
|
+
clientId: {
|
|
97
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
98
|
+
isOptional: false;
|
|
99
|
+
};
|
|
100
|
+
title: {
|
|
101
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
102
|
+
isOptional: false;
|
|
103
|
+
};
|
|
104
|
+
description: {
|
|
105
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
106
|
+
isOptional: true;
|
|
107
|
+
};
|
|
108
|
+
amount: {
|
|
109
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
110
|
+
isOptional: false;
|
|
111
|
+
};
|
|
112
|
+
currency: {
|
|
113
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
114
|
+
isOptional: false;
|
|
115
|
+
};
|
|
116
|
+
status: {
|
|
117
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
118
|
+
isOptional: false;
|
|
119
|
+
};
|
|
120
|
+
validUntil: {
|
|
121
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
122
|
+
isOptional: true;
|
|
123
|
+
};
|
|
124
|
+
createdAt: {
|
|
125
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
126
|
+
isOptional: false;
|
|
127
|
+
};
|
|
132
128
|
}>, undefined>;
|
|
133
|
-
//#endregion
|
|
134
|
-
export { AcceptQuoteContract, CreateQuoteContract };
|
|
135
129
|
//# sourceMappingURL=quote.operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.operations.d.ts","
|
|
1
|
+
{"version":3,"file":"quote.operations.d.ts","sourceRoot":"","sources":["../../src/quote/quote.operations.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoC9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiC9B,CAAC"}
|
|
@@ -1,99 +1,120 @@
|
|
|
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
|
-
|
|
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
|
-
}
|
|
1
|
+
// @bun
|
|
2
|
+
// src/quote/quote.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var QuoteModel = defineSchemaModel({
|
|
5
|
+
name: "Quote",
|
|
6
|
+
description: "Quote/proposal",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
12
|
+
amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
13
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
14
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
15
|
+
validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
16
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var CreateQuoteInputModel = defineSchemaModel({
|
|
20
|
+
name: "CreateQuoteInput",
|
|
21
|
+
description: "Input for creating a quote",
|
|
22
|
+
fields: {
|
|
23
|
+
clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
24
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
25
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
26
|
+
amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
27
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
28
|
+
validUntil: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
29
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
30
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
31
|
+
}
|
|
52
32
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
}
|
|
33
|
+
var AcceptQuoteInputModel = defineSchemaModel({
|
|
34
|
+
name: "AcceptQuoteInput",
|
|
35
|
+
description: "Input for accepting a quote",
|
|
36
|
+
fields: {
|
|
37
|
+
quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
38
|
+
acceptedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
39
|
+
notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
40
|
+
}
|
|
95
41
|
});
|
|
96
42
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
43
|
+
// src/quote/quote.operations.ts
|
|
44
|
+
import { defineCommand } from "@contractspec/lib.contracts";
|
|
45
|
+
var OWNERS = ["@examples.service-business-os"];
|
|
46
|
+
var CreateQuoteContract = defineCommand({
|
|
47
|
+
meta: {
|
|
48
|
+
key: "service.quote.create",
|
|
49
|
+
version: "1.0.0",
|
|
50
|
+
stability: "stable",
|
|
51
|
+
owners: [...OWNERS],
|
|
52
|
+
tags: ["service-business-os", "quote", "create"],
|
|
53
|
+
description: "Create a quote/proposal.",
|
|
54
|
+
goal: "Quote clients.",
|
|
55
|
+
context: "Quote creation."
|
|
56
|
+
},
|
|
57
|
+
io: {
|
|
58
|
+
input: CreateQuoteInputModel,
|
|
59
|
+
output: QuoteModel
|
|
60
|
+
},
|
|
61
|
+
policy: { auth: "user" },
|
|
62
|
+
acceptance: {
|
|
63
|
+
scenarios: [
|
|
64
|
+
{
|
|
65
|
+
key: "create-quote-happy-path",
|
|
66
|
+
given: ["Client exists"],
|
|
67
|
+
when: ["User creates quote"],
|
|
68
|
+
then: ["Quote is created"]
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
examples: [
|
|
72
|
+
{
|
|
73
|
+
key: "create-proposal",
|
|
74
|
+
input: {
|
|
75
|
+
clientId: "client-123",
|
|
76
|
+
items: [{ description: "Project A", price: 5000 }]
|
|
77
|
+
},
|
|
78
|
+
output: { id: "quote-123", status: "draft", total: 5000 }
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
var AcceptQuoteContract = defineCommand({
|
|
84
|
+
meta: {
|
|
85
|
+
key: "service.quote.accept",
|
|
86
|
+
version: "1.0.0",
|
|
87
|
+
stability: "stable",
|
|
88
|
+
owners: [...OWNERS],
|
|
89
|
+
tags: ["service-business-os", "quote", "accept"],
|
|
90
|
+
description: "Accept a quote.",
|
|
91
|
+
goal: "Confirm quote.",
|
|
92
|
+
context: "Quote acceptance."
|
|
93
|
+
},
|
|
94
|
+
io: {
|
|
95
|
+
input: AcceptQuoteInputModel,
|
|
96
|
+
output: QuoteModel
|
|
97
|
+
},
|
|
98
|
+
policy: { auth: "user" },
|
|
99
|
+
acceptance: {
|
|
100
|
+
scenarios: [
|
|
101
|
+
{
|
|
102
|
+
key: "accept-quote-happy-path",
|
|
103
|
+
given: ["Quote is open"],
|
|
104
|
+
when: ["Client accepts quote"],
|
|
105
|
+
then: ["Quote status becomes ACCEPTED"]
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
examples: [
|
|
109
|
+
{
|
|
110
|
+
key: "client-accepts",
|
|
111
|
+
input: { quoteId: "quote-123", signature: "John Doe" },
|
|
112
|
+
output: { id: "quote-123", status: "accepted" }
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
export {
|
|
118
|
+
CreateQuoteContract,
|
|
119
|
+
AcceptQuoteContract
|
|
120
|
+
};
|
|
@@ -1,101 +1,96 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
//#region src/quote/quote.schema.d.ts
|
|
4
1
|
/**
|
|
5
2
|
* Quote/proposal.
|
|
6
3
|
*/
|
|
7
|
-
declare const QuoteModel:
|
|
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 QuoteModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
5
|
+
id: {
|
|
6
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
clientId: {
|
|
10
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
title: {
|
|
14
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
15
|
+
isOptional: false;
|
|
16
|
+
};
|
|
17
|
+
description: {
|
|
18
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
19
|
+
isOptional: true;
|
|
20
|
+
};
|
|
21
|
+
amount: {
|
|
22
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
23
|
+
isOptional: false;
|
|
24
|
+
};
|
|
25
|
+
currency: {
|
|
26
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
27
|
+
isOptional: false;
|
|
28
|
+
};
|
|
29
|
+
status: {
|
|
30
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
31
|
+
isOptional: false;
|
|
32
|
+
};
|
|
33
|
+
validUntil: {
|
|
34
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
35
|
+
isOptional: true;
|
|
36
|
+
};
|
|
37
|
+
createdAt: {
|
|
38
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
39
|
+
isOptional: false;
|
|
40
|
+
};
|
|
44
41
|
}>;
|
|
45
42
|
/**
|
|
46
43
|
* Input for creating a quote.
|
|
47
44
|
*/
|
|
48
|
-
declare const CreateQuoteInputModel:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
45
|
+
export declare const CreateQuoteInputModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
46
|
+
clientId: {
|
|
47
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
48
|
+
isOptional: false;
|
|
49
|
+
};
|
|
50
|
+
title: {
|
|
51
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
52
|
+
isOptional: false;
|
|
53
|
+
};
|
|
54
|
+
description: {
|
|
55
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
56
|
+
isOptional: true;
|
|
57
|
+
};
|
|
58
|
+
amount: {
|
|
59
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
60
|
+
isOptional: false;
|
|
61
|
+
};
|
|
62
|
+
currency: {
|
|
63
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
64
|
+
isOptional: true;
|
|
65
|
+
};
|
|
66
|
+
validUntil: {
|
|
67
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
68
|
+
isOptional: true;
|
|
69
|
+
};
|
|
70
|
+
orgId: {
|
|
71
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
72
|
+
isOptional: false;
|
|
73
|
+
};
|
|
74
|
+
ownerId: {
|
|
75
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
76
|
+
isOptional: false;
|
|
77
|
+
};
|
|
81
78
|
}>;
|
|
82
79
|
/**
|
|
83
80
|
* Input for accepting a quote.
|
|
84
81
|
*/
|
|
85
|
-
declare const AcceptQuoteInputModel:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
export declare const AcceptQuoteInputModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
83
|
+
quoteId: {
|
|
84
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
85
|
+
isOptional: false;
|
|
86
|
+
};
|
|
87
|
+
acceptedBy: {
|
|
88
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
89
|
+
isOptional: false;
|
|
90
|
+
};
|
|
91
|
+
notes: {
|
|
92
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
93
|
+
isOptional: true;
|
|
94
|
+
};
|
|
98
95
|
}>;
|
|
99
|
-
//#endregion
|
|
100
|
-
export { AcceptQuoteInputModel, CreateQuoteInputModel, QuoteModel };
|
|
101
96
|
//# sourceMappingURL=quote.schema.d.ts.map
|