@pelygo/janus 0.1.2 → 0.2.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/index.d.ts +1848 -9
- package/dist/index.js +593 -253
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,137 @@ export declare interface AddReturnStatusRequest {
|
|
|
53
53
|
*/
|
|
54
54
|
export declare type ApprovalStatus = 'pending' | 'approved' | 'rejected';
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Asn Entity
|
|
58
|
+
*
|
|
59
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
60
|
+
*
|
|
61
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/asns/asn.entity.ts
|
|
62
|
+
*/
|
|
63
|
+
export declare interface Asn extends BaseEntity_2 {
|
|
64
|
+
clientId: number;
|
|
65
|
+
asn_status: 'draft' | 'awaiting_arrival' | 'arrived' | 'processing' | 'receipted' | 'receipted_with_discrepancies' | 'temporarily_receipted' | 'quarantined' | 'cancelled';
|
|
66
|
+
expected_arrival_date?: string;
|
|
67
|
+
total_expected_units?: number;
|
|
68
|
+
/** OneToMany relationship to AsnLine */
|
|
69
|
+
asnLines: AsnLine[];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* AsnLine Entity
|
|
74
|
+
*
|
|
75
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
76
|
+
*
|
|
77
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/asns/line.entity.ts
|
|
78
|
+
*/
|
|
79
|
+
export declare interface AsnLine extends BaseEntity_2 {
|
|
80
|
+
asn_id: number;
|
|
81
|
+
product_id?: number;
|
|
82
|
+
sku_code: string;
|
|
83
|
+
expected_quantity: number;
|
|
84
|
+
received_quantity?: number;
|
|
85
|
+
/** ManyToOne relationship to Asn */
|
|
86
|
+
asn: Asn;
|
|
87
|
+
/** OneToMany relationship to AsnReceipt */
|
|
88
|
+
asnReceipts: AsnReceipt[];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* AsnReceipt Entity
|
|
93
|
+
*
|
|
94
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
95
|
+
*
|
|
96
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/asns/receipt.entity.ts
|
|
97
|
+
*/
|
|
98
|
+
export declare interface AsnReceipt extends BaseEntity_2 {
|
|
99
|
+
asn_id: number;
|
|
100
|
+
asn_line_id: number;
|
|
101
|
+
received_quantity: number;
|
|
102
|
+
stock_status: 'available' | 'quarantined' | 'expired' | 'damaged' | 'reserved';
|
|
103
|
+
/** ManyToOne relationship to AsnLine */
|
|
104
|
+
asnLine: AsnLine;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* ASNs resource interface
|
|
109
|
+
*/
|
|
110
|
+
export declare interface AsnsResource {
|
|
111
|
+
/** Get all ASNs with optional filters */
|
|
112
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<Asn>>;
|
|
113
|
+
/** Get an ASN by ID */
|
|
114
|
+
getById(id: number): Promise<Asn>;
|
|
115
|
+
/** Create a new ASN */
|
|
116
|
+
create(data: CreateAsnRequest): Promise<Asn>;
|
|
117
|
+
/** Update an ASN */
|
|
118
|
+
update(id: number, data: Partial<CreateAsnRequest>): Promise<Asn>;
|
|
119
|
+
/** Delete an ASN */
|
|
120
|
+
delete(id: number): Promise<void>;
|
|
121
|
+
/** Get all lines for an ASN */
|
|
122
|
+
getLines(asnId: number, filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<AsnLine>>;
|
|
123
|
+
/** Get a specific ASN line */
|
|
124
|
+
getLineById(asnId: number, lineId: number): Promise<AsnLine>;
|
|
125
|
+
/** Create a new ASN line */
|
|
126
|
+
createLine(asnId: number, data: CreateAsnLineRequest): Promise<unknown>;
|
|
127
|
+
/** Update an ASN line */
|
|
128
|
+
updateLine(asnId: number, lineId: number, data: UpdateAsnLineRequest): Promise<AsnLine>;
|
|
129
|
+
/** Delete an ASN line */
|
|
130
|
+
deleteLine(asnId: number, lineId: number): Promise<void>;
|
|
131
|
+
/** Get all receipts for an ASN line */
|
|
132
|
+
getReceipts(asnId: number, lineId: number, filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<AsnReceipt>>;
|
|
133
|
+
/** Get a specific ASN receipt */
|
|
134
|
+
getReceiptById(asnId: number, lineId: number, receiptId: number): Promise<AsnReceipt>;
|
|
135
|
+
/** Create a new ASN receipt */
|
|
136
|
+
createReceipt(asnId: number, lineId: number, data: CreateAsnReceiptRequest): Promise<AsnReceipt>;
|
|
137
|
+
/** Update an ASN receipt */
|
|
138
|
+
updateReceipt(asnId: number, lineId: number, receiptId: number, data: UpdateAsnReceiptRequest): Promise<AsnReceipt>;
|
|
139
|
+
/** Delete an ASN receipt */
|
|
140
|
+
deleteReceipt(asnId: number, lineId: number, receiptId: number): Promise<void>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Audit Entity
|
|
145
|
+
*
|
|
146
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
147
|
+
*
|
|
148
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/audit/audit.entity.ts
|
|
149
|
+
*/
|
|
150
|
+
export declare interface Audit extends BaseEntity_2 {
|
|
151
|
+
/** Foreign key to the client this audit entry belongs to. */
|
|
152
|
+
clientId: number;
|
|
153
|
+
/** Name of the resource/entity that was changed (e.g. "stock", "order", "product"). */
|
|
154
|
+
resource: string;
|
|
155
|
+
/** Primary key of the specific resource record that was changed. */
|
|
156
|
+
resource_id: number;
|
|
157
|
+
/** Type of mutation that triggered this audit entry. */
|
|
158
|
+
action: 'create' | 'update' | 'delete';
|
|
159
|
+
/** Snapshot of the resource's field values before the change. Keys are field names, values are the previous values. Empty object for "create" actions. */
|
|
160
|
+
old_value: Record<string, unknown>;
|
|
161
|
+
/** Snapshot of the resource's field values after the change. Keys are field names, values are the new values. Empty object for "delete" actions. */
|
|
162
|
+
new_value: Record<string, unknown>;
|
|
163
|
+
/** Free-text notes providing additional context for the change. */
|
|
164
|
+
notes?: string;
|
|
165
|
+
/** Foreign key to the user who performed the change. */
|
|
166
|
+
createdById: number;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Filters for audits
|
|
171
|
+
*/
|
|
172
|
+
export declare interface AuditsFilters extends ClientScopedPaginatedQueryFilters {
|
|
173
|
+
/** Additional filter */
|
|
174
|
+
filter?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Audits resource interface (read-only)
|
|
179
|
+
*/
|
|
180
|
+
export declare interface AuditsResource {
|
|
181
|
+
/** Get all audit records with optional filters */
|
|
182
|
+
getAll(filters?: AuditsFilters): Promise<PaginatedListResponse<Audit>>;
|
|
183
|
+
/** Get an audit record by ID */
|
|
184
|
+
getById(id: number): Promise<Audit>;
|
|
185
|
+
}
|
|
186
|
+
|
|
56
187
|
/**
|
|
57
188
|
* Base Entity Interface
|
|
58
189
|
*
|
|
@@ -73,6 +204,27 @@ export declare interface BaseEntity {
|
|
|
73
204
|
partition_id?: number;
|
|
74
205
|
}
|
|
75
206
|
|
|
207
|
+
/**
|
|
208
|
+
* Base Entity Interface
|
|
209
|
+
*
|
|
210
|
+
* All JANUS entities extend from this base type.
|
|
211
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
212
|
+
*/
|
|
213
|
+
declare interface BaseEntity_2 {
|
|
214
|
+
/** Unique identifier */
|
|
215
|
+
id: number;
|
|
216
|
+
/** User ID who created this record */
|
|
217
|
+
created_by?: number;
|
|
218
|
+
/** User ID who last updated this record */
|
|
219
|
+
updated_by?: number;
|
|
220
|
+
/** Creation timestamp */
|
|
221
|
+
created_ts?: string;
|
|
222
|
+
/** Last update timestamp */
|
|
223
|
+
updated_ts?: string;
|
|
224
|
+
/** Partition ID for multi-tenancy */
|
|
225
|
+
partition_id?: number;
|
|
226
|
+
}
|
|
227
|
+
|
|
76
228
|
/**
|
|
77
229
|
* Filter Types for API Queries
|
|
78
230
|
* @module types/filters
|
|
@@ -87,6 +239,38 @@ export declare interface BaseFilters {
|
|
|
87
239
|
pageSize?: number;
|
|
88
240
|
}
|
|
89
241
|
|
|
242
|
+
/**
|
|
243
|
+
* Build a paginated URL for endpoints that require a clientId.
|
|
244
|
+
*
|
|
245
|
+
* Throws early for JS consumers if `clientId` is missing instead of sending
|
|
246
|
+
* a request that v2 will reject with a 400.
|
|
247
|
+
*
|
|
248
|
+
* @param basePath - Base URL path
|
|
249
|
+
* @param filters - Filter object with required clientId
|
|
250
|
+
* @returns Full URL with snake_case query parameters
|
|
251
|
+
*/
|
|
252
|
+
export declare function buildClientScopedPaginatedUrl(basePath: string, filters: FilterObject & {
|
|
253
|
+
clientId: number;
|
|
254
|
+
}): string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Build a URL with paginated query parameters, converting camelCase keys to snake_case.
|
|
258
|
+
*
|
|
259
|
+
* Use this for v2 endpoints that expect snake_case query params
|
|
260
|
+
* (e.g. `client_id`, `page_size`, `page_number`).
|
|
261
|
+
*
|
|
262
|
+
* @param basePath - Base URL path
|
|
263
|
+
* @param filters - Filter object with camelCase keys
|
|
264
|
+
* @returns Full URL with snake_case query parameters
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* ```typescript
|
|
268
|
+
* const url = buildPaginatedUrl('/products', { clientId: 5, pageSize: 25 });
|
|
269
|
+
* // Returns: "/products?client_id=5&page_size=25"
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
export declare function buildPaginatedUrl(basePath: string, filters?: FilterObject): string;
|
|
273
|
+
|
|
90
274
|
/**
|
|
91
275
|
* Build a query string from a filter object.
|
|
92
276
|
*
|
|
@@ -119,6 +303,16 @@ export declare function buildQueryString(filters: FilterObject): string;
|
|
|
119
303
|
*/
|
|
120
304
|
export declare function buildUrl(baseUrl: string, filters?: FilterObject): string;
|
|
121
305
|
|
|
306
|
+
/**
|
|
307
|
+
* Data for changing a user's password
|
|
308
|
+
*/
|
|
309
|
+
export declare interface ChangePasswordRequest {
|
|
310
|
+
/** Username */
|
|
311
|
+
username: string;
|
|
312
|
+
/** Client ID */
|
|
313
|
+
client_id: number;
|
|
314
|
+
}
|
|
315
|
+
|
|
122
316
|
/**
|
|
123
317
|
* Client Entity
|
|
124
318
|
*
|
|
@@ -143,6 +337,22 @@ export declare interface Client extends BaseEntity {
|
|
|
143
337
|
default_courier_service_id?: number;
|
|
144
338
|
/** Whether client is active */
|
|
145
339
|
active?: boolean;
|
|
340
|
+
/**
|
|
341
|
+
* Legacy vdepot customer ID.
|
|
342
|
+
*
|
|
343
|
+
* This is NOT the same as `id` (Janus internal ID).
|
|
344
|
+
* Use this value when querying legacy endpoints that filter by `products.customer_id`.
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* // Correct: use remote_client_id for legacy product queries
|
|
348
|
+
* janus.legacy.queryProducts({
|
|
349
|
+
* query: [{ query_name: 'products.customer_id', query_type: '=', query_value: client.remote_client_id }],
|
|
350
|
+
* });
|
|
351
|
+
*
|
|
352
|
+
* // WRONG: do not use client.id for legacy queries
|
|
353
|
+
* // client.id is the Janus internal ID, not the legacy customer ID
|
|
354
|
+
*/
|
|
355
|
+
remote_client_id?: number;
|
|
146
356
|
}
|
|
147
357
|
|
|
148
358
|
/**
|
|
@@ -170,6 +380,16 @@ export declare interface ClientCourierService extends BaseEntity {
|
|
|
170
380
|
*/
|
|
171
381
|
export declare type ClientOperationalStatus = 'active' | 'inactive' | 'onboarding' | 'offboarding';
|
|
172
382
|
|
|
383
|
+
/**
|
|
384
|
+
* Base filters for client-scoped v2 paginated list endpoints.
|
|
385
|
+
*
|
|
386
|
+
* These endpoints require `clientId` and will reject requests without it.
|
|
387
|
+
*/
|
|
388
|
+
export declare interface ClientScopedPaginatedQueryFilters extends PaginatedQueryFilters {
|
|
389
|
+
/** Filter by client ID (required for client-scoped endpoints) */
|
|
390
|
+
clientId: number;
|
|
391
|
+
}
|
|
392
|
+
|
|
173
393
|
/**
|
|
174
394
|
* Client settings structure
|
|
175
395
|
*/
|
|
@@ -254,6 +474,86 @@ export declare interface ClientsResource {
|
|
|
254
474
|
getSettings(clientId: number): Promise<unknown>;
|
|
255
475
|
}
|
|
256
476
|
|
|
477
|
+
/**
|
|
478
|
+
* Consignment Entity
|
|
479
|
+
*
|
|
480
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
481
|
+
*
|
|
482
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/Consignment.ts
|
|
483
|
+
*/
|
|
484
|
+
export declare interface Consignment {
|
|
485
|
+
/** Primary key identifier for the consignment record. */
|
|
486
|
+
id: number;
|
|
487
|
+
/** Foreign key to the warehouse packer who processed this consignment. */
|
|
488
|
+
packerId?: number;
|
|
489
|
+
/** Foreign key to the parent dispatch this consignment belongs to. */
|
|
490
|
+
dispatchId?: number;
|
|
491
|
+
/** Foreign key to the shipping service used for this consignment. */
|
|
492
|
+
serviceId?: number;
|
|
493
|
+
/** Foreign key to the courier/carrier handling delivery. */
|
|
494
|
+
courierId?: number;
|
|
495
|
+
/** Client-facing reference code for the consignment. */
|
|
496
|
+
reference?: string;
|
|
497
|
+
/** Carrier tracking code for parcel tracking. */
|
|
498
|
+
trackingCode?: string;
|
|
499
|
+
/** Unique reference generated by the carrier for this consignment. */
|
|
500
|
+
uniqueReference?: string;
|
|
501
|
+
/** Raw consignment data or label reference returned by the carrier API. */
|
|
502
|
+
consignment?: string;
|
|
503
|
+
/** Cost centre code for internal accounting allocation. */
|
|
504
|
+
costCentre?: string;
|
|
505
|
+
/** Additional weight added to the consignment (e.g. packaging weight) in grams or kilograms. */
|
|
506
|
+
weightAdded?: number;
|
|
507
|
+
/** ISO 8601 date string when the consignment was dispatched. */
|
|
508
|
+
dispatchDate?: string;
|
|
509
|
+
/** Description of the consignment contents (used on customs labels). */
|
|
510
|
+
description?: string;
|
|
511
|
+
/** Internal notes or comments about the consignment. */
|
|
512
|
+
notes?: string;
|
|
513
|
+
/** Raw JSON string of the carrier API request payload used to create the consignment. */
|
|
514
|
+
request?: string;
|
|
515
|
+
/** Declared value of the consignment contents for customs/insurance purposes. */
|
|
516
|
+
value?: number;
|
|
517
|
+
/** Liability/insurance coverage amount for the consignment. */
|
|
518
|
+
liability?: number;
|
|
519
|
+
/** ISO 8601 date string when packing started. */
|
|
520
|
+
packStart?: string;
|
|
521
|
+
/** ISO 8601 date string when packing was completed. */
|
|
522
|
+
packEnd?: string;
|
|
523
|
+
/** Structured collection booking details (e.g. collection date, time window, depot address). */
|
|
524
|
+
collection?: Record<string, unknown>;
|
|
525
|
+
/** Reason for export as required on customs declarations (e.g. "sale", "gift", "sample", "return"). */
|
|
526
|
+
reasonForExport?: string;
|
|
527
|
+
/** ISO 8601 date string when the consignment record was created. */
|
|
528
|
+
created?: string;
|
|
529
|
+
/** ISO 8601 date string when the consignment record was last modified. */
|
|
530
|
+
modified?: string;
|
|
531
|
+
/** Record status flag. 0 = inactive/deleted, 1 = active. */
|
|
532
|
+
status?: number;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Consignment entity (legacy dispatch relationship)
|
|
537
|
+
*/
|
|
538
|
+
declare interface Consignment_2 {
|
|
539
|
+
id: number;
|
|
540
|
+
[key: string]: unknown;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Consignments resource interface
|
|
545
|
+
*/
|
|
546
|
+
export declare interface ConsignmentsResource {
|
|
547
|
+
/** Get consignments by dispatch ID (not paginated) */
|
|
548
|
+
getByDispatchId(dispatchId: number): Promise<Consignment[]>;
|
|
549
|
+
/** Create a new consignment */
|
|
550
|
+
create(data: CreateConsignmentRequest): Promise<Consignment>;
|
|
551
|
+
/** Update a consignment */
|
|
552
|
+
update(id: number, data: Partial<CreateConsignmentRequest>): Promise<Consignment>;
|
|
553
|
+
/** Delete a consignment */
|
|
554
|
+
delete(id: number): Promise<void>;
|
|
555
|
+
}
|
|
556
|
+
|
|
257
557
|
/**
|
|
258
558
|
* Courier Entity
|
|
259
559
|
*
|
|
@@ -338,6 +638,66 @@ export declare interface CouriersResource {
|
|
|
338
638
|
updateService(courierId: number, serviceId: number, data: Partial<CreateCourierServiceRequest>): Promise<CourierServiceEntity>;
|
|
339
639
|
}
|
|
340
640
|
|
|
641
|
+
/**
|
|
642
|
+
* Data for creating/updating an ASN line
|
|
643
|
+
*/
|
|
644
|
+
export declare interface CreateAsnLineRequest {
|
|
645
|
+
/** Client ID */
|
|
646
|
+
client_id: number;
|
|
647
|
+
/** ASN ID */
|
|
648
|
+
asn_id?: number;
|
|
649
|
+
/** Product ID */
|
|
650
|
+
product_id?: number;
|
|
651
|
+
/** SKU code */
|
|
652
|
+
sku_code: string;
|
|
653
|
+
/** Expected quantity */
|
|
654
|
+
expected_quantity: number;
|
|
655
|
+
/** Received quantity */
|
|
656
|
+
received_quantity?: number;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Data for bulk creating ASN lines
|
|
661
|
+
*/
|
|
662
|
+
export declare interface CreateAsnLinesBulkRequest {
|
|
663
|
+
/** Client ID */
|
|
664
|
+
client_id: number;
|
|
665
|
+
/** ASN ID */
|
|
666
|
+
asn_id: number;
|
|
667
|
+
/** Array of ASN lines to create */
|
|
668
|
+
asn_lines: Array<Omit<CreateAsnLineRequest, 'client_id' | 'asn_id'>>;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Data for creating/updating an ASN receipt
|
|
673
|
+
*/
|
|
674
|
+
export declare interface CreateAsnReceiptRequest {
|
|
675
|
+
/** Client ID */
|
|
676
|
+
client_id: number;
|
|
677
|
+
/** ASN ID */
|
|
678
|
+
asn_id: number;
|
|
679
|
+
/** ASN line ID */
|
|
680
|
+
asn_line_id: number;
|
|
681
|
+
/** Received quantity */
|
|
682
|
+
received_quantity: number;
|
|
683
|
+
/** Stock status */
|
|
684
|
+
stock_status?: 'available' | 'quarantined' | 'expired' | 'damaged' | 'reserved';
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Data for creating/updating an ASN
|
|
689
|
+
*/
|
|
690
|
+
export declare interface CreateAsnRequest {
|
|
691
|
+
/** Client ID */
|
|
692
|
+
client_id: number;
|
|
693
|
+
/** ASN status */
|
|
694
|
+
asn_status?: 'draft' | 'awaiting_arrival' | 'arrived' | 'processing' | 'receipted' | 'receipted_with_discrepancies' | 'temporarily_receipted' | 'quarantined' | 'cancelled';
|
|
695
|
+
/** Expected arrival date (ISO string) */
|
|
696
|
+
expected_arrival_date?: string;
|
|
697
|
+
/** Total expected units */
|
|
698
|
+
total_expected_units?: number;
|
|
699
|
+
}
|
|
700
|
+
|
|
341
701
|
/**
|
|
342
702
|
* Data for client integration creation
|
|
343
703
|
*/
|
|
@@ -370,6 +730,40 @@ export declare interface CreateClientRequest {
|
|
|
370
730
|
settings?: Record<string, unknown>;
|
|
371
731
|
}
|
|
372
732
|
|
|
733
|
+
/**
|
|
734
|
+
* Data for creating/updating a consignment
|
|
735
|
+
*/
|
|
736
|
+
export declare interface CreateConsignmentRequest {
|
|
737
|
+
/** Client ID */
|
|
738
|
+
client_id: number;
|
|
739
|
+
/** Dispatch ID */
|
|
740
|
+
dispatch_id: number;
|
|
741
|
+
/** Packer ID */
|
|
742
|
+
packer_id?: number;
|
|
743
|
+
/** Post service ID */
|
|
744
|
+
post_service_id?: number;
|
|
745
|
+
/** Courier ID */
|
|
746
|
+
courier_id?: number;
|
|
747
|
+
/** Reference */
|
|
748
|
+
reference?: string;
|
|
749
|
+
/** Tracking number */
|
|
750
|
+
tracking_number?: string;
|
|
751
|
+
/** Dispatch date (ISO string) */
|
|
752
|
+
dispatch_date?: string;
|
|
753
|
+
/** Description */
|
|
754
|
+
description?: string;
|
|
755
|
+
/** Notes */
|
|
756
|
+
notes?: string;
|
|
757
|
+
/** Request details */
|
|
758
|
+
request?: string;
|
|
759
|
+
/** Pack start time (ISO string) */
|
|
760
|
+
pack_start?: string;
|
|
761
|
+
/** Pack end time (ISO string) */
|
|
762
|
+
pack_end?: string;
|
|
763
|
+
/** Reason for export */
|
|
764
|
+
reason_for_export?: string;
|
|
765
|
+
}
|
|
766
|
+
|
|
373
767
|
/**
|
|
374
768
|
* Data for creating/updating a courier
|
|
375
769
|
*/
|
|
@@ -402,6 +796,40 @@ export declare interface CreateCourierServiceRequest {
|
|
|
402
796
|
status?: boolean;
|
|
403
797
|
}
|
|
404
798
|
|
|
799
|
+
/**
|
|
800
|
+
* Data for creating/updating a dispatch
|
|
801
|
+
*/
|
|
802
|
+
export declare interface CreateDispatchRequest {
|
|
803
|
+
/** Client ID */
|
|
804
|
+
client_id: number;
|
|
805
|
+
/** Order ID */
|
|
806
|
+
order_id: number;
|
|
807
|
+
/** Dispatch reference */
|
|
808
|
+
reference?: string;
|
|
809
|
+
/** Address ID */
|
|
810
|
+
address_id?: number;
|
|
811
|
+
/** Dispatch date (ISO string) */
|
|
812
|
+
dispatch_date?: string;
|
|
813
|
+
/** Post service ID */
|
|
814
|
+
post_service_id?: number;
|
|
815
|
+
/** Dispatch status */
|
|
816
|
+
dispatch_status?: number;
|
|
817
|
+
/** Release date */
|
|
818
|
+
release_date?: string;
|
|
819
|
+
/** Whether dispatch is on hold */
|
|
820
|
+
hold?: number;
|
|
821
|
+
/** Whether dispatch is draft */
|
|
822
|
+
draft?: number;
|
|
823
|
+
/** Dispatch issue flag */
|
|
824
|
+
dispatch_issue?: number;
|
|
825
|
+
/** Stock status */
|
|
826
|
+
stock_status?: number;
|
|
827
|
+
/** Reason for export */
|
|
828
|
+
reason_for_export?: string;
|
|
829
|
+
/** Notes */
|
|
830
|
+
notes?: string;
|
|
831
|
+
}
|
|
832
|
+
|
|
405
833
|
/**
|
|
406
834
|
* Data for creating/updating an integration
|
|
407
835
|
*/
|
|
@@ -434,6 +862,94 @@ export declare interface CreateIntegrationRequest {
|
|
|
434
862
|
sources?: string;
|
|
435
863
|
}
|
|
436
864
|
|
|
865
|
+
/**
|
|
866
|
+
* Data for creating/updating an invoice line
|
|
867
|
+
*/
|
|
868
|
+
export declare interface CreateInvoiceLineRequest {
|
|
869
|
+
/** Client ID */
|
|
870
|
+
client_id: number;
|
|
871
|
+
/** Invoice ID */
|
|
872
|
+
invoice_id?: number;
|
|
873
|
+
/** Class ID */
|
|
874
|
+
class_id?: number;
|
|
875
|
+
/** Object ID */
|
|
876
|
+
object_id?: number;
|
|
877
|
+
/** Reference */
|
|
878
|
+
reference: string;
|
|
879
|
+
/** Description */
|
|
880
|
+
description?: string;
|
|
881
|
+
/** Dispatch date (ISO string) */
|
|
882
|
+
dispatch_date?: string;
|
|
883
|
+
/** Service name */
|
|
884
|
+
service_name?: string;
|
|
885
|
+
/** Service fee ID */
|
|
886
|
+
service_fee_id?: number;
|
|
887
|
+
/** Price */
|
|
888
|
+
price?: number;
|
|
889
|
+
/** Discount rate */
|
|
890
|
+
discount_rate?: number;
|
|
891
|
+
/** Postcode */
|
|
892
|
+
postcode?: string;
|
|
893
|
+
/** Country code */
|
|
894
|
+
country_code?: string;
|
|
895
|
+
/** Tax class */
|
|
896
|
+
tax_class?: number;
|
|
897
|
+
/** Consignment price */
|
|
898
|
+
consignment_price?: number;
|
|
899
|
+
/** Fuel charge */
|
|
900
|
+
fuel?: number;
|
|
901
|
+
/** Packaging price */
|
|
902
|
+
packaging_price?: number;
|
|
903
|
+
/** Discount amount */
|
|
904
|
+
discount?: number;
|
|
905
|
+
/** Number of lines */
|
|
906
|
+
lines?: number;
|
|
907
|
+
/** Number of picks */
|
|
908
|
+
picks?: number;
|
|
909
|
+
/** Weight */
|
|
910
|
+
weight?: number;
|
|
911
|
+
/** Margin charged */
|
|
912
|
+
margin_charged?: number;
|
|
913
|
+
/** Total override */
|
|
914
|
+
total_override?: number;
|
|
915
|
+
/** Status */
|
|
916
|
+
status?: number;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Data for bulk creating invoice lines
|
|
921
|
+
*/
|
|
922
|
+
export declare interface CreateInvoiceLinesBulkRequest {
|
|
923
|
+
/** Client ID */
|
|
924
|
+
client_id: number;
|
|
925
|
+
/** Invoice ID */
|
|
926
|
+
invoice_id: number;
|
|
927
|
+
/** Array of invoice lines to create */
|
|
928
|
+
invoice_lines: Array<Omit<CreateInvoiceLineRequest, 'client_id' | 'invoice_id'>>;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Data for creating/updating an invoice
|
|
933
|
+
*/
|
|
934
|
+
export declare interface CreateInvoiceRequest {
|
|
935
|
+
/** Client ID */
|
|
936
|
+
client_id: number;
|
|
937
|
+
/** Invoice date (ISO string) */
|
|
938
|
+
invoice_date: string;
|
|
939
|
+
/** Xero reference */
|
|
940
|
+
xero_reference?: string;
|
|
941
|
+
/** Total amount */
|
|
942
|
+
total?: number;
|
|
943
|
+
/** Whether invoice has been emailed */
|
|
944
|
+
emailed?: number;
|
|
945
|
+
/** Whether invoice has been paid */
|
|
946
|
+
paid?: number;
|
|
947
|
+
/** Fuel mode */
|
|
948
|
+
fuel_mode?: number;
|
|
949
|
+
/** Status */
|
|
950
|
+
status?: number;
|
|
951
|
+
}
|
|
952
|
+
|
|
437
953
|
/**
|
|
438
954
|
* Create a JANUS API client.
|
|
439
955
|
*
|
|
@@ -477,6 +993,178 @@ export declare interface CreateIntegrationRequest {
|
|
|
477
993
|
*/
|
|
478
994
|
export declare function createJanusApi(options?: JanusApiOptions): JanusApi;
|
|
479
995
|
|
|
996
|
+
/**
|
|
997
|
+
* Data for creating/updating a location
|
|
998
|
+
*/
|
|
999
|
+
export declare interface CreateLocationRequest {
|
|
1000
|
+
/** Client ID */
|
|
1001
|
+
client_id: number;
|
|
1002
|
+
/** Location code */
|
|
1003
|
+
location_code: string;
|
|
1004
|
+
/** Location type */
|
|
1005
|
+
location_type?: 'pick' | 'bulk' | 'staging' | 'receiving' | 'shipping' | 'quarantine' | 'returns';
|
|
1006
|
+
/** Zone */
|
|
1007
|
+
zone?: string;
|
|
1008
|
+
/** Aisle */
|
|
1009
|
+
aisle?: string;
|
|
1010
|
+
/** Bay */
|
|
1011
|
+
bay?: string;
|
|
1012
|
+
/** Level */
|
|
1013
|
+
level?: string;
|
|
1014
|
+
/** Position */
|
|
1015
|
+
position?: string;
|
|
1016
|
+
/** Fulfilment location ID */
|
|
1017
|
+
fulfilment_location_id?: number;
|
|
1018
|
+
/** Fulfilment location name */
|
|
1019
|
+
fulfilment_location_name?: string;
|
|
1020
|
+
/** Current units stored */
|
|
1021
|
+
current_units?: number;
|
|
1022
|
+
/** Maximum unit capacity */
|
|
1023
|
+
max_capacity_units?: number;
|
|
1024
|
+
/** Maximum weight capacity in kg */
|
|
1025
|
+
max_capacity_weight_kg?: number;
|
|
1026
|
+
/** Whether mixed SKUs are allowed */
|
|
1027
|
+
is_mixed_sku_allowed?: number;
|
|
1028
|
+
/** Whether location is active */
|
|
1029
|
+
is_active?: number;
|
|
1030
|
+
/** Whether location is pickable */
|
|
1031
|
+
is_pickable?: number;
|
|
1032
|
+
/** Whether location can receive stock */
|
|
1033
|
+
is_receivable?: number;
|
|
1034
|
+
/** Temperature zone */
|
|
1035
|
+
temperature_zone?: 'ambient' | 'chilled' | 'frozen';
|
|
1036
|
+
/** Notes */
|
|
1037
|
+
notes?: string;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Data for creating an order
|
|
1042
|
+
*/
|
|
1043
|
+
export declare interface CreateOrderRequest {
|
|
1044
|
+
/** Client ID */
|
|
1045
|
+
client_id: number;
|
|
1046
|
+
/** External order reference */
|
|
1047
|
+
reference?: string;
|
|
1048
|
+
/** External order ID */
|
|
1049
|
+
external_order_id?: string;
|
|
1050
|
+
/** Channel order ID */
|
|
1051
|
+
channel_order_id?: string;
|
|
1052
|
+
/** Transaction type */
|
|
1053
|
+
transaction_type: string;
|
|
1054
|
+
/** Sales channel */
|
|
1055
|
+
channel?: string;
|
|
1056
|
+
/** Delivery address ID */
|
|
1057
|
+
delivery_address_id?: number;
|
|
1058
|
+
/** Billing address ID */
|
|
1059
|
+
billing_address_id?: number;
|
|
1060
|
+
/** Order date (ISO string) */
|
|
1061
|
+
order_date?: string;
|
|
1062
|
+
/** Release date */
|
|
1063
|
+
release_date?: string;
|
|
1064
|
+
/** Post service ID */
|
|
1065
|
+
post_service_id?: number;
|
|
1066
|
+
/** Order status */
|
|
1067
|
+
order_status?: number;
|
|
1068
|
+
/** Notes */
|
|
1069
|
+
notes?: string;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* Data for creating/updating a product category
|
|
1074
|
+
*/
|
|
1075
|
+
export declare interface CreateProductCategoryRequest {
|
|
1076
|
+
/** Client ID */
|
|
1077
|
+
client_id: number;
|
|
1078
|
+
/** Category name */
|
|
1079
|
+
category_name: string;
|
|
1080
|
+
/** Description */
|
|
1081
|
+
description?: string;
|
|
1082
|
+
/** Parent category ID */
|
|
1083
|
+
parent_category_id?: number;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* Data for creating/updating a product via the v2 `/products` endpoint
|
|
1088
|
+
*/
|
|
1089
|
+
export declare interface CreateProductRequest {
|
|
1090
|
+
/** Client ID (Janus internal ID) */
|
|
1091
|
+
client_id: number;
|
|
1092
|
+
/** Product SKU code */
|
|
1093
|
+
sku_code: string;
|
|
1094
|
+
/** Product name */
|
|
1095
|
+
product_name: string;
|
|
1096
|
+
/** Product description */
|
|
1097
|
+
description: string;
|
|
1098
|
+
/** Additional SKU codes */
|
|
1099
|
+
additional_skus?: string;
|
|
1100
|
+
/** Amazon ASINs */
|
|
1101
|
+
asins?: string;
|
|
1102
|
+
/** Custom fields */
|
|
1103
|
+
custom_fields?: Record<string, unknown>;
|
|
1104
|
+
/** HS/commodity code */
|
|
1105
|
+
hs_code?: string;
|
|
1106
|
+
/** Unit of measure */
|
|
1107
|
+
unit_of_measure?: string;
|
|
1108
|
+
/** Eaches per pack */
|
|
1109
|
+
eaches_per_pack?: number;
|
|
1110
|
+
/** Case pack SKU code */
|
|
1111
|
+
case_pack_sku_code?: string;
|
|
1112
|
+
/** Weight in grams */
|
|
1113
|
+
weight_grams?: number;
|
|
1114
|
+
/** Barcode */
|
|
1115
|
+
barcode?: string;
|
|
1116
|
+
/** Case pack barcode */
|
|
1117
|
+
case_pack_barcode?: string;
|
|
1118
|
+
/** Product category ID */
|
|
1119
|
+
product_category_id?: number;
|
|
1120
|
+
/** Product type */
|
|
1121
|
+
product_type?: 'sellable_unit' | 'packaging' | 'component' | 'consumables';
|
|
1122
|
+
/** Sellable format */
|
|
1123
|
+
sellable_format?: 'single' | 'case_pack' | 'bundle';
|
|
1124
|
+
/** Commodity description */
|
|
1125
|
+
commodity_description?: string;
|
|
1126
|
+
/** Price/value */
|
|
1127
|
+
price?: number;
|
|
1128
|
+
/** Currency code */
|
|
1129
|
+
currency?: string;
|
|
1130
|
+
/** Quantity */
|
|
1131
|
+
quantity?: number;
|
|
1132
|
+
/** Country of origin (2-letter code) */
|
|
1133
|
+
country_of_origin?: string;
|
|
1134
|
+
/** Primary material */
|
|
1135
|
+
primary_material?: string;
|
|
1136
|
+
/** Secondary material */
|
|
1137
|
+
secondary_material?: string;
|
|
1138
|
+
/** Dangerous goods classification */
|
|
1139
|
+
dangerous_goods?: string;
|
|
1140
|
+
/** Export control classification */
|
|
1141
|
+
eccn?: string;
|
|
1142
|
+
/** Bundle components */
|
|
1143
|
+
bundle_components?: string;
|
|
1144
|
+
/** Whether product is composite */
|
|
1145
|
+
composite?: number;
|
|
1146
|
+
/** Image URL */
|
|
1147
|
+
image_url?: string;
|
|
1148
|
+
/** Low stock threshold */
|
|
1149
|
+
low_stock_threshold?: number;
|
|
1150
|
+
/** Requires batch tracking */
|
|
1151
|
+
requires_batch_tracking?: number;
|
|
1152
|
+
/** Requires serial tracking */
|
|
1153
|
+
requires_serial_tracking?: number;
|
|
1154
|
+
/** Requires best-before tracking */
|
|
1155
|
+
requires_bbe_tracking?: number;
|
|
1156
|
+
/** FEFO/FIFO override */
|
|
1157
|
+
fefo_fifo_override?: number;
|
|
1158
|
+
/** Whether product is a bundle */
|
|
1159
|
+
is_bundle?: number;
|
|
1160
|
+
/** Default stock status */
|
|
1161
|
+
default_stock_status?: 'available' | 'quarantined' | 'expired' | 'damaged';
|
|
1162
|
+
/** Product status */
|
|
1163
|
+
product_status?: 'active' | 'pre_active' | 'discontinued' | 'inactive' | 'archived';
|
|
1164
|
+
/** Record status */
|
|
1165
|
+
status?: number;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
480
1168
|
/**
|
|
481
1169
|
* Data for creating/updating a return category
|
|
482
1170
|
*/
|
|
@@ -581,6 +1269,104 @@ export declare interface CreateReturnStatusRequest {
|
|
|
581
1269
|
is_final?: boolean;
|
|
582
1270
|
}
|
|
583
1271
|
|
|
1272
|
+
/**
|
|
1273
|
+
* Data for creating/updating a stock allocation
|
|
1274
|
+
*/
|
|
1275
|
+
export declare interface CreateStockAllocationRequest {
|
|
1276
|
+
/** Client ID */
|
|
1277
|
+
client_id: number;
|
|
1278
|
+
/** Order ID */
|
|
1279
|
+
order_id: number;
|
|
1280
|
+
/** SKU code */
|
|
1281
|
+
sku_code?: string;
|
|
1282
|
+
/** Total quantity to allocate */
|
|
1283
|
+
total_quantity: number;
|
|
1284
|
+
/** Allocated stock details */
|
|
1285
|
+
allocated_stock?: Record<string, unknown>;
|
|
1286
|
+
/** Reserve until date (ISO string) */
|
|
1287
|
+
reserved_until?: string;
|
|
1288
|
+
/** Nominated release date (ISO string) */
|
|
1289
|
+
nominated_release_date?: string;
|
|
1290
|
+
/** Allocation type */
|
|
1291
|
+
allocation_type?: 'immediate' | 'future';
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
/**
|
|
1295
|
+
* Data for creating/updating a stock record
|
|
1296
|
+
*/
|
|
1297
|
+
export declare interface CreateStockRequest {
|
|
1298
|
+
/** Client ID */
|
|
1299
|
+
client_id: number;
|
|
1300
|
+
/** SKU code */
|
|
1301
|
+
sku_code: string;
|
|
1302
|
+
/** Storage location */
|
|
1303
|
+
location?: string;
|
|
1304
|
+
/** Quantity */
|
|
1305
|
+
quantity: number;
|
|
1306
|
+
/** Batch number */
|
|
1307
|
+
batch_number?: string;
|
|
1308
|
+
/** Serial number */
|
|
1309
|
+
serial_number?: string;
|
|
1310
|
+
/** Best before date (ISO string) */
|
|
1311
|
+
best_before_date?: string;
|
|
1312
|
+
/** Received date (ISO string) */
|
|
1313
|
+
received_date?: string;
|
|
1314
|
+
/** Stock status */
|
|
1315
|
+
stock_status?: 'available' | 'quarantined' | 'expired' | 'damaged' | 'reserved';
|
|
1316
|
+
/** Fulfilment location ID */
|
|
1317
|
+
fulfilment_location_id?: number;
|
|
1318
|
+
/** Fulfilment location name */
|
|
1319
|
+
fulfilment_location_name?: string;
|
|
1320
|
+
/** Fulfilment location country */
|
|
1321
|
+
fulfilment_location_country?: string;
|
|
1322
|
+
/** Notes */
|
|
1323
|
+
notes?: string;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Data for creating/updating a stock transaction
|
|
1328
|
+
*/
|
|
1329
|
+
export declare interface CreateStockTransactionRequest {
|
|
1330
|
+
/** Client ID */
|
|
1331
|
+
client_id: number;
|
|
1332
|
+
/** Transaction type */
|
|
1333
|
+
transaction_type: 'goods_in' | 'goods_out' | 'adjustment' | 'transfer' | 'return' | 'damage' | 'expiry';
|
|
1334
|
+
/** Stock record ID */
|
|
1335
|
+
stock_id: number;
|
|
1336
|
+
/** SKU code */
|
|
1337
|
+
sku_code?: string;
|
|
1338
|
+
/** Quantity */
|
|
1339
|
+
quantity: number;
|
|
1340
|
+
/** Quantity before transaction */
|
|
1341
|
+
quantity_before?: number;
|
|
1342
|
+
/** Quantity after transaction */
|
|
1343
|
+
quantity_after?: number;
|
|
1344
|
+
/** Location moved from */
|
|
1345
|
+
location_from?: string;
|
|
1346
|
+
/** Location moved to */
|
|
1347
|
+
location_to?: string;
|
|
1348
|
+
/** Batch number */
|
|
1349
|
+
batch_number?: string;
|
|
1350
|
+
/** Serial number */
|
|
1351
|
+
serial_number?: string;
|
|
1352
|
+
/** Reason code */
|
|
1353
|
+
reason_code?: string;
|
|
1354
|
+
/** Reason description */
|
|
1355
|
+
reason_description?: string;
|
|
1356
|
+
/** External reference number */
|
|
1357
|
+
reference_number?: string;
|
|
1358
|
+
/** Price in GBP */
|
|
1359
|
+
price_gbp?: number;
|
|
1360
|
+
/** IMS validation ID */
|
|
1361
|
+
ims_validation_id?: number;
|
|
1362
|
+
/** Source system */
|
|
1363
|
+
source_system?: 'ims_ui' | 'ims_api' | 'mobile_app' | 'asn' | 'oms' | 'cycle_count';
|
|
1364
|
+
/** User who performed the transaction */
|
|
1365
|
+
performed_by?: number;
|
|
1366
|
+
/** Notes */
|
|
1367
|
+
notes?: string;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
584
1370
|
/**
|
|
585
1371
|
* Data for creating a user
|
|
586
1372
|
*/
|
|
@@ -654,6 +1440,30 @@ export declare interface DateRangeFilter {
|
|
|
654
1440
|
*/
|
|
655
1441
|
export declare const DEFAULT_JANUS_URL = "https://api.janus.pelygo.com";
|
|
656
1442
|
|
|
1443
|
+
/**
|
|
1444
|
+
* Filters for dispatches
|
|
1445
|
+
*/
|
|
1446
|
+
export declare interface DispatchesFilters extends ClientScopedPaginatedQueryFilters {
|
|
1447
|
+
/** Filter by order ID */
|
|
1448
|
+
orderId?: number;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
/**
|
|
1452
|
+
* Dispatches resource interface
|
|
1453
|
+
*/
|
|
1454
|
+
export declare interface DispatchesResource {
|
|
1455
|
+
/** Get all dispatches with optional filters */
|
|
1456
|
+
getAll(filters?: DispatchesFilters): Promise<PaginatedListResponse<LegacyDispatch>>;
|
|
1457
|
+
/** Get a dispatch by ID */
|
|
1458
|
+
getById(id: number): Promise<LegacyDispatch>;
|
|
1459
|
+
/** Create a new dispatch */
|
|
1460
|
+
create(data: CreateDispatchRequest): Promise<LegacyDispatch>;
|
|
1461
|
+
/** Update a dispatch */
|
|
1462
|
+
update(id: number, data: Partial<CreateDispatchRequest>): Promise<LegacyDispatch>;
|
|
1463
|
+
/** Delete a dispatch */
|
|
1464
|
+
delete(id: number): Promise<void>;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
657
1467
|
/**
|
|
658
1468
|
* Generic filter object type
|
|
659
1469
|
*/
|
|
@@ -699,6 +1509,94 @@ export declare class ForbiddenError extends JanusApiError {
|
|
|
699
1509
|
constructor(message?: string, response?: unknown);
|
|
700
1510
|
}
|
|
701
1511
|
|
|
1512
|
+
/**
|
|
1513
|
+
* FormattedProduct — response shape from the `GET /products` endpoint.
|
|
1514
|
+
*
|
|
1515
|
+
* The v2 products endpoint returns formatted field names that differ
|
|
1516
|
+
* from the raw `LegacyProduct` entity (e.g. `sku_code` instead of `sku`,
|
|
1517
|
+
* `product_name` instead of `name`, `price` instead of `value`).
|
|
1518
|
+
*/
|
|
1519
|
+
export declare interface FormattedProduct {
|
|
1520
|
+
/** Primary key identifier for the product. */
|
|
1521
|
+
product_id: number;
|
|
1522
|
+
/** Foreign key to the client that owns this product. */
|
|
1523
|
+
client_id: number;
|
|
1524
|
+
/** Stock Keeping Unit code — unique product identifier within the client. */
|
|
1525
|
+
sku_code?: string;
|
|
1526
|
+
/** Human-readable product name. */
|
|
1527
|
+
product_name?: string;
|
|
1528
|
+
/** Extended product description. */
|
|
1529
|
+
description?: string;
|
|
1530
|
+
/** Comma-separated list of alternative SKU codes for this product. */
|
|
1531
|
+
additional_skus?: string;
|
|
1532
|
+
/** Amazon Standard Identification Numbers associated with this product. */
|
|
1533
|
+
asins?: string;
|
|
1534
|
+
/** Client-defined custom fields as key-value pairs. */
|
|
1535
|
+
custom_fields?: Record<string, unknown>;
|
|
1536
|
+
/** Harmonized System code for customs classification (e.g. "6204.62"). */
|
|
1537
|
+
hs_code?: string;
|
|
1538
|
+
/** Unit of measure for the product (e.g. "each", "kg", "litre"). */
|
|
1539
|
+
unit_of_measure?: string;
|
|
1540
|
+
/** Number of individual units (eaches) contained in one case pack. */
|
|
1541
|
+
eaches_per_pack?: number;
|
|
1542
|
+
/** SKU code of the case pack product that contains this item. */
|
|
1543
|
+
case_pack_sku_code?: string;
|
|
1544
|
+
/** Weight of a single unit in grams. */
|
|
1545
|
+
weight_grams?: number;
|
|
1546
|
+
/** Primary barcode (EAN/UPC) for the product. */
|
|
1547
|
+
barcode?: string;
|
|
1548
|
+
/** Barcode for the case pack version of this product. */
|
|
1549
|
+
case_pack_barcode?: string;
|
|
1550
|
+
/** Foreign key to the product category for grouping/reporting. */
|
|
1551
|
+
product_category_id?: number;
|
|
1552
|
+
/** Product type classification (e.g. "physical", "digital", "service"). */
|
|
1553
|
+
product_type?: string;
|
|
1554
|
+
/** How the product is sold (e.g. "single", "pack", "case"). */
|
|
1555
|
+
sellable_format?: string;
|
|
1556
|
+
/** Description of the commodity for customs declarations. */
|
|
1557
|
+
commodity_description?: string;
|
|
1558
|
+
/** Unit sale price in the client's default currency. */
|
|
1559
|
+
price?: number;
|
|
1560
|
+
/** ISO 4217 currency code for the price (e.g. "GBP", "USD"). */
|
|
1561
|
+
currency?: string;
|
|
1562
|
+
/** ISO 3166-1 alpha-2 country of origin code for customs (e.g. "CN", "GB"). */
|
|
1563
|
+
country_of_origin?: string;
|
|
1564
|
+
/** Primary material composition of the product (e.g. "cotton", "polyester"). */
|
|
1565
|
+
primary_material?: string;
|
|
1566
|
+
/** Secondary material composition of the product. */
|
|
1567
|
+
secondary_material?: string;
|
|
1568
|
+
/** Dangerous goods classification code (e.g. UN number, hazmat class). Null if not hazardous. */
|
|
1569
|
+
dangerous_goods?: string;
|
|
1570
|
+
/** Export Control Classification Number for trade compliance. */
|
|
1571
|
+
eccn?: string;
|
|
1572
|
+
/** JSON or delimited string describing the component SKUs and quantities in a bundle. */
|
|
1573
|
+
bundle_components?: string;
|
|
1574
|
+
/** URL to the product image. */
|
|
1575
|
+
image_url?: string;
|
|
1576
|
+
/** Stock quantity threshold that triggers a low-stock alert. */
|
|
1577
|
+
low_stock_threshold?: number;
|
|
1578
|
+
/** Whether batch/lot tracking is required. 0 = disabled, 1 = enabled. */
|
|
1579
|
+
requires_batch_tracking?: number;
|
|
1580
|
+
/** Whether serial number tracking is required. 0 = disabled, 1 = enabled. */
|
|
1581
|
+
requires_serial_tracking?: number;
|
|
1582
|
+
/** Whether best-before/expiry date tracking is required. 0 = disabled, 1 = enabled. */
|
|
1583
|
+
requires_bbe_tracking?: number;
|
|
1584
|
+
/** Override for FEFO/FIFO stock rotation rules. 0 = use default (FEFO), 1 = override to FIFO. */
|
|
1585
|
+
fefo_fifo_override?: number;
|
|
1586
|
+
/** Whether this product is a bundle of other products. 0 = standalone product, 1 = bundle. */
|
|
1587
|
+
is_bundle?: number;
|
|
1588
|
+
/** Default status assigned to stock when received (e.g. "available", "quarantined"). */
|
|
1589
|
+
default_stock_status?: string;
|
|
1590
|
+
/** Current product lifecycle status (e.g. "active", "discontinued", "pending_setup"). */
|
|
1591
|
+
product_status?: string;
|
|
1592
|
+
/** Record status flag. 0 = inactive/deleted, 1 = active. */
|
|
1593
|
+
status?: number;
|
|
1594
|
+
/** ISO 8601 date string when the product was created. */
|
|
1595
|
+
created_date?: string;
|
|
1596
|
+
/** ISO 8601 date string when the product was last updated. */
|
|
1597
|
+
updated_date?: string;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
702
1600
|
/**
|
|
703
1601
|
* Helpers resource interface (no auth required)
|
|
704
1602
|
*/
|
|
@@ -712,7 +1610,18 @@ export declare interface HelpersResource {
|
|
|
712
1610
|
}
|
|
713
1611
|
|
|
714
1612
|
/**
|
|
715
|
-
* HTTP query for legacy products
|
|
1613
|
+
* HTTP query for legacy endpoints (products, orders, etc.).
|
|
1614
|
+
*
|
|
1615
|
+
* **Important — Client ID mapping:**
|
|
1616
|
+
* Legacy tables use `customer_id`, which is the `Client.remote_client_id` value —
|
|
1617
|
+
* NOT `Client.id` (the Janus internal ID). For admin users (`partition_id = 0`),
|
|
1618
|
+
* the server does not auto-filter by client, so you must include a filter like:
|
|
1619
|
+
*
|
|
1620
|
+
* ```ts
|
|
1621
|
+
* { query_name: 'products.customer_id', query_type: '=', query_value: client.remote_client_id }
|
|
1622
|
+
* ```
|
|
1623
|
+
*
|
|
1624
|
+
* For non-admin users the server adds this filter automatically.
|
|
716
1625
|
*/
|
|
717
1626
|
export declare interface HttpQueryRequest {
|
|
718
1627
|
/** Query conditions */
|
|
@@ -775,6 +1684,122 @@ export declare interface IntegrationsResource {
|
|
|
775
1684
|
update(id: number, data: Partial<CreateIntegrationRequest>): Promise<IntegrationEntity>;
|
|
776
1685
|
}
|
|
777
1686
|
|
|
1687
|
+
/**
|
|
1688
|
+
* Invoice Entity
|
|
1689
|
+
*
|
|
1690
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
1691
|
+
*
|
|
1692
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/invoices/invoice.entity.ts
|
|
1693
|
+
*/
|
|
1694
|
+
export declare interface Invoice extends BaseEntity_2 {
|
|
1695
|
+
/** Foreign key to the client this invoice belongs to. */
|
|
1696
|
+
clientId?: number;
|
|
1697
|
+
/** ISO 8601 date string for the invoice issue date. */
|
|
1698
|
+
invoice_date: string;
|
|
1699
|
+
/** External reference ID from Xero accounting integration. */
|
|
1700
|
+
xero_reference?: string;
|
|
1701
|
+
/** Total invoice amount in the billing currency. */
|
|
1702
|
+
total?: number;
|
|
1703
|
+
/** Whether the invoice has been emailed to the client. 0 = not emailed, 1 = emailed. */
|
|
1704
|
+
emailed?: number;
|
|
1705
|
+
/** Whether the invoice has been marked as paid. 0 = unpaid, 1 = paid. */
|
|
1706
|
+
paid?: number;
|
|
1707
|
+
/** Fuel surcharge calculation mode. 0 = flat rate, 1 = percentage-based. */
|
|
1708
|
+
fuel_mode?: number;
|
|
1709
|
+
/** Record status flag. 0 = inactive/deleted, 1 = active. */
|
|
1710
|
+
status?: number;
|
|
1711
|
+
/** OneToMany relationship to InvoiceLine */
|
|
1712
|
+
invoiceLines?: InvoiceLine[];
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
/**
|
|
1716
|
+
* InvoiceLine Entity
|
|
1717
|
+
*
|
|
1718
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
1719
|
+
*
|
|
1720
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/invoices/line.entity.ts
|
|
1721
|
+
*/
|
|
1722
|
+
export declare interface InvoiceLine extends BaseEntity_2 {
|
|
1723
|
+
/** Foreign key to the parent invoice this line belongs to. */
|
|
1724
|
+
invoice_id?: number;
|
|
1725
|
+
/** Classification ID grouping this line item (e.g. storage, fulfilment, shipping). */
|
|
1726
|
+
class_id?: number;
|
|
1727
|
+
/** Foreign key to the billable object (e.g. dispatch ID, storage record ID) this line references. */
|
|
1728
|
+
object_id?: number;
|
|
1729
|
+
/** Client-facing reference string for the line item (e.g. order number, dispatch reference). */
|
|
1730
|
+
reference: string;
|
|
1731
|
+
/** Human-readable description of the charge. */
|
|
1732
|
+
description?: string;
|
|
1733
|
+
/** ISO 8601 date string of the dispatch associated with this charge. */
|
|
1734
|
+
dispatch_date?: string;
|
|
1735
|
+
/** Name of the shipping service used (e.g. "Royal Mail Tracked 24"). */
|
|
1736
|
+
service_name?: string;
|
|
1737
|
+
/** Foreign key to the service fee schedule applied for pricing. */
|
|
1738
|
+
service_fee_id?: number;
|
|
1739
|
+
/** Foreign key to the courier/carrier associated with this charge. */
|
|
1740
|
+
courier_id?: number;
|
|
1741
|
+
/** Unit price for this line item in the invoice currency. */
|
|
1742
|
+
price?: number;
|
|
1743
|
+
/** Discount rate applied to this line as a percentage (e.g. 10 = 10% off). */
|
|
1744
|
+
discount_rate?: number;
|
|
1745
|
+
/** Destination postcode used for shipping cost calculation. */
|
|
1746
|
+
postcode?: string;
|
|
1747
|
+
/** ISO 3166-1 alpha-2 destination country code (e.g. "GB", "US"). */
|
|
1748
|
+
country_code?: string;
|
|
1749
|
+
/** Tax classification for VAT/GST purposes. Determines the tax rate applied (e.g. 0 = zero-rated, 1 = standard rate, 2 = exempt). */
|
|
1750
|
+
tax_class?: number;
|
|
1751
|
+
/** Cost of the consignment/shipment charged by the carrier, before margin. */
|
|
1752
|
+
consignment_price?: number;
|
|
1753
|
+
/** Fuel surcharge amount added by the carrier. */
|
|
1754
|
+
fuel?: number;
|
|
1755
|
+
/** Cost of packaging materials used for the dispatch. */
|
|
1756
|
+
packaging_price?: number;
|
|
1757
|
+
/** Calculated discount amount in the invoice currency. */
|
|
1758
|
+
discount?: number;
|
|
1759
|
+
/** Number of order lines included in this dispatch (used for per-line billing). */
|
|
1760
|
+
lines?: number;
|
|
1761
|
+
/** Number of individual item picks performed (used for per-pick billing). */
|
|
1762
|
+
picks?: number;
|
|
1763
|
+
/** Total weight of the dispatch in kilograms. */
|
|
1764
|
+
weight?: number;
|
|
1765
|
+
/** Margin percentage or amount charged on top of the carrier cost (buy/sell spread). */
|
|
1766
|
+
margin_charged?: number;
|
|
1767
|
+
/** Manual override of the calculated line total. When set, replaces the computed total. */
|
|
1768
|
+
total_override?: number;
|
|
1769
|
+
/** Flag indicating this line needs recalculation. 0 = no recheck needed, 1 = recheck required. */
|
|
1770
|
+
recheck?: number;
|
|
1771
|
+
/** Flag indicating the price has been manually overridden. 0 = auto-calculated, 1 = manually overridden. */
|
|
1772
|
+
override?: number;
|
|
1773
|
+
/** Record status flag. 0 = inactive/deleted, 1 = active. */
|
|
1774
|
+
status?: number;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
/**
|
|
1778
|
+
* Invoices resource interface
|
|
1779
|
+
*/
|
|
1780
|
+
export declare interface InvoicesResource {
|
|
1781
|
+
/** Get all invoices with pagination */
|
|
1782
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<Invoice>>;
|
|
1783
|
+
/** Get an invoice by ID */
|
|
1784
|
+
getById(id: number): Promise<Invoice>;
|
|
1785
|
+
/** Create a new invoice */
|
|
1786
|
+
create(data: CreateInvoiceRequest): Promise<Invoice>;
|
|
1787
|
+
/** Update an invoice */
|
|
1788
|
+
update(id: number, data: Partial<CreateInvoiceRequest>): Promise<Invoice>;
|
|
1789
|
+
/** Delete an invoice */
|
|
1790
|
+
delete(id: number): Promise<void>;
|
|
1791
|
+
/** Get lines for an invoice */
|
|
1792
|
+
getLines(invoiceId: number, filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<InvoiceLine>>;
|
|
1793
|
+
/** Get a specific invoice line */
|
|
1794
|
+
getLineById(invoiceId: number, lineId: number): Promise<InvoiceLine>;
|
|
1795
|
+
/** Create a new invoice line */
|
|
1796
|
+
createLine(invoiceId: number, data: CreateInvoiceLineRequest): Promise<unknown>;
|
|
1797
|
+
/** Update an invoice line */
|
|
1798
|
+
updateLine(invoiceId: number, lineId: number, data: UpdateInvoiceLineRequest): Promise<InvoiceLine>;
|
|
1799
|
+
/** Delete an invoice line */
|
|
1800
|
+
deleteLine(invoiceId: number, lineId: number): Promise<void>;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
778
1803
|
/**
|
|
779
1804
|
* Check if an error is a JanusApiError
|
|
780
1805
|
*/
|
|
@@ -815,6 +1840,28 @@ export declare interface JanusApi {
|
|
|
815
1840
|
customer: CustomerResource;
|
|
816
1841
|
/** Legacy resource - legacy couriers, post services, products */
|
|
817
1842
|
legacy: LegacyResource;
|
|
1843
|
+
/** Products resource - product CRUD (preferred over legacy.queryProducts) */
|
|
1844
|
+
products: ProductsResource;
|
|
1845
|
+
/** Product categories resource */
|
|
1846
|
+
productCategories: ProductCategoriesResource;
|
|
1847
|
+
/** Stocks resource - stock management */
|
|
1848
|
+
stocks: StocksResource;
|
|
1849
|
+
/** Stock transactions resource */
|
|
1850
|
+
stockTransactions: StockTransactionsResource;
|
|
1851
|
+
/** Stock allocations resource */
|
|
1852
|
+
stockAllocations: StockAllocationsResource;
|
|
1853
|
+
/** Locations resource - warehouse locations */
|
|
1854
|
+
locations: LocationsResource;
|
|
1855
|
+
/** Audits resource - audit trail (read-only) */
|
|
1856
|
+
audits: AuditsResource;
|
|
1857
|
+
/** ASNs resource - advance shipping notices with lines and receipts */
|
|
1858
|
+
asns: AsnsResource;
|
|
1859
|
+
/** Dispatches resource */
|
|
1860
|
+
dispatches: DispatchesResource;
|
|
1861
|
+
/** Consignments resource */
|
|
1862
|
+
consignments: ConsignmentsResource;
|
|
1863
|
+
/** Invoices resource - invoices with line items */
|
|
1864
|
+
invoices: InvoicesResource;
|
|
818
1865
|
/** Underlying AuthApi instance for raw requests */
|
|
819
1866
|
auth: AuthApi;
|
|
820
1867
|
}
|
|
@@ -852,6 +1899,320 @@ export declare interface JanusApiOptions {
|
|
|
852
1899
|
onLoginError?: (error: Error) => void;
|
|
853
1900
|
}
|
|
854
1901
|
|
|
1902
|
+
/**
|
|
1903
|
+
* LegacyDispatch Entity
|
|
1904
|
+
*
|
|
1905
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
1906
|
+
*
|
|
1907
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/Dispatch.entity.ts
|
|
1908
|
+
*/
|
|
1909
|
+
export declare interface LegacyDispatch {
|
|
1910
|
+
/** Primary key identifier for the dispatch record. */
|
|
1911
|
+
id: number;
|
|
1912
|
+
/** Foreign key to the parent order this dispatch belongs to. */
|
|
1913
|
+
orderId?: number;
|
|
1914
|
+
/** Foreign key to the user who created or processed the dispatch. */
|
|
1915
|
+
userLoginId?: number;
|
|
1916
|
+
/** Client-facing reference code for the dispatch (e.g. order number or custom reference). */
|
|
1917
|
+
reference?: string;
|
|
1918
|
+
/** Foreign key to the delivery address record for the shopper. */
|
|
1919
|
+
shopperAddressIdDelivery?: number;
|
|
1920
|
+
/** ISO 8601 date string when the dispatch was shipped. */
|
|
1921
|
+
dispatchDate?: string;
|
|
1922
|
+
/** ISO 8601 date string when the associated invoice was raised. */
|
|
1923
|
+
invoiceDate?: string;
|
|
1924
|
+
/** Foreign key to the postal/shipping service used for this dispatch. */
|
|
1925
|
+
postServiceId?: number;
|
|
1926
|
+
/** Numeric status code for the dispatch. Common values: 0 = pending, 1 = dispatched, 2 = cancelled. */
|
|
1927
|
+
dispatchStatus?: number;
|
|
1928
|
+
/** Carrier tracking number for the shipment. */
|
|
1929
|
+
trackingNumber?: string;
|
|
1930
|
+
/** Actual measured weight of the dispatch in grams or kilograms (depends on client configuration). */
|
|
1931
|
+
actualWeight?: number;
|
|
1932
|
+
/** Foreign key to the courier/carrier used for delivery. */
|
|
1933
|
+
courierId?: number;
|
|
1934
|
+
/** Internal notes or comments attached to the dispatch. */
|
|
1935
|
+
notes?: string;
|
|
1936
|
+
/** Foreign key to the tariff schedule applied to this dispatch for billing. */
|
|
1937
|
+
tariffDispatchId?: number;
|
|
1938
|
+
/** Foreign key to the email template used for automated dispatch notifications. */
|
|
1939
|
+
autoEmailTemplateId?: number;
|
|
1940
|
+
/** ISO 8601 date string when the dispatch notification email was sent. Null if not yet mailed. */
|
|
1941
|
+
mailed?: string;
|
|
1942
|
+
/** Whether the dispatch is on hold. 0 = not on hold, 1 = on hold. */
|
|
1943
|
+
hold?: unknown;
|
|
1944
|
+
/** ISO 8601 date string when a held dispatch was released for processing. */
|
|
1945
|
+
releaseDate?: string;
|
|
1946
|
+
/** Whether this dispatch is a draft. 0 = finalised, 1 = draft. */
|
|
1947
|
+
draft?: unknown;
|
|
1948
|
+
/** Gift message to include with the shipment. */
|
|
1949
|
+
giftMessage?: string;
|
|
1950
|
+
/** Special delivery instructions for the courier (e.g. "leave with neighbour"). */
|
|
1951
|
+
deliveryInstructions?: string;
|
|
1952
|
+
/** Whether a cancellation has been requested. 0 = no cancellation requested, 1 = cancellation requested. */
|
|
1953
|
+
cancelRequested?: unknown;
|
|
1954
|
+
/** Foreign key to the current dispatch action being performed (e.g. pick, pack, ship). */
|
|
1955
|
+
dispatchActionId?: number;
|
|
1956
|
+
/** Status of the current dispatch action. 0 = not started, 1 = in progress, 2 = completed. */
|
|
1957
|
+
dispatchActionStatus?: number;
|
|
1958
|
+
/** Stock fulfilment status. 0 = unallocated, 1 = partially allocated, 2 = fully allocated. */
|
|
1959
|
+
stockStatus?: number;
|
|
1960
|
+
/** Flag indicating a problem with the dispatch. 0 = no issue, 1 = issue flagged. */
|
|
1961
|
+
dispatchIssue?: number;
|
|
1962
|
+
/** Whether this dispatch is for an international export. 0 = domestic, 1 = export. */
|
|
1963
|
+
export?: unknown;
|
|
1964
|
+
/** Incoterms delivery terms code (e.g. "DAP", "DDP", "EXW"). */
|
|
1965
|
+
deliveryTerms?: string;
|
|
1966
|
+
/** Reason code for export classification (customs/regulatory). */
|
|
1967
|
+
exportReason?: unknown;
|
|
1968
|
+
/** Dispatch priority level. Higher numbers indicate higher priority. */
|
|
1969
|
+
priority?: number;
|
|
1970
|
+
/** Foreign key to a workflow action record associated with this dispatch. */
|
|
1971
|
+
actionId?: number;
|
|
1972
|
+
/** ISO 8601 date string when the dispatch action was performed. */
|
|
1973
|
+
actioned?: string;
|
|
1974
|
+
/** Free-text reason for export, used on customs declarations. */
|
|
1975
|
+
reasonForExport?: string;
|
|
1976
|
+
/** ISO 8601 date string when the dispatch record was created. */
|
|
1977
|
+
created?: string;
|
|
1978
|
+
/** ISO 8601 date string when the dispatch record was last modified. */
|
|
1979
|
+
modified?: string;
|
|
1980
|
+
/** Record status flag. 0 = inactive/deleted, 1 = active. */
|
|
1981
|
+
status?: number;
|
|
1982
|
+
/** Partition ID for multi-tenant data isolation. */
|
|
1983
|
+
partition_id?: number;
|
|
1984
|
+
/** Whether the dispatch is fully complete. 0 = incomplete, 1 = complete. */
|
|
1985
|
+
complete?: number;
|
|
1986
|
+
/** ISO 8601 date string when the dispatch was marked as complete. */
|
|
1987
|
+
complete_date?: string;
|
|
1988
|
+
/** ManyToOne relationship to LegacyOrder */
|
|
1989
|
+
order: LegacyOrder;
|
|
1990
|
+
/** OneToMany relationship to LegacyDispatchItem */
|
|
1991
|
+
dispatchItems: LegacyDispatchItem[];
|
|
1992
|
+
/** OneToOne relationship to LegacyShopperAddress */
|
|
1993
|
+
shopperDeliveryAddress: LegacyShopperAddress;
|
|
1994
|
+
/** OneToOne relationship to Consignment */
|
|
1995
|
+
consignment: Consignment_2;
|
|
1996
|
+
/** OneToOne relationship to LegacyPostService */
|
|
1997
|
+
postService: LegacyPostService;
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
/**
|
|
2001
|
+
* LegacyDispatchItem Entity
|
|
2002
|
+
*
|
|
2003
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2004
|
+
*
|
|
2005
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/DispatchItem.entity.ts
|
|
2006
|
+
*/
|
|
2007
|
+
declare interface LegacyDispatchItem {
|
|
2008
|
+
id: number;
|
|
2009
|
+
dispatchId?: number;
|
|
2010
|
+
productId?: number;
|
|
2011
|
+
quantity?: number;
|
|
2012
|
+
tariffDispatchId?: number;
|
|
2013
|
+
tariffDispatchProductId?: number;
|
|
2014
|
+
created?: string;
|
|
2015
|
+
modified?: string;
|
|
2016
|
+
status?: number;
|
|
2017
|
+
partition_id?: number;
|
|
2018
|
+
/** ManyToOne relationship to LegacyDispatch */
|
|
2019
|
+
dispatch: LegacyDispatch;
|
|
2020
|
+
/** ManyToOne relationship to LegacyProduct */
|
|
2021
|
+
product: LegacyProduct;
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
/**
|
|
2025
|
+
* LegacyOrder Entity
|
|
2026
|
+
*
|
|
2027
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2028
|
+
*
|
|
2029
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/Order.entity.ts
|
|
2030
|
+
*/
|
|
2031
|
+
declare interface LegacyOrder {
|
|
2032
|
+
id: number;
|
|
2033
|
+
customerId?: number;
|
|
2034
|
+
userLoginId?: number;
|
|
2035
|
+
brandId?: number;
|
|
2036
|
+
reference?: string;
|
|
2037
|
+
source?: number;
|
|
2038
|
+
shopperAddressIdDelivery?: number;
|
|
2039
|
+
shopperAddressIdInvoice?: number;
|
|
2040
|
+
orderDate?: string;
|
|
2041
|
+
dispatchCompletedDate?: string;
|
|
2042
|
+
postServiceId?: number;
|
|
2043
|
+
orderStatus?: number;
|
|
2044
|
+
actualWeight?: number;
|
|
2045
|
+
courierId?: number;
|
|
2046
|
+
notes?: string;
|
|
2047
|
+
skippedLines?: number;
|
|
2048
|
+
autoEmailTemplateId?: number;
|
|
2049
|
+
hold?: unknown;
|
|
2050
|
+
releaseDate?: string;
|
|
2051
|
+
draft?: unknown;
|
|
2052
|
+
giftMessage?: string;
|
|
2053
|
+
deliveryInstructions?: string;
|
|
2054
|
+
cancelRequested?: unknown;
|
|
2055
|
+
orderActionId?: number;
|
|
2056
|
+
orderActionStatus?: number;
|
|
2057
|
+
stockDeducted?: unknown;
|
|
2058
|
+
orderIssue?: number;
|
|
2059
|
+
export?: unknown;
|
|
2060
|
+
deliveryTerms?: string;
|
|
2061
|
+
exportReason?: unknown;
|
|
2062
|
+
actionId?: number;
|
|
2063
|
+
created?: string;
|
|
2064
|
+
modified?: string;
|
|
2065
|
+
status?: number;
|
|
2066
|
+
partition_id?: number;
|
|
2067
|
+
external_order_id?: string;
|
|
2068
|
+
channel_order_id?: string;
|
|
2069
|
+
transaction_type: 'b2c' | 'b2b' | 'internal_transfer' | 'damage' | 'expiry';
|
|
2070
|
+
channel?: string;
|
|
2071
|
+
/** OneToMany relationship to LegacyOrderItem */
|
|
2072
|
+
orderItems: LegacyOrderItem[];
|
|
2073
|
+
/** OneToMany relationship to LegacyOrderMeta */
|
|
2074
|
+
orderMeta: LegacyOrderMeta[];
|
|
2075
|
+
/** OneToOne relationship to LegacyShopperAddress */
|
|
2076
|
+
shopperDeliveryAddress: LegacyShopperAddress;
|
|
2077
|
+
/** OneToOne relationship to LegacyShopperAddress */
|
|
2078
|
+
shopperBillingAddress: LegacyShopperAddress;
|
|
2079
|
+
/** OneToMany relationship to LegacyDispatch */
|
|
2080
|
+
dispatches: LegacyDispatch[];
|
|
2081
|
+
/** OneToOne relationship to LegacyDispatch */
|
|
2082
|
+
dispatch: LegacyDispatch;
|
|
2083
|
+
/** OneToOne relationship to Source */
|
|
2084
|
+
orderSource: Source;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
/**
|
|
2088
|
+
* LegacyOrderItem Entity
|
|
2089
|
+
*
|
|
2090
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2091
|
+
*
|
|
2092
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/OrderItem.entity.ts
|
|
2093
|
+
*/
|
|
2094
|
+
declare interface LegacyOrderItem {
|
|
2095
|
+
id: number;
|
|
2096
|
+
orderId?: number;
|
|
2097
|
+
productId?: number;
|
|
2098
|
+
quantity?: number;
|
|
2099
|
+
created?: string;
|
|
2100
|
+
modified?: string;
|
|
2101
|
+
status?: number;
|
|
2102
|
+
partition_id?: number;
|
|
2103
|
+
/** ManyToOne relationship to LegacyOrder */
|
|
2104
|
+
order: LegacyOrder;
|
|
2105
|
+
/** ManyToOne relationship to LegacyProduct */
|
|
2106
|
+
product: LegacyProduct;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
/**
|
|
2110
|
+
* LegacyOrderMeta Entity
|
|
2111
|
+
*
|
|
2112
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2113
|
+
*
|
|
2114
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/OrderMeta.entity.ts
|
|
2115
|
+
*/
|
|
2116
|
+
declare interface LegacyOrderMeta {
|
|
2117
|
+
id: number;
|
|
2118
|
+
orderId: number;
|
|
2119
|
+
orderData?: Record<string, unknown>;
|
|
2120
|
+
created?: string;
|
|
2121
|
+
modified?: string;
|
|
2122
|
+
status?: number;
|
|
2123
|
+
/** ManyToOne relationship to LegacyOrder */
|
|
2124
|
+
order: LegacyOrder;
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
/**
|
|
2128
|
+
* Legacy post service entity
|
|
2129
|
+
*/
|
|
2130
|
+
declare interface LegacyPostService {
|
|
2131
|
+
id: number;
|
|
2132
|
+
name?: string;
|
|
2133
|
+
[key: string]: unknown;
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
/**
|
|
2137
|
+
* LegacyProduct Entity
|
|
2138
|
+
*
|
|
2139
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2140
|
+
*
|
|
2141
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/Product.entity.ts
|
|
2142
|
+
*/
|
|
2143
|
+
declare interface LegacyProduct {
|
|
2144
|
+
id: number;
|
|
2145
|
+
sku?: string;
|
|
2146
|
+
name?: string;
|
|
2147
|
+
/** Legacy customer ID. Matches `Client.remote_client_id`, NOT `Client.id`. */
|
|
2148
|
+
customerId?: number;
|
|
2149
|
+
description?: string;
|
|
2150
|
+
commodityCode?: number;
|
|
2151
|
+
compostionId?: number;
|
|
2152
|
+
additional_skus?: string;
|
|
2153
|
+
asins?: string;
|
|
2154
|
+
custom_fields: Record<string, unknown>;
|
|
2155
|
+
unit_of_measure?: string;
|
|
2156
|
+
eaches_per_pack?: number;
|
|
2157
|
+
case_pack_sku_code?: string;
|
|
2158
|
+
weight_grams?: number;
|
|
2159
|
+
case_pack_barcode?: string;
|
|
2160
|
+
product_category_id?: number;
|
|
2161
|
+
product_type?: 'sellable_unit' | 'packaging' | 'component' | 'consumables';
|
|
2162
|
+
sellable_format: 'single' | 'case_pack' | 'bundle';
|
|
2163
|
+
commodity_description?: string;
|
|
2164
|
+
currency?: string;
|
|
2165
|
+
primary_material?: string;
|
|
2166
|
+
secondary_material?: string;
|
|
2167
|
+
dangerous_goods?: string;
|
|
2168
|
+
eccn?: string;
|
|
2169
|
+
bundle_components?: string;
|
|
2170
|
+
image_url?: string;
|
|
2171
|
+
low_stock_threshold?: number;
|
|
2172
|
+
requires_batch_tracking?: unknown;
|
|
2173
|
+
requires_serial_tracking?: unknown;
|
|
2174
|
+
requires_bbe_tracking?: unknown;
|
|
2175
|
+
fefo_fifo_override?: unknown;
|
|
2176
|
+
is_bundle?: unknown;
|
|
2177
|
+
default_stock_status: 'available' | 'quarantined' | 'expired' | 'damaged';
|
|
2178
|
+
product_status: 'active' | 'pre_active ' | 'discontinued ' | 'inactive ' | 'archived';
|
|
2179
|
+
value?: number;
|
|
2180
|
+
rrp?: number;
|
|
2181
|
+
qty?: number;
|
|
2182
|
+
dim_1?: number;
|
|
2183
|
+
dim_2?: number;
|
|
2184
|
+
dim_3?: number;
|
|
2185
|
+
weight?: number;
|
|
2186
|
+
stock?: number;
|
|
2187
|
+
stockExp?: number;
|
|
2188
|
+
stockAlloc?: number;
|
|
2189
|
+
stockRequested?: number;
|
|
2190
|
+
stockPreOrder?: number;
|
|
2191
|
+
stockPreOrderAlloc?: number;
|
|
2192
|
+
reorder?: number;
|
|
2193
|
+
barcode?: string;
|
|
2194
|
+
locationId?: number;
|
|
2195
|
+
abort: unknown;
|
|
2196
|
+
ignore: unknown;
|
|
2197
|
+
update: unknown;
|
|
2198
|
+
manage: unknown;
|
|
2199
|
+
archive: unknown;
|
|
2200
|
+
phantom: unknown;
|
|
2201
|
+
hsCode?: string;
|
|
2202
|
+
composite: unknown;
|
|
2203
|
+
origin?: string;
|
|
2204
|
+
zeroStock?: number;
|
|
2205
|
+
autoRework?: number;
|
|
2206
|
+
created?: string;
|
|
2207
|
+
modified?: string;
|
|
2208
|
+
status?: number;
|
|
2209
|
+
partition_id?: number;
|
|
2210
|
+
/** OneToMany relationship to LegacyDispatchItem */
|
|
2211
|
+
dispatchItems: LegacyDispatchItem[];
|
|
2212
|
+
/** OneToMany relationship to LegacyOrderItem */
|
|
2213
|
+
orderItems: LegacyOrderItem[];
|
|
2214
|
+
}
|
|
2215
|
+
|
|
855
2216
|
/**
|
|
856
2217
|
* Legacy resource interface
|
|
857
2218
|
*/
|
|
@@ -862,8 +2223,133 @@ export declare interface LegacyResource {
|
|
|
862
2223
|
getPostServices(): Promise<unknown[]>;
|
|
863
2224
|
/** Get legacy post services by carrier code */
|
|
864
2225
|
getPostServicesByCarrier(carrierCode: string): Promise<unknown[]>;
|
|
865
|
-
/**
|
|
2226
|
+
/**
|
|
2227
|
+
* Query legacy products.
|
|
2228
|
+
*
|
|
2229
|
+
* **Important — Client filtering:**
|
|
2230
|
+
* For non-admin users the server auto-filters by client. For admin users
|
|
2231
|
+
* (`partition_id = 0`) you must pass `products.customer_id` explicitly using
|
|
2232
|
+
* the client's `remote_client_id` — NOT `Client.id` (the Janus internal ID).
|
|
2233
|
+
*
|
|
2234
|
+
* @deprecated Use janus.products.getAll() instead.
|
|
2235
|
+
*
|
|
2236
|
+
* @example
|
|
2237
|
+
* // Admin user — must filter by client manually
|
|
2238
|
+
* janus.legacy.queryProducts({
|
|
2239
|
+
* query: [
|
|
2240
|
+
* { query_name: 'products.customer_id', query_type: '=', query_value: selectedClient.remote_client_id },
|
|
2241
|
+
* ],
|
|
2242
|
+
* limit: 1000,
|
|
2243
|
+
* });
|
|
2244
|
+
*
|
|
2245
|
+
* // Non-admin user — server filters automatically
|
|
2246
|
+
* janus.legacy.queryProducts({ query: [], limit: 1000 });
|
|
2247
|
+
*/
|
|
866
2248
|
queryProducts(query: HttpQueryRequest): Promise<unknown>;
|
|
2249
|
+
/** Get the legacy print list */
|
|
2250
|
+
getPrintList(): Promise<unknown[]>;
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
/**
|
|
2254
|
+
* LegacyShopperAddress Entity
|
|
2255
|
+
*
|
|
2256
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2257
|
+
*
|
|
2258
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/legacy/ShopperAddress.entity.ts
|
|
2259
|
+
*/
|
|
2260
|
+
declare interface LegacyShopperAddress {
|
|
2261
|
+
id: number;
|
|
2262
|
+
customerId?: number;
|
|
2263
|
+
userLoginId?: number;
|
|
2264
|
+
title?: string;
|
|
2265
|
+
forename?: string;
|
|
2266
|
+
surname?: string;
|
|
2267
|
+
company?: string;
|
|
2268
|
+
line_1?: string;
|
|
2269
|
+
line_2?: string;
|
|
2270
|
+
line_3?: string;
|
|
2271
|
+
city?: string;
|
|
2272
|
+
county?: string;
|
|
2273
|
+
country?: string;
|
|
2274
|
+
countryCode?: string;
|
|
2275
|
+
postcode?: string;
|
|
2276
|
+
email?: string;
|
|
2277
|
+
phoneNumber?: string;
|
|
2278
|
+
eori?: string;
|
|
2279
|
+
created?: string;
|
|
2280
|
+
modified?: string;
|
|
2281
|
+
status?: number;
|
|
2282
|
+
/** OneToOne relationship to LegacyOrder */
|
|
2283
|
+
orderDelivery: LegacyOrder;
|
|
2284
|
+
/** OneToOne relationship to LegacyOrder */
|
|
2285
|
+
orderBilling: LegacyOrder;
|
|
2286
|
+
/** OneToOne relationship to LegacyDispatch */
|
|
2287
|
+
dispatchDelivery: LegacyDispatch;
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
/**
|
|
2291
|
+
* Location Entity
|
|
2292
|
+
*
|
|
2293
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2294
|
+
*
|
|
2295
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/locations/location.entity.ts
|
|
2296
|
+
*/
|
|
2297
|
+
declare interface Location_2 extends BaseEntity_2 {
|
|
2298
|
+
/** Foreign key to the client that owns this location. */
|
|
2299
|
+
clientId?: number;
|
|
2300
|
+
/** Unique human-readable code identifying this location (e.g. "A-01-03-B"). */
|
|
2301
|
+
location_code?: string;
|
|
2302
|
+
/** Type of warehouse location determining its role in the fulfilment workflow. */
|
|
2303
|
+
location_type: 'pick' | 'bulk' | 'staging' | 'receiving' | 'shipping' | 'quarantine' | 'returns';
|
|
2304
|
+
/** Warehouse zone grouping (e.g. "A", "B", "Mezzanine"). */
|
|
2305
|
+
zone?: string;
|
|
2306
|
+
/** Aisle identifier within the zone. */
|
|
2307
|
+
aisle?: string;
|
|
2308
|
+
/** Bay/rack identifier within the aisle. */
|
|
2309
|
+
bay?: string;
|
|
2310
|
+
/** Vertical level/shelf within the bay. */
|
|
2311
|
+
level?: string;
|
|
2312
|
+
/** Horizontal position within the level. */
|
|
2313
|
+
position?: string;
|
|
2314
|
+
/** Foreign key to the fulfilment centre this location belongs to. */
|
|
2315
|
+
fulfilment_location_id?: number;
|
|
2316
|
+
/** Human-readable name of the fulfilment centre. */
|
|
2317
|
+
fulfilment_location_name?: string;
|
|
2318
|
+
/** Current number of stock units held in this location. */
|
|
2319
|
+
current_units?: number;
|
|
2320
|
+
/** Maximum unit capacity of this location. */
|
|
2321
|
+
max_capacity_units?: number;
|
|
2322
|
+
/** Maximum weight capacity in kilograms for this location. */
|
|
2323
|
+
max_capacity_weight_kg?: number;
|
|
2324
|
+
/** Whether multiple different SKUs can be stored in this location. 0 = no (single SKU only), 1 = yes (mixed SKUs allowed). */
|
|
2325
|
+
is_mixed_sku_allowed?: number;
|
|
2326
|
+
/** Whether this location is currently active. 0 = no (decommissioned), 1 = yes (in use). */
|
|
2327
|
+
is_active?: number;
|
|
2328
|
+
/** Whether stock can be picked from this location. 0 = no, 1 = yes. */
|
|
2329
|
+
is_pickable?: number;
|
|
2330
|
+
/** Whether stock can be received into this location. 0 = no, 1 = yes. */
|
|
2331
|
+
is_receivable?: number;
|
|
2332
|
+
/** Temperature storage zone for the location. */
|
|
2333
|
+
temperature_zone: 'ambient' | 'chilled' | 'frozen';
|
|
2334
|
+
/** Free-text notes about this location (e.g. access restrictions, special handling). */
|
|
2335
|
+
notes?: string;
|
|
2336
|
+
}
|
|
2337
|
+
export { Location_2 as Location }
|
|
2338
|
+
|
|
2339
|
+
/**
|
|
2340
|
+
* Locations resource interface
|
|
2341
|
+
*/
|
|
2342
|
+
export declare interface LocationsResource {
|
|
2343
|
+
/** Get all locations with optional filters */
|
|
2344
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<Location_2>>;
|
|
2345
|
+
/** Get a location by ID */
|
|
2346
|
+
getById(id: number): Promise<Location_2>;
|
|
2347
|
+
/** Create a new location */
|
|
2348
|
+
create(data: CreateLocationRequest): Promise<Location_2>;
|
|
2349
|
+
/** Update an existing location */
|
|
2350
|
+
update(id: number, data: Partial<CreateLocationRequest>): Promise<Location_2>;
|
|
2351
|
+
/** Delete a location by ID */
|
|
2352
|
+
delete(id: number): Promise<void>;
|
|
867
2353
|
}
|
|
868
2354
|
|
|
869
2355
|
/**
|
|
@@ -975,16 +2461,28 @@ export declare interface OrdersQueryFilters extends BaseFilters {
|
|
|
975
2461
|
* Orders resource interface
|
|
976
2462
|
*/
|
|
977
2463
|
export declare interface OrdersResource {
|
|
978
|
-
/** Get orders with filters */
|
|
2464
|
+
/** Get all orders with optional query filters (client, date range, status, etc.) */
|
|
979
2465
|
getAll(filters?: OrdersQueryFilters): Promise<unknown[]>;
|
|
980
|
-
/** Get order statistics */
|
|
2466
|
+
/** Get aggregated order statistics (counts, totals) with optional filters */
|
|
981
2467
|
getStats(filters?: OrdersStatsFilters): Promise<OrdersStatsResponse>;
|
|
982
|
-
/** Get return
|
|
2468
|
+
/** Get orders that have associated returns, with optional return-specific filters */
|
|
983
2469
|
getReturns(filters?: OrderReturnsFilters): Promise<unknown[]>;
|
|
984
|
-
/**
|
|
2470
|
+
/**
|
|
2471
|
+
* Get a single order by its dispatch reference string.
|
|
2472
|
+
* Optionally scope to a specific client.
|
|
2473
|
+
*/
|
|
985
2474
|
getByRef(dispatchRef: string, clientId?: number): Promise<unknown>;
|
|
986
|
-
/** Get filter options for returns */
|
|
2475
|
+
/** Get available filter options for the returns order list, scoped to a client */
|
|
987
2476
|
getReturnFilterOptions(clientId: number): Promise<FilterOptionsResponse>;
|
|
2477
|
+
/**
|
|
2478
|
+
* Get available filter type options for the main orders list.
|
|
2479
|
+
* Optionally scoped to a specific client; omit for all available filter types.
|
|
2480
|
+
*/
|
|
2481
|
+
getFilterTypes(clientId?: number): Promise<FilterOptionsResponse>;
|
|
2482
|
+
/** Create a new order. The request body must include all required order fields and line items. */
|
|
2483
|
+
create(data: CreateOrderRequest): Promise<unknown>;
|
|
2484
|
+
/** Update an existing order by ID. Only the provided fields will be changed (partial update). */
|
|
2485
|
+
updateOrder(id: number, data: Partial<CreateOrderRequest>): Promise<unknown>;
|
|
988
2486
|
}
|
|
989
2487
|
|
|
990
2488
|
/**
|
|
@@ -1008,6 +2506,40 @@ export declare interface OrdersStatsResponse {
|
|
|
1008
2506
|
[key: string]: unknown;
|
|
1009
2507
|
}
|
|
1010
2508
|
|
|
2509
|
+
/**
|
|
2510
|
+
* Paginated list response from v2 endpoints.
|
|
2511
|
+
*
|
|
2512
|
+
* New v2 endpoints (products, stocks, locations, etc.) return this shape.
|
|
2513
|
+
* Distinct from `PaginatedResponse<T>` which is used by older endpoints.
|
|
2514
|
+
*/
|
|
2515
|
+
export declare interface PaginatedListResponse<T> {
|
|
2516
|
+
/** Data items for the current page */
|
|
2517
|
+
data: T[];
|
|
2518
|
+
/** Pagination metadata */
|
|
2519
|
+
meta: PaginationMeta;
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
/**
|
|
2523
|
+
* Base filters for v2 paginated list endpoints.
|
|
2524
|
+
*
|
|
2525
|
+
* All new v2 endpoints accept these query parameters (sent as snake_case on the wire).
|
|
2526
|
+
* Use with `buildPaginatedUrl()` which converts camelCase keys automatically.
|
|
2527
|
+
*/
|
|
2528
|
+
export declare interface PaginatedQueryFilters {
|
|
2529
|
+
/** Filter by client ID (Janus internal ID) */
|
|
2530
|
+
clientId?: number;
|
|
2531
|
+
/** Results per page */
|
|
2532
|
+
pageSize?: number;
|
|
2533
|
+
/** Page number (1-based) */
|
|
2534
|
+
pageNumber?: number;
|
|
2535
|
+
/** Column to sort by */
|
|
2536
|
+
orderColumn?: string;
|
|
2537
|
+
/** Sort direction */
|
|
2538
|
+
orderDirection?: 'ASC' | 'DESC';
|
|
2539
|
+
/** Free-text search */
|
|
2540
|
+
query?: string;
|
|
2541
|
+
}
|
|
2542
|
+
|
|
1011
2543
|
/**
|
|
1012
2544
|
* Response Types for API Operations
|
|
1013
2545
|
* @module types/responses
|
|
@@ -1026,6 +2558,66 @@ export declare interface PaginatedResponse<T> {
|
|
|
1026
2558
|
pageSize?: number;
|
|
1027
2559
|
}
|
|
1028
2560
|
|
|
2561
|
+
/**
|
|
2562
|
+
* Pagination metadata returned by v2 list endpoints
|
|
2563
|
+
*/
|
|
2564
|
+
export declare interface PaginationMeta {
|
|
2565
|
+
/** Total number of items across all pages */
|
|
2566
|
+
total_items: number;
|
|
2567
|
+
/** Total number of pages */
|
|
2568
|
+
total_pages: number;
|
|
2569
|
+
/** Current page number (1-based) */
|
|
2570
|
+
current_page: number;
|
|
2571
|
+
/** Items per page */
|
|
2572
|
+
page_size: number;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
/**
|
|
2576
|
+
* Product categories resource interface
|
|
2577
|
+
*/
|
|
2578
|
+
export declare interface ProductCategoriesResource {
|
|
2579
|
+
/** Get all product categories with optional filters */
|
|
2580
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<ProductCategory>>;
|
|
2581
|
+
/** Get a product category by ID */
|
|
2582
|
+
getById(id: number): Promise<ProductCategory>;
|
|
2583
|
+
/** Create a new product category */
|
|
2584
|
+
create(data: CreateProductCategoryRequest): Promise<ProductCategory>;
|
|
2585
|
+
/** Update an existing product category */
|
|
2586
|
+
update(id: number, data: Partial<CreateProductCategoryRequest>): Promise<ProductCategory>;
|
|
2587
|
+
/** Delete a product category by ID */
|
|
2588
|
+
delete(id: number): Promise<void>;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
/**
|
|
2592
|
+
* ProductCategory Entity
|
|
2593
|
+
*
|
|
2594
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
2595
|
+
*
|
|
2596
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/productcategories/productcategory.entity.ts
|
|
2597
|
+
*/
|
|
2598
|
+
export declare interface ProductCategory extends BaseEntity_2 {
|
|
2599
|
+
clientId: number;
|
|
2600
|
+
category_name?: string;
|
|
2601
|
+
description?: string;
|
|
2602
|
+
parent_category_id?: number;
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
/**
|
|
2606
|
+
* Products resource interface
|
|
2607
|
+
*/
|
|
2608
|
+
export declare interface ProductsResource {
|
|
2609
|
+
/** Get all products with optional filters */
|
|
2610
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<FormattedProduct>>;
|
|
2611
|
+
/** Get a product by ID */
|
|
2612
|
+
getById(id: number): Promise<FormattedProduct>;
|
|
2613
|
+
/** Create a new product */
|
|
2614
|
+
create(data: CreateProductRequest): Promise<FormattedProduct>;
|
|
2615
|
+
/** Update an existing product */
|
|
2616
|
+
update(id: number, data: Partial<CreateProductRequest>): Promise<FormattedProduct>;
|
|
2617
|
+
/** Delete a product by ID */
|
|
2618
|
+
delete(id: number): Promise<void>;
|
|
2619
|
+
}
|
|
2620
|
+
|
|
1029
2621
|
/**
|
|
1030
2622
|
* Reports resource interface
|
|
1031
2623
|
*/
|
|
@@ -1483,6 +3075,192 @@ export declare interface SetReturnApprovalRequest {
|
|
|
1483
3075
|
approve: boolean;
|
|
1484
3076
|
}
|
|
1485
3077
|
|
|
3078
|
+
/**
|
|
3079
|
+
* Order source entity
|
|
3080
|
+
*/
|
|
3081
|
+
declare interface Source {
|
|
3082
|
+
id: number;
|
|
3083
|
+
name?: string;
|
|
3084
|
+
[key: string]: unknown;
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3087
|
+
/**
|
|
3088
|
+
* Stock Entity
|
|
3089
|
+
*
|
|
3090
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
3091
|
+
*
|
|
3092
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/stocks/stock.entity.ts
|
|
3093
|
+
*/
|
|
3094
|
+
export declare interface Stock extends BaseEntity_2 {
|
|
3095
|
+
/** Foreign key to the client that owns this stock. */
|
|
3096
|
+
clientId?: number;
|
|
3097
|
+
/** Stock Keeping Unit code identifying the product. */
|
|
3098
|
+
sku_code?: string;
|
|
3099
|
+
/** Location code where this stock is held (e.g. "A-01-03-B"). */
|
|
3100
|
+
location?: string;
|
|
3101
|
+
/** Number of units of this SKU at this location. */
|
|
3102
|
+
quantity?: number;
|
|
3103
|
+
/** Batch or lot number for batch-tracked products. */
|
|
3104
|
+
batch_number?: string;
|
|
3105
|
+
/** Serial number for serial-tracked products. */
|
|
3106
|
+
serial_number?: string;
|
|
3107
|
+
/** ISO 8601 date string for the best-before/expiry date (used in FEFO rotation). */
|
|
3108
|
+
best_before_date?: string;
|
|
3109
|
+
/** ISO 8601 date string when this stock was received into the warehouse. */
|
|
3110
|
+
received_date?: string;
|
|
3111
|
+
/** Current quality/availability status of the stock. */
|
|
3112
|
+
stock_status: 'available' | 'quarantined' | 'expired' | 'damaged' | 'reserved';
|
|
3113
|
+
/** Foreign key to the fulfilment centre holding this stock. */
|
|
3114
|
+
fulfilment_location_id?: number;
|
|
3115
|
+
/** Human-readable name of the fulfilment centre. */
|
|
3116
|
+
fulfilment_location_name?: string;
|
|
3117
|
+
/** ISO 3166-1 alpha-2 country code of the fulfilment centre (e.g. "GB", "US"). */
|
|
3118
|
+
fulfilment_location_country?: string;
|
|
3119
|
+
/** Free-text notes about this stock record (e.g. condition details, special handling). */
|
|
3120
|
+
notes?: string;
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
/**
|
|
3124
|
+
* StockAllocation Entity
|
|
3125
|
+
*
|
|
3126
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
3127
|
+
*
|
|
3128
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/stocks/allocation.entity.ts
|
|
3129
|
+
*/
|
|
3130
|
+
export declare interface StockAllocation extends BaseEntity_2 {
|
|
3131
|
+
/** Foreign key to the client this allocation belongs to. */
|
|
3132
|
+
clientId: number;
|
|
3133
|
+
/** Foreign key to the order this stock is allocated for. */
|
|
3134
|
+
order_id: number;
|
|
3135
|
+
/** SKU code of the product being allocated. */
|
|
3136
|
+
sku_code?: string;
|
|
3137
|
+
/** Total number of units allocated across all locations. */
|
|
3138
|
+
total_quantity: number;
|
|
3139
|
+
/** Breakdown of allocated stock by location. Keys are location codes, values contain quantity and stock details (e.g. `{ "A-01-03": { quantity: 5, stock_id: 42 } }`). */
|
|
3140
|
+
allocated_stock?: Record<string, unknown>;
|
|
3141
|
+
/** ISO 8601 date string until which the stock reservation is held. After this date the allocation may be released. */
|
|
3142
|
+
reserve_until?: string;
|
|
3143
|
+
/** ISO 8601 date string for when this allocation should be released for fulfilment. */
|
|
3144
|
+
nominated_release_date?: string;
|
|
3145
|
+
/** Whether the allocation is for immediate fulfilment or scheduled for a future date. */
|
|
3146
|
+
allocation_type: 'immediate' | 'future';
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3149
|
+
/**
|
|
3150
|
+
* Filters for stock allocations
|
|
3151
|
+
*/
|
|
3152
|
+
export declare interface StockAllocationsFilters extends ClientScopedPaginatedQueryFilters {
|
|
3153
|
+
/** Filter by order ID */
|
|
3154
|
+
orderId?: number;
|
|
3155
|
+
}
|
|
3156
|
+
|
|
3157
|
+
/**
|
|
3158
|
+
* Stock allocations resource interface
|
|
3159
|
+
*
|
|
3160
|
+
* Note: DELETE is intentionally not available for stock allocations.
|
|
3161
|
+
* Allocations should be updated or superseded rather than deleted.
|
|
3162
|
+
*/
|
|
3163
|
+
export declare interface StockAllocationsResource {
|
|
3164
|
+
/** Get all stock allocations with optional filters */
|
|
3165
|
+
getAll(filters?: StockAllocationsFilters): Promise<PaginatedListResponse<StockAllocation>>;
|
|
3166
|
+
/** Get a stock allocation by ID */
|
|
3167
|
+
getById(id: number): Promise<StockAllocation>;
|
|
3168
|
+
/** Create a new stock allocation */
|
|
3169
|
+
create(data: CreateStockAllocationRequest): Promise<StockAllocation>;
|
|
3170
|
+
/** Update an existing stock allocation */
|
|
3171
|
+
update(id: number, data: Partial<CreateStockAllocationRequest>): Promise<StockAllocation>;
|
|
3172
|
+
}
|
|
3173
|
+
|
|
3174
|
+
/**
|
|
3175
|
+
* Stocks resource interface
|
|
3176
|
+
*/
|
|
3177
|
+
export declare interface StocksResource {
|
|
3178
|
+
/** Get all stock records with optional filters */
|
|
3179
|
+
getAll(filters: ClientScopedPaginatedQueryFilters): Promise<PaginatedListResponse<Stock>>;
|
|
3180
|
+
/** Get a stock record by ID */
|
|
3181
|
+
getById(id: number): Promise<Stock>;
|
|
3182
|
+
/** Create a new stock record */
|
|
3183
|
+
create(data: CreateStockRequest): Promise<Stock>;
|
|
3184
|
+
/** Update an existing stock record */
|
|
3185
|
+
update(id: number, data: Partial<CreateStockRequest>): Promise<Stock>;
|
|
3186
|
+
/** Delete a stock record by ID */
|
|
3187
|
+
delete(id: number): Promise<void>;
|
|
3188
|
+
}
|
|
3189
|
+
|
|
3190
|
+
/**
|
|
3191
|
+
* StockTransaction Entity
|
|
3192
|
+
*
|
|
3193
|
+
* @generated This file is auto-generated. Do not edit manually.
|
|
3194
|
+
*
|
|
3195
|
+
* @source /home/dan/projects/VdepotPelygoProjects/v2/libs/vdepotlib/src/entities/stocks/transaction.entity.ts
|
|
3196
|
+
*/
|
|
3197
|
+
export declare interface StockTransaction extends BaseEntity_2 {
|
|
3198
|
+
/** Foreign key to the client this transaction belongs to. */
|
|
3199
|
+
clientId: number;
|
|
3200
|
+
/** Type of stock movement that occurred. */
|
|
3201
|
+
transaction_type: 'goods_in' | 'goods_out' | 'adjustment' | 'transfer' | 'return' | 'damage' | 'expiry';
|
|
3202
|
+
/** Foreign key to the stock record affected by this transaction. */
|
|
3203
|
+
stock_id: number;
|
|
3204
|
+
/** SKU code of the product involved in this transaction. */
|
|
3205
|
+
sku_code?: string;
|
|
3206
|
+
/** Number of units moved in this transaction (positive = in, negative = out). */
|
|
3207
|
+
quantity?: number;
|
|
3208
|
+
/** Stock quantity at the location before this transaction was applied. */
|
|
3209
|
+
quantity_before?: number;
|
|
3210
|
+
/** Stock quantity at the location after this transaction was applied. */
|
|
3211
|
+
quantity_after?: number;
|
|
3212
|
+
/** Location code the stock was moved from (for transfers and goods_out). */
|
|
3213
|
+
location_from?: string;
|
|
3214
|
+
/** Location code the stock was moved to (for transfers and goods_in). */
|
|
3215
|
+
location_to?: string;
|
|
3216
|
+
/** Batch or lot number of the stock involved. */
|
|
3217
|
+
batch_number?: string;
|
|
3218
|
+
/** Serial number of the stock involved. */
|
|
3219
|
+
serial_number?: string;
|
|
3220
|
+
/** Standardised reason code for the transaction (e.g. "DAMAGED", "CYCLE_COUNT_ADJ", "CUSTOMER_RETURN"). */
|
|
3221
|
+
reason_code?: string;
|
|
3222
|
+
/** Human-readable description of the reason for this transaction. */
|
|
3223
|
+
reason_description?: string;
|
|
3224
|
+
/** External reference tying this transaction to an order, ASN, or return (e.g. order ID, ASN number). */
|
|
3225
|
+
reference_number?: string;
|
|
3226
|
+
/** Unit value of the stock in GBP at the time of the transaction. */
|
|
3227
|
+
price_gbp?: number;
|
|
3228
|
+
/** Foreign key to the IMS validation record that authorised this transaction. Null if no validation was required. */
|
|
3229
|
+
ims_validation_id?: number;
|
|
3230
|
+
/** System that originated this transaction. */
|
|
3231
|
+
source_system: 'ims_ui' | 'ims_api' | 'mobile_app' | 'asn' | 'oms' | 'cycle_count';
|
|
3232
|
+
/** Foreign key to the user who performed this transaction. */
|
|
3233
|
+
performed_by?: number;
|
|
3234
|
+
/** Whether the stock record was created, updated, or soft-deleted by this transaction. */
|
|
3235
|
+
action: 'created' | 'updated' | 'deleted';
|
|
3236
|
+
/** Free-text notes providing additional context for this transaction. */
|
|
3237
|
+
notes?: string;
|
|
3238
|
+
}
|
|
3239
|
+
|
|
3240
|
+
/**
|
|
3241
|
+
* Filters for stock transactions
|
|
3242
|
+
*/
|
|
3243
|
+
export declare interface StockTransactionsFilters extends ClientScopedPaginatedQueryFilters {
|
|
3244
|
+
/** Filter by stock record ID */
|
|
3245
|
+
stockId?: number;
|
|
3246
|
+
}
|
|
3247
|
+
|
|
3248
|
+
/**
|
|
3249
|
+
* Stock transactions resource interface
|
|
3250
|
+
*/
|
|
3251
|
+
export declare interface StockTransactionsResource {
|
|
3252
|
+
/** Get all stock transactions with optional filters */
|
|
3253
|
+
getAll(filters?: StockTransactionsFilters): Promise<PaginatedListResponse<StockTransaction>>;
|
|
3254
|
+
/** Get a stock transaction by ID */
|
|
3255
|
+
getById(id: number): Promise<StockTransaction>;
|
|
3256
|
+
/** Create a new stock transaction */
|
|
3257
|
+
create(data: CreateStockTransactionRequest): Promise<StockTransaction>;
|
|
3258
|
+
/** Update an existing stock transaction */
|
|
3259
|
+
update(id: number, data: Partial<CreateStockTransactionRequest>): Promise<StockTransaction>;
|
|
3260
|
+
/** Delete a stock transaction by ID */
|
|
3261
|
+
delete(id: number): Promise<void>;
|
|
3262
|
+
}
|
|
3263
|
+
|
|
1486
3264
|
/** Task history entity from the API */
|
|
1487
3265
|
export declare interface TaskHistoryEntity {
|
|
1488
3266
|
id: number;
|
|
@@ -1528,6 +3306,22 @@ export declare class UnauthorizedError extends JanusApiError {
|
|
|
1528
3306
|
constructor(message?: string, response?: unknown);
|
|
1529
3307
|
}
|
|
1530
3308
|
|
|
3309
|
+
/**
|
|
3310
|
+
* Data for updating an ASN line
|
|
3311
|
+
*/
|
|
3312
|
+
export declare interface UpdateAsnLineRequest extends Partial<Omit<CreateAsnLineRequest, 'client_id'>> {
|
|
3313
|
+
/** Client ID */
|
|
3314
|
+
client_id: number;
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
/**
|
|
3318
|
+
* Data for updating an ASN receipt
|
|
3319
|
+
*/
|
|
3320
|
+
export declare interface UpdateAsnReceiptRequest extends Partial<Omit<CreateAsnReceiptRequest, 'client_id' | 'asn_id' | 'asn_line_id'>> {
|
|
3321
|
+
/** Client ID */
|
|
3322
|
+
client_id: number;
|
|
3323
|
+
}
|
|
3324
|
+
|
|
1531
3325
|
/**
|
|
1532
3326
|
* Data for updating a client
|
|
1533
3327
|
*/
|
|
@@ -1552,6 +3346,14 @@ export declare interface UpdateClientRequest {
|
|
|
1552
3346
|
active?: boolean;
|
|
1553
3347
|
}
|
|
1554
3348
|
|
|
3349
|
+
/**
|
|
3350
|
+
* Data for updating an invoice line
|
|
3351
|
+
*/
|
|
3352
|
+
export declare interface UpdateInvoiceLineRequest extends Partial<Omit<CreateInvoiceLineRequest, 'client_id'>> {
|
|
3353
|
+
/** Client ID */
|
|
3354
|
+
client_id: number;
|
|
3355
|
+
}
|
|
3356
|
+
|
|
1555
3357
|
/**
|
|
1556
3358
|
* Data for updating a user
|
|
1557
3359
|
*/
|
|
@@ -1616,14 +3418,51 @@ export declare interface UserClientAccess {
|
|
|
1616
3418
|
name: string;
|
|
1617
3419
|
}
|
|
1618
3420
|
|
|
3421
|
+
/**
|
|
3422
|
+
* Filters for user list
|
|
3423
|
+
*/
|
|
3424
|
+
export declare interface UsersListFilters extends PaginatedQueryFilters {
|
|
3425
|
+
/** Filter by role */
|
|
3426
|
+
filterRole?: string;
|
|
3427
|
+
/** Filter by user type */
|
|
3428
|
+
filterType?: string;
|
|
3429
|
+
/** Filter by assigned client ID */
|
|
3430
|
+
filterClientId?: number;
|
|
3431
|
+
}
|
|
3432
|
+
|
|
1619
3433
|
/**
|
|
1620
3434
|
* Users resource interface
|
|
1621
3435
|
*/
|
|
1622
3436
|
export declare interface UsersResource {
|
|
1623
|
-
/**
|
|
3437
|
+
/** Get all users with optional pagination and search filters */
|
|
3438
|
+
getAll(filters?: UsersListFilters): Promise<PaginatedListResponse<User>>;
|
|
3439
|
+
/** Get a single user by their numeric ID */
|
|
3440
|
+
getById(id: number): Promise<User>;
|
|
3441
|
+
/** Create a new user account with the required registration fields */
|
|
1624
3442
|
create(data: CreateUserRequest): Promise<User>;
|
|
1625
|
-
/**
|
|
3443
|
+
/** Partially update a user (PATCH). Only the provided fields will be changed. */
|
|
1626
3444
|
update(data: UpdateUserRequest): Promise<User>;
|
|
3445
|
+
/**
|
|
3446
|
+
* Fully replace a user record (PUT).
|
|
3447
|
+
* All user fields should be provided in the data object, including:
|
|
3448
|
+
* `username`, `firstname`, `lastname`, `email`, `partition_id`, and any
|
|
3449
|
+
* other user-level properties. Omitted fields may be reset to defaults.
|
|
3450
|
+
*/
|
|
3451
|
+
replace(id: number, data: Record<string, unknown>): Promise<User>;
|
|
3452
|
+
/** Delete a user by ID */
|
|
3453
|
+
delete(id: number): Promise<void>;
|
|
3454
|
+
/**
|
|
3455
|
+
* Change the authenticated user's password.
|
|
3456
|
+
* The request body should contain the current password and the new password
|
|
3457
|
+
* (see {@link ChangePasswordRequest}).
|
|
3458
|
+
*/
|
|
3459
|
+
changePassword(data: ChangePasswordRequest): Promise<void>;
|
|
3460
|
+
/**
|
|
3461
|
+
* Complete a password reset using a token/link string.
|
|
3462
|
+
* The `link` parameter is the password-reset token received via email,
|
|
3463
|
+
* which the server validates to authorize the reset.
|
|
3464
|
+
*/
|
|
3465
|
+
resetPassword(link: string): Promise<void>;
|
|
1627
3466
|
}
|
|
1628
3467
|
|
|
1629
3468
|
/**
|