@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,53 +1,73 @@
|
|
|
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
|
-
policy: { auth: "user" },
|
|
29
|
-
acceptance: {
|
|
30
|
-
scenarios: [{
|
|
31
|
-
key: "create-client-happy-path",
|
|
32
|
-
given: ["User is authenticated"],
|
|
33
|
-
when: ["User creates a new client"],
|
|
34
|
-
then: ["Client is created"]
|
|
35
|
-
}],
|
|
36
|
-
examples: [{
|
|
37
|
-
key: "create-basic",
|
|
38
|
-
input: {
|
|
39
|
-
name: "Acme Corp",
|
|
40
|
-
email: "contact@acme.com",
|
|
41
|
-
phone: "555-0123"
|
|
42
|
-
},
|
|
43
|
-
output: {
|
|
44
|
-
id: "client-123",
|
|
45
|
-
name: "Acme Corp"
|
|
46
|
-
}
|
|
47
|
-
}]
|
|
48
|
-
}
|
|
1
|
+
// @bun
|
|
2
|
+
// src/client/client.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var ClientModel = defineSchemaModel({
|
|
5
|
+
name: "Client",
|
|
6
|
+
description: "Client profile",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
contactEmail: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
11
|
+
phone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
12
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
14
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
var CreateClientInputModel = defineSchemaModel({
|
|
18
|
+
name: "CreateClientInput",
|
|
19
|
+
description: "Input for creating a client",
|
|
20
|
+
fields: {
|
|
21
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
contactEmail: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
23
|
+
phone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
25
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
26
|
+
metadata: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
27
|
+
}
|
|
49
28
|
});
|
|
50
29
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
30
|
+
// src/client/client.operations.ts
|
|
31
|
+
import { defineCommand } from "@contractspec/lib.contracts";
|
|
32
|
+
var OWNERS = ["@examples.service-business-os"];
|
|
33
|
+
var CreateClientContract = defineCommand({
|
|
34
|
+
meta: {
|
|
35
|
+
key: "service.client.create",
|
|
36
|
+
version: "1.0.0",
|
|
37
|
+
stability: "stable",
|
|
38
|
+
owners: [...OWNERS],
|
|
39
|
+
tags: ["service-business-os", "client", "create"],
|
|
40
|
+
description: "Create a new client.",
|
|
41
|
+
goal: "Onboard clients.",
|
|
42
|
+
context: "CRM."
|
|
43
|
+
},
|
|
44
|
+
io: {
|
|
45
|
+
input: CreateClientInputModel,
|
|
46
|
+
output: ClientModel
|
|
47
|
+
},
|
|
48
|
+
policy: { auth: "user" },
|
|
49
|
+
acceptance: {
|
|
50
|
+
scenarios: [
|
|
51
|
+
{
|
|
52
|
+
key: "create-client-happy-path",
|
|
53
|
+
given: ["User is authenticated"],
|
|
54
|
+
when: ["User creates a new client"],
|
|
55
|
+
then: ["Client is created"]
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
examples: [
|
|
59
|
+
{
|
|
60
|
+
key: "create-basic",
|
|
61
|
+
input: {
|
|
62
|
+
name: "Acme Corp",
|
|
63
|
+
email: "contact@acme.com",
|
|
64
|
+
phone: "555-0123"
|
|
65
|
+
},
|
|
66
|
+
output: { id: "client-123", name: "Acme Corp" }
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
CreateClientContract
|
|
73
|
+
};
|
|
@@ -1,68 +1,63 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema279 from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
//#region src/client/client.schema.d.ts
|
|
4
1
|
/**
|
|
5
2
|
* Client profile.
|
|
6
3
|
*/
|
|
7
|
-
declare const ClientModel:
|
|
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
|
-
|
|
4
|
+
export declare const ClientModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
5
|
+
id: {
|
|
6
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
name: {
|
|
10
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
contactEmail: {
|
|
14
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
15
|
+
isOptional: true;
|
|
16
|
+
};
|
|
17
|
+
phone: {
|
|
18
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
19
|
+
isOptional: true;
|
|
20
|
+
};
|
|
21
|
+
orgId: {
|
|
22
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
23
|
+
isOptional: false;
|
|
24
|
+
};
|
|
25
|
+
ownerId: {
|
|
26
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
27
|
+
isOptional: false;
|
|
28
|
+
};
|
|
29
|
+
createdAt: {
|
|
30
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
31
|
+
isOptional: false;
|
|
32
|
+
};
|
|
36
33
|
}>;
|
|
37
34
|
/**
|
|
38
35
|
* Input for creating a client.
|
|
39
36
|
*/
|
|
40
|
-
declare const CreateClientInputModel:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
37
|
+
export declare const CreateClientInputModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
38
|
+
name: {
|
|
39
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
41
|
+
};
|
|
42
|
+
contactEmail: {
|
|
43
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
44
|
+
isOptional: true;
|
|
45
|
+
};
|
|
46
|
+
phone: {
|
|
47
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
48
|
+
isOptional: true;
|
|
49
|
+
};
|
|
50
|
+
orgId: {
|
|
51
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
52
|
+
isOptional: false;
|
|
53
|
+
};
|
|
54
|
+
ownerId: {
|
|
55
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
56
|
+
isOptional: false;
|
|
57
|
+
};
|
|
58
|
+
metadata: {
|
|
59
|
+
type: import("@contractspec/lib.schema").FieldType<unknown, unknown>;
|
|
60
|
+
isOptional: true;
|
|
61
|
+
};
|
|
65
62
|
}>;
|
|
66
|
-
//#endregion
|
|
67
|
-
export { ClientModel, CreateClientInputModel };
|
|
68
63
|
//# sourceMappingURL=client.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.schema.d.ts","
|
|
1
|
+
{"version":3,"file":"client.schema.d.ts","sourceRoot":"","sources":["../../src/client/client.schema.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;EAWjC,CAAC"}
|
|
@@ -1,77 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
17
|
-
isOptional: false
|
|
18
|
-
},
|
|
19
|
-
contactEmail: {
|
|
20
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
21
|
-
isOptional: true
|
|
22
|
-
},
|
|
23
|
-
phone: {
|
|
24
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
25
|
-
isOptional: true
|
|
26
|
-
},
|
|
27
|
-
orgId: {
|
|
28
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
29
|
-
isOptional: false
|
|
30
|
-
},
|
|
31
|
-
ownerId: {
|
|
32
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
33
|
-
isOptional: false
|
|
34
|
-
},
|
|
35
|
-
createdAt: {
|
|
36
|
-
type: ScalarTypeEnum.DateTime(),
|
|
37
|
-
isOptional: false
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
// @bun
|
|
2
|
+
// src/client/client.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var ClientModel = defineSchemaModel({
|
|
5
|
+
name: "Client",
|
|
6
|
+
description: "Client profile",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
contactEmail: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
11
|
+
phone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
12
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
14
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
15
|
+
}
|
|
40
16
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
contactEmail: {
|
|
53
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
54
|
-
isOptional: true
|
|
55
|
-
},
|
|
56
|
-
phone: {
|
|
57
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
58
|
-
isOptional: true
|
|
59
|
-
},
|
|
60
|
-
orgId: {
|
|
61
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
62
|
-
isOptional: false
|
|
63
|
-
},
|
|
64
|
-
ownerId: {
|
|
65
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
66
|
-
isOptional: false
|
|
67
|
-
},
|
|
68
|
-
metadata: {
|
|
69
|
-
type: ScalarTypeEnum.JSON(),
|
|
70
|
-
isOptional: true
|
|
71
|
-
}
|
|
72
|
-
}
|
|
17
|
+
var CreateClientInputModel = defineSchemaModel({
|
|
18
|
+
name: "CreateClientInput",
|
|
19
|
+
description: "Input for creating a client",
|
|
20
|
+
fields: {
|
|
21
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
contactEmail: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
23
|
+
phone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
25
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
26
|
+
metadata: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
27
|
+
}
|
|
73
28
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
29
|
+
export {
|
|
30
|
+
CreateClientInputModel,
|
|
31
|
+
ClientModel
|
|
32
|
+
};
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Client domain - Client management.
|
|
3
|
+
*/
|
|
4
|
+
export { ClientModel, CreateClientInputModel } from './client.schema';
|
|
5
|
+
export { CreateClientContract } from './client.operations';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/client/index.js
CHANGED
|
@@ -1,4 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/client/client.schema.ts
|
|
3
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var ClientModel = defineSchemaModel({
|
|
5
|
+
name: "Client",
|
|
6
|
+
description: "Client profile",
|
|
7
|
+
fields: {
|
|
8
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
contactEmail: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
11
|
+
phone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
12
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
14
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
var CreateClientInputModel = defineSchemaModel({
|
|
18
|
+
name: "CreateClientInput",
|
|
19
|
+
description: "Input for creating a client",
|
|
20
|
+
fields: {
|
|
21
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
contactEmail: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
23
|
+
phone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
25
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
26
|
+
metadata: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
27
|
+
}
|
|
28
|
+
});
|
|
3
29
|
|
|
4
|
-
|
|
30
|
+
// src/client/client.operations.ts
|
|
31
|
+
import { defineCommand } from "@contractspec/lib.contracts";
|
|
32
|
+
var OWNERS = ["@examples.service-business-os"];
|
|
33
|
+
var CreateClientContract = defineCommand({
|
|
34
|
+
meta: {
|
|
35
|
+
key: "service.client.create",
|
|
36
|
+
version: "1.0.0",
|
|
37
|
+
stability: "stable",
|
|
38
|
+
owners: [...OWNERS],
|
|
39
|
+
tags: ["service-business-os", "client", "create"],
|
|
40
|
+
description: "Create a new client.",
|
|
41
|
+
goal: "Onboard clients.",
|
|
42
|
+
context: "CRM."
|
|
43
|
+
},
|
|
44
|
+
io: {
|
|
45
|
+
input: CreateClientInputModel,
|
|
46
|
+
output: ClientModel
|
|
47
|
+
},
|
|
48
|
+
policy: { auth: "user" },
|
|
49
|
+
acceptance: {
|
|
50
|
+
scenarios: [
|
|
51
|
+
{
|
|
52
|
+
key: "create-client-happy-path",
|
|
53
|
+
given: ["User is authenticated"],
|
|
54
|
+
when: ["User creates a new client"],
|
|
55
|
+
then: ["Client is created"]
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
examples: [
|
|
59
|
+
{
|
|
60
|
+
key: "create-basic",
|
|
61
|
+
input: {
|
|
62
|
+
name: "Acme Corp",
|
|
63
|
+
email: "contact@acme.com",
|
|
64
|
+
phone: "555-0123"
|
|
65
|
+
},
|
|
66
|
+
output: { id: "client-123", name: "Acme Corp" }
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
CreateClientInputModel,
|
|
73
|
+
CreateClientContract,
|
|
74
|
+
ClientModel
|
|
75
|
+
};
|
package/dist/docs/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import './service-business-os.docblock';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC"}
|
package/dist/docs/index.js
CHANGED
|
@@ -1 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/docs/service-business-os.docblock.ts
|
|
3
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
4
|
+
var serviceBusinessDocBlocks = [
|
|
5
|
+
{
|
|
6
|
+
id: "docs.examples.service-business-os",
|
|
7
|
+
title: "Service Business OS",
|
|
8
|
+
summary: "Field/service business flow from client intake to quote, job scheduling, invoicing, and payments with notifications and audit trail.",
|
|
9
|
+
kind: "reference",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/examples/service-business-os",
|
|
12
|
+
tags: ["services", "quotes", "jobs", "invoices", "payments"],
|
|
13
|
+
body: `## Flows
|
|
14
|
+
|
|
15
|
+
1) **Client intake** \u2192 create client, capture contact + owner.
|
|
16
|
+
2) **Quote** \u2192 draft, send, accept/reject (events + notifications).
|
|
17
|
+
3) **Job** \u2192 schedule, assign technician, complete with notes and attachments.
|
|
18
|
+
4) **Invoice** \u2192 issue after completion, track status.
|
|
19
|
+
5) **Payment** \u2192 record payment and emit analytics/audit.
|
|
20
|
+
|
|
21
|
+
## Modules reused
|
|
22
|
+
- Identity/RBAC for org + roles
|
|
23
|
+
- Files for attachments (proposals, receipts)
|
|
24
|
+
- Notifications for quote sent/accepted, job reminders, overdue invoices
|
|
25
|
+
- Jobs for reminder/schedule tasks
|
|
26
|
+
- Audit trail for all lifecycle changes
|
|
27
|
+
|
|
28
|
+
## Presentations
|
|
29
|
+
- Dashboard, client list, quote list/detail, job board, invoice list, payment list (React + Markdown targets).
|
|
30
|
+
`
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "docs.examples.service-business-os.goal",
|
|
34
|
+
title: "Service Business OS \u2014 Goal",
|
|
35
|
+
summary: "Why this field-service OS exists and outcomes it targets.",
|
|
36
|
+
kind: "goal",
|
|
37
|
+
visibility: "public",
|
|
38
|
+
route: "/docs/examples/service-business-os/goal",
|
|
39
|
+
tags: ["services", "goal"],
|
|
40
|
+
body: `## Why it matters
|
|
41
|
+
- Provides a regenerable, end-to-end service lifecycle (client \u2192 quote \u2192 job \u2192 invoice \u2192 payment).
|
|
42
|
+
- Keeps pricing, scheduling, invoicing, and payments consistent across surfaces.
|
|
43
|
+
|
|
44
|
+
## Business/Product goal
|
|
45
|
+
- Deliver auditable quotes/jobs/invoices with notifications and reminders.
|
|
46
|
+
- Support attachments and PII-safe flows; stage new payment rules via feature flags.
|
|
47
|
+
|
|
48
|
+
## Success criteria
|
|
49
|
+
- Spec changes regenerate UI/API/events cleanly across lifecycle steps.
|
|
50
|
+
- Audit/Notifications/Jobs remain wired for every mutation.`
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "docs.examples.service-business-os.usage",
|
|
54
|
+
title: "Service Business OS \u2014 Usage",
|
|
55
|
+
summary: "How to operate, extend, and regenerate the service OS safely.",
|
|
56
|
+
kind: "usage",
|
|
57
|
+
visibility: "public",
|
|
58
|
+
route: "/docs/examples/service-business-os/usage",
|
|
59
|
+
tags: ["services", "usage"],
|
|
60
|
+
body: `## Setup
|
|
61
|
+
1) Seed (if provided) or create client \u2192 quote \u2192 job \u2192 invoice \u2192 payment via UI.
|
|
62
|
+
2) Configure Files for attachments and Notifications for quote/job/invoice events.
|
|
63
|
+
|
|
64
|
+
## Extend & regenerate
|
|
65
|
+
1) Adjust schemas: quote line items, job statuses, invoice terms, payment methods.
|
|
66
|
+
2) Regenerate to sync UI/API/events; mark PII paths in policy.
|
|
67
|
+
3) Use Feature Flags to trial new payment rules or reminder cadences.
|
|
68
|
+
|
|
69
|
+
## Guardrails
|
|
70
|
+
- Emit events for quote accepted/rejected, job scheduled/completed, invoice overdue, payment recorded.
|
|
71
|
+
- Keep pricing/tax rules explicit in spec; avoid implicit handler math.
|
|
72
|
+
- Use Audit Trail for lifecycle mutations; schedule reminders via Jobs.`
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: "docs.examples.service-business-os.constraints",
|
|
76
|
+
title: "Service Business OS \u2014 Constraints & Safety",
|
|
77
|
+
summary: "Internal guardrails for quotes/jobs/invoices/payments and regeneration safety.",
|
|
78
|
+
kind: "reference",
|
|
79
|
+
visibility: "internal",
|
|
80
|
+
route: "/docs/examples/service-business-os/constraints",
|
|
81
|
+
tags: ["services", "constraints", "internal"],
|
|
82
|
+
body: `## Constraints
|
|
83
|
+
- Commission/tax/payment rules must be explicit in spec; no hidden handler math.
|
|
84
|
+
- Events to emit: quote.sent/accepted/rejected, job.scheduled/completed, invoice.issued/overdue, payment.recorded.
|
|
85
|
+
- Regeneration must not alter payment semantics without reviewed spec changes.
|
|
86
|
+
|
|
87
|
+
## PII & Attachments
|
|
88
|
+
- Mark PII paths (client contact, address); redact in markdown/JSON.
|
|
89
|
+
- Files (quotes, receipts) should use presigned URLs with scoped access.
|
|
90
|
+
|
|
91
|
+
## Verification
|
|
92
|
+
- Add fixtures for quote/job/invoice state transitions.
|
|
93
|
+
- Ensure Notifications/Audit/Jobs wiring persists after regeneration.
|
|
94
|
+
- Use Feature Flags to trial new payment rules/reminder cadences; default safe/off.`
|
|
95
|
+
}
|
|
96
|
+
];
|
|
97
|
+
registerDocBlocks(serviceBusinessDocBlocks);
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=service-business-os.docblock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-business-os.docblock.d.ts","sourceRoot":"","sources":["../../src/docs/service-business-os.docblock.ts"],"names":[],"mappings":""}
|