@contractspec/example.service-business-os 1.46.2 → 1.47.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/client/client.operations.d.ts +17 -17
- package/dist/client/client.operations.d.ts.map +1 -1
- package/dist/client/client.schema.d.ts +16 -16
- package/dist/entities/index.d.ts +155 -155
- package/dist/entities/index.js.map +1 -1
- package/dist/events.d.ts +90 -90
- package/dist/events.d.ts.map +1 -1
- package/dist/example.d.ts +2 -2
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +4 -2
- package/dist/example.js.map +1 -1
- package/dist/invoice/invoice.operations.d.ts +17 -17
- package/dist/invoice/invoice.schema.d.ts +16 -16
- package/dist/job/job.operations.d.ts +62 -62
- package/dist/job/job.operations.d.ts.map +1 -1
- package/dist/job/job.schema.d.ts +20 -20
- package/dist/job/job.schema.d.ts.map +1 -1
- package/dist/payment/payment.operations.d.ts +16 -16
- package/dist/payment/payment.operations.d.ts.map +1 -1
- package/dist/payment/payment.schema.d.ts +15 -15
- package/dist/payment/payment.schema.d.ts.map +1 -1
- package/dist/presentations.d.ts +8 -8
- package/dist/presentations.d.ts.map +1 -1
- package/dist/presentations.js +15 -15
- package/dist/presentations.js.map +1 -1
- package/dist/quote/quote.operations.d.ts +35 -35
- package/dist/quote/quote.operations.d.ts.map +1 -1
- package/dist/quote/quote.schema.d.ts +24 -24
- package/dist/quote/quote.schema.d.ts.map +1 -1
- package/dist/service-business-os.capability.d.ts +8 -0
- package/dist/service-business-os.capability.d.ts.map +1 -0
- package/dist/service-business-os.capability.js +29 -0
- package/dist/service-business-os.capability.js.map +1 -0
- package/dist/service.feature.d.ts +2 -2
- package/dist/service.feature.d.ts.map +1 -1
- package/dist/service.feature.js +4 -2
- package/dist/service.feature.js.map +1 -1
- package/package.json +6 -7
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema177 from "@contractspec/lib.schema";
|
|
2
|
+
import * as _contractspec_lib_contracts6 from "@contractspec/lib.contracts";
|
|
3
3
|
|
|
4
4
|
//#region src/client/client.operations.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Create a new client.
|
|
7
7
|
*/
|
|
8
|
-
declare const CreateClientContract:
|
|
8
|
+
declare const CreateClientContract: _contractspec_lib_contracts6.OperationSpec<_contractspec_lib_schema177.SchemaModel<{
|
|
9
9
|
name: {
|
|
10
|
-
type:
|
|
10
|
+
type: _contractspec_lib_schema177.FieldType<string, string>;
|
|
11
11
|
isOptional: false;
|
|
12
12
|
};
|
|
13
13
|
contactEmail: {
|
|
14
|
-
type:
|
|
14
|
+
type: _contractspec_lib_schema177.FieldType<string, string>;
|
|
15
15
|
isOptional: true;
|
|
16
16
|
};
|
|
17
17
|
phone: {
|
|
18
|
-
type:
|
|
18
|
+
type: _contractspec_lib_schema177.FieldType<string, string>;
|
|
19
19
|
isOptional: true;
|
|
20
20
|
};
|
|
21
21
|
orgId: {
|
|
22
|
-
type:
|
|
22
|
+
type: _contractspec_lib_schema177.FieldType<string, string>;
|
|
23
23
|
isOptional: false;
|
|
24
24
|
};
|
|
25
25
|
ownerId: {
|
|
26
|
-
type:
|
|
26
|
+
type: _contractspec_lib_schema177.FieldType<string, string>;
|
|
27
27
|
isOptional: false;
|
|
28
28
|
};
|
|
29
29
|
metadata: {
|
|
30
|
-
type:
|
|
30
|
+
type: _contractspec_lib_schema177.FieldType<unknown, unknown>;
|
|
31
31
|
isOptional: true;
|
|
32
32
|
};
|
|
33
|
-
}>,
|
|
33
|
+
}>, _contractspec_lib_schema177.SchemaModel<{
|
|
34
34
|
id: {
|
|
35
|
-
type:
|
|
35
|
+
type: _contractspec_lib_schema177.FieldType<string, string>;
|
|
36
36
|
isOptional: false;
|
|
37
37
|
};
|
|
38
38
|
name: {
|
|
39
|
-
type:
|
|
39
|
+
type: _contractspec_lib_schema177.FieldType<string, string>;
|
|
40
40
|
isOptional: false;
|
|
41
41
|
};
|
|
42
42
|
contactEmail: {
|
|
43
|
-
type:
|
|
43
|
+
type: _contractspec_lib_schema177.FieldType<string, string>;
|
|
44
44
|
isOptional: true;
|
|
45
45
|
};
|
|
46
46
|
phone: {
|
|
47
|
-
type:
|
|
47
|
+
type: _contractspec_lib_schema177.FieldType<string, string>;
|
|
48
48
|
isOptional: true;
|
|
49
49
|
};
|
|
50
50
|
orgId: {
|
|
51
|
-
type:
|
|
51
|
+
type: _contractspec_lib_schema177.FieldType<string, string>;
|
|
52
52
|
isOptional: false;
|
|
53
53
|
};
|
|
54
54
|
ownerId: {
|
|
55
|
-
type:
|
|
55
|
+
type: _contractspec_lib_schema177.FieldType<string, string>;
|
|
56
56
|
isOptional: false;
|
|
57
57
|
};
|
|
58
58
|
createdAt: {
|
|
59
|
-
type:
|
|
59
|
+
type: _contractspec_lib_schema177.FieldType<Date, string>;
|
|
60
60
|
isOptional: false;
|
|
61
61
|
};
|
|
62
62
|
}>, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.operations.d.ts","names":[],"sources":["../../src/client/client.operations.ts"],"sourcesContent":[],"mappings":";;;;;;;cAQa,
|
|
1
|
+
{"version":3,"file":"client.operations.d.ts","names":[],"sources":["../../src/client/client.operations.ts"],"sourcesContent":[],"mappings":";;;;;;;cAQa,mDAAoB,0CAAA;EAApB,IAAA,EAAA;IAqCX,IAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;EArC+B,KAAA,EAAA;;;;;;;;;+CAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;UAAA,2BAAA,CAAA"}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema139 from "@contractspec/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/client/client.schema.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Client profile.
|
|
6
6
|
*/
|
|
7
|
-
declare const ClientModel:
|
|
7
|
+
declare const ClientModel: _contractspec_lib_schema139.SchemaModel<{
|
|
8
8
|
id: {
|
|
9
|
-
type:
|
|
9
|
+
type: _contractspec_lib_schema139.FieldType<string, string>;
|
|
10
10
|
isOptional: false;
|
|
11
11
|
};
|
|
12
12
|
name: {
|
|
13
|
-
type:
|
|
13
|
+
type: _contractspec_lib_schema139.FieldType<string, string>;
|
|
14
14
|
isOptional: false;
|
|
15
15
|
};
|
|
16
16
|
contactEmail: {
|
|
17
|
-
type:
|
|
17
|
+
type: _contractspec_lib_schema139.FieldType<string, string>;
|
|
18
18
|
isOptional: true;
|
|
19
19
|
};
|
|
20
20
|
phone: {
|
|
21
|
-
type:
|
|
21
|
+
type: _contractspec_lib_schema139.FieldType<string, string>;
|
|
22
22
|
isOptional: true;
|
|
23
23
|
};
|
|
24
24
|
orgId: {
|
|
25
|
-
type:
|
|
25
|
+
type: _contractspec_lib_schema139.FieldType<string, string>;
|
|
26
26
|
isOptional: false;
|
|
27
27
|
};
|
|
28
28
|
ownerId: {
|
|
29
|
-
type:
|
|
29
|
+
type: _contractspec_lib_schema139.FieldType<string, string>;
|
|
30
30
|
isOptional: false;
|
|
31
31
|
};
|
|
32
32
|
createdAt: {
|
|
33
|
-
type:
|
|
33
|
+
type: _contractspec_lib_schema139.FieldType<Date, string>;
|
|
34
34
|
isOptional: false;
|
|
35
35
|
};
|
|
36
36
|
}>;
|
|
37
37
|
/**
|
|
38
38
|
* Input for creating a client.
|
|
39
39
|
*/
|
|
40
|
-
declare const CreateClientInputModel:
|
|
40
|
+
declare const CreateClientInputModel: _contractspec_lib_schema139.SchemaModel<{
|
|
41
41
|
name: {
|
|
42
|
-
type:
|
|
42
|
+
type: _contractspec_lib_schema139.FieldType<string, string>;
|
|
43
43
|
isOptional: false;
|
|
44
44
|
};
|
|
45
45
|
contactEmail: {
|
|
46
|
-
type:
|
|
46
|
+
type: _contractspec_lib_schema139.FieldType<string, string>;
|
|
47
47
|
isOptional: true;
|
|
48
48
|
};
|
|
49
49
|
phone: {
|
|
50
|
-
type:
|
|
50
|
+
type: _contractspec_lib_schema139.FieldType<string, string>;
|
|
51
51
|
isOptional: true;
|
|
52
52
|
};
|
|
53
53
|
orgId: {
|
|
54
|
-
type:
|
|
54
|
+
type: _contractspec_lib_schema139.FieldType<string, string>;
|
|
55
55
|
isOptional: false;
|
|
56
56
|
};
|
|
57
57
|
ownerId: {
|
|
58
|
-
type:
|
|
58
|
+
type: _contractspec_lib_schema139.FieldType<string, string>;
|
|
59
59
|
isOptional: false;
|
|
60
60
|
};
|
|
61
61
|
metadata: {
|
|
62
|
-
type:
|
|
62
|
+
type: _contractspec_lib_schema139.FieldType<unknown, unknown>;
|
|
63
63
|
isOptional: true;
|
|
64
64
|
};
|
|
65
65
|
}>;
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,166 +1,166 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema280 from "@contractspec/lib.schema";
|
|
2
2
|
import { ModuleSchemaContribution } from "@contractspec/lib.schema";
|
|
3
3
|
|
|
4
4
|
//#region src/entities/index.d.ts
|
|
5
|
-
declare const QuoteStatusEnum:
|
|
6
|
-
declare const JobStatusEnum:
|
|
7
|
-
declare const InvoiceStatusEnum:
|
|
8
|
-
declare const PaymentMethodEnum:
|
|
9
|
-
declare const ClientEntity:
|
|
10
|
-
id:
|
|
11
|
-
name:
|
|
12
|
-
contactEmail:
|
|
13
|
-
phone:
|
|
14
|
-
address:
|
|
15
|
-
industry:
|
|
16
|
-
orgId:
|
|
17
|
-
ownerId:
|
|
18
|
-
metadata:
|
|
19
|
-
createdAt:
|
|
20
|
-
updatedAt:
|
|
21
|
-
quotes:
|
|
22
|
-
jobs:
|
|
5
|
+
declare const QuoteStatusEnum: _contractspec_lib_schema280.EntityEnumDef;
|
|
6
|
+
declare const JobStatusEnum: _contractspec_lib_schema280.EntityEnumDef;
|
|
7
|
+
declare const InvoiceStatusEnum: _contractspec_lib_schema280.EntityEnumDef;
|
|
8
|
+
declare const PaymentMethodEnum: _contractspec_lib_schema280.EntityEnumDef;
|
|
9
|
+
declare const ClientEntity: _contractspec_lib_schema280.EntitySpec<{
|
|
10
|
+
id: _contractspec_lib_schema280.EntityScalarField;
|
|
11
|
+
name: _contractspec_lib_schema280.EntityScalarField;
|
|
12
|
+
contactEmail: _contractspec_lib_schema280.EntityScalarField;
|
|
13
|
+
phone: _contractspec_lib_schema280.EntityScalarField;
|
|
14
|
+
address: _contractspec_lib_schema280.EntityScalarField;
|
|
15
|
+
industry: _contractspec_lib_schema280.EntityScalarField;
|
|
16
|
+
orgId: _contractspec_lib_schema280.EntityScalarField;
|
|
17
|
+
ownerId: _contractspec_lib_schema280.EntityScalarField;
|
|
18
|
+
metadata: _contractspec_lib_schema280.EntityScalarField;
|
|
19
|
+
createdAt: _contractspec_lib_schema280.EntityScalarField;
|
|
20
|
+
updatedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
21
|
+
quotes: _contractspec_lib_schema280.EntityRelationField;
|
|
22
|
+
jobs: _contractspec_lib_schema280.EntityRelationField;
|
|
23
23
|
}>;
|
|
24
|
-
declare const QuoteEntity:
|
|
25
|
-
id:
|
|
26
|
-
clientId:
|
|
27
|
-
title:
|
|
28
|
-
description:
|
|
29
|
-
amount:
|
|
30
|
-
currency:
|
|
31
|
-
status:
|
|
32
|
-
validUntil:
|
|
33
|
-
terms:
|
|
34
|
-
orgId:
|
|
35
|
-
ownerId:
|
|
36
|
-
createdAt:
|
|
37
|
-
updatedAt:
|
|
38
|
-
client:
|
|
39
|
-
jobs:
|
|
24
|
+
declare const QuoteEntity: _contractspec_lib_schema280.EntitySpec<{
|
|
25
|
+
id: _contractspec_lib_schema280.EntityScalarField;
|
|
26
|
+
clientId: _contractspec_lib_schema280.EntityScalarField;
|
|
27
|
+
title: _contractspec_lib_schema280.EntityScalarField;
|
|
28
|
+
description: _contractspec_lib_schema280.EntityScalarField;
|
|
29
|
+
amount: _contractspec_lib_schema280.EntityScalarField;
|
|
30
|
+
currency: _contractspec_lib_schema280.EntityScalarField;
|
|
31
|
+
status: _contractspec_lib_schema280.EntityEnumField;
|
|
32
|
+
validUntil: _contractspec_lib_schema280.EntityScalarField;
|
|
33
|
+
terms: _contractspec_lib_schema280.EntityScalarField;
|
|
34
|
+
orgId: _contractspec_lib_schema280.EntityScalarField;
|
|
35
|
+
ownerId: _contractspec_lib_schema280.EntityScalarField;
|
|
36
|
+
createdAt: _contractspec_lib_schema280.EntityScalarField;
|
|
37
|
+
updatedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
38
|
+
client: _contractspec_lib_schema280.EntityRelationField;
|
|
39
|
+
jobs: _contractspec_lib_schema280.EntityRelationField;
|
|
40
40
|
}>;
|
|
41
|
-
declare const JobEntity:
|
|
42
|
-
id:
|
|
43
|
-
quoteId:
|
|
44
|
-
clientId:
|
|
45
|
-
title:
|
|
46
|
-
status:
|
|
47
|
-
scheduledAt:
|
|
48
|
-
completedAt:
|
|
49
|
-
assignedTo:
|
|
50
|
-
location:
|
|
51
|
-
notes:
|
|
52
|
-
orgId:
|
|
53
|
-
createdAt:
|
|
54
|
-
updatedAt:
|
|
55
|
-
quote:
|
|
56
|
-
client:
|
|
57
|
-
invoices:
|
|
41
|
+
declare const JobEntity: _contractspec_lib_schema280.EntitySpec<{
|
|
42
|
+
id: _contractspec_lib_schema280.EntityScalarField;
|
|
43
|
+
quoteId: _contractspec_lib_schema280.EntityScalarField;
|
|
44
|
+
clientId: _contractspec_lib_schema280.EntityScalarField;
|
|
45
|
+
title: _contractspec_lib_schema280.EntityScalarField;
|
|
46
|
+
status: _contractspec_lib_schema280.EntityEnumField;
|
|
47
|
+
scheduledAt: _contractspec_lib_schema280.EntityScalarField;
|
|
48
|
+
completedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
49
|
+
assignedTo: _contractspec_lib_schema280.EntityScalarField;
|
|
50
|
+
location: _contractspec_lib_schema280.EntityScalarField;
|
|
51
|
+
notes: _contractspec_lib_schema280.EntityScalarField;
|
|
52
|
+
orgId: _contractspec_lib_schema280.EntityScalarField;
|
|
53
|
+
createdAt: _contractspec_lib_schema280.EntityScalarField;
|
|
54
|
+
updatedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
55
|
+
quote: _contractspec_lib_schema280.EntityRelationField;
|
|
56
|
+
client: _contractspec_lib_schema280.EntityRelationField;
|
|
57
|
+
invoices: _contractspec_lib_schema280.EntityRelationField;
|
|
58
58
|
}>;
|
|
59
|
-
declare const InvoiceEntity:
|
|
60
|
-
id:
|
|
61
|
-
jobId:
|
|
62
|
-
invoiceNumber:
|
|
63
|
-
amount:
|
|
64
|
-
currency:
|
|
65
|
-
status:
|
|
66
|
-
dueDate:
|
|
67
|
-
issuedAt:
|
|
68
|
-
paidAt:
|
|
69
|
-
orgId:
|
|
70
|
-
notes:
|
|
71
|
-
metadata:
|
|
72
|
-
createdAt:
|
|
73
|
-
updatedAt:
|
|
74
|
-
job:
|
|
75
|
-
payments:
|
|
59
|
+
declare const InvoiceEntity: _contractspec_lib_schema280.EntitySpec<{
|
|
60
|
+
id: _contractspec_lib_schema280.EntityScalarField;
|
|
61
|
+
jobId: _contractspec_lib_schema280.EntityScalarField;
|
|
62
|
+
invoiceNumber: _contractspec_lib_schema280.EntityScalarField;
|
|
63
|
+
amount: _contractspec_lib_schema280.EntityScalarField;
|
|
64
|
+
currency: _contractspec_lib_schema280.EntityScalarField;
|
|
65
|
+
status: _contractspec_lib_schema280.EntityEnumField;
|
|
66
|
+
dueDate: _contractspec_lib_schema280.EntityScalarField;
|
|
67
|
+
issuedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
68
|
+
paidAt: _contractspec_lib_schema280.EntityScalarField;
|
|
69
|
+
orgId: _contractspec_lib_schema280.EntityScalarField;
|
|
70
|
+
notes: _contractspec_lib_schema280.EntityScalarField;
|
|
71
|
+
metadata: _contractspec_lib_schema280.EntityScalarField;
|
|
72
|
+
createdAt: _contractspec_lib_schema280.EntityScalarField;
|
|
73
|
+
updatedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
74
|
+
job: _contractspec_lib_schema280.EntityRelationField;
|
|
75
|
+
payments: _contractspec_lib_schema280.EntityRelationField;
|
|
76
76
|
}>;
|
|
77
|
-
declare const PaymentEntity:
|
|
78
|
-
id:
|
|
79
|
-
invoiceId:
|
|
80
|
-
amount:
|
|
81
|
-
currency:
|
|
82
|
-
method:
|
|
83
|
-
reference:
|
|
84
|
-
receivedAt:
|
|
85
|
-
orgId:
|
|
86
|
-
createdAt:
|
|
87
|
-
invoice:
|
|
77
|
+
declare const PaymentEntity: _contractspec_lib_schema280.EntitySpec<{
|
|
78
|
+
id: _contractspec_lib_schema280.EntityScalarField;
|
|
79
|
+
invoiceId: _contractspec_lib_schema280.EntityScalarField;
|
|
80
|
+
amount: _contractspec_lib_schema280.EntityScalarField;
|
|
81
|
+
currency: _contractspec_lib_schema280.EntityScalarField;
|
|
82
|
+
method: _contractspec_lib_schema280.EntityEnumField;
|
|
83
|
+
reference: _contractspec_lib_schema280.EntityScalarField;
|
|
84
|
+
receivedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
85
|
+
orgId: _contractspec_lib_schema280.EntityScalarField;
|
|
86
|
+
createdAt: _contractspec_lib_schema280.EntityScalarField;
|
|
87
|
+
invoice: _contractspec_lib_schema280.EntityRelationField;
|
|
88
88
|
}>;
|
|
89
|
-
declare const serviceBusinessEntities: (
|
|
90
|
-
id:
|
|
91
|
-
name:
|
|
92
|
-
contactEmail:
|
|
93
|
-
phone:
|
|
94
|
-
address:
|
|
95
|
-
industry:
|
|
96
|
-
orgId:
|
|
97
|
-
ownerId:
|
|
98
|
-
metadata:
|
|
99
|
-
createdAt:
|
|
100
|
-
updatedAt:
|
|
101
|
-
quotes:
|
|
102
|
-
jobs:
|
|
103
|
-
}> |
|
|
104
|
-
id:
|
|
105
|
-
clientId:
|
|
106
|
-
title:
|
|
107
|
-
description:
|
|
108
|
-
amount:
|
|
109
|
-
currency:
|
|
110
|
-
status:
|
|
111
|
-
validUntil:
|
|
112
|
-
terms:
|
|
113
|
-
orgId:
|
|
114
|
-
ownerId:
|
|
115
|
-
createdAt:
|
|
116
|
-
updatedAt:
|
|
117
|
-
client:
|
|
118
|
-
jobs:
|
|
119
|
-
}> |
|
|
120
|
-
id:
|
|
121
|
-
quoteId:
|
|
122
|
-
clientId:
|
|
123
|
-
title:
|
|
124
|
-
status:
|
|
125
|
-
scheduledAt:
|
|
126
|
-
completedAt:
|
|
127
|
-
assignedTo:
|
|
128
|
-
location:
|
|
129
|
-
notes:
|
|
130
|
-
orgId:
|
|
131
|
-
createdAt:
|
|
132
|
-
updatedAt:
|
|
133
|
-
quote:
|
|
134
|
-
client:
|
|
135
|
-
invoices:
|
|
136
|
-
}> |
|
|
137
|
-
id:
|
|
138
|
-
jobId:
|
|
139
|
-
invoiceNumber:
|
|
140
|
-
amount:
|
|
141
|
-
currency:
|
|
142
|
-
status:
|
|
143
|
-
dueDate:
|
|
144
|
-
issuedAt:
|
|
145
|
-
paidAt:
|
|
146
|
-
orgId:
|
|
147
|
-
notes:
|
|
148
|
-
metadata:
|
|
149
|
-
createdAt:
|
|
150
|
-
updatedAt:
|
|
151
|
-
job:
|
|
152
|
-
payments:
|
|
153
|
-
}> |
|
|
154
|
-
id:
|
|
155
|
-
invoiceId:
|
|
156
|
-
amount:
|
|
157
|
-
currency:
|
|
158
|
-
method:
|
|
159
|
-
reference:
|
|
160
|
-
receivedAt:
|
|
161
|
-
orgId:
|
|
162
|
-
createdAt:
|
|
163
|
-
invoice:
|
|
89
|
+
declare const serviceBusinessEntities: (_contractspec_lib_schema280.EntitySpec<{
|
|
90
|
+
id: _contractspec_lib_schema280.EntityScalarField;
|
|
91
|
+
name: _contractspec_lib_schema280.EntityScalarField;
|
|
92
|
+
contactEmail: _contractspec_lib_schema280.EntityScalarField;
|
|
93
|
+
phone: _contractspec_lib_schema280.EntityScalarField;
|
|
94
|
+
address: _contractspec_lib_schema280.EntityScalarField;
|
|
95
|
+
industry: _contractspec_lib_schema280.EntityScalarField;
|
|
96
|
+
orgId: _contractspec_lib_schema280.EntityScalarField;
|
|
97
|
+
ownerId: _contractspec_lib_schema280.EntityScalarField;
|
|
98
|
+
metadata: _contractspec_lib_schema280.EntityScalarField;
|
|
99
|
+
createdAt: _contractspec_lib_schema280.EntityScalarField;
|
|
100
|
+
updatedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
101
|
+
quotes: _contractspec_lib_schema280.EntityRelationField;
|
|
102
|
+
jobs: _contractspec_lib_schema280.EntityRelationField;
|
|
103
|
+
}> | _contractspec_lib_schema280.EntitySpec<{
|
|
104
|
+
id: _contractspec_lib_schema280.EntityScalarField;
|
|
105
|
+
clientId: _contractspec_lib_schema280.EntityScalarField;
|
|
106
|
+
title: _contractspec_lib_schema280.EntityScalarField;
|
|
107
|
+
description: _contractspec_lib_schema280.EntityScalarField;
|
|
108
|
+
amount: _contractspec_lib_schema280.EntityScalarField;
|
|
109
|
+
currency: _contractspec_lib_schema280.EntityScalarField;
|
|
110
|
+
status: _contractspec_lib_schema280.EntityEnumField;
|
|
111
|
+
validUntil: _contractspec_lib_schema280.EntityScalarField;
|
|
112
|
+
terms: _contractspec_lib_schema280.EntityScalarField;
|
|
113
|
+
orgId: _contractspec_lib_schema280.EntityScalarField;
|
|
114
|
+
ownerId: _contractspec_lib_schema280.EntityScalarField;
|
|
115
|
+
createdAt: _contractspec_lib_schema280.EntityScalarField;
|
|
116
|
+
updatedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
117
|
+
client: _contractspec_lib_schema280.EntityRelationField;
|
|
118
|
+
jobs: _contractspec_lib_schema280.EntityRelationField;
|
|
119
|
+
}> | _contractspec_lib_schema280.EntitySpec<{
|
|
120
|
+
id: _contractspec_lib_schema280.EntityScalarField;
|
|
121
|
+
quoteId: _contractspec_lib_schema280.EntityScalarField;
|
|
122
|
+
clientId: _contractspec_lib_schema280.EntityScalarField;
|
|
123
|
+
title: _contractspec_lib_schema280.EntityScalarField;
|
|
124
|
+
status: _contractspec_lib_schema280.EntityEnumField;
|
|
125
|
+
scheduledAt: _contractspec_lib_schema280.EntityScalarField;
|
|
126
|
+
completedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
127
|
+
assignedTo: _contractspec_lib_schema280.EntityScalarField;
|
|
128
|
+
location: _contractspec_lib_schema280.EntityScalarField;
|
|
129
|
+
notes: _contractspec_lib_schema280.EntityScalarField;
|
|
130
|
+
orgId: _contractspec_lib_schema280.EntityScalarField;
|
|
131
|
+
createdAt: _contractspec_lib_schema280.EntityScalarField;
|
|
132
|
+
updatedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
133
|
+
quote: _contractspec_lib_schema280.EntityRelationField;
|
|
134
|
+
client: _contractspec_lib_schema280.EntityRelationField;
|
|
135
|
+
invoices: _contractspec_lib_schema280.EntityRelationField;
|
|
136
|
+
}> | _contractspec_lib_schema280.EntitySpec<{
|
|
137
|
+
id: _contractspec_lib_schema280.EntityScalarField;
|
|
138
|
+
jobId: _contractspec_lib_schema280.EntityScalarField;
|
|
139
|
+
invoiceNumber: _contractspec_lib_schema280.EntityScalarField;
|
|
140
|
+
amount: _contractspec_lib_schema280.EntityScalarField;
|
|
141
|
+
currency: _contractspec_lib_schema280.EntityScalarField;
|
|
142
|
+
status: _contractspec_lib_schema280.EntityEnumField;
|
|
143
|
+
dueDate: _contractspec_lib_schema280.EntityScalarField;
|
|
144
|
+
issuedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
145
|
+
paidAt: _contractspec_lib_schema280.EntityScalarField;
|
|
146
|
+
orgId: _contractspec_lib_schema280.EntityScalarField;
|
|
147
|
+
notes: _contractspec_lib_schema280.EntityScalarField;
|
|
148
|
+
metadata: _contractspec_lib_schema280.EntityScalarField;
|
|
149
|
+
createdAt: _contractspec_lib_schema280.EntityScalarField;
|
|
150
|
+
updatedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
151
|
+
job: _contractspec_lib_schema280.EntityRelationField;
|
|
152
|
+
payments: _contractspec_lib_schema280.EntityRelationField;
|
|
153
|
+
}> | _contractspec_lib_schema280.EntitySpec<{
|
|
154
|
+
id: _contractspec_lib_schema280.EntityScalarField;
|
|
155
|
+
invoiceId: _contractspec_lib_schema280.EntityScalarField;
|
|
156
|
+
amount: _contractspec_lib_schema280.EntityScalarField;
|
|
157
|
+
currency: _contractspec_lib_schema280.EntityScalarField;
|
|
158
|
+
method: _contractspec_lib_schema280.EntityEnumField;
|
|
159
|
+
reference: _contractspec_lib_schema280.EntityScalarField;
|
|
160
|
+
receivedAt: _contractspec_lib_schema280.EntityScalarField;
|
|
161
|
+
orgId: _contractspec_lib_schema280.EntityScalarField;
|
|
162
|
+
createdAt: _contractspec_lib_schema280.EntityScalarField;
|
|
163
|
+
invoice: _contractspec_lib_schema280.EntityRelationField;
|
|
164
164
|
}>)[];
|
|
165
165
|
declare const serviceBusinessSchemaContribution: ModuleSchemaContribution;
|
|
166
166
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["serviceBusinessSchemaContribution: ModuleSchemaContribution"],"sources":["../../src/entities/index.ts"],"sourcesContent":["import {\n defineEntity,\n defineEntityEnum,\n field,\n index,\n} from '@contractspec/lib.schema';\nimport type { ModuleSchemaContribution } from '@contractspec/lib.schema';\n\nconst schema = 'lssm_service_os';\n\nexport const QuoteStatusEnum = defineEntityEnum({\n name: 'QuoteStatus',\n schema,\n values: ['DRAFT', 'SENT', 'ACCEPTED', 'REJECTED', 'EXPIRED'] as const,\n description: 'Lifecycle for quotes/proposals.',\n});\n\nexport const JobStatusEnum = defineEntityEnum({\n name: 'JobStatus',\n schema,\n values: ['SCHEDULED', 'IN_PROGRESS', 'COMPLETED', 'CANCELLED'] as const,\n description: 'Lifecycle for service jobs/interventions.',\n});\n\nexport const InvoiceStatusEnum = defineEntityEnum({\n name: 'InvoiceStatus',\n schema,\n values: ['DRAFT', 'SENT', 'PAID', 'OVERDUE', 'CANCELLED'] as const,\n description: 'Lifecycle for invoices.',\n});\n\nexport const PaymentMethodEnum = defineEntityEnum({\n name: 'PaymentMethod',\n schema,\n values: ['CARD', 'BANK_TRANSFER', 'CASH', 'CHECK'] as const,\n description: 'Payment method used.',\n});\n\nexport const ClientEntity = defineEntity({\n name: 'Client',\n description: 'Customer organization or individual.',\n schema,\n map: 'client',\n fields: {\n id: field.id({ description: 'Unique client identifier' }),\n name: field.string({ description: 'Client display name' }),\n contactEmail: field.string({\n description: 'Primary contact email',\n isOptional: true,\n }),\n phone: field.string({ description: 'Primary phone', isOptional: true }),\n address: field.json({ description: 'Mailing address', isOptional: true }),\n industry: field.string({\n description: 'Industry/vertical',\n isOptional: true,\n }),\n orgId: field.string({ description: 'Owning organization' }),\n ownerId: field.string({ description: 'Account owner' }),\n metadata: field.json({\n description: 'Additional metadata',\n isOptional: true,\n }),\n createdAt: field.createdAt(),\n updatedAt: field.updatedAt(),\n quotes: field.hasMany('Quote'),\n jobs: field.hasMany('Job'),\n },\n indexes: [index.on(['orgId']), index.on(['ownerId']), index.on(['name'])],\n});\n\nexport const QuoteEntity = defineEntity({\n name: 'Quote',\n description: 'Proposal/quote for a job.',\n schema,\n map: 'quote',\n fields: {\n id: field.id({ description: 'Unique quote identifier' }),\n clientId: field.foreignKey({ description: 'Client receiving quote' }),\n title: field.string({ description: 'Quote title' }),\n description: field.string({\n description: 'Work summary',\n isOptional: true,\n }),\n amount: field.float({ description: 'Total quoted amount' }),\n currency: field.string({ description: 'Currency code', default: '\"USD\"' }),\n status: field.enum('QuoteStatus', {\n description: 'Quote status',\n default: 'DRAFT',\n }),\n validUntil: field.dateTime({\n description: 'Expiration date',\n isOptional: true,\n }),\n terms: field.string({\n description: 'Payment/engagement terms',\n isOptional: true,\n }),\n orgId: field.string({ description: 'Owning organization' }),\n ownerId: field.string({ description: 'Account owner' }),\n createdAt: field.createdAt(),\n updatedAt: field.updatedAt(),\n client: field.belongsTo('Client', ['clientId'], ['id'], {\n onDelete: 'Cascade',\n }),\n jobs: field.hasMany('Job'),\n },\n enums: [QuoteStatusEnum],\n indexes: [\n index.on(['orgId', 'status']),\n index.on(['clientId']),\n index.on(['validUntil']),\n ],\n});\n\nexport const JobEntity = defineEntity({\n name: 'Job',\n description: 'Service job/intervention derived from an accepted quote.',\n schema,\n map: 'job',\n fields: {\n id: field.id({ description: 'Unique job identifier' }),\n quoteId: field.foreignKey({ description: 'Source quote' }),\n clientId: field.foreignKey({ description: 'Client receiving service' }),\n title: field.string({ description: 'Job title' }),\n status: field.enum('JobStatus', {\n description: 'Job status',\n default: 'SCHEDULED',\n }),\n scheduledAt: field.dateTime({\n description: 'Scheduled start date/time',\n isOptional: true,\n }),\n completedAt: field.dateTime({\n description: 'Completion timestamp',\n isOptional: true,\n }),\n assignedTo: field.string({\n description: 'Assignee/technician user ID',\n isOptional: true,\n }),\n location: field.json({ description: 'Location details', isOptional: true }),\n notes: field.string({ description: 'Internal notes', isOptional: true }),\n orgId: field.string({ description: 'Owning organization' }),\n createdAt: field.createdAt(),\n updatedAt: field.updatedAt(),\n quote: field.belongsTo('Quote', ['quoteId'], ['id'], {\n onDelete: 'SetNull',\n }),\n client: field.belongsTo('Client', ['clientId'], ['id'], {\n onDelete: 'Cascade',\n }),\n invoices: field.hasMany('Invoice'),\n },\n enums: [JobStatusEnum],\n indexes: [\n index.on(['orgId', 'status']),\n index.on(['clientId']),\n index.on(['assignedTo', 'status']),\n index.on(['scheduledAt']),\n ],\n});\n\nexport const InvoiceEntity = defineEntity({\n name: 'Invoice',\n description: 'Invoice issued for a completed job.',\n schema,\n map: 'invoice',\n fields: {\n id: field.id({ description: 'Unique invoice identifier' }),\n jobId: field.foreignKey({ description: 'Related job' }),\n invoiceNumber: field.string({\n description: 'Invoice number',\n isUnique: true,\n }),\n amount: field.decimal({ description: 'Invoice amount' }),\n currency: field.string({ description: 'Currency code', default: '\"USD\"' }),\n status: field.enum('InvoiceStatus', {\n description: 'Invoice status',\n default: 'DRAFT',\n }),\n dueDate: field.dateTime({ description: 'Due date', isOptional: true }),\n issuedAt: field.dateTime({\n description: 'Issued timestamp',\n isOptional: true,\n }),\n paidAt: field.dateTime({ description: 'Paid timestamp', isOptional: true }),\n orgId: field.string({ description: 'Owning organization' }),\n notes: field.string({ description: 'Invoice notes', isOptional: true }),\n metadata: field.json({ description: 'Metadata', isOptional: true }),\n createdAt: field.createdAt(),\n updatedAt: field.updatedAt(),\n job: field.belongsTo('Job', ['jobId'], ['id'], { onDelete: 'Cascade' }),\n payments: field.hasMany('Payment'),\n },\n enums: [InvoiceStatusEnum],\n indexes: [\n index.on(['invoiceNumber']),\n index.on(['orgId', 'status']),\n index.on(['dueDate']),\n ],\n});\n\nexport const PaymentEntity = defineEntity({\n name: 'Payment',\n description: 'Payment received for an invoice.',\n schema,\n map: 'payment',\n fields: {\n id: field.id({ description: 'Unique payment identifier' }),\n invoiceId: field.foreignKey({ description: 'Invoice being paid' }),\n amount: field.decimal({ description: 'Payment amount' }),\n currency: field.string({ description: 'Currency code', default: '\"USD\"' }),\n method: field.enum('PaymentMethod', { description: 'Payment method' }),\n reference: field.string({\n description: 'Payment reference/transaction ID',\n isOptional: true,\n }),\n receivedAt: field.dateTime({ description: 'When payment was received' }),\n orgId: field.string({ description: 'Owning organization' }),\n createdAt: field.createdAt(),\n invoice: field.belongsTo('Invoice', ['invoiceId'], ['id'], {\n onDelete: 'Cascade',\n }),\n },\n enums: [PaymentMethodEnum],\n indexes: [\n index.on(['invoiceId']),\n index.on(['orgId']),\n index.on(['receivedAt']),\n ],\n});\n\nexport const serviceBusinessEntities = [\n ClientEntity,\n QuoteEntity,\n JobEntity,\n InvoiceEntity,\n PaymentEntity,\n];\n\nexport const serviceBusinessSchemaContribution: ModuleSchemaContribution = {\n moduleId: '@contractspec/example.service-business-os',\n // schema,\n entities: serviceBusinessEntities,\n enums: [QuoteStatusEnum, JobStatusEnum, InvoiceStatusEnum, PaymentMethodEnum],\n};\n"],"mappings":";;;AAQA,M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KAAK,iBAAiB,EAAE,aAAa,kBAAkB,CAAC;EACtE,WAAW,MAAM,OAAO;GACtB,aAAa;GACb,YAAY;GACb,CAAC;EACF,YAAY,MAAM,SAAS,EAAE,aAAa,6BAA6B,CAAC;EACxE,OAAO,MAAM,OAAO,EAAE,aAAa,uBAAuB,CAAC;EAC3D,WAAW,MAAM,WAAW;EAC5B,SAAS,MAAM,UAAU,WAAW,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,EACzD,UAAU,WACX,CAAC;EACH;CACD,OAAO,CAAC,kBAAkB;CAC1B,SAAS;EACP,MAAM,GAAG,CAAC,YAAY,CAAC;EACvB,MAAM,GAAG,CAAC,QAAQ,CAAC;EACnB,MAAM,GAAG,CAAC,aAAa,CAAC;EACzB;CACF,CAAC;AAEF,MAAa,0BAA0B;CACrC;CACA;CACA;CACA;CACA;CACD;AAED,MAAaA,oCAA8D;CACzE,UAAU;CAEV,UAAU;CACV,OAAO;EAAC;EAAiB;EAAe;EAAmB;EAAkB;CAC9E"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/entities/index.ts"],"sourcesContent":["import {\n defineEntity,\n defineEntityEnum,\n field,\n index,\n} from '@contractspec/lib.schema';\nimport type { ModuleSchemaContribution } from '@contractspec/lib.schema';\n\nconst schema = 'lssm_service_os';\n\nexport const QuoteStatusEnum = defineEntityEnum({\n name: 'QuoteStatus',\n schema,\n values: ['DRAFT', 'SENT', 'ACCEPTED', 'REJECTED', 'EXPIRED'] as const,\n description: 'Lifecycle for quotes/proposals.',\n});\n\nexport const JobStatusEnum = defineEntityEnum({\n name: 'JobStatus',\n schema,\n values: ['SCHEDULED', 'IN_PROGRESS', 'COMPLETED', 'CANCELLED'] as const,\n description: 'Lifecycle for service jobs/interventions.',\n});\n\nexport const InvoiceStatusEnum = defineEntityEnum({\n name: 'InvoiceStatus',\n schema,\n values: ['DRAFT', 'SENT', 'PAID', 'OVERDUE', 'CANCELLED'] as const,\n description: 'Lifecycle for invoices.',\n});\n\nexport const PaymentMethodEnum = defineEntityEnum({\n name: 'PaymentMethod',\n schema,\n values: ['CARD', 'BANK_TRANSFER', 'CASH', 'CHECK'] as const,\n description: 'Payment method used.',\n});\n\nexport const ClientEntity = defineEntity({\n name: 'Client',\n description: 'Customer organization or individual.',\n schema,\n map: 'client',\n fields: {\n id: field.id({ description: 'Unique client identifier' }),\n name: field.string({ description: 'Client display name' }),\n contactEmail: field.string({\n description: 'Primary contact email',\n isOptional: true,\n }),\n phone: field.string({ description: 'Primary phone', isOptional: true }),\n address: field.json({ description: 'Mailing address', isOptional: true }),\n industry: field.string({\n description: 'Industry/vertical',\n isOptional: true,\n }),\n orgId: field.string({ description: 'Owning organization' }),\n ownerId: field.string({ description: 'Account owner' }),\n metadata: field.json({\n description: 'Additional metadata',\n isOptional: true,\n }),\n createdAt: field.createdAt(),\n updatedAt: field.updatedAt(),\n quotes: field.hasMany('Quote'),\n jobs: field.hasMany('Job'),\n },\n indexes: [index.on(['orgId']), index.on(['ownerId']), index.on(['name'])],\n});\n\nexport const QuoteEntity = defineEntity({\n name: 'Quote',\n description: 'Proposal/quote for a job.',\n schema,\n map: 'quote',\n fields: {\n id: field.id({ description: 'Unique quote identifier' }),\n clientId: field.foreignKey({ description: 'Client receiving quote' }),\n title: field.string({ description: 'Quote title' }),\n description: field.string({\n description: 'Work summary',\n isOptional: true,\n }),\n amount: field.float({ description: 'Total quoted amount' }),\n currency: field.string({ description: 'Currency code', default: '\"USD\"' }),\n status: field.enum('QuoteStatus', {\n description: 'Quote status',\n default: 'DRAFT',\n }),\n validUntil: field.dateTime({\n description: 'Expiration date',\n isOptional: true,\n }),\n terms: field.string({\n description: 'Payment/engagement terms',\n isOptional: true,\n }),\n orgId: field.string({ description: 'Owning organization' }),\n ownerId: field.string({ description: 'Account owner' }),\n createdAt: field.createdAt(),\n updatedAt: field.updatedAt(),\n client: field.belongsTo('Client', ['clientId'], ['id'], {\n onDelete: 'Cascade',\n }),\n jobs: field.hasMany('Job'),\n },\n enums: [QuoteStatusEnum],\n indexes: [\n index.on(['orgId', 'status']),\n index.on(['clientId']),\n index.on(['validUntil']),\n ],\n});\n\nexport const JobEntity = defineEntity({\n name: 'Job',\n description: 'Service job/intervention derived from an accepted quote.',\n schema,\n map: 'job',\n fields: {\n id: field.id({ description: 'Unique job identifier' }),\n quoteId: field.foreignKey({ description: 'Source quote' }),\n clientId: field.foreignKey({ description: 'Client receiving service' }),\n title: field.string({ description: 'Job title' }),\n status: field.enum('JobStatus', {\n description: 'Job status',\n default: 'SCHEDULED',\n }),\n scheduledAt: field.dateTime({\n description: 'Scheduled start date/time',\n isOptional: true,\n }),\n completedAt: field.dateTime({\n description: 'Completion timestamp',\n isOptional: true,\n }),\n assignedTo: field.string({\n description: 'Assignee/technician user ID',\n isOptional: true,\n }),\n location: field.json({ description: 'Location details', isOptional: true }),\n notes: field.string({ description: 'Internal notes', isOptional: true }),\n orgId: field.string({ description: 'Owning organization' }),\n createdAt: field.createdAt(),\n updatedAt: field.updatedAt(),\n quote: field.belongsTo('Quote', ['quoteId'], ['id'], {\n onDelete: 'SetNull',\n }),\n client: field.belongsTo('Client', ['clientId'], ['id'], {\n onDelete: 'Cascade',\n }),\n invoices: field.hasMany('Invoice'),\n },\n enums: [JobStatusEnum],\n indexes: [\n index.on(['orgId', 'status']),\n index.on(['clientId']),\n index.on(['assignedTo', 'status']),\n index.on(['scheduledAt']),\n ],\n});\n\nexport const InvoiceEntity = defineEntity({\n name: 'Invoice',\n description: 'Invoice issued for a completed job.',\n schema,\n map: 'invoice',\n fields: {\n id: field.id({ description: 'Unique invoice identifier' }),\n jobId: field.foreignKey({ description: 'Related job' }),\n invoiceNumber: field.string({\n description: 'Invoice number',\n isUnique: true,\n }),\n amount: field.decimal({ description: 'Invoice amount' }),\n currency: field.string({ description: 'Currency code', default: '\"USD\"' }),\n status: field.enum('InvoiceStatus', {\n description: 'Invoice status',\n default: 'DRAFT',\n }),\n dueDate: field.dateTime({ description: 'Due date', isOptional: true }),\n issuedAt: field.dateTime({\n description: 'Issued timestamp',\n isOptional: true,\n }),\n paidAt: field.dateTime({ description: 'Paid timestamp', isOptional: true }),\n orgId: field.string({ description: 'Owning organization' }),\n notes: field.string({ description: 'Invoice notes', isOptional: true }),\n metadata: field.json({ description: 'Metadata', isOptional: true }),\n createdAt: field.createdAt(),\n updatedAt: field.updatedAt(),\n job: field.belongsTo('Job', ['jobId'], ['id'], { onDelete: 'Cascade' }),\n payments: field.hasMany('Payment'),\n },\n enums: [InvoiceStatusEnum],\n indexes: [\n index.on(['invoiceNumber']),\n index.on(['orgId', 'status']),\n index.on(['dueDate']),\n ],\n});\n\nexport const PaymentEntity = defineEntity({\n name: 'Payment',\n description: 'Payment received for an invoice.',\n schema,\n map: 'payment',\n fields: {\n id: field.id({ description: 'Unique payment identifier' }),\n invoiceId: field.foreignKey({ description: 'Invoice being paid' }),\n amount: field.decimal({ description: 'Payment amount' }),\n currency: field.string({ description: 'Currency code', default: '\"USD\"' }),\n method: field.enum('PaymentMethod', { description: 'Payment method' }),\n reference: field.string({\n description: 'Payment reference/transaction ID',\n isOptional: true,\n }),\n receivedAt: field.dateTime({ description: 'When payment was received' }),\n orgId: field.string({ description: 'Owning organization' }),\n createdAt: field.createdAt(),\n invoice: field.belongsTo('Invoice', ['invoiceId'], ['id'], {\n onDelete: 'Cascade',\n }),\n },\n enums: [PaymentMethodEnum],\n indexes: [\n index.on(['invoiceId']),\n index.on(['orgId']),\n index.on(['receivedAt']),\n ],\n});\n\nexport const serviceBusinessEntities = [\n ClientEntity,\n QuoteEntity,\n JobEntity,\n InvoiceEntity,\n PaymentEntity,\n];\n\nexport const serviceBusinessSchemaContribution: ModuleSchemaContribution = {\n moduleId: '@contractspec/example.service-business-os',\n // schema,\n entities: serviceBusinessEntities,\n enums: [QuoteStatusEnum, JobStatusEnum, InvoiceStatusEnum, PaymentMethodEnum],\n};\n"],"mappings":";;;AAQA,MAAM,SAAS;AAEf,MAAa,kBAAkB,iBAAiB;C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