@contractspec/example.service-business-os 3.7.17 → 3.7.18
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 +1 -72
- package/dist/browser/client/client.schema.js +1 -31
- package/dist/browser/client/index.js +1 -74
- package/dist/browser/docs/index.js +5 -49
- package/dist/browser/docs/service-business-os.docblock.js +5 -49
- package/dist/browser/entities/index.js +1 -246
- package/dist/browser/events.js +1 -135
- package/dist/browser/example.js +1 -39
- package/dist/browser/handlers/index.js +1 -5
- package/dist/browser/index.js +1 -766
- package/dist/browser/invoice/index.js +1 -77
- package/dist/browser/invoice/invoice.operations.js +1 -75
- package/dist/browser/invoice/invoice.schema.js +1 -34
- package/dist/browser/job/index.js +1 -175
- package/dist/browser/job/job.operations.js +1 -172
- package/dist/browser/job/job.schema.js +1 -41
- package/dist/browser/operations/index.js +1 -506
- package/dist/browser/payment/index.js +1 -69
- package/dist/browser/payment/payment.operations.js +1 -67
- package/dist/browser/payment/payment.schema.js +1 -30
- package/dist/browser/presentations/index.js +1 -13
- package/dist/browser/presentations.js +1 -175
- package/dist/browser/quote/index.js +1 -122
- package/dist/browser/quote/quote.operations.js +1 -119
- package/dist/browser/quote/quote.schema.js +1 -45
- package/dist/browser/service-business-os.capability.js +1 -31
- package/dist/browser/service.feature.js +1 -85
- package/dist/client/client.operations.js +1 -72
- package/dist/client/client.schema.js +1 -31
- package/dist/client/index.js +1 -74
- package/dist/docs/index.js +5 -49
- package/dist/docs/service-business-os.docblock.js +5 -49
- package/dist/entities/index.js +1 -246
- package/dist/events.js +1 -135
- package/dist/example.js +1 -39
- package/dist/handlers/index.js +1 -5
- package/dist/index.js +1 -766
- package/dist/invoice/index.js +1 -77
- package/dist/invoice/invoice.operations.js +1 -75
- package/dist/invoice/invoice.schema.js +1 -34
- package/dist/job/index.js +1 -175
- package/dist/job/job.operations.js +1 -172
- package/dist/job/job.schema.js +1 -41
- package/dist/node/client/client.operations.js +1 -72
- package/dist/node/client/client.schema.js +1 -31
- package/dist/node/client/index.js +1 -74
- package/dist/node/docs/index.js +5 -49
- package/dist/node/docs/service-business-os.docblock.js +5 -49
- package/dist/node/entities/index.js +1 -246
- package/dist/node/events.js +1 -135
- package/dist/node/example.js +1 -39
- package/dist/node/handlers/index.js +1 -5
- package/dist/node/index.js +1 -766
- package/dist/node/invoice/index.js +1 -77
- package/dist/node/invoice/invoice.operations.js +1 -75
- package/dist/node/invoice/invoice.schema.js +1 -34
- package/dist/node/job/index.js +1 -175
- package/dist/node/job/job.operations.js +1 -172
- package/dist/node/job/job.schema.js +1 -41
- package/dist/node/operations/index.js +1 -506
- package/dist/node/payment/index.js +1 -69
- package/dist/node/payment/payment.operations.js +1 -67
- package/dist/node/payment/payment.schema.js +1 -30
- package/dist/node/presentations/index.js +1 -13
- package/dist/node/presentations.js +1 -175
- package/dist/node/quote/index.js +1 -122
- package/dist/node/quote/quote.operations.js +1 -119
- package/dist/node/quote/quote.schema.js +1 -45
- package/dist/node/service-business-os.capability.js +1 -31
- package/dist/node/service.feature.js +1 -85
- package/dist/operations/index.js +1 -506
- package/dist/payment/index.js +1 -69
- package/dist/payment/payment.operations.js +1 -67
- package/dist/payment/payment.schema.js +1 -30
- package/dist/presentations/index.js +1 -13
- package/dist/presentations.js +1 -175
- package/dist/quote/index.js +1 -122
- package/dist/quote/quote.operations.js +1 -119
- package/dist/quote/quote.schema.js +1 -45
- package/dist/service-business-os.capability.js +1 -31
- package/dist/service.feature.js +1 -85
- package/package.json +5 -5
|
@@ -1,77 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
-
var InvoiceModel = defineSchemaModel({
|
|
4
|
-
name: "Invoice",
|
|
5
|
-
description: "Invoice issued for a job",
|
|
6
|
-
fields: {
|
|
7
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
-
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
-
invoiceNumber: {
|
|
10
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
11
|
-
isOptional: false
|
|
12
|
-
},
|
|
13
|
-
amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
14
|
-
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
15
|
-
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
16
|
-
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
17
|
-
issuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
18
|
-
paidAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
var IssueInvoiceInputModel = defineSchemaModel({
|
|
22
|
-
name: "IssueInvoiceInput",
|
|
23
|
-
description: "Input for issuing an invoice",
|
|
24
|
-
fields: {
|
|
25
|
-
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
26
|
-
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
27
|
-
notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
28
|
-
lineItems: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// src/invoice/invoice.operations.ts
|
|
33
|
-
import { defineCommand } from "@contractspec/lib.contracts-spec";
|
|
34
|
-
var OWNERS = ["@examples.service-business-os"];
|
|
35
|
-
var IssueInvoiceContract = defineCommand({
|
|
36
|
-
meta: {
|
|
37
|
-
key: "service.invoice.issue",
|
|
38
|
-
version: "1.0.0",
|
|
39
|
-
stability: "stable",
|
|
40
|
-
owners: [...OWNERS],
|
|
41
|
-
tags: ["service-business-os", "invoice", "issue"],
|
|
42
|
-
description: "Issue an invoice for a job.",
|
|
43
|
-
goal: "Bill clients.",
|
|
44
|
-
context: "Billing."
|
|
45
|
-
},
|
|
46
|
-
io: {
|
|
47
|
-
input: IssueInvoiceInputModel,
|
|
48
|
-
output: InvoiceModel
|
|
49
|
-
},
|
|
50
|
-
policy: { auth: "user" },
|
|
51
|
-
acceptance: {
|
|
52
|
-
scenarios: [
|
|
53
|
-
{
|
|
54
|
-
key: "issue-invoice-happy-path",
|
|
55
|
-
given: ["Job is complete"],
|
|
56
|
-
when: ["User issues invoice"],
|
|
57
|
-
then: ["Invoice is created and sent"]
|
|
58
|
-
}
|
|
59
|
-
],
|
|
60
|
-
examples: [
|
|
61
|
-
{
|
|
62
|
-
key: "issue-standard",
|
|
63
|
-
input: {
|
|
64
|
-
jobId: "job-123",
|
|
65
|
-
dueDate: "2025-02-01",
|
|
66
|
-
items: [{ description: "Service", amount: 100 }]
|
|
67
|
-
},
|
|
68
|
-
output: { id: "inv-456", status: "issued", total: 100 }
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
export {
|
|
74
|
-
IssueInvoiceInputModel,
|
|
75
|
-
IssueInvoiceContract,
|
|
76
|
-
InvoiceModel
|
|
77
|
-
};
|
|
1
|
+
import{defineSchemaModel as g,ScalarTypeEnum as I}from"@contractspec/lib.schema";var x=g({name:"Invoice",description:"Invoice issued for a job",fields:{id:{type:I.String_unsecure(),isOptional:!1},jobId:{type:I.String_unsecure(),isOptional:!1},invoiceNumber:{type:I.String_unsecure(),isOptional:!1},amount:{type:I.Float_unsecure(),isOptional:!1},currency:{type:I.String_unsecure(),isOptional:!1},status:{type:I.String_unsecure(),isOptional:!1},dueDate:{type:I.DateTime(),isOptional:!0},issuedAt:{type:I.DateTime(),isOptional:!0},paidAt:{type:I.DateTime(),isOptional:!0}}}),v=g({name:"IssueInvoiceInput",description:"Input for issuing an invoice",fields:{jobId:{type:I.String_unsecure(),isOptional:!1},dueDate:{type:I.DateTime(),isOptional:!0},notes:{type:I.String_unsecure(),isOptional:!0},lineItems:{type:I.JSON(),isOptional:!0}}});import{defineCommand as j}from"@contractspec/lib.contracts-spec";var k=["@examples.service-business-os"],o=j({meta:{key:"service.invoice.issue",version:"1.0.0",stability:"stable",owners:[...k],tags:["service-business-os","invoice","issue"],description:"Issue an invoice for a job.",goal:"Bill clients.",context:"Billing."},io:{input:v,output:x},policy:{auth:"user"},acceptance:{scenarios:[{key:"issue-invoice-happy-path",given:["Job is complete"],when:["User issues invoice"],then:["Invoice is created and sent"]}],examples:[{key:"issue-standard",input:{jobId:"job-123",dueDate:"2025-02-01",items:[{description:"Service",amount:100}]},output:{id:"inv-456",status:"issued",total:100}}]}});export{v as IssueInvoiceInputModel,o as IssueInvoiceContract,x as InvoiceModel};
|
|
@@ -1,75 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
-
var InvoiceModel = defineSchemaModel({
|
|
4
|
-
name: "Invoice",
|
|
5
|
-
description: "Invoice issued for a job",
|
|
6
|
-
fields: {
|
|
7
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
-
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
-
invoiceNumber: {
|
|
10
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
11
|
-
isOptional: false
|
|
12
|
-
},
|
|
13
|
-
amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
14
|
-
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
15
|
-
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
16
|
-
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
17
|
-
issuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
18
|
-
paidAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
var IssueInvoiceInputModel = defineSchemaModel({
|
|
22
|
-
name: "IssueInvoiceInput",
|
|
23
|
-
description: "Input for issuing an invoice",
|
|
24
|
-
fields: {
|
|
25
|
-
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
26
|
-
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
27
|
-
notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
28
|
-
lineItems: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// src/invoice/invoice.operations.ts
|
|
33
|
-
import { defineCommand } from "@contractspec/lib.contracts-spec";
|
|
34
|
-
var OWNERS = ["@examples.service-business-os"];
|
|
35
|
-
var IssueInvoiceContract = defineCommand({
|
|
36
|
-
meta: {
|
|
37
|
-
key: "service.invoice.issue",
|
|
38
|
-
version: "1.0.0",
|
|
39
|
-
stability: "stable",
|
|
40
|
-
owners: [...OWNERS],
|
|
41
|
-
tags: ["service-business-os", "invoice", "issue"],
|
|
42
|
-
description: "Issue an invoice for a job.",
|
|
43
|
-
goal: "Bill clients.",
|
|
44
|
-
context: "Billing."
|
|
45
|
-
},
|
|
46
|
-
io: {
|
|
47
|
-
input: IssueInvoiceInputModel,
|
|
48
|
-
output: InvoiceModel
|
|
49
|
-
},
|
|
50
|
-
policy: { auth: "user" },
|
|
51
|
-
acceptance: {
|
|
52
|
-
scenarios: [
|
|
53
|
-
{
|
|
54
|
-
key: "issue-invoice-happy-path",
|
|
55
|
-
given: ["Job is complete"],
|
|
56
|
-
when: ["User issues invoice"],
|
|
57
|
-
then: ["Invoice is created and sent"]
|
|
58
|
-
}
|
|
59
|
-
],
|
|
60
|
-
examples: [
|
|
61
|
-
{
|
|
62
|
-
key: "issue-standard",
|
|
63
|
-
input: {
|
|
64
|
-
jobId: "job-123",
|
|
65
|
-
dueDate: "2025-02-01",
|
|
66
|
-
items: [{ description: "Service", amount: 100 }]
|
|
67
|
-
},
|
|
68
|
-
output: { id: "inv-456", status: "issued", total: 100 }
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
export {
|
|
74
|
-
IssueInvoiceContract
|
|
75
|
-
};
|
|
1
|
+
import{defineSchemaModel as k,ScalarTypeEnum as j}from"@contractspec/lib.schema";var q=k({name:"Invoice",description:"Invoice issued for a job",fields:{id:{type:j.String_unsecure(),isOptional:!1},jobId:{type:j.String_unsecure(),isOptional:!1},invoiceNumber:{type:j.String_unsecure(),isOptional:!1},amount:{type:j.Float_unsecure(),isOptional:!1},currency:{type:j.String_unsecure(),isOptional:!1},status:{type:j.String_unsecure(),isOptional:!1},dueDate:{type:j.DateTime(),isOptional:!0},issuedAt:{type:j.DateTime(),isOptional:!0},paidAt:{type:j.DateTime(),isOptional:!0}}}),w=k({name:"IssueInvoiceInput",description:"Input for issuing an invoice",fields:{jobId:{type:j.String_unsecure(),isOptional:!1},dueDate:{type:j.DateTime(),isOptional:!0},notes:{type:j.String_unsecure(),isOptional:!0},lineItems:{type:j.JSON(),isOptional:!0}}});import{defineCommand as x}from"@contractspec/lib.contracts-spec";var z=["@examples.service-business-os"],G=x({meta:{key:"service.invoice.issue",version:"1.0.0",stability:"stable",owners:[...z],tags:["service-business-os","invoice","issue"],description:"Issue an invoice for a job.",goal:"Bill clients.",context:"Billing."},io:{input:w,output:q},policy:{auth:"user"},acceptance:{scenarios:[{key:"issue-invoice-happy-path",given:["Job is complete"],when:["User issues invoice"],then:["Invoice is created and sent"]}],examples:[{key:"issue-standard",input:{jobId:"job-123",dueDate:"2025-02-01",items:[{description:"Service",amount:100}]},output:{id:"inv-456",status:"issued",total:100}}]}});export{G as IssueInvoiceContract};
|
|
@@ -1,34 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
-
var InvoiceModel = defineSchemaModel({
|
|
4
|
-
name: "Invoice",
|
|
5
|
-
description: "Invoice issued for a job",
|
|
6
|
-
fields: {
|
|
7
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
-
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
-
invoiceNumber: {
|
|
10
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
11
|
-
isOptional: false
|
|
12
|
-
},
|
|
13
|
-
amount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
14
|
-
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
15
|
-
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
16
|
-
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
17
|
-
issuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
18
|
-
paidAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
var IssueInvoiceInputModel = defineSchemaModel({
|
|
22
|
-
name: "IssueInvoiceInput",
|
|
23
|
-
description: "Input for issuing an invoice",
|
|
24
|
-
fields: {
|
|
25
|
-
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
26
|
-
dueDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
27
|
-
notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
28
|
-
lineItems: { type: ScalarTypeEnum.JSON(), isOptional: true }
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
export {
|
|
32
|
-
IssueInvoiceInputModel,
|
|
33
|
-
InvoiceModel
|
|
34
|
-
};
|
|
1
|
+
import{defineSchemaModel as k,ScalarTypeEnum as j}from"@contractspec/lib.schema";var w=k({name:"Invoice",description:"Invoice issued for a job",fields:{id:{type:j.String_unsecure(),isOptional:!1},jobId:{type:j.String_unsecure(),isOptional:!1},invoiceNumber:{type:j.String_unsecure(),isOptional:!1},amount:{type:j.Float_unsecure(),isOptional:!1},currency:{type:j.String_unsecure(),isOptional:!1},status:{type:j.String_unsecure(),isOptional:!1},dueDate:{type:j.DateTime(),isOptional:!0},issuedAt:{type:j.DateTime(),isOptional:!0},paidAt:{type:j.DateTime(),isOptional:!0}}}),x=k({name:"IssueInvoiceInput",description:"Input for issuing an invoice",fields:{jobId:{type:j.String_unsecure(),isOptional:!1},dueDate:{type:j.DateTime(),isOptional:!0},notes:{type:j.String_unsecure(),isOptional:!0},lineItems:{type:j.JSON(),isOptional:!0}}});export{x as IssueInvoiceInputModel,w as InvoiceModel};
|
package/dist/node/job/index.js
CHANGED
|
@@ -1,175 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
-
var JobModel = defineSchemaModel({
|
|
4
|
-
name: "Job",
|
|
5
|
-
description: "Scheduled job",
|
|
6
|
-
fields: {
|
|
7
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
-
quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
-
clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
-
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
-
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
-
scheduledAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
13
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
14
|
-
assignedTo: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
var ScheduleJobInputModel = defineSchemaModel({
|
|
18
|
-
name: "ScheduleJobInput",
|
|
19
|
-
description: "Input for scheduling a job",
|
|
20
|
-
fields: {
|
|
21
|
-
quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
-
scheduledAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
23
|
-
assignedTo: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
-
location: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
25
|
-
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
var CompleteJobInputModel = defineSchemaModel({
|
|
29
|
-
name: "CompleteJobInput",
|
|
30
|
-
description: "Input for completing a job",
|
|
31
|
-
fields: {
|
|
32
|
-
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
33
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
34
|
-
notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// src/job/job.operations.ts
|
|
39
|
-
import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
|
|
40
|
-
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
41
|
-
var OWNERS = ["@examples.service-business-os"];
|
|
42
|
-
var ListJobsInputModel = defineSchemaModel2({
|
|
43
|
-
name: "ListJobsInput",
|
|
44
|
-
description: "Input for listing jobs",
|
|
45
|
-
fields: {
|
|
46
|
-
status: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
47
|
-
clientId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
48
|
-
limit: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
|
|
49
|
-
offset: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true }
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
var ListJobsOutputModel = defineSchemaModel2({
|
|
53
|
-
name: "ListJobsOutput",
|
|
54
|
-
description: "Output for listing jobs",
|
|
55
|
-
fields: {
|
|
56
|
-
jobs: { type: JobModel, isOptional: false, isList: true },
|
|
57
|
-
total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
var ListJobsOperation = defineQuery({
|
|
61
|
-
meta: {
|
|
62
|
-
key: "service.job.list",
|
|
63
|
-
version: "1.0.0",
|
|
64
|
-
stability: "stable",
|
|
65
|
-
owners: [...OWNERS],
|
|
66
|
-
tags: ["service-business-os", "job", "list", "query"],
|
|
67
|
-
description: "List all jobs with filtering",
|
|
68
|
-
goal: "Retrieve list of jobs",
|
|
69
|
-
context: "Job management"
|
|
70
|
-
},
|
|
71
|
-
io: {
|
|
72
|
-
input: ListJobsInputModel,
|
|
73
|
-
output: ListJobsOutputModel
|
|
74
|
-
},
|
|
75
|
-
policy: { auth: "user" },
|
|
76
|
-
acceptance: {
|
|
77
|
-
scenarios: [
|
|
78
|
-
{
|
|
79
|
-
key: "list-jobs-happy-path",
|
|
80
|
-
given: ["Jobs exist"],
|
|
81
|
-
when: ["User lists jobs"],
|
|
82
|
-
then: ["List of jobs is returned"]
|
|
83
|
-
}
|
|
84
|
-
],
|
|
85
|
-
examples: [
|
|
86
|
-
{
|
|
87
|
-
key: "list-active",
|
|
88
|
-
input: { status: "scheduled", limit: 10 },
|
|
89
|
-
output: { jobs: [], total: 5 }
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
var ScheduleJobContract = defineCommand({
|
|
95
|
-
meta: {
|
|
96
|
-
key: "service.job.schedule",
|
|
97
|
-
version: "1.0.0",
|
|
98
|
-
stability: "stable",
|
|
99
|
-
owners: [...OWNERS],
|
|
100
|
-
tags: ["service-business-os", "job", "schedule"],
|
|
101
|
-
description: "Schedule a job.",
|
|
102
|
-
goal: "Schedule work.",
|
|
103
|
-
context: "Job scheduling."
|
|
104
|
-
},
|
|
105
|
-
io: {
|
|
106
|
-
input: ScheduleJobInputModel,
|
|
107
|
-
output: JobModel
|
|
108
|
-
},
|
|
109
|
-
policy: { auth: "user" },
|
|
110
|
-
acceptance: {
|
|
111
|
-
scenarios: [
|
|
112
|
-
{
|
|
113
|
-
key: "schedule-job-happy-path",
|
|
114
|
-
given: ["Client exists"],
|
|
115
|
-
when: ["User schedules job"],
|
|
116
|
-
then: ["Job is created with status SCHEDULED"]
|
|
117
|
-
}
|
|
118
|
-
],
|
|
119
|
-
examples: [
|
|
120
|
-
{
|
|
121
|
-
key: "schedule-repair",
|
|
122
|
-
input: {
|
|
123
|
-
clientId: "client-123",
|
|
124
|
-
date: "2025-01-20T10:00:00Z",
|
|
125
|
-
type: "repair"
|
|
126
|
-
},
|
|
127
|
-
output: { id: "job-456", status: "scheduled" }
|
|
128
|
-
}
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
var CompleteJobContract = defineCommand({
|
|
133
|
-
meta: {
|
|
134
|
-
key: "service.job.complete",
|
|
135
|
-
version: "1.0.0",
|
|
136
|
-
stability: "stable",
|
|
137
|
-
owners: [...OWNERS],
|
|
138
|
-
tags: ["service-business-os", "job", "complete"],
|
|
139
|
-
description: "Mark a job as complete.",
|
|
140
|
-
goal: "Record job completion.",
|
|
141
|
-
context: "Job management."
|
|
142
|
-
},
|
|
143
|
-
io: {
|
|
144
|
-
input: CompleteJobInputModel,
|
|
145
|
-
output: JobModel
|
|
146
|
-
},
|
|
147
|
-
policy: { auth: "user" },
|
|
148
|
-
acceptance: {
|
|
149
|
-
scenarios: [
|
|
150
|
-
{
|
|
151
|
-
key: "complete-job-happy-path",
|
|
152
|
-
given: ["Job is scheduled"],
|
|
153
|
-
when: ["User completes job"],
|
|
154
|
-
then: ["Job status becomes COMPLETED"]
|
|
155
|
-
}
|
|
156
|
-
],
|
|
157
|
-
examples: [
|
|
158
|
-
{
|
|
159
|
-
key: "mark-complete",
|
|
160
|
-
input: { jobId: "job-456", notes: "Done successfully" },
|
|
161
|
-
output: { id: "job-456", status: "completed" }
|
|
162
|
-
}
|
|
163
|
-
]
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
export {
|
|
167
|
-
ScheduleJobInputModel,
|
|
168
|
-
ScheduleJobContract,
|
|
169
|
-
ListJobsOutputModel,
|
|
170
|
-
ListJobsOperation,
|
|
171
|
-
ListJobsInputModel,
|
|
172
|
-
JobModel,
|
|
173
|
-
CompleteJobInputModel,
|
|
174
|
-
CompleteJobContract
|
|
175
|
-
};
|
|
1
|
+
import{defineSchemaModel as C,ScalarTypeEnum as J}from"@contractspec/lib.schema";var x=C({name:"Job",description:"Scheduled job",fields:{id:{type:J.String_unsecure(),isOptional:!1},quoteId:{type:J.String_unsecure(),isOptional:!1},clientId:{type:J.String_unsecure(),isOptional:!1},title:{type:J.String_unsecure(),isOptional:!1},status:{type:J.String_unsecure(),isOptional:!1},scheduledAt:{type:J.DateTime(),isOptional:!0},completedAt:{type:J.DateTime(),isOptional:!0},assignedTo:{type:J.String_unsecure(),isOptional:!0}}}),L=C({name:"ScheduleJobInput",description:"Input for scheduling a job",fields:{quoteId:{type:J.String_unsecure(),isOptional:!1},scheduledAt:{type:J.DateTime(),isOptional:!1},assignedTo:{type:J.String_unsecure(),isOptional:!0},location:{type:J.JSON(),isOptional:!0},title:{type:J.String_unsecure(),isOptional:!0}}}),k=C({name:"CompleteJobInput",description:"Input for completing a job",fields:{jobId:{type:J.String_unsecure(),isOptional:!1},completedAt:{type:J.DateTime(),isOptional:!0},notes:{type:J.String_unsecure(),isOptional:!0}}});import{defineCommand as t,defineQuery as A}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as v,ScalarTypeEnum as g}from"@contractspec/lib.schema";var q=["@examples.service-business-os"],w=v({name:"ListJobsInput",description:"Input for listing jobs",fields:{status:{type:g.String_unsecure(),isOptional:!0},clientId:{type:g.String_unsecure(),isOptional:!0},limit:{type:g.Int_unsecure(),isOptional:!0},offset:{type:g.Int_unsecure(),isOptional:!0}}}),z=v({name:"ListJobsOutput",description:"Output for listing jobs",fields:{jobs:{type:x,isOptional:!1,isList:!0},total:{type:g.Int_unsecure(),isOptional:!1}}}),B=A({meta:{key:"service.job.list",version:"1.0.0",stability:"stable",owners:[...q],tags:["service-business-os","job","list","query"],description:"List all jobs with filtering",goal:"Retrieve list of jobs",context:"Job management"},io:{input:w,output:z},policy:{auth:"user"},acceptance:{scenarios:[{key:"list-jobs-happy-path",given:["Jobs exist"],when:["User lists jobs"],then:["List of jobs is returned"]}],examples:[{key:"list-active",input:{status:"scheduled",limit:10},output:{jobs:[],total:5}}]}}),D=t({meta:{key:"service.job.schedule",version:"1.0.0",stability:"stable",owners:[...q],tags:["service-business-os","job","schedule"],description:"Schedule a job.",goal:"Schedule work.",context:"Job scheduling."},io:{input:L,output:x},policy:{auth:"user"},acceptance:{scenarios:[{key:"schedule-job-happy-path",given:["Client exists"],when:["User schedules job"],then:["Job is created with status SCHEDULED"]}],examples:[{key:"schedule-repair",input:{clientId:"client-123",date:"2025-01-20T10:00:00Z",type:"repair"},output:{id:"job-456",status:"scheduled"}}]}}),F=t({meta:{key:"service.job.complete",version:"1.0.0",stability:"stable",owners:[...q],tags:["service-business-os","job","complete"],description:"Mark a job as complete.",goal:"Record job completion.",context:"Job management."},io:{input:k,output:x},policy:{auth:"user"},acceptance:{scenarios:[{key:"complete-job-happy-path",given:["Job is scheduled"],when:["User completes job"],then:["Job status becomes COMPLETED"]}],examples:[{key:"mark-complete",input:{jobId:"job-456",notes:"Done successfully"},output:{id:"job-456",status:"completed"}}]}});export{L as ScheduleJobInputModel,D as ScheduleJobContract,z as ListJobsOutputModel,B as ListJobsOperation,w as ListJobsInputModel,x as JobModel,k as CompleteJobInputModel,F as CompleteJobContract};
|
|
@@ -1,172 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
-
var JobModel = defineSchemaModel({
|
|
4
|
-
name: "Job",
|
|
5
|
-
description: "Scheduled job",
|
|
6
|
-
fields: {
|
|
7
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
-
quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
-
clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
-
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
-
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
-
scheduledAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
13
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
14
|
-
assignedTo: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
var ScheduleJobInputModel = defineSchemaModel({
|
|
18
|
-
name: "ScheduleJobInput",
|
|
19
|
-
description: "Input for scheduling a job",
|
|
20
|
-
fields: {
|
|
21
|
-
quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
-
scheduledAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
23
|
-
assignedTo: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
-
location: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
25
|
-
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
var CompleteJobInputModel = defineSchemaModel({
|
|
29
|
-
name: "CompleteJobInput",
|
|
30
|
-
description: "Input for completing a job",
|
|
31
|
-
fields: {
|
|
32
|
-
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
33
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
34
|
-
notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// src/job/job.operations.ts
|
|
39
|
-
import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
|
|
40
|
-
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
41
|
-
var OWNERS = ["@examples.service-business-os"];
|
|
42
|
-
var ListJobsInputModel = defineSchemaModel2({
|
|
43
|
-
name: "ListJobsInput",
|
|
44
|
-
description: "Input for listing jobs",
|
|
45
|
-
fields: {
|
|
46
|
-
status: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
47
|
-
clientId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
48
|
-
limit: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
|
|
49
|
-
offset: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true }
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
var ListJobsOutputModel = defineSchemaModel2({
|
|
53
|
-
name: "ListJobsOutput",
|
|
54
|
-
description: "Output for listing jobs",
|
|
55
|
-
fields: {
|
|
56
|
-
jobs: { type: JobModel, isOptional: false, isList: true },
|
|
57
|
-
total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
var ListJobsOperation = defineQuery({
|
|
61
|
-
meta: {
|
|
62
|
-
key: "service.job.list",
|
|
63
|
-
version: "1.0.0",
|
|
64
|
-
stability: "stable",
|
|
65
|
-
owners: [...OWNERS],
|
|
66
|
-
tags: ["service-business-os", "job", "list", "query"],
|
|
67
|
-
description: "List all jobs with filtering",
|
|
68
|
-
goal: "Retrieve list of jobs",
|
|
69
|
-
context: "Job management"
|
|
70
|
-
},
|
|
71
|
-
io: {
|
|
72
|
-
input: ListJobsInputModel,
|
|
73
|
-
output: ListJobsOutputModel
|
|
74
|
-
},
|
|
75
|
-
policy: { auth: "user" },
|
|
76
|
-
acceptance: {
|
|
77
|
-
scenarios: [
|
|
78
|
-
{
|
|
79
|
-
key: "list-jobs-happy-path",
|
|
80
|
-
given: ["Jobs exist"],
|
|
81
|
-
when: ["User lists jobs"],
|
|
82
|
-
then: ["List of jobs is returned"]
|
|
83
|
-
}
|
|
84
|
-
],
|
|
85
|
-
examples: [
|
|
86
|
-
{
|
|
87
|
-
key: "list-active",
|
|
88
|
-
input: { status: "scheduled", limit: 10 },
|
|
89
|
-
output: { jobs: [], total: 5 }
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
var ScheduleJobContract = defineCommand({
|
|
95
|
-
meta: {
|
|
96
|
-
key: "service.job.schedule",
|
|
97
|
-
version: "1.0.0",
|
|
98
|
-
stability: "stable",
|
|
99
|
-
owners: [...OWNERS],
|
|
100
|
-
tags: ["service-business-os", "job", "schedule"],
|
|
101
|
-
description: "Schedule a job.",
|
|
102
|
-
goal: "Schedule work.",
|
|
103
|
-
context: "Job scheduling."
|
|
104
|
-
},
|
|
105
|
-
io: {
|
|
106
|
-
input: ScheduleJobInputModel,
|
|
107
|
-
output: JobModel
|
|
108
|
-
},
|
|
109
|
-
policy: { auth: "user" },
|
|
110
|
-
acceptance: {
|
|
111
|
-
scenarios: [
|
|
112
|
-
{
|
|
113
|
-
key: "schedule-job-happy-path",
|
|
114
|
-
given: ["Client exists"],
|
|
115
|
-
when: ["User schedules job"],
|
|
116
|
-
then: ["Job is created with status SCHEDULED"]
|
|
117
|
-
}
|
|
118
|
-
],
|
|
119
|
-
examples: [
|
|
120
|
-
{
|
|
121
|
-
key: "schedule-repair",
|
|
122
|
-
input: {
|
|
123
|
-
clientId: "client-123",
|
|
124
|
-
date: "2025-01-20T10:00:00Z",
|
|
125
|
-
type: "repair"
|
|
126
|
-
},
|
|
127
|
-
output: { id: "job-456", status: "scheduled" }
|
|
128
|
-
}
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
var CompleteJobContract = defineCommand({
|
|
133
|
-
meta: {
|
|
134
|
-
key: "service.job.complete",
|
|
135
|
-
version: "1.0.0",
|
|
136
|
-
stability: "stable",
|
|
137
|
-
owners: [...OWNERS],
|
|
138
|
-
tags: ["service-business-os", "job", "complete"],
|
|
139
|
-
description: "Mark a job as complete.",
|
|
140
|
-
goal: "Record job completion.",
|
|
141
|
-
context: "Job management."
|
|
142
|
-
},
|
|
143
|
-
io: {
|
|
144
|
-
input: CompleteJobInputModel,
|
|
145
|
-
output: JobModel
|
|
146
|
-
},
|
|
147
|
-
policy: { auth: "user" },
|
|
148
|
-
acceptance: {
|
|
149
|
-
scenarios: [
|
|
150
|
-
{
|
|
151
|
-
key: "complete-job-happy-path",
|
|
152
|
-
given: ["Job is scheduled"],
|
|
153
|
-
when: ["User completes job"],
|
|
154
|
-
then: ["Job status becomes COMPLETED"]
|
|
155
|
-
}
|
|
156
|
-
],
|
|
157
|
-
examples: [
|
|
158
|
-
{
|
|
159
|
-
key: "mark-complete",
|
|
160
|
-
input: { jobId: "job-456", notes: "Done successfully" },
|
|
161
|
-
output: { id: "job-456", status: "completed" }
|
|
162
|
-
}
|
|
163
|
-
]
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
export {
|
|
167
|
-
ScheduleJobContract,
|
|
168
|
-
ListJobsOutputModel,
|
|
169
|
-
ListJobsOperation,
|
|
170
|
-
ListJobsInputModel,
|
|
171
|
-
CompleteJobContract
|
|
172
|
-
};
|
|
1
|
+
import{defineSchemaModel as w,ScalarTypeEnum as k}from"@contractspec/lib.schema";var v=w({name:"Job",description:"Scheduled job",fields:{id:{type:k.String_unsecure(),isOptional:!1},quoteId:{type:k.String_unsecure(),isOptional:!1},clientId:{type:k.String_unsecure(),isOptional:!1},title:{type:k.String_unsecure(),isOptional:!1},status:{type:k.String_unsecure(),isOptional:!1},scheduledAt:{type:k.DateTime(),isOptional:!0},completedAt:{type:k.DateTime(),isOptional:!0},assignedTo:{type:k.String_unsecure(),isOptional:!0}}}),z=w({name:"ScheduleJobInput",description:"Input for scheduling a job",fields:{quoteId:{type:k.String_unsecure(),isOptional:!1},scheduledAt:{type:k.DateTime(),isOptional:!1},assignedTo:{type:k.String_unsecure(),isOptional:!0},location:{type:k.JSON(),isOptional:!0},title:{type:k.String_unsecure(),isOptional:!0}}}),A=w({name:"CompleteJobInput",description:"Input for completing a job",fields:{jobId:{type:k.String_unsecure(),isOptional:!1},completedAt:{type:k.DateTime(),isOptional:!0},notes:{type:k.String_unsecure(),isOptional:!0}}});import{defineCommand as B,defineQuery as F}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as D,ScalarTypeEnum as q}from"@contractspec/lib.schema";var x=["@examples.service-business-os"],G=D({name:"ListJobsInput",description:"Input for listing jobs",fields:{status:{type:q.String_unsecure(),isOptional:!0},clientId:{type:q.String_unsecure(),isOptional:!0},limit:{type:q.Int_unsecure(),isOptional:!0},offset:{type:q.Int_unsecure(),isOptional:!0}}}),H=D({name:"ListJobsOutput",description:"Output for listing jobs",fields:{jobs:{type:v,isOptional:!1,isList:!0},total:{type:q.Int_unsecure(),isOptional:!1}}}),Y=F({meta:{key:"service.job.list",version:"1.0.0",stability:"stable",owners:[...x],tags:["service-business-os","job","list","query"],description:"List all jobs with filtering",goal:"Retrieve list of jobs",context:"Job management"},io:{input:G,output:H},policy:{auth:"user"},acceptance:{scenarios:[{key:"list-jobs-happy-path",given:["Jobs exist"],when:["User lists jobs"],then:["List of jobs is returned"]}],examples:[{key:"list-active",input:{status:"scheduled",limit:10},output:{jobs:[],total:5}}]}}),Z=B({meta:{key:"service.job.schedule",version:"1.0.0",stability:"stable",owners:[...x],tags:["service-business-os","job","schedule"],description:"Schedule a job.",goal:"Schedule work.",context:"Job scheduling."},io:{input:z,output:v},policy:{auth:"user"},acceptance:{scenarios:[{key:"schedule-job-happy-path",given:["Client exists"],when:["User schedules job"],then:["Job is created with status SCHEDULED"]}],examples:[{key:"schedule-repair",input:{clientId:"client-123",date:"2025-01-20T10:00:00Z",type:"repair"},output:{id:"job-456",status:"scheduled"}}]}}),_=B({meta:{key:"service.job.complete",version:"1.0.0",stability:"stable",owners:[...x],tags:["service-business-os","job","complete"],description:"Mark a job as complete.",goal:"Record job completion.",context:"Job management."},io:{input:A,output:v},policy:{auth:"user"},acceptance:{scenarios:[{key:"complete-job-happy-path",given:["Job is scheduled"],when:["User completes job"],then:["Job status becomes COMPLETED"]}],examples:[{key:"mark-complete",input:{jobId:"job-456",notes:"Done successfully"},output:{id:"job-456",status:"completed"}}]}});export{Z as ScheduleJobContract,H as ListJobsOutputModel,Y as ListJobsOperation,G as ListJobsInputModel,_ as CompleteJobContract};
|
|
@@ -1,41 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
-
var JobModel = defineSchemaModel({
|
|
4
|
-
name: "Job",
|
|
5
|
-
description: "Scheduled job",
|
|
6
|
-
fields: {
|
|
7
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
8
|
-
quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
-
clientId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
-
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
-
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
-
scheduledAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
13
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
14
|
-
assignedTo: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
var ScheduleJobInputModel = defineSchemaModel({
|
|
18
|
-
name: "ScheduleJobInput",
|
|
19
|
-
description: "Input for scheduling a job",
|
|
20
|
-
fields: {
|
|
21
|
-
quoteId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
-
scheduledAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
23
|
-
assignedTo: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
-
location: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
25
|
-
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
var CompleteJobInputModel = defineSchemaModel({
|
|
29
|
-
name: "CompleteJobInput",
|
|
30
|
-
description: "Input for completing a job",
|
|
31
|
-
fields: {
|
|
32
|
-
jobId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
33
|
-
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
34
|
-
notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
export {
|
|
38
|
-
ScheduleJobInputModel,
|
|
39
|
-
JobModel,
|
|
40
|
-
CompleteJobInputModel
|
|
41
|
-
};
|
|
1
|
+
import{defineSchemaModel as q,ScalarTypeEnum as k}from"@contractspec/lib.schema";var w=q({name:"Job",description:"Scheduled job",fields:{id:{type:k.String_unsecure(),isOptional:!1},quoteId:{type:k.String_unsecure(),isOptional:!1},clientId:{type:k.String_unsecure(),isOptional:!1},title:{type:k.String_unsecure(),isOptional:!1},status:{type:k.String_unsecure(),isOptional:!1},scheduledAt:{type:k.DateTime(),isOptional:!0},completedAt:{type:k.DateTime(),isOptional:!0},assignedTo:{type:k.String_unsecure(),isOptional:!0}}}),x=q({name:"ScheduleJobInput",description:"Input for scheduling a job",fields:{quoteId:{type:k.String_unsecure(),isOptional:!1},scheduledAt:{type:k.DateTime(),isOptional:!1},assignedTo:{type:k.String_unsecure(),isOptional:!0},location:{type:k.JSON(),isOptional:!0},title:{type:k.String_unsecure(),isOptional:!0}}}),z=q({name:"CompleteJobInput",description:"Input for completing a job",fields:{jobId:{type:k.String_unsecure(),isOptional:!1},completedAt:{type:k.DateTime(),isOptional:!0},notes:{type:k.String_unsecure(),isOptional:!0}}});export{x as ScheduleJobInputModel,w as JobModel,z as CompleteJobInputModel};
|