@nuwah/vertical-sdk 0.0.0-stage → 0.2.0-rc.1
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/LICENSE +17 -0
- package/README.md +229 -2
- package/bin/nuwah-contract-check-rules.d.mts +41 -0
- package/bin/nuwah-contract-check-rules.mjs +333 -0
- package/bin/nuwah-contract-check.mjs +64 -0
- package/dist/accounting.d.ts +1417 -0
- package/dist/accounting.js +274 -0
- package/dist/active-org.d.ts +13 -0
- package/dist/active-org.js +59 -0
- package/dist/actors.d.ts +448 -0
- package/dist/actors.js +143 -0
- package/dist/ai.d.ts +359 -0
- package/dist/ai.js +229 -0
- package/dist/analytics.d.ts +37 -0
- package/dist/analytics.js +8 -0
- package/dist/atlas.d.ts +291 -0
- package/dist/atlas.js +78 -0
- package/dist/audit.d.ts +193 -0
- package/dist/audit.js +26 -0
- package/dist/authentication.d.ts +119 -0
- package/dist/authentication.js +83 -0
- package/dist/awards.d.ts +38 -0
- package/dist/awards.js +10 -0
- package/dist/blueprint/document.d.ts +178 -0
- package/dist/blueprint/document.js +17 -0
- package/dist/blueprint/index.d.ts +3 -0
- package/dist/blueprint/index.js +5 -0
- package/dist/blueprint/manifest.d.ts +105 -0
- package/dist/blueprint/manifest.js +11 -0
- package/dist/blueprint/validate.d.ts +14 -0
- package/dist/blueprint/validate.js +416 -0
- package/dist/bookings-directory.d.ts +118 -0
- package/dist/bookings-directory.js +289 -0
- package/dist/bookings-extra.d.ts +1448 -0
- package/dist/bookings-extra.js +582 -0
- package/dist/bookings.d.ts +1365 -0
- package/dist/bookings.js +305 -0
- package/dist/builder-code.d.ts +164 -0
- package/dist/builder-code.js +12 -0
- package/dist/builder-core-gaps.d.ts +83 -0
- package/dist/builder-core-gaps.js +8 -0
- package/dist/builder-repos.d.ts +73 -0
- package/dist/builder-repos.js +37 -0
- package/dist/builder.d.ts +730 -0
- package/dist/builder.js +105 -0
- package/dist/campaigns.d.ts +105 -0
- package/dist/campaigns.js +25 -0
- package/dist/catalogs.d.ts +188 -0
- package/dist/catalogs.js +36 -0
- package/dist/commerce-ai.d.ts +182 -0
- package/dist/commerce-ai.js +27 -0
- package/dist/connections.d.ts +278 -0
- package/dist/connections.js +96 -0
- package/dist/content-control.d.ts +121 -0
- package/dist/content-control.js +23 -0
- package/dist/contributions.d.ts +560 -0
- package/dist/contributions.js +140 -0
- package/dist/conversation-assist.d.ts +154 -0
- package/dist/conversation-assist.js +51 -0
- package/dist/conversation-info.d.ts +219 -0
- package/dist/conversation-info.js +43 -0
- package/dist/crm.d.ts +533 -0
- package/dist/crm.js +142 -0
- package/dist/dashboards.d.ts +119 -0
- package/dist/dashboards.js +22 -0
- package/dist/delegations.d.ts +161 -0
- package/dist/delegations.js +39 -0
- package/dist/docs.d.ts +289 -0
- package/dist/docs.js +49 -0
- package/dist/documents.d.ts +317 -0
- package/dist/documents.js +84 -0
- package/dist/drafts.d.ts +132 -0
- package/dist/drafts.js +56 -0
- package/dist/engagements.d.ts +133 -0
- package/dist/engagements.js +15 -0
- package/dist/event-stream.d.ts +54 -0
- package/dist/event-stream.js +228 -0
- package/dist/exchanges.d.ts +447 -0
- package/dist/exchanges.js +145 -0
- package/dist/exports.d.ts +113 -0
- package/dist/exports.js +81 -0
- package/dist/feeds.d.ts +228 -0
- package/dist/feeds.js +52 -0
- package/dist/files.d.ts +56 -0
- package/dist/files.js +55 -0
- package/dist/finance-insights.d.ts +41 -0
- package/dist/finance-insights.js +61 -0
- package/dist/fixed-assets.d.ts +155 -0
- package/dist/fixed-assets.js +28 -0
- package/dist/fulfilment-jobs.d.ts +405 -0
- package/dist/fulfilment-jobs.js +76 -0
- package/dist/fulfilment.d.ts +205 -0
- package/dist/fulfilment.js +39 -0
- package/dist/hr.d.ts +350 -0
- package/dist/hr.js +94 -0
- package/dist/http.d.ts +124 -0
- package/dist/http.js +392 -0
- package/dist/inbox.d.ts +206 -0
- package/dist/inbox.js +36 -0
- package/dist/index.d.ts +384 -0
- package/dist/index.js +294 -0
- package/dist/insights.d.ts +176 -0
- package/dist/insights.js +52 -0
- package/dist/inventory.d.ts +797 -0
- package/dist/inventory.js +120 -0
- package/dist/list-query.d.ts +211 -0
- package/dist/list-query.js +158 -0
- package/dist/listings.d.ts +381 -0
- package/dist/listings.js +173 -0
- package/dist/location-sharing.d.ts +83 -0
- package/dist/location-sharing.js +20 -0
- package/dist/marketplace.d.ts +268 -0
- package/dist/marketplace.js +59 -0
- package/dist/matching.d.ts +103 -0
- package/dist/matching.js +22 -0
- package/dist/media.d.ts +221 -0
- package/dist/media.js +239 -0
- package/dist/metrics.d.ts +125 -0
- package/dist/metrics.js +45 -0
- package/dist/moderation.d.ts +240 -0
- package/dist/moderation.js +40 -0
- package/dist/money.d.ts +41 -0
- package/dist/money.js +79 -0
- package/dist/my-data.d.ts +266 -0
- package/dist/my-data.js +32 -0
- package/dist/names.d.ts +14 -0
- package/dist/names.js +17 -0
- package/dist/occasions.d.ts +256 -0
- package/dist/occasions.js +40 -0
- package/dist/onboarding.d.ts +88 -0
- package/dist/onboarding.js +38 -0
- package/dist/pagination.d.ts +204 -0
- package/dist/pagination.js +141 -0
- package/dist/party-baseline-attributes.d.ts +245 -0
- package/dist/party-baseline-attributes.js +36 -0
- package/dist/party.d.ts +401 -0
- package/dist/party.js +56 -0
- package/dist/patient.d.ts +161 -0
- package/dist/patient.js +45 -0
- package/dist/payroll.d.ts +378 -0
- package/dist/payroll.js +60 -0
- package/dist/person-addresses.d.ts +88 -0
- package/dist/person-addresses.js +18 -0
- package/dist/person-cart.d.ts +250 -0
- package/dist/person-cart.js +63 -0
- package/dist/person-chat-assist.d.ts +47 -0
- package/dist/person-chat-assist.js +13 -0
- package/dist/person-data-webhooks.d.ts +72 -0
- package/dist/person-data-webhooks.js +86 -0
- package/dist/person-data.d.ts +212 -0
- package/dist/person-data.js +162 -0
- package/dist/person-locations.d.ts +54 -0
- package/dist/person-locations.js +6 -0
- package/dist/person-messaging.d.ts +405 -0
- package/dist/person-messaging.js +112 -0
- package/dist/person-notifications.d.ts +319 -0
- package/dist/person-notifications.js +164 -0
- package/dist/personalisation.d.ts +21 -0
- package/dist/personalisation.js +8 -0
- package/dist/platform.d.ts +63 -0
- package/dist/platform.js +45 -0
- package/dist/portfolio.d.ts +163 -0
- package/dist/portfolio.js +28 -0
- package/dist/pos.d.ts +743 -0
- package/dist/pos.js +129 -0
- package/dist/procurement.d.ts +664 -0
- package/dist/procurement.js +157 -0
- package/dist/promotions.d.ts +169 -0
- package/dist/promotions.js +39 -0
- package/dist/publications.d.ts +583 -0
- package/dist/publications.js +164 -0
- package/dist/ranking.d.ts +43 -0
- package/dist/ranking.js +34 -0
- package/dist/ratings.d.ts +293 -0
- package/dist/ratings.js +109 -0
- package/dist/reactions.d.ts +123 -0
- package/dist/reactions.js +41 -0
- package/dist/recipient-orders.d.ts +294 -0
- package/dist/recipient-orders.js +73 -0
- package/dist/relationships.d.ts +18 -0
- package/dist/relationships.js +8 -0
- package/dist/reporting.d.ts +107 -0
- package/dist/reporting.js +56 -0
- package/dist/sales.d.ts +270 -0
- package/dist/sales.js +66 -0
- package/dist/shares.d.ts +105 -0
- package/dist/shares.js +27 -0
- package/dist/shop.d.ts +993 -0
- package/dist/shop.js +215 -0
- package/dist/shopping-assistant.d.ts +65 -0
- package/dist/shopping-assistant.js +14 -0
- package/dist/spaces.d.ts +422 -0
- package/dist/spaces.js +118 -0
- package/dist/stored-value.d.ts +754 -0
- package/dist/stored-value.js +177 -0
- package/dist/types.d.ts +83 -0
- package/dist/types.js +2 -0
- package/dist/vault.d.ts +290 -0
- package/dist/vault.js +55 -0
- package/dist/vertical-runtime.d.ts +17 -0
- package/dist/vertical-runtime.js +8 -0
- package/dist/vite/build-manifest-plugin.d.ts +42 -0
- package/dist/vite/build-manifest-plugin.js +42 -0
- package/dist/vite/first-paint-plugin.d.ts +26 -0
- package/dist/vite/first-paint-plugin.js +57 -0
- package/dist/wishlists.d.ts +591 -0
- package/dist/wishlists.js +188 -0
- package/dist/workbench.d.ts +114 -0
- package/dist/workbench.js +22 -0
- package/dist/workspace.d.ts +190 -0
- package/dist/workspace.js +41 -0
- package/package.json +52 -4
- package/templates/extension-image.Dockerfile +38 -0
- package/templates/nuwah-vertical.yml +102 -0
- package/templates/vertical-app/.env.example +34 -0
- package/templates/vertical-app/README.md +108 -0
- package/templates/vertical-app/github/workflows/ci.yml +51 -0
- package/templates/vertical-app/gitignore +5 -0
- package/templates/vertical-app/index.html +12 -0
- package/templates/vertical-app/package.json +28 -0
- package/templates/vertical-app/src/App.tsx +64 -0
- package/templates/vertical-app/src/blueprint/blueprint.ts +45 -0
- package/templates/vertical-app/src/blueprint/screens.ts +15 -0
- package/templates/vertical-app/src/env.d.ts +18 -0
- package/templates/vertical-app/src/index.css +139 -0
- package/templates/vertical-app/src/lib/i18n.ts +5 -0
- package/templates/vertical-app/src/lib/iam.ts +19 -0
- package/templates/vertical-app/src/lib/operations.ts +93 -0
- package/templates/vertical-app/src/lib/router.ts +24 -0
- package/templates/vertical-app/src/lib/sdk.ts +21 -0
- package/templates/vertical-app/src/lib/theme.ts +18 -0
- package/templates/vertical-app/src/lib/words.ts +39 -0
- package/templates/vertical-app/src/main.tsx +25 -0
- package/templates/vertical-app/src/pages/AppScreens.tsx +71 -0
- package/templates/vertical-app/src/pages/AuthCallback.tsx +44 -0
- package/templates/vertical-app/src/pages/Home.tsx +36 -0
- package/templates/vertical-app/tsconfig.json +24 -0
- package/templates/vertical-app/vite.config.ts +23 -0
- package/templates/vertical-ci.yml +192 -0
|
@@ -0,0 +1,664 @@
|
|
|
1
|
+
import type { Http } from './http.js';
|
|
2
|
+
import type { ListQuery, Paginated } from './types.js';
|
|
3
|
+
export interface Vendor {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
code: string;
|
|
7
|
+
email: string | null;
|
|
8
|
+
phone: string | null;
|
|
9
|
+
tax_id: string | null;
|
|
10
|
+
payment_terms_days: number;
|
|
11
|
+
bank_iban: string | null;
|
|
12
|
+
currency_code: string | null;
|
|
13
|
+
is_active: boolean;
|
|
14
|
+
notes: string | null;
|
|
15
|
+
created_at: string | null;
|
|
16
|
+
updated_at: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface CreateVendorInput {
|
|
19
|
+
name: string;
|
|
20
|
+
code: string;
|
|
21
|
+
email?: string | null;
|
|
22
|
+
phone?: string | null;
|
|
23
|
+
tax_id?: string | null;
|
|
24
|
+
payment_terms_days?: number | null;
|
|
25
|
+
bank_iban?: string | null;
|
|
26
|
+
currency_code?: string | null;
|
|
27
|
+
is_active?: boolean | null;
|
|
28
|
+
notes?: string | null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Body for `PUT /vendors/{id}`. Unlike create, `name`/`code`/`payment_terms_days`/`is_active`
|
|
32
|
+
* are `sometimes` but NOT nullable on update (UpdateVendorRequest) — omit to keep, never null.
|
|
33
|
+
*/
|
|
34
|
+
export interface UpdateVendorInput {
|
|
35
|
+
name?: string;
|
|
36
|
+
code?: string;
|
|
37
|
+
email?: string | null;
|
|
38
|
+
phone?: string | null;
|
|
39
|
+
tax_id?: string | null;
|
|
40
|
+
payment_terms_days?: number;
|
|
41
|
+
bank_iban?: string | null;
|
|
42
|
+
currency_code?: string | null;
|
|
43
|
+
is_active?: boolean;
|
|
44
|
+
notes?: string | null;
|
|
45
|
+
}
|
|
46
|
+
export interface VendorListQuery extends ListQuery {
|
|
47
|
+
is_active?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface PurchaseOrderLine {
|
|
50
|
+
id: string;
|
|
51
|
+
purchase_order_id: string;
|
|
52
|
+
item_id: string | null;
|
|
53
|
+
item_sku: string | null;
|
|
54
|
+
description: string;
|
|
55
|
+
quantity: string;
|
|
56
|
+
unit_price: string;
|
|
57
|
+
tax_rate_percent: string;
|
|
58
|
+
discount: string;
|
|
59
|
+
line_subtotal: string;
|
|
60
|
+
line_tax: string;
|
|
61
|
+
line_total: string;
|
|
62
|
+
received_qty: string;
|
|
63
|
+
billed_qty: string;
|
|
64
|
+
sort: number;
|
|
65
|
+
/** Present on the single-order read: the line's item must be received with an expiry date. */
|
|
66
|
+
item_is_expiry_tracked?: boolean;
|
|
67
|
+
/** Present on the single-order read: receiving the line creates a batch (cost layer). */
|
|
68
|
+
item_tracks_batch?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface PurchaseOrder {
|
|
71
|
+
id: string;
|
|
72
|
+
po_number: string;
|
|
73
|
+
vendor_id: string;
|
|
74
|
+
warehouse_id: string | null;
|
|
75
|
+
status: string;
|
|
76
|
+
currency_code: string;
|
|
77
|
+
subtotal: string;
|
|
78
|
+
tax_total: string;
|
|
79
|
+
discount_total: string;
|
|
80
|
+
total: string;
|
|
81
|
+
accounting_bill_id: string | null;
|
|
82
|
+
accounting_bill_number: string | null;
|
|
83
|
+
expected_date: string | null;
|
|
84
|
+
notes: string | null;
|
|
85
|
+
created_by_person_id: string | null;
|
|
86
|
+
order_type?: PurchaseOrderType;
|
|
87
|
+
payment_method?: PurchaseOrderPaymentMethod | null;
|
|
88
|
+
approved_at?: string | null;
|
|
89
|
+
lines?: PurchaseOrderLine[];
|
|
90
|
+
created_at: string | null;
|
|
91
|
+
updated_at: string | null;
|
|
92
|
+
}
|
|
93
|
+
export type PurchaseOrderType = 'standard' | 'quick_buy' | 'tender';
|
|
94
|
+
export type PurchaseOrderPaymentMethod = 'cash' | 'credit_account' | 'bank_transfer' | 'cheque';
|
|
95
|
+
export interface PurchaseOrderLineInput {
|
|
96
|
+
item_id?: string | null;
|
|
97
|
+
item_sku?: string | null;
|
|
98
|
+
description: string;
|
|
99
|
+
quantity: number | string;
|
|
100
|
+
unit_price: number | string;
|
|
101
|
+
tax_rate_percent?: number | string | null;
|
|
102
|
+
discount?: number | string | null;
|
|
103
|
+
sort?: number | null;
|
|
104
|
+
/** Cost centre the line is charged to. */
|
|
105
|
+
cost_center_id?: string | null;
|
|
106
|
+
}
|
|
107
|
+
export interface CreatePurchaseOrderInput {
|
|
108
|
+
vendor_id: string;
|
|
109
|
+
warehouse_id?: string | null;
|
|
110
|
+
currency_code: string;
|
|
111
|
+
expected_date?: string | null;
|
|
112
|
+
notes?: string | null;
|
|
113
|
+
created_by_person_id?: string | null;
|
|
114
|
+
order_type?: PurchaseOrderType;
|
|
115
|
+
payment_method?: PurchaseOrderPaymentMethod | null;
|
|
116
|
+
lines?: PurchaseOrderLineInput[];
|
|
117
|
+
}
|
|
118
|
+
export interface UpdatePurchaseOrderInput {
|
|
119
|
+
vendor_id?: string;
|
|
120
|
+
warehouse_id?: string | null;
|
|
121
|
+
currency_code?: string;
|
|
122
|
+
expected_date?: string | null;
|
|
123
|
+
notes?: string | null;
|
|
124
|
+
order_type?: PurchaseOrderType;
|
|
125
|
+
payment_method?: PurchaseOrderPaymentMethod | null;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Body for `PUT /orders/{id}/lines/{line}`. Every key is `sometimes`; only the item
|
|
129
|
+
* references and cost centre are nullable (UpdatePurchaseOrderLineRequest) — a null
|
|
130
|
+
* tax/discount/sort is a 422, so send `0` to clear.
|
|
131
|
+
*/
|
|
132
|
+
export interface UpdatePurchaseOrderLineInput {
|
|
133
|
+
item_id?: string | null;
|
|
134
|
+
item_sku?: string | null;
|
|
135
|
+
description?: string;
|
|
136
|
+
quantity?: number | string;
|
|
137
|
+
unit_price?: number | string;
|
|
138
|
+
tax_rate_percent?: number | string;
|
|
139
|
+
discount?: number | string;
|
|
140
|
+
sort?: number;
|
|
141
|
+
cost_center_id?: string | null;
|
|
142
|
+
}
|
|
143
|
+
export interface PurchaseOrderListQuery extends ListQuery {
|
|
144
|
+
status?: string;
|
|
145
|
+
vendor_id?: string;
|
|
146
|
+
}
|
|
147
|
+
export interface GoodsReceiptLine {
|
|
148
|
+
id: string;
|
|
149
|
+
goods_receipt_id: string;
|
|
150
|
+
purchase_order_line_id: string;
|
|
151
|
+
item_id: string | null;
|
|
152
|
+
quantity: string;
|
|
153
|
+
unit_cost: string;
|
|
154
|
+
stock_movement_id: string | null;
|
|
155
|
+
batch_number?: string | null;
|
|
156
|
+
expiry_date?: string | null;
|
|
157
|
+
/** Weight of ONE received unit, as a decimal string. */
|
|
158
|
+
unit_weight_kilograms?: string | null;
|
|
159
|
+
/** Volume of ONE received unit, as a decimal string. */
|
|
160
|
+
unit_volume_cubic_meters?: string | null;
|
|
161
|
+
}
|
|
162
|
+
export interface GoodsReceipt {
|
|
163
|
+
id: string;
|
|
164
|
+
purchase_order_id: string;
|
|
165
|
+
receipt_number: string;
|
|
166
|
+
warehouse_id: string | null;
|
|
167
|
+
status: string;
|
|
168
|
+
received_at: string | null;
|
|
169
|
+
notes: string | null;
|
|
170
|
+
created_by_person_id: string | null;
|
|
171
|
+
lines?: GoodsReceiptLine[];
|
|
172
|
+
created_at: string | null;
|
|
173
|
+
updated_at: string | null;
|
|
174
|
+
}
|
|
175
|
+
/** The batch a received line creates: supplier batch number and the expiry date (`YYYY-MM-DD`). */
|
|
176
|
+
export interface ReceiveLineDetail {
|
|
177
|
+
batch_number?: string | null;
|
|
178
|
+
expiry_date?: string | null;
|
|
179
|
+
/** Weight of ONE unit, kilograms (> 0, up to 4 decimals). */
|
|
180
|
+
unit_weight_kilograms?: number | string | null;
|
|
181
|
+
/** Volume of ONE unit, cubic metres (> 0, up to 6 decimals). */
|
|
182
|
+
unit_volume_cubic_meters?: number | string | null;
|
|
183
|
+
}
|
|
184
|
+
/** Body for `PATCH /receipts/{receipt}/lines/{line}` — correct one line's per-unit measures. */
|
|
185
|
+
export interface UpdateGoodsReceiptLineMeasuresInput {
|
|
186
|
+
unit_weight_kilograms?: number | string | null;
|
|
187
|
+
unit_volume_cubic_meters?: number | string | null;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Receive goods against a PO. `lines` is an OPTIONAL map of
|
|
191
|
+
* `po_line_id => qty_to_receive`; omit it to receive the full remaining balance.
|
|
192
|
+
* `line_details` is an OPTIONAL map of `po_line_id => { batch_number?, expiry_date? }`; a line
|
|
193
|
+
* whose item is expiry-tracked MUST carry `expiry_date`, or the receipt is refused (422,
|
|
194
|
+
* reason `expiry_date_required`).
|
|
195
|
+
*/
|
|
196
|
+
export interface ReceiveGoodsInput {
|
|
197
|
+
lines?: Record<string, number | string>;
|
|
198
|
+
line_details?: Record<string, ReceiveLineDetail>;
|
|
199
|
+
notes?: string | null;
|
|
200
|
+
}
|
|
201
|
+
export interface VendorBillLine {
|
|
202
|
+
id: string;
|
|
203
|
+
description: string;
|
|
204
|
+
quantity: string;
|
|
205
|
+
unit_price: string;
|
|
206
|
+
discount_percent: string;
|
|
207
|
+
tax_rate_percent: string;
|
|
208
|
+
line_subtotal: string;
|
|
209
|
+
line_tax: string;
|
|
210
|
+
line_total: string;
|
|
211
|
+
}
|
|
212
|
+
export interface VendorBill {
|
|
213
|
+
id: string;
|
|
214
|
+
bill_number: string;
|
|
215
|
+
status: string;
|
|
216
|
+
bill_date: string | null;
|
|
217
|
+
due_date: string | null;
|
|
218
|
+
subtotal: string;
|
|
219
|
+
tax_amount: string;
|
|
220
|
+
total: string;
|
|
221
|
+
reference: string | null;
|
|
222
|
+
lines?: VendorBillLine[];
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Bill a received PO (3-way match). `lines` is an OPTIONAL map of
|
|
226
|
+
* `po_line_id => qty_to_bill`; `prices` an OPTIONAL map of
|
|
227
|
+
* `po_line_id => vendor billed unit price` (tolerance-checked vs the PO price).
|
|
228
|
+
*/
|
|
229
|
+
export interface BillPurchaseOrderInput {
|
|
230
|
+
lines?: Record<string, number | string>;
|
|
231
|
+
prices?: Record<string, number | string>;
|
|
232
|
+
}
|
|
233
|
+
export interface RequisitionLine {
|
|
234
|
+
id: string;
|
|
235
|
+
requisition_id: string;
|
|
236
|
+
item_id: string | null;
|
|
237
|
+
description: string;
|
|
238
|
+
quantity: string;
|
|
239
|
+
estimated_unit_price: string | null;
|
|
240
|
+
notes: string | null;
|
|
241
|
+
sort: number;
|
|
242
|
+
}
|
|
243
|
+
export interface Requisition {
|
|
244
|
+
id: string;
|
|
245
|
+
requisition_number: string;
|
|
246
|
+
requested_by_person_id: string | null;
|
|
247
|
+
department: string | null;
|
|
248
|
+
status: string;
|
|
249
|
+
needed_by: string | null;
|
|
250
|
+
notes: string | null;
|
|
251
|
+
purchase_order_id: string | null;
|
|
252
|
+
created_by_person_id: string | null;
|
|
253
|
+
lines?: RequisitionLine[];
|
|
254
|
+
created_at: string | null;
|
|
255
|
+
updated_at: string | null;
|
|
256
|
+
}
|
|
257
|
+
export interface RequisitionLineInput {
|
|
258
|
+
item_id?: string | null;
|
|
259
|
+
description: string;
|
|
260
|
+
quantity: number | string;
|
|
261
|
+
estimated_unit_price?: number | string | null;
|
|
262
|
+
notes?: string | null;
|
|
263
|
+
sort?: number | null;
|
|
264
|
+
}
|
|
265
|
+
export interface CreateRequisitionInput {
|
|
266
|
+
requested_by_person_id?: string | null;
|
|
267
|
+
department?: string | null;
|
|
268
|
+
needed_by?: string | null;
|
|
269
|
+
notes?: string | null;
|
|
270
|
+
created_by_person_id?: string | null;
|
|
271
|
+
lines?: RequisitionLineInput[];
|
|
272
|
+
}
|
|
273
|
+
export interface UpdateRequisitionInput {
|
|
274
|
+
requested_by_person_id?: string | null;
|
|
275
|
+
department?: string | null;
|
|
276
|
+
needed_by?: string | null;
|
|
277
|
+
notes?: string | null;
|
|
278
|
+
}
|
|
279
|
+
/** Convert an approved requisition to a PO (chosen vendor + optional warehouse). */
|
|
280
|
+
export interface ConvertRequisitionInput {
|
|
281
|
+
vendor_id: string;
|
|
282
|
+
warehouse_id?: string | null;
|
|
283
|
+
}
|
|
284
|
+
export interface RejectRequisitionInput {
|
|
285
|
+
reason?: string | null;
|
|
286
|
+
}
|
|
287
|
+
export interface RequisitionListQuery extends ListQuery {
|
|
288
|
+
status?: string;
|
|
289
|
+
department?: string;
|
|
290
|
+
}
|
|
291
|
+
export interface RfqLine {
|
|
292
|
+
id: string;
|
|
293
|
+
rfq_id: string;
|
|
294
|
+
item_id: string | null;
|
|
295
|
+
description: string;
|
|
296
|
+
quantity: string;
|
|
297
|
+
sort: number;
|
|
298
|
+
}
|
|
299
|
+
export interface RfqQuoteLine {
|
|
300
|
+
id: string;
|
|
301
|
+
rfq_line_id: string;
|
|
302
|
+
unit_price: string;
|
|
303
|
+
}
|
|
304
|
+
export interface RfqQuote {
|
|
305
|
+
id: string;
|
|
306
|
+
rfq_id: string;
|
|
307
|
+
vendor_id: string;
|
|
308
|
+
status: string;
|
|
309
|
+
total: string;
|
|
310
|
+
notes: string | null;
|
|
311
|
+
lines?: RfqQuoteLine[];
|
|
312
|
+
/** Public-sourcing: stamped when the vendor submits through the public response link. */
|
|
313
|
+
submitted_at?: string | null;
|
|
314
|
+
respondent_name?: string | null;
|
|
315
|
+
}
|
|
316
|
+
export interface Rfq {
|
|
317
|
+
id: string;
|
|
318
|
+
rfq_number: string;
|
|
319
|
+
status: string;
|
|
320
|
+
due_date: string | null;
|
|
321
|
+
notes: string | null;
|
|
322
|
+
awarded_vendor_id: string | null;
|
|
323
|
+
purchase_order_id: string | null;
|
|
324
|
+
lines?: RfqLine[];
|
|
325
|
+
quotes?: RfqQuote[];
|
|
326
|
+
created_at: string | null;
|
|
327
|
+
updated_at: string | null;
|
|
328
|
+
/** Public-sourcing: whether the RFQ accepts quotes via a public vendor link, + the cut-off. */
|
|
329
|
+
is_public?: boolean;
|
|
330
|
+
response_deadline?: string | null;
|
|
331
|
+
}
|
|
332
|
+
export interface RfqLineInput {
|
|
333
|
+
item_id?: string | null;
|
|
334
|
+
description: string;
|
|
335
|
+
quantity: number | string;
|
|
336
|
+
sort?: number | null;
|
|
337
|
+
}
|
|
338
|
+
export interface CreateRfqInput {
|
|
339
|
+
due_date?: string | null;
|
|
340
|
+
notes?: string | null;
|
|
341
|
+
lines?: RfqLineInput[];
|
|
342
|
+
}
|
|
343
|
+
export interface UpdateRfqInput {
|
|
344
|
+
due_date?: string | null;
|
|
345
|
+
notes?: string | null;
|
|
346
|
+
}
|
|
347
|
+
/** Send an RFQ to a set of invited vendors. */
|
|
348
|
+
export interface SendRfqInput {
|
|
349
|
+
vendor_ids: string[];
|
|
350
|
+
}
|
|
351
|
+
/** Record an invited vendor's quote (per-line unit prices). */
|
|
352
|
+
export interface RecordQuoteInput {
|
|
353
|
+
vendor_id: string;
|
|
354
|
+
notes?: string | null;
|
|
355
|
+
lines: Array<{
|
|
356
|
+
rfq_line_id: string;
|
|
357
|
+
unit_price: number | string;
|
|
358
|
+
}>;
|
|
359
|
+
}
|
|
360
|
+
/** Award a quoted RFQ to a winning vendor (+ optional receiving warehouse). */
|
|
361
|
+
export interface AwardRfqInput {
|
|
362
|
+
vendor_id: string;
|
|
363
|
+
warehouse_id?: string | null;
|
|
364
|
+
}
|
|
365
|
+
/** Publish a draft RFQ to a set of vendors for public responses. */
|
|
366
|
+
export interface PublishRfqInput {
|
|
367
|
+
vendor_ids: string[];
|
|
368
|
+
response_deadline?: string | null;
|
|
369
|
+
}
|
|
370
|
+
/** One invited vendor's private response link, returned by publish. */
|
|
371
|
+
export interface RfqInvite {
|
|
372
|
+
vendor_id: string;
|
|
373
|
+
quote_id: string;
|
|
374
|
+
token: string;
|
|
375
|
+
response_url: string;
|
|
376
|
+
}
|
|
377
|
+
/** The result of publishing an RFQ: the updated RFQ + each vendor's response link. */
|
|
378
|
+
export interface PublishRfqResult {
|
|
379
|
+
rfq: Rfq;
|
|
380
|
+
invites: RfqInvite[];
|
|
381
|
+
}
|
|
382
|
+
/** The per-tenant public-sourcing policy. */
|
|
383
|
+
export interface SourcingPolicy {
|
|
384
|
+
allow_public_responses: boolean;
|
|
385
|
+
enforce_response_deadline: boolean;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* `over_receipt_tolerance_percent`: null = no limit (the default); "0.00" = exactly as ordered;
|
|
389
|
+
* otherwise the percentage (scale-2 decimal string, at most 100) a line may be received above
|
|
390
|
+
* its ordered quantity. A receipt past it is refused 422 with reason `over_receipt_tolerance_exceeded`.
|
|
391
|
+
*/
|
|
392
|
+
export interface ReceivingPolicy {
|
|
393
|
+
over_receipt_tolerance_percent: string | null;
|
|
394
|
+
}
|
|
395
|
+
/** The body of PUT /api/procurement/receiving-policy — the field is required; `null` means no limit. */
|
|
396
|
+
export interface UpdateReceivingPolicyInput {
|
|
397
|
+
over_receipt_tolerance_percent: string | number | null;
|
|
398
|
+
}
|
|
399
|
+
export interface ProcurementReportQuery extends ListQuery {
|
|
400
|
+
from?: string;
|
|
401
|
+
to?: string;
|
|
402
|
+
/** by-period only. */
|
|
403
|
+
bucket?: 'day' | 'month';
|
|
404
|
+
}
|
|
405
|
+
export interface ProcurementReportEnvelope<T = Record<string, unknown>> {
|
|
406
|
+
data: T;
|
|
407
|
+
meta: {
|
|
408
|
+
from: string;
|
|
409
|
+
to: string;
|
|
410
|
+
bucket?: string;
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
export type LandedCostAllocationMethod = 'by_value' | 'by_quantity' | 'equal' | 'manual' | 'by_weight' | 'by_volume';
|
|
414
|
+
export type LandedCostVoucherStatus = 'draft' | 'posted' | 'cancelled';
|
|
415
|
+
export type LandedCostChargeType = 'freight' | 'duty' | 'insurance' | 'brokerage' | 'handling' | 'other';
|
|
416
|
+
export interface LandedCostLine {
|
|
417
|
+
id: string;
|
|
418
|
+
sort_order: number;
|
|
419
|
+
charge_type: LandedCostChargeType | null;
|
|
420
|
+
description: string;
|
|
421
|
+
amount: string;
|
|
422
|
+
}
|
|
423
|
+
/** Only for `manual`: the amount typed per receipt line. */
|
|
424
|
+
export interface LandedCostManualAmount {
|
|
425
|
+
goods_receipt_line_id: string;
|
|
426
|
+
amount: string;
|
|
427
|
+
}
|
|
428
|
+
/** One row of the split a voucher was posted with. Empty until posted. */
|
|
429
|
+
export interface LandedCostAllocation {
|
|
430
|
+
goods_receipt_line_id: string;
|
|
431
|
+
stock_movement_id: string;
|
|
432
|
+
item_id: string | null;
|
|
433
|
+
quantity: string;
|
|
434
|
+
basis_value: string;
|
|
435
|
+
allocated_amount: string;
|
|
436
|
+
}
|
|
437
|
+
export interface LandedCostVoucher {
|
|
438
|
+
id: string;
|
|
439
|
+
voucher_number: string;
|
|
440
|
+
/** Null only on a history-only voucher imported from Inventory. */
|
|
441
|
+
goods_receipt_id: string | null;
|
|
442
|
+
receipt_number: string | null;
|
|
443
|
+
purchase_order_id: string | null;
|
|
444
|
+
allocation_method: LandedCostAllocationMethod;
|
|
445
|
+
status: LandedCostVoucherStatus;
|
|
446
|
+
vendor_party_id: string | null;
|
|
447
|
+
vendor_name: string | null;
|
|
448
|
+
currency_code: string;
|
|
449
|
+
total_amount: string;
|
|
450
|
+
notes: string | null;
|
|
451
|
+
cost_adjustment_id: string | null;
|
|
452
|
+
journal_entry_id: string | null;
|
|
453
|
+
reversal_cost_adjustment_id: string | null;
|
|
454
|
+
created_by_person_id: string | null;
|
|
455
|
+
posted_by_person_id: string | null;
|
|
456
|
+
posted_at: string | null;
|
|
457
|
+
cancelled_by_person_id: string | null;
|
|
458
|
+
cancelled_at: string | null;
|
|
459
|
+
cancellation_reason: string | null;
|
|
460
|
+
/** The `inventory.landed_cost_vouchers` id an imported voucher came from. */
|
|
461
|
+
legacy_inventory_voucher_id: string | null;
|
|
462
|
+
/** The Inventory goods receipt an imported voucher was raised against. */
|
|
463
|
+
legacy_inventory_goods_receipt_id: string | null;
|
|
464
|
+
/** Imported for the record: every write answers 422 `landed_cost_legacy_history_only`. */
|
|
465
|
+
legacy_history_only: boolean;
|
|
466
|
+
created_at: string | null;
|
|
467
|
+
updated_at: string | null;
|
|
468
|
+
lines?: LandedCostLine[];
|
|
469
|
+
manual_amounts?: LandedCostManualAmount[];
|
|
470
|
+
allocations?: LandedCostAllocation[];
|
|
471
|
+
}
|
|
472
|
+
export interface LandedCostListQuery extends ListQuery {
|
|
473
|
+
status?: LandedCostVoucherStatus;
|
|
474
|
+
goods_receipt_id?: string;
|
|
475
|
+
allocation_method?: LandedCostAllocationMethod;
|
|
476
|
+
/** Matches the voucher number. */
|
|
477
|
+
search?: string;
|
|
478
|
+
}
|
|
479
|
+
export interface LandedCostLineInput {
|
|
480
|
+
description: string;
|
|
481
|
+
amount: string;
|
|
482
|
+
charge_type?: LandedCostChargeType | null;
|
|
483
|
+
}
|
|
484
|
+
export interface CreateLandedCostVoucherInput {
|
|
485
|
+
goods_receipt_id: string;
|
|
486
|
+
allocation_method: LandedCostAllocationMethod;
|
|
487
|
+
/** The carrier / broker billing the charge — a Party id. */
|
|
488
|
+
vendor_party_id?: string | null;
|
|
489
|
+
currency_code?: string | null;
|
|
490
|
+
notes?: string | null;
|
|
491
|
+
lines: LandedCostLineInput[];
|
|
492
|
+
/** Required for `manual`; must sum to the voucher total. */
|
|
493
|
+
manual_amounts?: LandedCostManualAmount[];
|
|
494
|
+
}
|
|
495
|
+
export type UpdateLandedCostVoucherInput = Partial<CreateLandedCostVoucherInput>;
|
|
496
|
+
export declare function createProcurementNamespace(http: Http): {
|
|
497
|
+
vendors: {
|
|
498
|
+
/** GET /api/procurement/vendors — paginated `{data, meta}`. */
|
|
499
|
+
list: (query?: VendorListQuery) => Promise<Paginated<Vendor>>;
|
|
500
|
+
/** GET /api/procurement/vendors/{id} */
|
|
501
|
+
get: (id: string) => Promise<Vendor>;
|
|
502
|
+
/** POST /api/procurement/vendors — 201. */
|
|
503
|
+
create: (input: CreateVendorInput) => Promise<Vendor>;
|
|
504
|
+
/** PUT /api/procurement/vendors/{id} */
|
|
505
|
+
update: (id: string, input: UpdateVendorInput) => Promise<Vendor>;
|
|
506
|
+
/** POST /api/procurement/vendors/{id}/deactivate */
|
|
507
|
+
deactivate: (id: string) => Promise<Vendor>;
|
|
508
|
+
};
|
|
509
|
+
purchaseOrders: {
|
|
510
|
+
/** GET /api/procurement/orders — paginated `{data, meta}`. */
|
|
511
|
+
list: (query?: PurchaseOrderListQuery) => Promise<Paginated<PurchaseOrder>>;
|
|
512
|
+
/** GET /api/procurement/orders/{id} */
|
|
513
|
+
get: (id: string) => Promise<PurchaseOrder>;
|
|
514
|
+
/** POST /api/procurement/orders — creates a draft (201). */
|
|
515
|
+
create: (input: CreatePurchaseOrderInput) => Promise<PurchaseOrder>;
|
|
516
|
+
/** PUT /api/procurement/orders/{id} — draft header update. */
|
|
517
|
+
update: (id: string, input: UpdatePurchaseOrderInput) => Promise<PurchaseOrder>;
|
|
518
|
+
/** DELETE /api/procurement/orders/{id} — draft only, 204. */
|
|
519
|
+
remove: (id: string) => Promise<void>;
|
|
520
|
+
/** POST /api/procurement/orders/{id}/approve */
|
|
521
|
+
approve: (id: string) => Promise<PurchaseOrder>;
|
|
522
|
+
/** POST /api/procurement/orders/{id}/send */
|
|
523
|
+
send: (id: string) => Promise<PurchaseOrder>;
|
|
524
|
+
/** POST /api/procurement/orders/{id}/cancel */
|
|
525
|
+
cancel: (id: string) => Promise<PurchaseOrder>;
|
|
526
|
+
/** POST /api/procurement/orders/{id}/lines — append a line (201). */
|
|
527
|
+
addLine: (orderId: string, input: PurchaseOrderLineInput) => Promise<PurchaseOrderLine>;
|
|
528
|
+
/** PUT /api/procurement/orders/{id}/lines/{line} */
|
|
529
|
+
updateLine: (orderId: string, lineId: string, input: UpdatePurchaseOrderLineInput) => Promise<PurchaseOrderLine>;
|
|
530
|
+
/** DELETE /api/procurement/orders/{id}/lines/{line} — 204. */
|
|
531
|
+
removeLine: (orderId: string, lineId: string) => Promise<void>;
|
|
532
|
+
};
|
|
533
|
+
receiving: {
|
|
534
|
+
/** GET /api/procurement/purchase-orders/{po}/receipts — bare `{data}`. */
|
|
535
|
+
listReceipts: (poId: string) => Promise<{
|
|
536
|
+
data: GoodsReceipt[];
|
|
537
|
+
}>;
|
|
538
|
+
/** GET /api/procurement/receipts/{id} */
|
|
539
|
+
getReceipt: (id: string) => Promise<GoodsReceipt>;
|
|
540
|
+
/** PATCH /api/procurement/receipts/{receipt}/lines/{line} — per-unit weight/volume (wrapped `{data}`). */
|
|
541
|
+
updateReceiptLineMeasures: (receiptId: string, lineId: string, input: UpdateGoodsReceiptLineMeasuresInput) => Promise<GoodsReceiptLine>;
|
|
542
|
+
/** POST /api/procurement/purchase-orders/{po}/receipts — receive (201). */
|
|
543
|
+
receive: (poId: string, input?: ReceiveGoodsInput) => Promise<GoodsReceipt>;
|
|
544
|
+
};
|
|
545
|
+
landedCosts: {
|
|
546
|
+
/** GET /api/procurement/landed-costs — `{data, links, meta}`. */
|
|
547
|
+
list: (query?: LandedCostListQuery) => Promise<Paginated<LandedCostVoucher>>;
|
|
548
|
+
/** GET /api/procurement/landed-costs/{id} — wrapped `{data}`. */
|
|
549
|
+
get: (id: string) => Promise<{
|
|
550
|
+
data: LandedCostVoucher;
|
|
551
|
+
}>;
|
|
552
|
+
/** GET /api/procurement/receipts/{receipt}/landed-costs — bare `{data}`. */
|
|
553
|
+
forReceipt: (receiptId: string) => Promise<{
|
|
554
|
+
data: LandedCostVoucher[];
|
|
555
|
+
}>;
|
|
556
|
+
/** POST /api/procurement/landed-costs — creates a draft (201), wrapped `{data}`. */
|
|
557
|
+
create: (input: CreateLandedCostVoucherInput) => Promise<{
|
|
558
|
+
data: LandedCostVoucher;
|
|
559
|
+
}>;
|
|
560
|
+
/** PATCH /api/procurement/landed-costs/{id} — DRAFT ONLY (422 otherwise). */
|
|
561
|
+
update: (id: string, input: UpdateLandedCostVoucherInput) => Promise<{
|
|
562
|
+
data: LandedCostVoucher;
|
|
563
|
+
}>;
|
|
564
|
+
/** DELETE /api/procurement/landed-costs/{id} — DRAFT ONLY; 204. */
|
|
565
|
+
remove: (id: string) => Promise<void>;
|
|
566
|
+
/** POST /api/procurement/landed-costs/{id}/post — splits and applies the charge. */
|
|
567
|
+
post: (id: string) => Promise<{
|
|
568
|
+
data: LandedCostVoucher;
|
|
569
|
+
}>;
|
|
570
|
+
/** POST /api/procurement/landed-costs/{id}/cancel — posts the exact reversal; final. */
|
|
571
|
+
cancel: (id: string, reason?: string | null) => Promise<{
|
|
572
|
+
data: LandedCostVoucher;
|
|
573
|
+
}>;
|
|
574
|
+
};
|
|
575
|
+
billing: {
|
|
576
|
+
/** GET /api/procurement/purchase-orders/{po}/bill — the posted vendor bill. */
|
|
577
|
+
getBill: (poId: string) => Promise<VendorBill>;
|
|
578
|
+
/** POST /api/procurement/purchase-orders/{po}/bill — 3-way match (201). */
|
|
579
|
+
bill: (poId: string, input?: BillPurchaseOrderInput) => Promise<VendorBill>;
|
|
580
|
+
};
|
|
581
|
+
requisitions: {
|
|
582
|
+
/** GET /api/procurement/requisitions — paginated `{data, meta}`. */
|
|
583
|
+
list: (query?: RequisitionListQuery) => Promise<Paginated<Requisition>>;
|
|
584
|
+
/** GET /api/procurement/requisitions/{id} */
|
|
585
|
+
get: (id: string) => Promise<Requisition>;
|
|
586
|
+
/** POST /api/procurement/requisitions — creates a draft (201). */
|
|
587
|
+
create: (input: CreateRequisitionInput) => Promise<Requisition>;
|
|
588
|
+
/** PUT /api/procurement/requisitions/{id} — draft header update. */
|
|
589
|
+
update: (id: string, input: UpdateRequisitionInput) => Promise<Requisition>;
|
|
590
|
+
/** DELETE /api/procurement/requisitions/{id} — 204. */
|
|
591
|
+
remove: (id: string) => Promise<void>;
|
|
592
|
+
/** POST /api/procurement/requisitions/{id}/submit */
|
|
593
|
+
submit: (id: string) => Promise<Requisition>;
|
|
594
|
+
/** POST /api/procurement/requisitions/{id}/approve */
|
|
595
|
+
approve: (id: string) => Promise<Requisition>;
|
|
596
|
+
/** POST /api/procurement/requisitions/{id}/reject */
|
|
597
|
+
reject: (id: string, input?: RejectRequisitionInput) => Promise<Requisition>;
|
|
598
|
+
/** POST /api/procurement/requisitions/{id}/convert — answers the NEW purchase order (201), not the requisition. */
|
|
599
|
+
convert: (id: string, input: ConvertRequisitionInput) => Promise<PurchaseOrder>;
|
|
600
|
+
/** POST /api/procurement/requisitions/{id}/lines — append a line. */
|
|
601
|
+
addLine: (requisitionId: string, input: RequisitionLineInput) => Promise<RequisitionLine>;
|
|
602
|
+
/** DELETE /api/procurement/requisitions/{id}/lines/{line} — 204. */
|
|
603
|
+
removeLine: (requisitionId: string, lineId: string) => Promise<void>;
|
|
604
|
+
};
|
|
605
|
+
rfqs: {
|
|
606
|
+
/** GET /api/procurement/rfqs — paginated `{data, meta}`. */
|
|
607
|
+
list: (query?: RfqListQuery) => Promise<Paginated<Rfq>>;
|
|
608
|
+
/** GET /api/procurement/rfqs/{id} — single resource, unwrapped from its `{data}` envelope. */
|
|
609
|
+
get: (id: string) => Promise<Rfq>;
|
|
610
|
+
/** POST /api/procurement/rfqs — creates a draft (201). */
|
|
611
|
+
create: (input: CreateRfqInput) => Promise<Rfq>;
|
|
612
|
+
/** PUT /api/procurement/rfqs/{id} — draft header update. */
|
|
613
|
+
update: (id: string, input: UpdateRfqInput) => Promise<Rfq>;
|
|
614
|
+
/** DELETE /api/procurement/rfqs/{id} — 204. */
|
|
615
|
+
remove: (id: string) => Promise<void>;
|
|
616
|
+
/** POST /api/procurement/rfqs/{id}/send — invite vendors. */
|
|
617
|
+
send: (id: string, input: SendRfqInput) => Promise<Rfq>;
|
|
618
|
+
/** POST /api/procurement/rfqs/{id}/quotes — record a vendor quote; answers the new quote (201). */
|
|
619
|
+
recordQuote: (id: string, input: RecordQuoteInput) => Promise<RfqQuote>;
|
|
620
|
+
/** POST /api/procurement/rfqs/{id}/award — award to a vendor; answers the purchase order it raised (201). */
|
|
621
|
+
award: (id: string, input: AwardRfqInput) => Promise<PurchaseOrder>;
|
|
622
|
+
/** POST /api/procurement/rfqs/{id}/lines — append a line. */
|
|
623
|
+
addLine: (rfqId: string, input: RfqLineInput) => Promise<RfqLine>;
|
|
624
|
+
/**
|
|
625
|
+
* POST /api/procurement/rfqs/{id}/publish — open the RFQ for public vendor responses
|
|
626
|
+
* and mint a private response link per invited vendor (201). Returns the RFQ + invites.
|
|
627
|
+
*/
|
|
628
|
+
publish: (id: string, input: PublishRfqInput) => Promise<PublishRfqResult>;
|
|
629
|
+
};
|
|
630
|
+
/** The per-tenant public-sourcing policy (gates whether the "Publish" surface is offered). */
|
|
631
|
+
sourcingPolicy: {
|
|
632
|
+
/** GET /api/procurement/sourcing-policy */
|
|
633
|
+
get: () => Promise<SourcingPolicy>;
|
|
634
|
+
/** PUT /api/procurement/sourcing-policy */
|
|
635
|
+
set: (input: SourcingPolicy) => Promise<SourcingPolicy>;
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* The per-tenant receiving policy: how far above the ordered quantity a purchase-order
|
|
639
|
+
* line may be received, judged on the line's total across every receipt. Replaces the
|
|
640
|
+
* Inventory settings field `over_receipt_tolerance_percent`.
|
|
641
|
+
*/
|
|
642
|
+
receivingPolicy: {
|
|
643
|
+
/** GET /api/procurement/receiving-policy */
|
|
644
|
+
get: () => Promise<ReceivingPolicy>;
|
|
645
|
+
/** PUT /api/procurement/receiving-policy — send `null` for no limit, `0` for exactly as ordered. */
|
|
646
|
+
set: (input: UpdateReceivingPolicyInput) => Promise<ReceivingPolicy>;
|
|
647
|
+
};
|
|
648
|
+
reports: {
|
|
649
|
+
/** GET /api/procurement/reports/summary?from=&to= */
|
|
650
|
+
summary: (query?: ProcurementReportQuery) => Promise<ProcurementReportEnvelope<Record<string, unknown>>>;
|
|
651
|
+
/** GET /api/procurement/reports/by-vendor?from=&to= */
|
|
652
|
+
byVendor: (query?: ProcurementReportQuery) => Promise<ProcurementReportEnvelope<Record<string, unknown>[]>>;
|
|
653
|
+
/** GET /api/procurement/reports/by-product?from=&to= */
|
|
654
|
+
byProduct: (query?: ProcurementReportQuery) => Promise<ProcurementReportEnvelope<Record<string, unknown>[]>>;
|
|
655
|
+
/** GET /api/procurement/reports/by-period?from=&to=&bucket=day|month */
|
|
656
|
+
byPeriod: (query?: ProcurementReportQuery) => Promise<ProcurementReportEnvelope<Record<string, unknown>[]>>;
|
|
657
|
+
/** GET /api/procurement/reports/open-orders?from=&to= */
|
|
658
|
+
openOrders: (query?: ProcurementReportQuery) => Promise<ProcurementReportEnvelope<Record<string, unknown>[]>>;
|
|
659
|
+
};
|
|
660
|
+
};
|
|
661
|
+
export interface RfqListQuery extends ListQuery {
|
|
662
|
+
status?: string;
|
|
663
|
+
}
|
|
664
|
+
export type ProcurementNamespace = ReturnType<typeof createProcurementNamespace>;
|