@kohost/api-client 7.7.0 → 7.8.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/lib/bills.d.ts +74 -0
- package/dist/lib/bills.js +83 -0
- package/dist/lib/bills.js.map +1 -0
- package/dist/lib/deviceNotifications.js +1 -4
- package/dist/lib/deviceNotifications.js.map +1 -1
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.js +27 -2
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/kfcStatsWindow.d.ts +37 -0
- package/dist/lib/kfcStatsWindow.js +46 -0
- package/dist/lib/kfcStatsWindow.js.map +1 -0
- package/dist/lib/lowerBoundTable.d.ts +11 -0
- package/dist/lib/lowerBoundTable.js +28 -0
- package/dist/lib/lowerBoundTable.js.map +1 -0
- package/dist/lib/money.d.ts +61 -0
- package/dist/lib/money.js +80 -0
- package/dist/lib/money.js.map +1 -0
- package/dist/lib/policy-resolvers.js +5 -4
- package/dist/lib/policy-resolvers.js.map +1 -1
- package/dist/lib/ticketRichText.d.ts +35 -0
- package/dist/lib/ticketRichText.js +86 -0
- package/dist/lib/ticketRichText.js.map +1 -0
- package/dist/models/bill.d.ts +17 -0
- package/dist/models/bill.js +37 -0
- package/dist/models/bill.js.map +1 -0
- package/dist/models/billingCategory.d.ts +17 -0
- package/dist/models/billingCategory.js +22 -0
- package/dist/models/billingCategory.js.map +1 -0
- package/dist/models/index.d.ts +2 -1
- package/dist/models/index.js +5 -3
- package/dist/models/index.js.map +1 -1
- package/dist/models/organization.js +4 -0
- package/dist/models/organization.js.map +1 -1
- package/dist/models/ticket.js +5 -0
- package/dist/models/ticket.js.map +1 -1
- package/dist/schemas/bill.d.ts +255 -0
- package/dist/schemas/bill.js +248 -0
- package/dist/schemas/bill.js.map +1 -0
- package/dist/schemas/billingCategory.d.ts +46 -0
- package/dist/schemas/billingCategory.js +38 -0
- package/dist/schemas/billingCategory.js.map +1 -0
- package/dist/schemas/definitions.d.ts +3 -3
- package/dist/schemas/definitions.js +4 -1
- package/dist/schemas/definitions.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -1
- package/dist/schemas/index.js +3 -2
- package/dist/schemas/organization.d.ts +112 -1
- package/dist/schemas/organization.js +93 -0
- package/dist/schemas/organization.js.map +1 -1
- package/dist/schemas/property.d.ts +32 -0
- package/dist/schemas/property.js +26 -0
- package/dist/schemas/property.js.map +1 -1
- package/dist/schemas/ticket.d.ts +381 -3
- package/dist/schemas/ticket.js +419 -1
- package/dist/schemas/ticket.js.map +1 -1
- package/dist/useCases/acknowledgeCostDivergence.d.ts +39 -0
- package/dist/useCases/acknowledgeCostDivergence.js +47 -0
- package/dist/useCases/acknowledgeCostDivergence.js.map +1 -0
- package/dist/useCases/addBillLine.d.ts +36 -0
- package/dist/useCases/addBillLine.js +47 -0
- package/dist/useCases/addBillLine.js.map +1 -0
- package/dist/useCases/addStaffFunctionMember.d.ts +39 -0
- package/dist/useCases/addStaffFunctionMember.js +47 -0
- package/dist/useCases/addStaffFunctionMember.js.map +1 -0
- package/dist/useCases/cancelWorkItem.d.ts +39 -0
- package/dist/useCases/cancelWorkItem.js +47 -0
- package/dist/useCases/cancelWorkItem.js.map +1 -0
- package/dist/useCases/clearWorkItemNoCharge.d.ts +39 -0
- package/dist/useCases/clearWorkItemNoCharge.js +47 -0
- package/dist/useCases/clearWorkItemNoCharge.js.map +1 -0
- package/dist/useCases/createBill.d.ts +27 -0
- package/dist/useCases/createBill.js +47 -0
- package/dist/useCases/createBill.js.map +1 -0
- package/dist/useCases/createBillingCategory.d.ts +27 -0
- package/dist/useCases/createBillingCategory.js +47 -0
- package/dist/useCases/createBillingCategory.js.map +1 -0
- package/dist/useCases/decideApproval.d.ts +39 -0
- package/dist/useCases/decideApproval.js +47 -0
- package/dist/useCases/decideApproval.js.map +1 -0
- package/dist/useCases/deleteBill.d.ts +36 -0
- package/dist/useCases/deleteBill.js +47 -0
- package/dist/useCases/deleteBill.js.map +1 -0
- package/dist/useCases/deleteStaffUser.d.ts +36 -0
- package/dist/useCases/deleteStaffUser.js +47 -0
- package/dist/useCases/deleteStaffUser.js.map +1 -0
- package/dist/useCases/describeBill.d.ts +36 -0
- package/dist/useCases/describeBill.js +47 -0
- package/dist/useCases/describeBill.js.map +1 -0
- package/dist/useCases/describeConciergeFacilitiesViewer.d.ts +27 -0
- package/dist/useCases/describeConciergeFacilitiesViewer.js +47 -0
- package/dist/useCases/describeConciergeFacilitiesViewer.js.map +1 -0
- package/dist/useCases/describeConciergeStatsFilters.d.ts +27 -0
- package/dist/useCases/describeConciergeStatsFilters.js +47 -0
- package/dist/useCases/describeConciergeStatsFilters.js.map +1 -0
- package/dist/useCases/describeConciergeStatsHeatmap.d.ts +27 -0
- package/dist/useCases/describeConciergeStatsHeatmap.js +47 -0
- package/dist/useCases/describeConciergeStatsHeatmap.js.map +1 -0
- package/dist/useCases/describeConciergeStatsSummary.d.ts +27 -0
- package/dist/useCases/describeConciergeStatsSummary.js +47 -0
- package/dist/useCases/describeConciergeStatsSummary.js.map +1 -0
- package/dist/useCases/describeConciergeStatsTickets.d.ts +27 -0
- package/dist/useCases/describeConciergeStatsTickets.js +47 -0
- package/dist/useCases/describeConciergeStatsTickets.js.map +1 -0
- package/dist/useCases/describeConciergeWorkspaceFilters.d.ts +27 -0
- package/dist/useCases/describeConciergeWorkspaceFilters.js +47 -0
- package/dist/useCases/describeConciergeWorkspaceFilters.js.map +1 -0
- package/dist/useCases/describeOrganizationBill.d.ts +36 -0
- package/dist/useCases/describeOrganizationBill.js +47 -0
- package/dist/useCases/describeOrganizationBill.js.map +1 -0
- package/dist/useCases/describeSelfAccess.d.ts +27 -0
- package/dist/useCases/describeSelfAccess.js +47 -0
- package/dist/useCases/describeSelfAccess.js.map +1 -0
- package/dist/useCases/describeStaffFunctions.d.ts +27 -0
- package/dist/useCases/describeStaffFunctions.js +47 -0
- package/dist/useCases/describeStaffFunctions.js.map +1 -0
- package/dist/useCases/describeTicketStatsFilters.d.ts +27 -0
- package/dist/useCases/describeTicketStatsFilters.js +47 -0
- package/dist/useCases/describeTicketStatsFilters.js.map +1 -0
- package/dist/useCases/describeTicketStatsHeatmap.d.ts +27 -0
- package/dist/useCases/describeTicketStatsHeatmap.js +47 -0
- package/dist/useCases/describeTicketStatsHeatmap.js.map +1 -0
- package/dist/useCases/describeTicketStatsSummary.d.ts +27 -0
- package/dist/useCases/describeTicketStatsSummary.js +47 -0
- package/dist/useCases/describeTicketStatsSummary.js.map +1 -0
- package/dist/useCases/describeTicketStatsTickets.d.ts +27 -0
- package/dist/useCases/describeTicketStatsTickets.js +47 -0
- package/dist/useCases/describeTicketStatsTickets.js.map +1 -0
- package/dist/useCases/editCostEntry.d.ts +39 -0
- package/dist/useCases/editCostEntry.js +47 -0
- package/dist/useCases/editCostEntry.js.map +1 -0
- package/dist/useCases/index.d.ts +57 -0
- package/dist/useCases/index.js +116 -2
- package/dist/useCases/index.js.map +1 -1
- package/dist/useCases/listBillingCategories.d.ts +27 -0
- package/dist/useCases/listBillingCategories.js +47 -0
- package/dist/useCases/listBillingCategories.js.map +1 -0
- package/dist/useCases/listBills.d.ts +27 -0
- package/dist/useCases/listBills.js +47 -0
- package/dist/useCases/listBills.js.map +1 -0
- package/dist/useCases/listConciergeUninvoicedCosts.d.ts +27 -0
- package/dist/useCases/listConciergeUninvoicedCosts.js +47 -0
- package/dist/useCases/listConciergeUninvoicedCosts.js.map +1 -0
- package/dist/useCases/listConciergeWorkspaceBills.d.ts +27 -0
- package/dist/useCases/listConciergeWorkspaceBills.js +47 -0
- package/dist/useCases/listConciergeWorkspaceBills.js.map +1 -0
- package/dist/useCases/listConciergeWorkspaceTickets.d.ts +27 -0
- package/dist/useCases/listConciergeWorkspaceTickets.js +47 -0
- package/dist/useCases/listConciergeWorkspaceTickets.js.map +1 -0
- package/dist/useCases/listEligibleApprovers.d.ts +36 -0
- package/dist/useCases/listEligibleApprovers.js +47 -0
- package/dist/useCases/listEligibleApprovers.js.map +1 -0
- package/dist/useCases/listFacilitiesStaffIds.d.ts +27 -0
- package/dist/useCases/listFacilitiesStaffIds.js +47 -0
- package/dist/useCases/listFacilitiesStaffIds.js.map +1 -0
- package/dist/useCases/listKohostStaff.d.ts +27 -0
- package/dist/useCases/listKohostStaff.js +47 -0
- package/dist/useCases/listKohostStaff.js.map +1 -0
- package/dist/useCases/listOrganizationBills.d.ts +27 -0
- package/dist/useCases/listOrganizationBills.js +47 -0
- package/dist/useCases/listOrganizationBills.js.map +1 -0
- package/dist/useCases/markBillPaid.d.ts +36 -0
- package/dist/useCases/markBillPaid.js +47 -0
- package/dist/useCases/markBillPaid.js.map +1 -0
- package/dist/useCases/markBillSent.d.ts +36 -0
- package/dist/useCases/markBillSent.js +47 -0
- package/dist/useCases/markBillSent.js.map +1 -0
- package/dist/useCases/previewBill.d.ts +36 -0
- package/dist/useCases/previewBill.js +47 -0
- package/dist/useCases/previewBill.js.map +1 -0
- package/dist/useCases/recordCostActual.d.ts +39 -0
- package/dist/useCases/recordCostActual.js +47 -0
- package/dist/useCases/recordCostActual.js.map +1 -0
- package/dist/useCases/recordCostEntry.d.ts +36 -0
- package/dist/useCases/recordCostEntry.js +47 -0
- package/dist/useCases/recordCostEntry.js.map +1 -0
- package/dist/useCases/reinstateCostEntry.d.ts +39 -0
- package/dist/useCases/reinstateCostEntry.js +47 -0
- package/dist/useCases/reinstateCostEntry.js.map +1 -0
- package/dist/useCases/removeBillLine.d.ts +39 -0
- package/dist/useCases/removeBillLine.js +47 -0
- package/dist/useCases/removeBillLine.js.map +1 -0
- package/dist/useCases/removeStaffFunctionMember.d.ts +39 -0
- package/dist/useCases/removeStaffFunctionMember.js +47 -0
- package/dist/useCases/removeStaffFunctionMember.js.map +1 -0
- package/dist/useCases/requestApproval.d.ts +36 -0
- package/dist/useCases/requestApproval.js +47 -0
- package/dist/useCases/requestApproval.js.map +1 -0
- package/dist/useCases/rescheduleWorkItem.d.ts +39 -0
- package/dist/useCases/rescheduleWorkItem.js +47 -0
- package/dist/useCases/rescheduleWorkItem.js.map +1 -0
- package/dist/useCases/scheduleWorkItem.d.ts +36 -0
- package/dist/useCases/scheduleWorkItem.js +47 -0
- package/dist/useCases/scheduleWorkItem.js.map +1 -0
- package/dist/useCases/setCostVendorInvoice.d.ts +39 -0
- package/dist/useCases/setCostVendorInvoice.js +47 -0
- package/dist/useCases/setCostVendorInvoice.js.map +1 -0
- package/dist/useCases/setUserSuperAdmin.d.ts +36 -0
- package/dist/useCases/setUserSuperAdmin.js +47 -0
- package/dist/useCases/setUserSuperAdmin.js.map +1 -0
- package/dist/useCases/setWorkItemNoCharge.d.ts +39 -0
- package/dist/useCases/setWorkItemNoCharge.js +47 -0
- package/dist/useCases/setWorkItemNoCharge.js.map +1 -0
- package/dist/useCases/updateBill.d.ts +36 -0
- package/dist/useCases/updateBill.js +47 -0
- package/dist/useCases/updateBill.js.map +1 -0
- package/dist/useCases/updateBillLine.d.ts +39 -0
- package/dist/useCases/updateBillLine.js +47 -0
- package/dist/useCases/updateBillLine.js.map +1 -0
- package/dist/useCases/updateBillingCategory.d.ts +36 -0
- package/dist/useCases/updateBillingCategory.js +47 -0
- package/dist/useCases/updateBillingCategory.js.map +1 -0
- package/dist/useCases/updateOrganizationBillingAddress.d.ts +36 -0
- package/dist/useCases/updateOrganizationBillingAddress.js +47 -0
- package/dist/useCases/updateOrganizationBillingAddress.js.map +1 -0
- package/dist/useCases/updateOrganizationBillingContacts.d.ts +36 -0
- package/dist/useCases/updateOrganizationBillingContacts.js +47 -0
- package/dist/useCases/updateOrganizationBillingContacts.js.map +1 -0
- package/dist/useCases/updateOrganizationTaxExempt.d.ts +36 -0
- package/dist/useCases/updateOrganizationTaxExempt.js +47 -0
- package/dist/useCases/updateOrganizationTaxExempt.js.map +1 -0
- package/dist/useCases/updateStaffUser.d.ts +36 -0
- package/dist/useCases/updateStaffUser.js +47 -0
- package/dist/useCases/updateStaffUser.js.map +1 -0
- package/dist/useCases/voidBill.d.ts +36 -0
- package/dist/useCases/voidBill.js +47 -0
- package/dist/useCases/voidBill.js.map +1 -0
- package/dist/useCases/writeOffCostEntry.d.ts +39 -0
- package/dist/useCases/writeOffCostEntry.js +47 -0
- package/dist/useCases/writeOffCostEntry.js.map +1 -0
- package/dist/validate.d.ts +25 -8
- package/dist/validate.js +9 -4
- package/dist/validate.js.map +1 -1
- package/package.json +9 -8
- package/dist/models/order.d.ts +0 -17
- package/dist/models/order.js +0 -33
- package/dist/models/order.js.map +0 -1
- package/dist/schemas/order.d.ts +0 -186
- package/dist/schemas/order.js +0 -157
- package/dist/schemas/order.js.map +0 -1
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import defs, { ISODateString } from "./definitions.js";
|
|
2
|
+
import type { FromSchema } from "json-schema-to-ts";
|
|
3
|
+
import { mediaFileSchema } from "./mediaFile.js";
|
|
4
|
+
export declare const billSchema: {
|
|
5
|
+
readonly $schema: "http://json-schema.org/draft-07/schema";
|
|
6
|
+
readonly $id: "bill.json";
|
|
7
|
+
readonly title: "Bill";
|
|
8
|
+
readonly description: string;
|
|
9
|
+
readonly type: "object";
|
|
10
|
+
readonly required: readonly ["id", "organizationId", "status", "currency", "lines"];
|
|
11
|
+
readonly additionalProperties: false;
|
|
12
|
+
readonly properties: {
|
|
13
|
+
readonly id: {
|
|
14
|
+
readonly $ref: "definitions.json#/definitions/id";
|
|
15
|
+
};
|
|
16
|
+
readonly type: {
|
|
17
|
+
readonly type: "string";
|
|
18
|
+
readonly enum: readonly ["bill"];
|
|
19
|
+
readonly default: "bill";
|
|
20
|
+
};
|
|
21
|
+
readonly organizationId: {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly description: string;
|
|
24
|
+
};
|
|
25
|
+
readonly status: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
readonly enum: readonly ["draft", "sent", "paid", "void"];
|
|
28
|
+
readonly default: "draft";
|
|
29
|
+
readonly description: string;
|
|
30
|
+
};
|
|
31
|
+
readonly invoiceNumber: {
|
|
32
|
+
readonly type: readonly ["string", "null"];
|
|
33
|
+
readonly default: null;
|
|
34
|
+
readonly description: string;
|
|
35
|
+
};
|
|
36
|
+
readonly period: {
|
|
37
|
+
readonly type: readonly ["string", "null"];
|
|
38
|
+
readonly default: null;
|
|
39
|
+
readonly description: string;
|
|
40
|
+
};
|
|
41
|
+
readonly currency: {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
readonly enum: readonly ["USD"];
|
|
44
|
+
readonly default: "USD";
|
|
45
|
+
readonly description: "ISO 4217 currency code. USD only in v1.";
|
|
46
|
+
};
|
|
47
|
+
readonly fileId: {
|
|
48
|
+
readonly type: readonly ["string", "null"];
|
|
49
|
+
readonly default: null;
|
|
50
|
+
readonly description: string;
|
|
51
|
+
};
|
|
52
|
+
readonly fileUrl: {
|
|
53
|
+
readonly type: readonly ["string", "null"];
|
|
54
|
+
readonly default: null;
|
|
55
|
+
readonly description: string;
|
|
56
|
+
};
|
|
57
|
+
readonly memo: {
|
|
58
|
+
readonly type: readonly ["string", "null"];
|
|
59
|
+
readonly default: null;
|
|
60
|
+
readonly description: "Internal KFC-only note. Never customer-facing; editable in any state.";
|
|
61
|
+
};
|
|
62
|
+
readonly billingAddress: {
|
|
63
|
+
readonly anyOf: readonly [{
|
|
64
|
+
readonly $ref: "definitions.json#/definitions/address";
|
|
65
|
+
}, {
|
|
66
|
+
readonly type: "null";
|
|
67
|
+
}];
|
|
68
|
+
readonly default: null;
|
|
69
|
+
readonly description: string;
|
|
70
|
+
};
|
|
71
|
+
readonly taxRate: {
|
|
72
|
+
readonly type: readonly ["number", "null"];
|
|
73
|
+
readonly default: null;
|
|
74
|
+
readonly minimum: 0;
|
|
75
|
+
readonly description: string;
|
|
76
|
+
};
|
|
77
|
+
readonly taxExempt: {
|
|
78
|
+
readonly type: "boolean";
|
|
79
|
+
readonly default: false;
|
|
80
|
+
readonly description: string;
|
|
81
|
+
};
|
|
82
|
+
readonly shippingAmount: {
|
|
83
|
+
readonly type: readonly ["integer", "null"];
|
|
84
|
+
readonly default: null;
|
|
85
|
+
readonly minimum: 0;
|
|
86
|
+
readonly description: string;
|
|
87
|
+
};
|
|
88
|
+
readonly lines: {
|
|
89
|
+
readonly type: "array";
|
|
90
|
+
readonly default: readonly [];
|
|
91
|
+
readonly description: string;
|
|
92
|
+
readonly items: {
|
|
93
|
+
readonly oneOf: readonly [{
|
|
94
|
+
readonly type: "object";
|
|
95
|
+
readonly additionalProperties: false;
|
|
96
|
+
readonly required: readonly ["id", "type", "ticketId", "costId"];
|
|
97
|
+
readonly properties: {
|
|
98
|
+
readonly id: {
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
readonly description: "Server-minted ID of the bill line.";
|
|
101
|
+
};
|
|
102
|
+
readonly type: {
|
|
103
|
+
readonly type: "string";
|
|
104
|
+
readonly enum: readonly ["cost"];
|
|
105
|
+
readonly description: "Discriminator: a line drawn from a ticket cost entry.";
|
|
106
|
+
};
|
|
107
|
+
readonly ticketId: {
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
readonly description: "The ID of the ticket the claimed cost entry lives on.";
|
|
110
|
+
};
|
|
111
|
+
readonly costId: {
|
|
112
|
+
readonly type: "string";
|
|
113
|
+
readonly description: "The ID of the claimed cost entry within the ticket.";
|
|
114
|
+
};
|
|
115
|
+
readonly categoryId: {
|
|
116
|
+
readonly type: readonly ["string", "null"];
|
|
117
|
+
readonly default: null;
|
|
118
|
+
readonly description: string;
|
|
119
|
+
};
|
|
120
|
+
readonly categoryName: {
|
|
121
|
+
readonly type: readonly ["string", "null"];
|
|
122
|
+
readonly default: null;
|
|
123
|
+
readonly description: string;
|
|
124
|
+
};
|
|
125
|
+
readonly adjustedAmount: {
|
|
126
|
+
readonly type: readonly ["integer", "null"];
|
|
127
|
+
readonly minimum: 0;
|
|
128
|
+
readonly default: null;
|
|
129
|
+
readonly description: string;
|
|
130
|
+
};
|
|
131
|
+
readonly adjustmentReason: {
|
|
132
|
+
readonly type: readonly ["string", "null"];
|
|
133
|
+
readonly default: null;
|
|
134
|
+
readonly description: string;
|
|
135
|
+
};
|
|
136
|
+
readonly amount: {
|
|
137
|
+
readonly type: readonly ["integer", "null"];
|
|
138
|
+
readonly default: null;
|
|
139
|
+
readonly description: string;
|
|
140
|
+
};
|
|
141
|
+
readonly description: {
|
|
142
|
+
readonly type: readonly ["string", "null"];
|
|
143
|
+
readonly default: null;
|
|
144
|
+
readonly description: string;
|
|
145
|
+
};
|
|
146
|
+
readonly taxable: {
|
|
147
|
+
readonly type: "boolean";
|
|
148
|
+
readonly default: false;
|
|
149
|
+
readonly description: string;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
}, {
|
|
153
|
+
readonly type: "object";
|
|
154
|
+
readonly additionalProperties: false;
|
|
155
|
+
readonly required: readonly ["id", "type", "description", "amount"];
|
|
156
|
+
readonly properties: {
|
|
157
|
+
readonly id: {
|
|
158
|
+
readonly type: "string";
|
|
159
|
+
readonly description: "Server-minted ID of the bill line.";
|
|
160
|
+
};
|
|
161
|
+
readonly type: {
|
|
162
|
+
readonly type: "string";
|
|
163
|
+
readonly enum: readonly ["manual"];
|
|
164
|
+
readonly description: "Discriminator: a literal, non-ticket line.";
|
|
165
|
+
};
|
|
166
|
+
readonly description: {
|
|
167
|
+
readonly type: "string";
|
|
168
|
+
readonly minLength: 1;
|
|
169
|
+
readonly description: "The literal customer-facing description.";
|
|
170
|
+
};
|
|
171
|
+
readonly amount: {
|
|
172
|
+
readonly type: "integer";
|
|
173
|
+
readonly description: string;
|
|
174
|
+
};
|
|
175
|
+
readonly propertyId: {
|
|
176
|
+
readonly type: readonly ["string", "null"];
|
|
177
|
+
readonly default: null;
|
|
178
|
+
readonly description: "The property the manual line is attributed to, when it concerns one.";
|
|
179
|
+
};
|
|
180
|
+
readonly categoryId: {
|
|
181
|
+
readonly type: readonly ["string", "null"];
|
|
182
|
+
readonly default: null;
|
|
183
|
+
readonly description: string;
|
|
184
|
+
};
|
|
185
|
+
readonly categoryName: {
|
|
186
|
+
readonly type: readonly ["string", "null"];
|
|
187
|
+
readonly default: null;
|
|
188
|
+
readonly description: "The category name snapshotted at mark-sent.";
|
|
189
|
+
};
|
|
190
|
+
readonly cost: {
|
|
191
|
+
readonly type: readonly ["integer", "null"];
|
|
192
|
+
readonly default: null;
|
|
193
|
+
readonly description: string;
|
|
194
|
+
};
|
|
195
|
+
readonly vendorId: {
|
|
196
|
+
readonly type: readonly ["string", "null"];
|
|
197
|
+
readonly default: null;
|
|
198
|
+
readonly description: string;
|
|
199
|
+
};
|
|
200
|
+
readonly vendorInvoice: {
|
|
201
|
+
readonly anyOf: readonly [{
|
|
202
|
+
readonly $ref: "mediaFile.json";
|
|
203
|
+
}, {
|
|
204
|
+
readonly type: "null";
|
|
205
|
+
}];
|
|
206
|
+
readonly default: null;
|
|
207
|
+
readonly description: string;
|
|
208
|
+
};
|
|
209
|
+
readonly vendorInvoiceNumber: {
|
|
210
|
+
readonly type: readonly ["string", "null"];
|
|
211
|
+
readonly default: null;
|
|
212
|
+
readonly description: "The vendor's own invoice number. Internal, redacted org-side.";
|
|
213
|
+
};
|
|
214
|
+
readonly taxable: {
|
|
215
|
+
readonly type: "boolean";
|
|
216
|
+
readonly default: false;
|
|
217
|
+
readonly description: string;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
}];
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
readonly sentAt: {
|
|
224
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
225
|
+
readonly description: "When the bill was marked sent. Absent until sent.";
|
|
226
|
+
};
|
|
227
|
+
readonly paidAt: {
|
|
228
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
229
|
+
readonly description: "When the bill was marked paid. Absent until paid.";
|
|
230
|
+
};
|
|
231
|
+
readonly voidedAt: {
|
|
232
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
233
|
+
readonly description: "When the bill was voided. Absent unless voided.";
|
|
234
|
+
};
|
|
235
|
+
readonly createdAt: {
|
|
236
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
237
|
+
};
|
|
238
|
+
readonly updatedAt: {
|
|
239
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
export type BillSchema = FromSchema<typeof billSchema, {
|
|
244
|
+
references: [typeof defs, typeof mediaFileSchema];
|
|
245
|
+
deserialize: [
|
|
246
|
+
{
|
|
247
|
+
pattern: {
|
|
248
|
+
format: "date-time";
|
|
249
|
+
};
|
|
250
|
+
output: Date | ISODateString;
|
|
251
|
+
}
|
|
252
|
+
];
|
|
253
|
+
}>;
|
|
254
|
+
/** One line on a bill: a cost line or a manual line. */
|
|
255
|
+
export type BillLine = NonNullable<BillSchema["lines"]>[number];
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
const billSchema = {
|
|
2
|
+
$schema: "http://json-schema.org/draft-07/schema",
|
|
3
|
+
$id: "bill.json",
|
|
4
|
+
title: "Bill",
|
|
5
|
+
description: "A OneBill bill, stored platform-wide and stamped with its organization: KFC staff assemble billed lines from the uninvoiced cost pool (plus manual lines) into a draft, then mark it sent to freeze and reveal it to the customer. Lifecycle draft → sent → paid, plus void. Customers see a bill in-app only once sent.",
|
|
6
|
+
type: "object",
|
|
7
|
+
required: [
|
|
8
|
+
"id",
|
|
9
|
+
"organizationId",
|
|
10
|
+
"status",
|
|
11
|
+
"currency",
|
|
12
|
+
"lines"
|
|
13
|
+
],
|
|
14
|
+
additionalProperties: false,
|
|
15
|
+
properties: {
|
|
16
|
+
id: { $ref: "definitions.json#/definitions/id" },
|
|
17
|
+
type: {
|
|
18
|
+
type: "string",
|
|
19
|
+
enum: ["bill"],
|
|
20
|
+
default: "bill"
|
|
21
|
+
},
|
|
22
|
+
organizationId: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "The organization the bill invoices. Bills live in one admin-database collection across every organization, so each carries its owner explicitly — stamped from the request context at creation, never client-supplied."
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
type: "string",
|
|
28
|
+
enum: [
|
|
29
|
+
"draft",
|
|
30
|
+
"sent",
|
|
31
|
+
"paid",
|
|
32
|
+
"void"
|
|
33
|
+
],
|
|
34
|
+
default: "draft",
|
|
35
|
+
description: "Lifecycle state. `sent` freezes customer-facing fields and reveals the bill to the org; `paid` records manual payment; `void` releases cost-entry claims and hides the bill from the org view. Drafts hard-delete rather than voiding."
|
|
36
|
+
},
|
|
37
|
+
invoiceNumber: {
|
|
38
|
+
type: ["string", "null"],
|
|
39
|
+
default: null,
|
|
40
|
+
description: "Kohost's own invoice number, `KB-<n>` from a single global sequence. System-assigned at mark-sent and never entered by hand: null while the bill is a draft, immutable once set. A wrong bill is corrected by void-and-reissue, so numbers gap and are never reused."
|
|
41
|
+
},
|
|
42
|
+
period: {
|
|
43
|
+
type: ["string", "null"],
|
|
44
|
+
default: null,
|
|
45
|
+
description: "Display-only month label (e.g. \"July 2026\"). A UI hint; the bill's membership is defined by its lines, not a calendar bucket."
|
|
46
|
+
},
|
|
47
|
+
currency: {
|
|
48
|
+
type: "string",
|
|
49
|
+
enum: ["USD"],
|
|
50
|
+
default: "USD",
|
|
51
|
+
description: "ISO 4217 currency code. USD only in v1."
|
|
52
|
+
},
|
|
53
|
+
fileId: {
|
|
54
|
+
type: ["string", "null"],
|
|
55
|
+
default: null,
|
|
56
|
+
description: "The generated bill PDF's media-file ID, minted atomically at mark-sent."
|
|
57
|
+
},
|
|
58
|
+
fileUrl: {
|
|
59
|
+
type: ["string", "null"],
|
|
60
|
+
default: null,
|
|
61
|
+
description: "The generated bill PDF's file-store URL, snapshotted at mark-sent alongside fileId. Held so the sent-bill surface and the sent notification email can mint a signed, unauthenticated download link without a file lookup. Unsigned on its own (a bare link 401s)."
|
|
62
|
+
},
|
|
63
|
+
memo: {
|
|
64
|
+
type: ["string", "null"],
|
|
65
|
+
default: null,
|
|
66
|
+
description: "Internal KFC-only note. Never customer-facing; editable in any state."
|
|
67
|
+
},
|
|
68
|
+
billingAddress: {
|
|
69
|
+
anyOf: [{ $ref: "definitions.json#/definitions/address" }, { type: "null" }],
|
|
70
|
+
default: null,
|
|
71
|
+
description: "The org billing address snapshotted at mark-sent. Null while drafting, when it live-reads from the Organization. Mark-sent requires a complete address (line1, city, state, postalCode)."
|
|
72
|
+
},
|
|
73
|
+
taxRate: {
|
|
74
|
+
type: ["number", "null"],
|
|
75
|
+
default: null,
|
|
76
|
+
minimum: 0,
|
|
77
|
+
description: "Tax rate as a plain float percent applied to the taxable line subtotal. While drafting, null means the platform default rate; the effective rate is snapshotted at mark-sent."
|
|
78
|
+
},
|
|
79
|
+
taxExempt: {
|
|
80
|
+
type: "boolean",
|
|
81
|
+
default: false,
|
|
82
|
+
description: "The organization's tax exemption snapshotted at mark-sent. While drafting it live-reads from the Organization."
|
|
83
|
+
},
|
|
84
|
+
shippingAmount: {
|
|
85
|
+
type: ["integer", "null"],
|
|
86
|
+
default: null,
|
|
87
|
+
minimum: 0,
|
|
88
|
+
description: "Shipping & handling in integer cents, added to the grand total on top of the line subtotal and tax. Null means none."
|
|
89
|
+
},
|
|
90
|
+
lines: {
|
|
91
|
+
type: "array",
|
|
92
|
+
default: [],
|
|
93
|
+
description: "The bill's lines: cost lines claimed from the uninvoiced pool and literal manual lines.",
|
|
94
|
+
items: { oneOf: [{
|
|
95
|
+
type: "object",
|
|
96
|
+
additionalProperties: false,
|
|
97
|
+
required: [
|
|
98
|
+
"id",
|
|
99
|
+
"type",
|
|
100
|
+
"ticketId",
|
|
101
|
+
"costId"
|
|
102
|
+
],
|
|
103
|
+
properties: {
|
|
104
|
+
id: {
|
|
105
|
+
type: "string",
|
|
106
|
+
description: "Server-minted ID of the bill line."
|
|
107
|
+
},
|
|
108
|
+
type: {
|
|
109
|
+
type: "string",
|
|
110
|
+
enum: ["cost"],
|
|
111
|
+
description: "Discriminator: a line drawn from a ticket cost entry."
|
|
112
|
+
},
|
|
113
|
+
ticketId: {
|
|
114
|
+
type: "string",
|
|
115
|
+
description: "The ID of the ticket the claimed cost entry lives on."
|
|
116
|
+
},
|
|
117
|
+
costId: {
|
|
118
|
+
type: "string",
|
|
119
|
+
description: "The ID of the claimed cost entry within the ticket."
|
|
120
|
+
},
|
|
121
|
+
categoryId: {
|
|
122
|
+
type: ["string", "null"],
|
|
123
|
+
default: null,
|
|
124
|
+
description: "The picked billing category, inherited from the claimed cost entry when the claim does not name one. Optional while drafting, required at mark-sent. Manual pick — never derived from the ticket's issue."
|
|
125
|
+
},
|
|
126
|
+
categoryName: {
|
|
127
|
+
type: ["string", "null"],
|
|
128
|
+
default: null,
|
|
129
|
+
description: "The category name snapshotted at mark-sent. Null while drafting, when it live-reads from the category library."
|
|
130
|
+
},
|
|
131
|
+
adjustedAmount: {
|
|
132
|
+
type: ["integer", "null"],
|
|
133
|
+
minimum: 0,
|
|
134
|
+
default: null,
|
|
135
|
+
description: "Optional draft-time override of the billed amount in integer cents, floored at zero, replacing the marked-up actual at display and snapshot. Requires `adjustmentReason`. A credit (below zero) is a manual line instead."
|
|
136
|
+
},
|
|
137
|
+
adjustmentReason: {
|
|
138
|
+
type: ["string", "null"],
|
|
139
|
+
default: null,
|
|
140
|
+
description: "Short required reason accompanying `adjustedAmount`, kept for the internal record."
|
|
141
|
+
},
|
|
142
|
+
amount: {
|
|
143
|
+
type: ["integer", "null"],
|
|
144
|
+
default: null,
|
|
145
|
+
description: "The billed amount in integer cents, snapshotted at mark-sent. Null while drafting, when it live-reads (marked-up actual or the adjustment) from the cost entry."
|
|
146
|
+
},
|
|
147
|
+
description: {
|
|
148
|
+
type: ["string", "null"],
|
|
149
|
+
default: null,
|
|
150
|
+
description: "The line description, snapshotted at mark-sent. Null while drafting, when it live-reads from the cost entry."
|
|
151
|
+
},
|
|
152
|
+
taxable: {
|
|
153
|
+
type: "boolean",
|
|
154
|
+
default: false,
|
|
155
|
+
description: "Whether the line's amount joins the bill's taxable subtotal. Customer-facing: locks at mark-sent."
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
type: "object",
|
|
160
|
+
additionalProperties: false,
|
|
161
|
+
required: [
|
|
162
|
+
"id",
|
|
163
|
+
"type",
|
|
164
|
+
"description",
|
|
165
|
+
"amount"
|
|
166
|
+
],
|
|
167
|
+
properties: {
|
|
168
|
+
id: {
|
|
169
|
+
type: "string",
|
|
170
|
+
description: "Server-minted ID of the bill line."
|
|
171
|
+
},
|
|
172
|
+
type: {
|
|
173
|
+
type: "string",
|
|
174
|
+
enum: ["manual"],
|
|
175
|
+
description: "Discriminator: a literal, non-ticket line."
|
|
176
|
+
},
|
|
177
|
+
description: {
|
|
178
|
+
type: "string",
|
|
179
|
+
minLength: 1,
|
|
180
|
+
description: "The literal customer-facing description."
|
|
181
|
+
},
|
|
182
|
+
amount: {
|
|
183
|
+
type: "integer",
|
|
184
|
+
description: "The billed amount in integer cents. May be negative, serving as a credit (reference the reason in the description)."
|
|
185
|
+
},
|
|
186
|
+
propertyId: {
|
|
187
|
+
type: ["string", "null"],
|
|
188
|
+
default: null,
|
|
189
|
+
description: "The property the manual line is attributed to, when it concerns one."
|
|
190
|
+
},
|
|
191
|
+
categoryId: {
|
|
192
|
+
type: ["string", "null"],
|
|
193
|
+
default: null,
|
|
194
|
+
description: "The picked billing category. Optional while drafting, required at mark-sent."
|
|
195
|
+
},
|
|
196
|
+
categoryName: {
|
|
197
|
+
type: ["string", "null"],
|
|
198
|
+
default: null,
|
|
199
|
+
description: "The category name snapshotted at mark-sent."
|
|
200
|
+
},
|
|
201
|
+
cost: {
|
|
202
|
+
type: ["integer", "null"],
|
|
203
|
+
default: null,
|
|
204
|
+
description: "Informational internal vendor cost in integer cents. Never derives the amount. Redacted org-side."
|
|
205
|
+
},
|
|
206
|
+
vendorId: {
|
|
207
|
+
type: ["string", "null"],
|
|
208
|
+
default: null,
|
|
209
|
+
description: "Optional reference to the org-scoped Vendor. Internal, redacted org-side."
|
|
210
|
+
},
|
|
211
|
+
vendorInvoice: {
|
|
212
|
+
anyOf: [{ $ref: "mediaFile.json" }, { type: "null" }],
|
|
213
|
+
default: null,
|
|
214
|
+
description: "The vendor's invoice file backing the line, mirroring the cost-entry field. Internal, redacted org-side."
|
|
215
|
+
},
|
|
216
|
+
vendorInvoiceNumber: {
|
|
217
|
+
type: ["string", "null"],
|
|
218
|
+
default: null,
|
|
219
|
+
description: "The vendor's own invoice number. Internal, redacted org-side."
|
|
220
|
+
},
|
|
221
|
+
taxable: {
|
|
222
|
+
type: "boolean",
|
|
223
|
+
default: false,
|
|
224
|
+
description: "Whether the line's amount joins the bill's taxable subtotal. Customer-facing: locks at mark-sent."
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}] }
|
|
228
|
+
},
|
|
229
|
+
sentAt: {
|
|
230
|
+
$ref: "definitions.json#/definitions/date",
|
|
231
|
+
description: "When the bill was marked sent. Absent until sent."
|
|
232
|
+
},
|
|
233
|
+
paidAt: {
|
|
234
|
+
$ref: "definitions.json#/definitions/date",
|
|
235
|
+
description: "When the bill was marked paid. Absent until paid."
|
|
236
|
+
},
|
|
237
|
+
voidedAt: {
|
|
238
|
+
$ref: "definitions.json#/definitions/date",
|
|
239
|
+
description: "When the bill was voided. Absent unless voided."
|
|
240
|
+
},
|
|
241
|
+
createdAt: { $ref: "definitions.json#/definitions/date" },
|
|
242
|
+
updatedAt: { $ref: "definitions.json#/definitions/date" }
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
//#endregion
|
|
246
|
+
export { billSchema };
|
|
247
|
+
|
|
248
|
+
//# sourceMappingURL=bill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bill.js","names":[],"sources":["../../.generated/schemas/bill.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\nimport { mediaFileSchema } from \"./mediaFile\";\n\n// One bill line is a discriminated union on `type`, so `lines.items` is their\n// `oneOf`. The two branches are disjoint via the `type` const plus\n// `additionalProperties: false`, so a line validates against exactly one.\n//\n// A cost line references a ticket cost entry by `(ticketId, costId)`. While the\n// bill is a draft it carries only the reference, the picked `categoryId`, and\n// any draft-time adjustment; the customer-facing `amount`, `description`, and\n// `categoryName` are live-read from the cost entry and snapshotted onto the\n// line at mark-sent. The billed amount is the marked-up actual (or the\n// `adjustedAmount` override, floored at zero) — vendor truth on the cost entry\n// is never touched.\nconst costLineSchema = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"type\", \"ticketId\", \"costId\"],\n properties: {\n id: {\n type: \"string\",\n description: \"Server-minted ID of the bill line.\",\n },\n type: {\n type: \"string\",\n enum: [\"cost\"],\n description: \"Discriminator: a line drawn from a ticket cost entry.\",\n },\n ticketId: {\n type: \"string\",\n description: \"The ID of the ticket the claimed cost entry lives on.\",\n },\n costId: {\n type: \"string\",\n description: \"The ID of the claimed cost entry within the ticket.\",\n },\n categoryId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The picked billing category, inherited from the claimed cost entry \" +\n \"when the claim does not name one. Optional while drafting, required \" +\n \"at mark-sent. Manual pick — never derived from the ticket's issue.\",\n },\n categoryName: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The category name snapshotted at mark-sent. Null while drafting, \" +\n \"when it live-reads from the category library.\",\n },\n adjustedAmount: {\n type: [\"integer\", \"null\"],\n minimum: 0,\n default: null,\n description:\n \"Optional draft-time override of the billed amount in integer cents, \" +\n \"floored at zero, replacing the marked-up actual at display and \" +\n \"snapshot. Requires `adjustmentReason`. A credit (below zero) is a \" +\n \"manual line instead.\",\n },\n adjustmentReason: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Short required reason accompanying `adjustedAmount`, kept for the \" +\n \"internal record.\",\n },\n amount: {\n type: [\"integer\", \"null\"],\n default: null,\n description:\n \"The billed amount in integer cents, snapshotted at mark-sent. Null \" +\n \"while drafting, when it live-reads (marked-up actual or the \" +\n \"adjustment) from the cost entry.\",\n },\n description: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The line description, snapshotted at mark-sent. Null while drafting, \" +\n \"when it live-reads from the cost entry.\",\n },\n taxable: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether the line's amount joins the bill's taxable subtotal. \" +\n \"Customer-facing: locks at mark-sent.\",\n },\n },\n} as const;\n\n// A manual line is a literal customer-facing row with no markup math: a\n// `description` and `amount` (which may be negative, serving as a credit) and\n// an optional `propertyId`. The independent internal fields — informational\n// `cost` (never derives the amount), `vendorId`, the vendor-invoice file, and\n// `vendorInvoiceNumber` — are redacted org-side via `canSeeCostSplit` and stay\n// editable in any bill state.\nconst manualLineSchema = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"type\", \"description\", \"amount\"],\n properties: {\n id: {\n type: \"string\",\n description: \"Server-minted ID of the bill line.\",\n },\n type: {\n type: \"string\",\n enum: [\"manual\"],\n description: \"Discriminator: a literal, non-ticket line.\",\n },\n description: {\n type: \"string\",\n minLength: 1,\n description: \"The literal customer-facing description.\",\n },\n amount: {\n type: \"integer\",\n description:\n \"The billed amount in integer cents. May be negative, serving as a \" +\n \"credit (reference the reason in the description).\",\n },\n propertyId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The property the manual line is attributed to, when it concerns one.\",\n },\n categoryId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The picked billing category. Optional while drafting, required at \" +\n \"mark-sent.\",\n },\n categoryName: {\n type: [\"string\", \"null\"],\n default: null,\n description: \"The category name snapshotted at mark-sent.\",\n },\n cost: {\n type: [\"integer\", \"null\"],\n default: null,\n description:\n \"Informational internal vendor cost in integer cents. Never derives \" +\n \"the amount. Redacted org-side.\",\n },\n vendorId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Optional reference to the org-scoped Vendor. Internal, redacted \" +\n \"org-side.\",\n },\n vendorInvoice: {\n anyOf: [{ $ref: \"mediaFile.json\" }, { type: \"null\" }],\n default: null,\n description:\n \"The vendor's invoice file backing the line, mirroring the cost-entry \" +\n \"field. Internal, redacted org-side.\",\n },\n vendorInvoiceNumber: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The vendor's own invoice number. Internal, redacted org-side.\",\n },\n taxable: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether the line's amount joins the bill's taxable subtotal. \" +\n \"Customer-facing: locks at mark-sent.\",\n },\n },\n} as const;\n\nexport const billSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"bill.json\",\n title: \"Bill\",\n description:\n \"A OneBill bill, stored platform-wide and stamped with its organization: \" +\n \"KFC staff assemble billed lines from the \" +\n \"uninvoiced cost pool (plus manual lines) into a draft, then mark it sent \" +\n \"to freeze and reveal it to the customer. Lifecycle draft → sent → paid, \" +\n \"plus void. Customers see a bill in-app only once sent.\",\n type: \"object\",\n required: [\"id\", \"organizationId\", \"status\", \"currency\", \"lines\"],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n type: {\n type: \"string\",\n enum: [\"bill\"],\n default: \"bill\",\n },\n organizationId: {\n type: \"string\",\n description:\n \"The organization the bill invoices. Bills live in one admin-database \" +\n \"collection across every organization, so each carries its owner \" +\n \"explicitly — stamped from the request context at creation, never \" +\n \"client-supplied.\",\n },\n status: {\n type: \"string\",\n enum: [\"draft\", \"sent\", \"paid\", \"void\"],\n default: \"draft\",\n description:\n \"Lifecycle state. `sent` freezes customer-facing fields and reveals \" +\n \"the bill to the org; `paid` records manual payment; `void` releases \" +\n \"cost-entry claims and hides the bill from the org view. Drafts \" +\n \"hard-delete rather than voiding.\",\n },\n invoiceNumber: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Kohost's own invoice number, `KB-<n>` from a single global sequence. \" +\n \"System-assigned at mark-sent and never entered by hand: null while \" +\n \"the bill is a draft, immutable once set. A wrong bill is corrected \" +\n \"by void-and-reissue, so numbers gap and are never reused.\",\n },\n period: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n 'Display-only month label (e.g. \"July 2026\"). A UI hint; the bill\\'s ' +\n \"membership is defined by its lines, not a calendar bucket.\",\n },\n currency: {\n type: \"string\",\n enum: [\"USD\"],\n default: \"USD\",\n description: \"ISO 4217 currency code. USD only in v1.\",\n },\n fileId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The generated bill PDF's media-file ID, minted atomically at \" +\n \"mark-sent.\",\n },\n fileUrl: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The generated bill PDF's file-store URL, snapshotted at mark-sent \" +\n \"alongside fileId. Held so the sent-bill surface and the sent \" +\n \"notification email can mint a signed, unauthenticated download link \" +\n \"without a file lookup. Unsigned on its own (a bare link 401s).\",\n },\n memo: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Internal KFC-only note. Never customer-facing; editable in any state.\",\n },\n billingAddress: {\n anyOf: [\n { $ref: \"definitions.json#/definitions/address\" },\n { type: \"null\" },\n ],\n default: null,\n description:\n \"The org billing address snapshotted at mark-sent. Null while \" +\n \"drafting, when it live-reads from the Organization. Mark-sent \" +\n \"requires a complete address (line1, city, state, postalCode).\",\n },\n taxRate: {\n type: [\"number\", \"null\"],\n default: null,\n minimum: 0,\n description:\n \"Tax rate as a plain float percent applied to the taxable line \" +\n \"subtotal. While drafting, null means the platform default rate; the \" +\n \"effective rate is snapshotted at mark-sent.\",\n },\n taxExempt: {\n type: \"boolean\",\n default: false,\n description:\n \"The organization's tax exemption snapshotted at mark-sent. While \" +\n \"drafting it live-reads from the Organization.\",\n },\n shippingAmount: {\n type: [\"integer\", \"null\"],\n default: null,\n minimum: 0,\n description:\n \"Shipping & handling in integer cents, added to the grand total on \" +\n \"top of the line subtotal and tax. Null means none.\",\n },\n lines: {\n type: \"array\",\n default: [],\n description:\n \"The bill's lines: cost lines claimed from the uninvoiced pool and \" +\n \"literal manual lines.\",\n items: {\n oneOf: [costLineSchema, manualLineSchema],\n },\n },\n sentAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the bill was marked sent. Absent until sent.\",\n },\n paidAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the bill was marked paid. Absent until paid.\",\n },\n voidedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the bill was voided. Absent unless voided.\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n },\n} as const;\n\nexport type BillSchema = FromSchema<\n typeof billSchema,\n {\n references: [typeof defs, typeof mediaFileSchema];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n\n/** One line on a bill: a cost line or a manual line. */\nexport type BillLine = NonNullable<BillSchema[\"lines\"]>[number];\n"],"mappings":"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"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import defs, { ISODateString } from "./definitions.js";
|
|
2
|
+
import type { FromSchema } from "json-schema-to-ts";
|
|
3
|
+
export declare const billingCategorySchema: {
|
|
4
|
+
readonly $schema: "http://json-schema.org/draft-07/schema";
|
|
5
|
+
readonly $id: "billingCategory.json";
|
|
6
|
+
readonly title: "Billing Category";
|
|
7
|
+
readonly description: "A label in the global, KFC-maintained billing category library, picked per bill line while drafting (e.g. \"HVAC System Maintenance/Repair\"). Named distinctly from the generic `category` schema (space/product/media discriminators). Archived, never deleted.";
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly required: readonly ["id", "name"];
|
|
10
|
+
readonly additionalProperties: false;
|
|
11
|
+
readonly properties: {
|
|
12
|
+
readonly id: {
|
|
13
|
+
readonly $ref: "definitions.json#/definitions/id";
|
|
14
|
+
readonly description: "Unique identifier for the Billing Category.";
|
|
15
|
+
};
|
|
16
|
+
readonly name: {
|
|
17
|
+
readonly type: "string";
|
|
18
|
+
readonly minLength: 1;
|
|
19
|
+
readonly description: "Display name shown in the drafting picker and on bill lines/PDFs. Renames apply to drafts; sent bills keep their snapshotted name.";
|
|
20
|
+
};
|
|
21
|
+
readonly archived: {
|
|
22
|
+
readonly type: "boolean";
|
|
23
|
+
readonly default: false;
|
|
24
|
+
readonly description: "Archived categories leave the drafting picker but a draft line already holding one stays valid at send. Archive instead of delete: a category may be referenced by sent bills forever.";
|
|
25
|
+
};
|
|
26
|
+
readonly createdAt: {
|
|
27
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
28
|
+
readonly description: "When the Billing Category was created.";
|
|
29
|
+
};
|
|
30
|
+
readonly updatedAt: {
|
|
31
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
32
|
+
readonly description: "When the Billing Category was last modified.";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export type BillingCategorySchema = FromSchema<typeof billingCategorySchema, {
|
|
37
|
+
references: [typeof defs];
|
|
38
|
+
deserialize: [
|
|
39
|
+
{
|
|
40
|
+
pattern: {
|
|
41
|
+
format: "date-time";
|
|
42
|
+
};
|
|
43
|
+
output: Date | ISODateString;
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
}>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region .generated/schemas/billingCategory.ts
|
|
2
|
+
const billingCategorySchema = {
|
|
3
|
+
$schema: "http://json-schema.org/draft-07/schema",
|
|
4
|
+
$id: "billingCategory.json",
|
|
5
|
+
title: "Billing Category",
|
|
6
|
+
description: "A label in the global, KFC-maintained billing category library, picked per bill line while drafting (e.g. \"HVAC System Maintenance/Repair\"). Named distinctly from the generic `category` schema (space/product/media discriminators). Archived, never deleted.",
|
|
7
|
+
type: "object",
|
|
8
|
+
required: ["id", "name"],
|
|
9
|
+
additionalProperties: false,
|
|
10
|
+
properties: {
|
|
11
|
+
id: {
|
|
12
|
+
$ref: "definitions.json#/definitions/id",
|
|
13
|
+
description: "Unique identifier for the Billing Category."
|
|
14
|
+
},
|
|
15
|
+
name: {
|
|
16
|
+
type: "string",
|
|
17
|
+
minLength: 1,
|
|
18
|
+
description: "Display name shown in the drafting picker and on bill lines/PDFs. Renames apply to drafts; sent bills keep their snapshotted name."
|
|
19
|
+
},
|
|
20
|
+
archived: {
|
|
21
|
+
type: "boolean",
|
|
22
|
+
default: false,
|
|
23
|
+
description: "Archived categories leave the drafting picker but a draft line already holding one stays valid at send. Archive instead of delete: a category may be referenced by sent bills forever."
|
|
24
|
+
},
|
|
25
|
+
createdAt: {
|
|
26
|
+
$ref: "definitions.json#/definitions/date",
|
|
27
|
+
description: "When the Billing Category was created."
|
|
28
|
+
},
|
|
29
|
+
updatedAt: {
|
|
30
|
+
$ref: "definitions.json#/definitions/date",
|
|
31
|
+
description: "When the Billing Category was last modified."
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { billingCategorySchema };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=billingCategory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billingCategory.js","names":[],"sources":["../../.generated/schemas/billingCategory.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\nexport const billingCategorySchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"billingCategory.json\",\n title: \"Billing Category\",\n description:\n \"A label in the global, KFC-maintained billing category library, picked per bill line while drafting (e.g. \\\"HVAC System Maintenance/Repair\\\"). Named distinctly from the generic `category` schema (space/product/media discriminators). Archived, never deleted.\",\n type: \"object\",\n required: [\"id\", \"name\"],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n description: \"Unique identifier for the Billing Category.\",\n },\n name: {\n type: \"string\",\n minLength: 1,\n description:\n \"Display name shown in the drafting picker and on bill lines/PDFs. Renames apply to drafts; sent bills keep their snapshotted name.\",\n },\n archived: {\n type: \"boolean\",\n default: false,\n description:\n \"Archived categories leave the drafting picker but a draft line already holding one stays valid at send. Archive instead of delete: a category may be referenced by sent bills forever.\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the Billing Category was created.\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the Billing Category was last modified.\",\n },\n },\n} as const;\n\nexport type BillingCategorySchema = FromSchema<\n typeof billingCategorySchema,\n {\n references: [typeof defs];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n"],"mappings":";AAGA,MAAa,wBAAwB;CACnC,SAAS;CACT,KAAK;CACL,OAAO;CACP,aACE;CACF,MAAM;CACN,UAAU,CAAC,MAAM,MAAM;CACvB,sBAAsB;CACtB,YAAY;EACV,IAAI;GACF,MAAM;GACN,aAAa;EACf;EACA,MAAM;GACJ,MAAM;GACN,WAAW;GACX,aACE;EACJ;EACA,UAAU;GACR,MAAM;GACN,SAAS;GACT,aACE;EACJ;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;EACA,WAAW;GACT,MAAM;GACN,aAAa;EACf;CACF;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const TICKET_NOTIFICATION_EVENTS: readonly ["ticketCreated", "ticketAssignedToMe", "addedAsCollaborator", "mentionedInTicket", "messageOnMyTicket", "ticketResolved", "ticketCreatedAsObserver", "messageAsObserver", "ticketResolvedAsObserver"];
|
|
1
|
+
export declare const TICKET_NOTIFICATION_EVENTS: readonly ["ticketCreated", "ticketAssignedToMe", "addedAsCollaborator", "mentionedInTicket", "messageOnMyTicket", "ticketResolved", "ticketCreatedAsObserver", "messageAsObserver", "ticketResolvedAsObserver", "approvalRequested", "approvalDecided"];
|
|
2
2
|
export type TicketNotificationEvent = (typeof TICKET_NOTIFICATION_EVENTS)[number];
|
|
3
3
|
export declare const NOTIFICATION_CHANNELS: readonly ["email", "sms", "push"];
|
|
4
4
|
export type NotificationChannel = (typeof NOTIFICATION_CHANNELS)[number];
|
|
@@ -79,7 +79,7 @@ declare const defs: {
|
|
|
79
79
|
readonly driver: {
|
|
80
80
|
readonly type: "string";
|
|
81
81
|
readonly description: "Driver used to communicate with the object.";
|
|
82
|
-
readonly enum: readonly ["adlink", "avigilon-alta", "aws-kinesis", "bacnet", "benq", "butler", "comelit", "cool-automation", "crestron", "dell", "digital-watchdog", "distech", "dmp", "doorbird", "dormakaba", "dsc", "dsc-itv2", "earbridge", "ecobee", "epson", "geovision-rs", "geovision-as-manager", "honeywell-vista", "honeywell-resideo", "igor", "inncom", "isapi", "kohost-k7", "kohost", "lapi", "lg", "lg-webos", "linortek", "lirc", "mews", "mht", "mobile-mule", "mock", "modbus", "napco", "newline", "obix", "one-roster", "onvif", "orchid-fusion", "paxton", "pdk", "pelican-wireless", "power-shades", "rachio", "rebrandly", "relay", "reolink", "rtsp", "salto", "salto-irn", "samsung", "se", "sendgrid", "singlewire", "smartboard", "sonifi", "stay-n-touch", "storable", "twilio", "unifi", "valcom", "veracross", "verkada", "vivotek", "vizio", "wisenet", "zkteco", "cloudflare-images", "cloudflare-stream", "insperia-privacy"];
|
|
82
|
+
readonly enum: readonly ["adlink", "apex-american-audio", "avigilon-alta", "aws-kinesis", "bacnet", "benq", "butler", "comelit", "cool-automation", "crestron", "dell", "digital-watchdog", "distech", "dmp", "doorbird", "dormakaba", "dsc", "dsc-itv2", "earbridge", "ecobee", "epson", "geovision-rs", "geovision-as-manager", "honeywell-vista", "honeywell-resideo", "igor", "inncom", "isapi", "kohost-k7", "kohost", "lapi", "lg", "lg-webos", "linortek", "lirc", "mews", "mht", "mobile-mule", "mock", "modbus", "napco", "newline", "obix", "one-roster", "onvif", "orchid-fusion", "paxton", "pdk", "pelican-wireless", "power-shades", "rachio", "rebrandly", "relay", "reolink", "rtsp", "salto", "salto-irn", "samsung", "se", "sendgrid", "singlewire", "smartboard", "sonifi", "stay-n-touch", "storable", "twilio", "unifi", "valcom", "veracross", "verkada", "vivotek", "vizio", "wisenet", "zkteco", "cloudflare-images", "cloudflare-stream", "insperia-privacy"];
|
|
83
83
|
};
|
|
84
84
|
readonly type: {
|
|
85
85
|
readonly type: "string";
|
|
@@ -171,7 +171,7 @@ declare const defs: {
|
|
|
171
171
|
};
|
|
172
172
|
readonly ticketNotificationEvent: {
|
|
173
173
|
readonly type: "string";
|
|
174
|
-
readonly enum: readonly ["ticketCreated", "ticketAssignedToMe", "addedAsCollaborator", "mentionedInTicket", "messageOnMyTicket", "ticketResolved", "ticketCreatedAsObserver", "messageAsObserver", "ticketResolvedAsObserver"];
|
|
174
|
+
readonly enum: readonly ["ticketCreated", "ticketAssignedToMe", "addedAsCollaborator", "mentionedInTicket", "messageOnMyTicket", "ticketResolved", "ticketCreatedAsObserver", "messageAsObserver", "ticketResolvedAsObserver", "approvalRequested", "approvalDecided"];
|
|
175
175
|
};
|
|
176
176
|
readonly notificationChannel: {
|
|
177
177
|
readonly type: "string";
|