bukku-client 0.1.0-test.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/LICENSE +674 -0
- package/README.md +85 -0
- package/dist/accounting/accounts/index.d.ts +52 -0
- package/dist/accounting/accounts/index.d.ts.map +1 -0
- package/dist/accounting/accounts/index.js +72 -0
- package/dist/accounting/accounts/index.js.map +1 -0
- package/dist/accounting/accounts/type.d.ts +125 -0
- package/dist/accounting/accounts/type.d.ts.map +1 -0
- package/dist/accounting/accounts/type.js +4 -0
- package/dist/accounting/accounts/type.js.map +1 -0
- package/dist/accounting/index.d.ts +10 -0
- package/dist/accounting/index.d.ts.map +1 -0
- package/dist/accounting/index.js +16 -0
- package/dist/accounting/index.js.map +1 -0
- package/dist/accounting/journal-entries/index.d.ts +52 -0
- package/dist/accounting/journal-entries/index.d.ts.map +1 -0
- package/dist/accounting/journal-entries/index.js +72 -0
- package/dist/accounting/journal-entries/index.js.map +1 -0
- package/dist/accounting/journal-entries/type.d.ts +151 -0
- package/dist/accounting/journal-entries/type.d.ts.map +1 -0
- package/dist/accounting/journal-entries/type.js +4 -0
- package/dist/accounting/journal-entries/type.js.map +1 -0
- package/dist/common/type.d.ts +105 -0
- package/dist/common/type.d.ts.map +1 -0
- package/dist/common/type.js +3 -0
- package/dist/common/type.js.map +1 -0
- package/dist/contacts/contacts/index.d.ts +57 -0
- package/dist/contacts/contacts/index.d.ts.map +1 -0
- package/dist/contacts/contacts/index.js +82 -0
- package/dist/contacts/contacts/index.js.map +1 -0
- package/dist/contacts/contacts/type.d.ts +286 -0
- package/dist/contacts/contacts/type.d.ts.map +1 -0
- package/dist/contacts/contacts/type.js +4 -0
- package/dist/contacts/contacts/type.js.map +1 -0
- package/dist/contacts/groups/index.d.ts +42 -0
- package/dist/contacts/groups/index.d.ts.map +1 -0
- package/dist/contacts/groups/index.js +59 -0
- package/dist/contacts/groups/index.js.map +1 -0
- package/dist/contacts/groups/type.d.ts +34 -0
- package/dist/contacts/groups/type.d.ts.map +1 -0
- package/dist/contacts/groups/type.js +4 -0
- package/dist/contacts/groups/type.js.map +1 -0
- package/dist/contacts/index.d.ts +10 -0
- package/dist/contacts/index.d.ts.map +1 -0
- package/dist/contacts/index.js +15 -0
- package/dist/contacts/index.js.map +1 -0
- package/dist/control-panel/index.d.ts +15 -0
- package/dist/control-panel/index.d.ts.map +1 -0
- package/dist/control-panel/index.js +35 -0
- package/dist/control-panel/index.js.map +1 -0
- package/dist/control-panel/locations/index.d.ts +51 -0
- package/dist/control-panel/locations/index.d.ts.map +1 -0
- package/dist/control-panel/locations/index.js +70 -0
- package/dist/control-panel/locations/index.js.map +1 -0
- package/dist/control-panel/locations/type.d.ts +91 -0
- package/dist/control-panel/locations/type.d.ts.map +1 -0
- package/dist/control-panel/locations/type.js +4 -0
- package/dist/control-panel/locations/type.js.map +1 -0
- package/dist/control-panel/tag-groups/index.d.ts +44 -0
- package/dist/control-panel/tag-groups/index.d.ts.map +1 -0
- package/dist/control-panel/tag-groups/index.js +63 -0
- package/dist/control-panel/tag-groups/index.js.map +1 -0
- package/dist/control-panel/tag-groups/type.d.ts +64 -0
- package/dist/control-panel/tag-groups/type.d.ts.map +1 -0
- package/dist/control-panel/tag-groups/type.js +4 -0
- package/dist/control-panel/tag-groups/type.js.map +1 -0
- package/dist/control-panel/tags/index.d.ts +43 -0
- package/dist/control-panel/tags/index.d.ts.map +1 -0
- package/dist/control-panel/tags/index.js +60 -0
- package/dist/control-panel/tags/index.js.map +1 -0
- package/dist/control-panel/tags/type.d.ts +60 -0
- package/dist/control-panel/tags/type.d.ts.map +1 -0
- package/dist/control-panel/tags/type.js +4 -0
- package/dist/control-panel/tags/type.js.map +1 -0
- package/dist/files/index.d.ts +29 -0
- package/dist/files/index.d.ts.map +1 -0
- package/dist/files/index.js +42 -0
- package/dist/files/index.js.map +1 -0
- package/dist/files/type.d.ts +50 -0
- package/dist/files/type.d.ts.map +1 -0
- package/dist/files/type.js +4 -0
- package/dist/files/type.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +130 -0
- package/dist/index.js.map +1 -0
- package/dist/lists/index.d.ts +24 -0
- package/dist/lists/index.d.ts.map +1 -0
- package/dist/lists/index.js +33 -0
- package/dist/lists/index.js.map +1 -0
- package/dist/lists/type.d.ts +781 -0
- package/dist/lists/type.d.ts.map +1 -0
- package/dist/lists/type.js +3 -0
- package/dist/lists/type.js.map +1 -0
- package/dist/products/groups/index.d.ts +42 -0
- package/dist/products/groups/index.d.ts.map +1 -0
- package/dist/products/groups/index.js +59 -0
- package/dist/products/groups/index.js.map +1 -0
- package/dist/products/groups/type.d.ts +53 -0
- package/dist/products/groups/type.d.ts.map +1 -0
- package/dist/products/groups/type.js +5 -0
- package/dist/products/groups/type.js.map +1 -0
- package/dist/products/index.d.ts +10 -0
- package/dist/products/index.d.ts.map +1 -0
- package/dist/products/index.js +15 -0
- package/dist/products/index.js.map +1 -0
- package/dist/products/products/index.d.ts +51 -0
- package/dist/products/products/index.d.ts.map +1 -0
- package/dist/products/products/index.js +70 -0
- package/dist/products/products/index.js.map +1 -0
- package/dist/products/products/type.d.ts +270 -0
- package/dist/products/products/type.d.ts.map +1 -0
- package/dist/products/products/type.js +4 -0
- package/dist/products/products/type.js.map +1 -0
- package/dist/purchases/bills/index.d.ts +51 -0
- package/dist/purchases/bills/index.d.ts.map +1 -0
- package/dist/purchases/bills/index.js +75 -0
- package/dist/purchases/bills/index.js.map +1 -0
- package/dist/purchases/bills/type.d.ts +254 -0
- package/dist/purchases/bills/type.d.ts.map +1 -0
- package/dist/purchases/bills/type.js +4 -0
- package/dist/purchases/bills/type.js.map +1 -0
- package/dist/purchases/credit-notes/index.d.ts +51 -0
- package/dist/purchases/credit-notes/index.d.ts.map +1 -0
- package/dist/purchases/credit-notes/index.js +71 -0
- package/dist/purchases/credit-notes/index.js.map +1 -0
- package/dist/purchases/credit-notes/type.d.ts +204 -0
- package/dist/purchases/credit-notes/type.d.ts.map +1 -0
- package/dist/purchases/credit-notes/type.js +4 -0
- package/dist/purchases/credit-notes/type.js.map +1 -0
- package/dist/purchases/goods-received-notes/index.d.ts +51 -0
- package/dist/purchases/goods-received-notes/index.d.ts.map +1 -0
- package/dist/purchases/goods-received-notes/index.js +71 -0
- package/dist/purchases/goods-received-notes/index.js.map +1 -0
- package/dist/purchases/goods-received-notes/type.d.ts +184 -0
- package/dist/purchases/goods-received-notes/type.d.ts.map +1 -0
- package/dist/purchases/goods-received-notes/type.js +4 -0
- package/dist/purchases/goods-received-notes/type.js.map +1 -0
- package/dist/purchases/index.d.ts +18 -0
- package/dist/purchases/index.d.ts.map +1 -0
- package/dist/purchases/index.js +23 -0
- package/dist/purchases/index.js.map +1 -0
- package/dist/purchases/payments/index.d.ts +51 -0
- package/dist/purchases/payments/index.d.ts.map +1 -0
- package/dist/purchases/payments/index.js +71 -0
- package/dist/purchases/payments/index.js.map +1 -0
- package/dist/purchases/payments/type.d.ts +183 -0
- package/dist/purchases/payments/type.d.ts.map +1 -0
- package/dist/purchases/payments/type.js +4 -0
- package/dist/purchases/payments/type.js.map +1 -0
- package/dist/purchases/purchase-orders/index.d.ts +51 -0
- package/dist/purchases/purchase-orders/index.d.ts.map +1 -0
- package/dist/purchases/purchase-orders/index.js +71 -0
- package/dist/purchases/purchase-orders/index.js.map +1 -0
- package/dist/purchases/purchase-orders/type.d.ts +182 -0
- package/dist/purchases/purchase-orders/type.d.ts.map +1 -0
- package/dist/purchases/purchase-orders/type.js +4 -0
- package/dist/purchases/purchase-orders/type.js.map +1 -0
- package/dist/purchases/refunds/index.d.ts +51 -0
- package/dist/purchases/refunds/index.d.ts.map +1 -0
- package/dist/purchases/refunds/index.js +71 -0
- package/dist/purchases/refunds/index.js.map +1 -0
- package/dist/purchases/refunds/type.d.ts +181 -0
- package/dist/purchases/refunds/type.d.ts.map +1 -0
- package/dist/purchases/refunds/type.js +4 -0
- package/dist/purchases/refunds/type.js.map +1 -0
- package/dist/sales/credit-notes/index.d.ts +52 -0
- package/dist/sales/credit-notes/index.d.ts.map +1 -0
- package/dist/sales/credit-notes/index.js +72 -0
- package/dist/sales/credit-notes/index.js.map +1 -0
- package/dist/sales/credit-notes/type.d.ts +304 -0
- package/dist/sales/credit-notes/type.d.ts.map +1 -0
- package/dist/sales/credit-notes/type.js +4 -0
- package/dist/sales/credit-notes/type.js.map +1 -0
- package/dist/sales/delivery-orders/index.d.ts +51 -0
- package/dist/sales/delivery-orders/index.d.ts.map +1 -0
- package/dist/sales/delivery-orders/index.js +72 -0
- package/dist/sales/delivery-orders/index.js.map +1 -0
- package/dist/sales/delivery-orders/type.d.ts +212 -0
- package/dist/sales/delivery-orders/type.d.ts.map +1 -0
- package/dist/sales/delivery-orders/type.js +4 -0
- package/dist/sales/delivery-orders/type.js.map +1 -0
- package/dist/sales/index.d.ts +20 -0
- package/dist/sales/index.d.ts.map +1 -0
- package/dist/sales/index.js +24 -0
- package/dist/sales/index.js.map +1 -0
- package/dist/sales/invoices/index.d.ts +52 -0
- package/dist/sales/invoices/index.d.ts.map +1 -0
- package/dist/sales/invoices/index.js +73 -0
- package/dist/sales/invoices/index.js.map +1 -0
- package/dist/sales/invoices/type.d.ts +335 -0
- package/dist/sales/invoices/type.d.ts.map +1 -0
- package/dist/sales/invoices/type.js +4 -0
- package/dist/sales/invoices/type.js.map +1 -0
- package/dist/sales/payments/index.d.ts +52 -0
- package/dist/sales/payments/index.d.ts.map +1 -0
- package/dist/sales/payments/index.js +72 -0
- package/dist/sales/payments/index.js.map +1 -0
- package/dist/sales/payments/type.d.ts +242 -0
- package/dist/sales/payments/type.d.ts.map +1 -0
- package/dist/sales/payments/type.js +4 -0
- package/dist/sales/payments/type.js.map +1 -0
- package/dist/sales/quotations/index.d.ts +51 -0
- package/dist/sales/quotations/index.d.ts.map +1 -0
- package/dist/sales/quotations/index.js +71 -0
- package/dist/sales/quotations/index.js.map +1 -0
- package/dist/sales/quotations/type.d.ts +202 -0
- package/dist/sales/quotations/type.d.ts.map +1 -0
- package/dist/sales/quotations/type.js +3 -0
- package/dist/sales/quotations/type.js.map +1 -0
- package/dist/sales/refunds/index.d.ts +52 -0
- package/dist/sales/refunds/index.d.ts.map +1 -0
- package/dist/sales/refunds/index.js +72 -0
- package/dist/sales/refunds/index.js.map +1 -0
- package/dist/sales/refunds/type.d.ts +225 -0
- package/dist/sales/refunds/type.d.ts.map +1 -0
- package/dist/sales/refunds/type.js +4 -0
- package/dist/sales/refunds/type.js.map +1 -0
- package/dist/sales/sales-orders/index.d.ts +52 -0
- package/dist/sales/sales-orders/index.d.ts.map +1 -0
- package/dist/sales/sales-orders/index.js +72 -0
- package/dist/sales/sales-orders/index.js.map +1 -0
- package/dist/sales/sales-orders/type.d.ts +202 -0
- package/dist/sales/sales-orders/type.d.ts.map +1 -0
- package/dist/sales/sales-orders/type.js +4 -0
- package/dist/sales/sales-orders/type.js.map +1 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// src/sales/credit-notes/index.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CreditNotesAPI = void 0;
|
|
5
|
+
class CreditNotesAPI {
|
|
6
|
+
constructor(_request) {
|
|
7
|
+
this._request = _request;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new credit note.
|
|
11
|
+
* Endpoint: POST /sales/credit_notes
|
|
12
|
+
* @param data - The data for the new credit note.
|
|
13
|
+
* @returns A promise that resolves to the created credit note.
|
|
14
|
+
*/
|
|
15
|
+
async create(data) {
|
|
16
|
+
const response = await this._request("/sales/credit_notes", "POST", data);
|
|
17
|
+
return response.transaction;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves a paginated list of credit notes.
|
|
21
|
+
* Endpoint: GET /sales/credit_notes
|
|
22
|
+
* @param params - Optional parameters for filtering and pagination.
|
|
23
|
+
* @returns A promise that resolves to the API response for listing credit notes.
|
|
24
|
+
*/
|
|
25
|
+
async list(params) {
|
|
26
|
+
return this._request("/sales/credit_notes", "GET", undefined, params);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a specific credit note by its ID.
|
|
30
|
+
* Endpoint: GET /sales/credit_notes/{id}
|
|
31
|
+
* @param id - The ID of the credit note to retrieve.
|
|
32
|
+
* @returns A promise that resolves to the credit note.
|
|
33
|
+
*/
|
|
34
|
+
async get(id) {
|
|
35
|
+
const response = await this._request(`/sales/credit_notes/${id}`, "GET");
|
|
36
|
+
return response.transaction;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Updates an existing credit note.
|
|
40
|
+
* Endpoint: PUT /sales/credit_notes/{id}
|
|
41
|
+
* @param id - The ID of the credit note to update.
|
|
42
|
+
* @param data - The data to update the credit note with.
|
|
43
|
+
* @returns A promise that resolves to the updated credit note.
|
|
44
|
+
*/
|
|
45
|
+
async update(id, data) {
|
|
46
|
+
const response = await this._request(`/sales/credit_notes/${id}`, "PUT", data);
|
|
47
|
+
return response.transaction;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Deletes a credit note.
|
|
51
|
+
* Endpoint: DELETE /sales/credit_notes/{id}
|
|
52
|
+
* Note: Deletion policy for credit notes (e.g. status restrictions) should be verified with API documentation.
|
|
53
|
+
* @param id - The ID of the credit note to delete.
|
|
54
|
+
* @returns A promise that resolves when the credit note is deleted.
|
|
55
|
+
*/
|
|
56
|
+
async delete(id) {
|
|
57
|
+
await this._request(`/sales/credit_notes/${id}`, "DELETE");
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Updates the status of an existing credit note.
|
|
61
|
+
* Endpoint: PATCH /sales/credit_notes/{id}
|
|
62
|
+
* @param id - The ID of the credit note to update.
|
|
63
|
+
* @param data - The data containing the new status.
|
|
64
|
+
* @returns A promise that resolves to the updated credit note.
|
|
65
|
+
*/
|
|
66
|
+
async updateStatus(id, data) {
|
|
67
|
+
const response = await this._request(`/sales/credit_notes/${id}`, "PATCH", data);
|
|
68
|
+
return response.transaction;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.CreditNotesAPI = CreditNotesAPI;
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sales/credit-notes/index.ts"],"names":[],"mappings":";AAAA,kCAAkC;;;AAalC,MAAa,cAAc;IACzB,YAAoB,QAAiC;QAAjC,aAAQ,GAAR,QAAQ,CAAyB;IAAG,CAAC;IAEzD;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CAAC,IAAiC;QAC5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,qBAAqB,EACrB,MAAM,EACN,IAAI,CACL,CAAC;QACF,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,MAAkC;QAElC,OAAO,IAAI,CAAC,QAAQ,CAClB,qBAAqB,EACrB,KAAK,EACL,SAAS,EACT,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CAAC,EAAmB;QAC3B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,uBAAuB,EAAE,EAAE,EAC3B,KAAK,CACN,CAAC;QACF,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CACV,EAAmB,EACnB,IAAiC;QAEjC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,uBAAuB,EAAE,EAAE,EAC3B,KAAK,EACL,IAAI,CACL,CAAC;QACF,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,EAAmB;QAC9B,MAAM,IAAI,CAAC,QAAQ,CAAO,uBAAuB,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;IACnE,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,YAAY,CAChB,EAAmB,EACnB,IAAuC;QAEvC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,uBAAuB,EAAE,EAAE,EAC3B,OAAO,EACP,IAAI,CACL,CAAC;QACF,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;CACF;AAjGD,wCAiGC"}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { BukkuEmailDetails, BukkuFileAttachment, BukkuListPagination, BukkuFormItem } from "../../common/type";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a form item for creating or updating a Bukku Credit Note.
|
|
4
|
+
*/
|
|
5
|
+
export interface BukkuCreditNoteFormItemCreateParams {
|
|
6
|
+
/** The id of the item, required when you're updating an item. */
|
|
7
|
+
id?: number;
|
|
8
|
+
/** The type of the item, leave null for normal item. */
|
|
9
|
+
type?: null | "bundle" | "subtitle" | "subtotal";
|
|
10
|
+
/** The account of the item, required for normal item. */
|
|
11
|
+
account_id?: number;
|
|
12
|
+
/** The description of the item, required for normal / bundle & subtitle items. */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** The service date of the item, following format YYYY-MM-DD. */
|
|
15
|
+
service_date?: string;
|
|
16
|
+
/** The product of the item. */
|
|
17
|
+
product_id?: number;
|
|
18
|
+
/** The product unit / UOM of the product, leave blank to use the product's default unit. */
|
|
19
|
+
product_unit_id?: number;
|
|
20
|
+
/** The location of the product, used for inventory product, leave blank to use the system default location. */
|
|
21
|
+
location_id?: number;
|
|
22
|
+
/** The unit price of the item, supports up to 4 decimal points, required for normal items. */
|
|
23
|
+
unit_price?: number;
|
|
24
|
+
/** The quantity of the item, supports up to 4 decimal points, required for normal items. */
|
|
25
|
+
quantity?: number;
|
|
26
|
+
/** The discount of the item, supports value (eg. 255.12) or percentage (eg. 10%). Max 14 chars. */
|
|
27
|
+
discount?: string;
|
|
28
|
+
/** The tax code of the item. */
|
|
29
|
+
tax_code_id?: number;
|
|
30
|
+
/**
|
|
31
|
+
* The classification code, required for bundle items. Retrieve values from Lists API of item classification_code_list.
|
|
32
|
+
* Conditionally required based on MyInvois settings.
|
|
33
|
+
*/
|
|
34
|
+
classification_code?: string;
|
|
35
|
+
/** The child items, used by bundle. */
|
|
36
|
+
children?: BukkuCreditNoteFormItemCreateParams[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Represents a link item for creating a Bukku Credit Note, specifying where credit is applied.
|
|
40
|
+
*/
|
|
41
|
+
export interface BukkuCreditNoteLinkItemCreateParams {
|
|
42
|
+
/** The id of the link item, required when you're updating an item. */
|
|
43
|
+
id?: number;
|
|
44
|
+
/** The target transaction to apply the amount to. */
|
|
45
|
+
target_transaction_id: number;
|
|
46
|
+
/** The amount to apply. */
|
|
47
|
+
apply_amount: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Parameters for creating a Bukku Credit Note.
|
|
51
|
+
* Based on POST /sales/credit_notes
|
|
52
|
+
*/
|
|
53
|
+
export interface BukkuCreditNoteCreateParams {
|
|
54
|
+
contact_id: number;
|
|
55
|
+
number?: string;
|
|
56
|
+
number2?: string;
|
|
57
|
+
date: string;
|
|
58
|
+
currency_code: string;
|
|
59
|
+
exchange_rate: number;
|
|
60
|
+
billing_party?: string;
|
|
61
|
+
show_shipping?: boolean;
|
|
62
|
+
shipping_party?: string;
|
|
63
|
+
shipping_info?: string;
|
|
64
|
+
tag_ids?: number[];
|
|
65
|
+
title?: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
remarks?: string;
|
|
68
|
+
tax_mode: "inclusive" | "exclusive";
|
|
69
|
+
form_items: Array<BukkuCreditNoteFormItemCreateParams>;
|
|
70
|
+
link_items?: Array<BukkuCreditNoteLinkItemCreateParams>;
|
|
71
|
+
status: "draft" | "pending_approval" | "ready";
|
|
72
|
+
email?: BukkuEmailDetails;
|
|
73
|
+
files?: Array<BukkuFileAttachment>;
|
|
74
|
+
/** The customs form number. Present only if myinvois_action is present. */
|
|
75
|
+
customs_form_no?: string | null;
|
|
76
|
+
/** The customs K2 form number. Present only if myinvois_action is present. */
|
|
77
|
+
customs_k2_form_no?: string | null;
|
|
78
|
+
/** The incoterms value. Present only if myinvois_action is present. */
|
|
79
|
+
incoterms?: string | null;
|
|
80
|
+
/** Determines if the current transaction will be submitted to MyInvois. Conditionally required. */
|
|
81
|
+
myinvois_action?: "NORMAL" | "VALIDATE" | "EXTERNAL";
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Represents an item this Credit Note is applied to, in a Bukku Credit Note response.
|
|
85
|
+
* Based on the `link_items` array in the sample response.
|
|
86
|
+
*/
|
|
87
|
+
export interface BukkuCreditNoteAppliedToItem {
|
|
88
|
+
id: number;
|
|
89
|
+
target_transaction_id: number;
|
|
90
|
+
type: string;
|
|
91
|
+
number: string;
|
|
92
|
+
date: string;
|
|
93
|
+
description?: string;
|
|
94
|
+
amount: number;
|
|
95
|
+
balance: number;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Represents an origin transaction linked to this Credit Note, in a Bukku Credit Note response.
|
|
99
|
+
* Based on the `linked_items` array in the sample response.
|
|
100
|
+
*/
|
|
101
|
+
export interface BukkuCreditNoteOriginLinkItem {
|
|
102
|
+
id: number;
|
|
103
|
+
origin_transaction_id: number;
|
|
104
|
+
type: string;
|
|
105
|
+
number: string;
|
|
106
|
+
date: string;
|
|
107
|
+
amount: number;
|
|
108
|
+
balance: number;
|
|
109
|
+
apply_amount: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Represents the detailed file information within a Bukku Credit Note's file entry.
|
|
113
|
+
*/
|
|
114
|
+
export interface BukkuCreditNoteFileDetail {
|
|
115
|
+
id: number;
|
|
116
|
+
url: string;
|
|
117
|
+
filename: string;
|
|
118
|
+
mime_type: string;
|
|
119
|
+
size: number;
|
|
120
|
+
created_at: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Represents a file entry attached to a Bukku Credit Note.
|
|
124
|
+
*/
|
|
125
|
+
export interface BukkuCreditNoteFileEntry {
|
|
126
|
+
id: number;
|
|
127
|
+
file_id: number;
|
|
128
|
+
file: BukkuCreditNoteFileDetail[];
|
|
129
|
+
is_shared: boolean;
|
|
130
|
+
created_at: string;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Represents a Bukku Credit Note object as returned by the API.
|
|
134
|
+
*/
|
|
135
|
+
export interface BukkuCreditNote {
|
|
136
|
+
id: number;
|
|
137
|
+
contact_id: number;
|
|
138
|
+
contact_name: string;
|
|
139
|
+
number: string;
|
|
140
|
+
number2: string;
|
|
141
|
+
date: string;
|
|
142
|
+
currency_code: string;
|
|
143
|
+
currency_symbol: string;
|
|
144
|
+
exchange_rate: number;
|
|
145
|
+
billing_party: string;
|
|
146
|
+
show_shipping: boolean;
|
|
147
|
+
shipping_info: string;
|
|
148
|
+
shipping_party: string;
|
|
149
|
+
tag_ids: number[];
|
|
150
|
+
tag_names: string[];
|
|
151
|
+
title: string | null;
|
|
152
|
+
description: string;
|
|
153
|
+
remarks: string;
|
|
154
|
+
tax_mode: "inclusive" | "exclusive";
|
|
155
|
+
form_items: BukkuFormItem[];
|
|
156
|
+
link_items: BukkuCreditNoteAppliedToItem[];
|
|
157
|
+
linked_items: BukkuCreditNoteOriginLinkItem[];
|
|
158
|
+
amount: number;
|
|
159
|
+
balance: number;
|
|
160
|
+
status: string;
|
|
161
|
+
type: string;
|
|
162
|
+
short_link: string;
|
|
163
|
+
files: BukkuCreditNoteFileEntry[];
|
|
164
|
+
customs_form_no: string | null;
|
|
165
|
+
customs_k2_form_no: string | null;
|
|
166
|
+
incoterms: string | null;
|
|
167
|
+
myinvois_action: "NORMAL" | "VALIDATE" | "EXTERNAL" | null;
|
|
168
|
+
myinvois_document_uuid: string | null;
|
|
169
|
+
myinvois_document_long_id: string | null;
|
|
170
|
+
myinvois_document_status: string | null;
|
|
171
|
+
issued_at: string | null;
|
|
172
|
+
validated_at: string | null;
|
|
173
|
+
rejected_at: string | null;
|
|
174
|
+
reject_message: string | null;
|
|
175
|
+
cancelled_at: string | null;
|
|
176
|
+
cancel_message: string | null;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Represents the API response structure when a credit note is created or retrieved.
|
|
180
|
+
*/
|
|
181
|
+
export interface BukkuCreditNoteResponse {
|
|
182
|
+
transaction: BukkuCreditNote;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Parameters for updating a Bukku Credit Note.
|
|
186
|
+
* Based on PUT /sales/credit_notes/{transactionId}
|
|
187
|
+
* 'status' is typically managed by a separate PATCH endpoint.
|
|
188
|
+
* 'number' becomes a required field.
|
|
189
|
+
*/
|
|
190
|
+
export interface BukkuCreditNoteUpdateParams {
|
|
191
|
+
contact_id: number;
|
|
192
|
+
number: string;
|
|
193
|
+
number2?: string;
|
|
194
|
+
date: string;
|
|
195
|
+
currency_code: string;
|
|
196
|
+
exchange_rate: number;
|
|
197
|
+
billing_party?: string;
|
|
198
|
+
show_shipping?: boolean;
|
|
199
|
+
shipping_party?: string;
|
|
200
|
+
shipping_info?: string;
|
|
201
|
+
tag_ids?: number[];
|
|
202
|
+
title?: string;
|
|
203
|
+
description?: string;
|
|
204
|
+
remarks?: string;
|
|
205
|
+
tax_mode: "inclusive" | "exclusive";
|
|
206
|
+
form_items: Array<BukkuCreditNoteFormItemCreateParams>;
|
|
207
|
+
link_items?: Array<BukkuCreditNoteLinkItemCreateParams>;
|
|
208
|
+
email?: BukkuEmailDetails;
|
|
209
|
+
files?: Array<BukkuFileAttachment>;
|
|
210
|
+
customs_form_no?: string | null;
|
|
211
|
+
customs_k2_form_no?: string | null;
|
|
212
|
+
incoterms?: string | null;
|
|
213
|
+
myinvois_action?: "NORMAL" | "VALIDATE" | "EXTERNAL";
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Parameters for updating the status of a Bukku Credit Note.
|
|
217
|
+
* Based on PATCH /sales/credit_notes/{transactionId} (assumption, common pattern).
|
|
218
|
+
*/
|
|
219
|
+
export interface BukkuCreditNoteStatusUpdateParams {
|
|
220
|
+
/** The new status for the credit note. */
|
|
221
|
+
status: "ready" | "draft" | "pending_approval" | "void";
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Parameters for listing Bukku Credit Notes (GET /sales/credit_notes).
|
|
225
|
+
*/
|
|
226
|
+
export interface BukkuCreditNoteListParams {
|
|
227
|
+
/** Filter by payment status. */
|
|
228
|
+
payment_status?: "PAID" | "OUTSTANDING" | "OVERDUE";
|
|
229
|
+
/** Search for transactions on and after the date (YYYY-MM-DD). */
|
|
230
|
+
date_from?: string;
|
|
231
|
+
/** Search for transactions on and before the date (YYYY-MM-DD). */
|
|
232
|
+
date_to?: string;
|
|
233
|
+
/** Search for keywords in No., Reference No., Title, Remarks, Description, Contact Name, Billing Party & Shipping Party. Max 100 chars. */
|
|
234
|
+
search?: string;
|
|
235
|
+
/** Search for keywords within custom fields, use format DD/MM/YYYY for a date. Max 100 chars. */
|
|
236
|
+
custom_search?: string;
|
|
237
|
+
/** Search by contact ID. */
|
|
238
|
+
contact_id?: number;
|
|
239
|
+
/** Search by status, default to All but Void. */
|
|
240
|
+
status?: "all" | "draft" | "pending_approval" | "ready" | "void";
|
|
241
|
+
/** Search by the latest email status. */
|
|
242
|
+
email_status?: "UNSENT" | "PENDING" | "SENT" | "BOUNCED" | "OPENED" | "VIEWED";
|
|
243
|
+
/** Sort by field. */
|
|
244
|
+
sort_by?: "number" | "date" | "contact_name" | "number2" | "title" | "description" | "amount" | "balance" | "created_at";
|
|
245
|
+
/** Sort the list in ascending or descending order. */
|
|
246
|
+
sort_dir?: "asc" | "desc";
|
|
247
|
+
/** The current page number. Default: 1, Min: 1. */
|
|
248
|
+
page?: number;
|
|
249
|
+
/** Number of records per page. Default: 30. */
|
|
250
|
+
page_size?: number;
|
|
251
|
+
[key: string]: any;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Represents a summary of a Bukku Credit Note as it appears in a list.
|
|
255
|
+
* Based on the sample response for GET /sales/credit_notes.
|
|
256
|
+
*/
|
|
257
|
+
export interface BukkuCreditNoteListItem {
|
|
258
|
+
id: number;
|
|
259
|
+
number: string;
|
|
260
|
+
number2: string;
|
|
261
|
+
contact_id: number;
|
|
262
|
+
contact_name: string;
|
|
263
|
+
contact_email: string;
|
|
264
|
+
date: string;
|
|
265
|
+
billing_party: string;
|
|
266
|
+
shipping_party: string;
|
|
267
|
+
tag_names?: string[];
|
|
268
|
+
title: string | null;
|
|
269
|
+
description: string;
|
|
270
|
+
currency_code: string;
|
|
271
|
+
currency_symbol: string;
|
|
272
|
+
exchange_rate: number;
|
|
273
|
+
amount: number;
|
|
274
|
+
/** Balance may not always be present in list items, though it's sortable. Made optional based on sample. */
|
|
275
|
+
balance?: number;
|
|
276
|
+
status: string;
|
|
277
|
+
email_status: string;
|
|
278
|
+
file_count: number;
|
|
279
|
+
short_link: string;
|
|
280
|
+
created_by: string;
|
|
281
|
+
created_at: string;
|
|
282
|
+
updated_at: string;
|
|
283
|
+
customs_form_no: string | null;
|
|
284
|
+
customs_k2_form_no: string | null;
|
|
285
|
+
incoterms: string | null;
|
|
286
|
+
myinvois_action: string | null;
|
|
287
|
+
myinvois_document_uuid: string | null;
|
|
288
|
+
myinvois_document_long_id: string | null;
|
|
289
|
+
myinvois_document_status: string | null;
|
|
290
|
+
issued_at: string | null;
|
|
291
|
+
validated_at: string | null;
|
|
292
|
+
rejected_at: string | null;
|
|
293
|
+
reject_message: string | null;
|
|
294
|
+
cancelled_at: string | null;
|
|
295
|
+
cancel_message: string | null;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Represents the API response structure for listing credit notes.
|
|
299
|
+
*/
|
|
300
|
+
export interface BukkuCreditNoteListApiResponse {
|
|
301
|
+
paging: BukkuListPagination;
|
|
302
|
+
transactions: BukkuCreditNoteListItem[];
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/sales/credit-notes/type.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAClD,iEAAiE;IACjE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,IAAI,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;IACjD,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4FAA4F;IAC5F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+GAA+G;IAC/G,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,mCAAmC,EAAE,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAA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EAAE,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/sales/credit-notes/type.ts"],"names":[],"mappings":";AAAA,iCAAiC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { BukkuAPIRequestFunction } from "../../types";
|
|
2
|
+
import { BukkuDeliveryOrder, BukkuDeliveryOrderCreateParams, BukkuDeliveryOrderListApiResponse, BukkuDeliveryOrderListParams, BukkuDeliveryOrderStatusUpdateParams, BukkuDeliveryOrderUpdateParams } from "./type";
|
|
3
|
+
export declare class DeliveryOrdersAPI {
|
|
4
|
+
private _request;
|
|
5
|
+
constructor(_request: BukkuAPIRequestFunction);
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new delivery order.
|
|
8
|
+
* Endpoint: POST /sales/delivery_orders
|
|
9
|
+
* @param data - The data for the new delivery order.
|
|
10
|
+
* @returns A promise that resolves to the created delivery order.
|
|
11
|
+
*/
|
|
12
|
+
create(data: BukkuDeliveryOrderCreateParams): Promise<BukkuDeliveryOrder>;
|
|
13
|
+
/**
|
|
14
|
+
* Retrieves a paginated list of delivery orders.
|
|
15
|
+
* Endpoint: GET /sales/delivery_orders
|
|
16
|
+
* @param params - Optional parameters for filtering and pagination.
|
|
17
|
+
* @returns A promise that resolves to the API response for listing delivery orders.
|
|
18
|
+
*/
|
|
19
|
+
list(params?: BukkuDeliveryOrderListParams): Promise<BukkuDeliveryOrderListApiResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves a specific delivery order by its ID.
|
|
22
|
+
* Endpoint: GET /sales/delivery_orders/{id}
|
|
23
|
+
* @param id - The ID of the delivery order to retrieve.
|
|
24
|
+
* @returns A promise that resolves to the delivery order.
|
|
25
|
+
*/
|
|
26
|
+
get(id: string | number): Promise<BukkuDeliveryOrder>;
|
|
27
|
+
/**
|
|
28
|
+
* Updates an existing delivery order.
|
|
29
|
+
* Endpoint: PUT /sales/delivery_orders/{id}
|
|
30
|
+
* @param id - The ID of the delivery order to update.
|
|
31
|
+
* @param data - The data to update the delivery order with.
|
|
32
|
+
* @returns A promise that resolves to the updated delivery order.
|
|
33
|
+
*/
|
|
34
|
+
update(id: string | number, data: BukkuDeliveryOrderUpdateParams): Promise<BukkuDeliveryOrder>;
|
|
35
|
+
/**
|
|
36
|
+
* Deletes a delivery order.
|
|
37
|
+
* Endpoint: DELETE /sales/delivery_orders/{id}
|
|
38
|
+
* @param id - The ID of the delivery order to delete.
|
|
39
|
+
* @returns A promise that resolves when the delivery order is deleted.
|
|
40
|
+
*/
|
|
41
|
+
delete(id: string | number): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Updates the status of an existing delivery order.
|
|
44
|
+
* Endpoint: PATCH /sales/delivery_orders/{id}
|
|
45
|
+
* @param id - The ID of the delivery order to update.
|
|
46
|
+
* @param data - The data containing the new status.
|
|
47
|
+
* @returns A promise that resolves to the updated delivery order.
|
|
48
|
+
*/
|
|
49
|
+
updateStatus(id: string | number, data: BukkuDeliveryOrderStatusUpdateParams): Promise<BukkuDeliveryOrder>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sales/delivery-orders/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,kBAAkB,EAClB,8BAA8B,EAC9B,iCAAiC,EACjC,4BAA4B,EAE5B,oCAAoC,EACpC,8BAA8B,EAC/B,MAAM,QAAQ,CAAC;AAEhB,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,uBAAuB;IAIrD;;;;;OAKG;IACG,MAAM,CACV,IAAI,EAAE,8BAA8B,GACnC,OAAO,CAAC,kBAAkB,CAAC;IAS9B;;;;;OAKG;IACG,IAAI,CACR,MAAM,CAAC,EAAE,4BAA4B,GACpC,OAAO,CAAC,iCAAiC,CAAC;IAS7C;;;;;OAKG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAQ3D;;;;;;OAMG;IACG,MAAM,CACV,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,IAAI,EAAE,8BAA8B,GACnC,OAAO,CAAC,kBAAkB,CAAC;IAS9B;;;;;OAKG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhD;;;;;;OAMG;IACG,YAAY,CAChB,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,IAAI,EAAE,oCAAoC,GACzC,OAAO,CAAC,kBAAkB,CAAC;CAQ/B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// src/sales/delivery-orders/index.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DeliveryOrdersAPI = void 0;
|
|
5
|
+
class DeliveryOrdersAPI {
|
|
6
|
+
constructor(_request) {
|
|
7
|
+
this._request = _request;
|
|
8
|
+
}
|
|
9
|
+
// --- Delivery Orders ---
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new delivery order.
|
|
12
|
+
* Endpoint: POST /sales/delivery_orders
|
|
13
|
+
* @param data - The data for the new delivery order.
|
|
14
|
+
* @returns A promise that resolves to the created delivery order.
|
|
15
|
+
*/
|
|
16
|
+
async create(data) {
|
|
17
|
+
const response = await this._request("/sales/delivery_orders", "POST", data);
|
|
18
|
+
return response.transaction;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves a paginated list of delivery orders.
|
|
22
|
+
* Endpoint: GET /sales/delivery_orders
|
|
23
|
+
* @param params - Optional parameters for filtering and pagination.
|
|
24
|
+
* @returns A promise that resolves to the API response for listing delivery orders.
|
|
25
|
+
*/
|
|
26
|
+
async list(params) {
|
|
27
|
+
return this._request("/sales/delivery_orders", "GET", undefined, params);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves a specific delivery order by its ID.
|
|
31
|
+
* Endpoint: GET /sales/delivery_orders/{id}
|
|
32
|
+
* @param id - The ID of the delivery order to retrieve.
|
|
33
|
+
* @returns A promise that resolves to the delivery order.
|
|
34
|
+
*/
|
|
35
|
+
async get(id) {
|
|
36
|
+
const response = await this._request(`/sales/delivery_orders/${id}`, "GET");
|
|
37
|
+
return response.transaction;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Updates an existing delivery order.
|
|
41
|
+
* Endpoint: PUT /sales/delivery_orders/{id}
|
|
42
|
+
* @param id - The ID of the delivery order to update.
|
|
43
|
+
* @param data - The data to update the delivery order with.
|
|
44
|
+
* @returns A promise that resolves to the updated delivery order.
|
|
45
|
+
*/
|
|
46
|
+
async update(id, data) {
|
|
47
|
+
const response = await this._request(`/sales/delivery_orders/${id}`, "PUT", data);
|
|
48
|
+
return response.transaction;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Deletes a delivery order.
|
|
52
|
+
* Endpoint: DELETE /sales/delivery_orders/{id}
|
|
53
|
+
* @param id - The ID of the delivery order to delete.
|
|
54
|
+
* @returns A promise that resolves when the delivery order is deleted.
|
|
55
|
+
*/
|
|
56
|
+
async delete(id) {
|
|
57
|
+
await this._request(`/sales/delivery_orders/${id}`, "DELETE");
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Updates the status of an existing delivery order.
|
|
61
|
+
* Endpoint: PATCH /sales/delivery_orders/{id}
|
|
62
|
+
* @param id - The ID of the delivery order to update.
|
|
63
|
+
* @param data - The data containing the new status.
|
|
64
|
+
* @returns A promise that resolves to the updated delivery order.
|
|
65
|
+
*/
|
|
66
|
+
async updateStatus(id, data) {
|
|
67
|
+
const response = await this._request(`/sales/delivery_orders/${id}`, "PATCH", data);
|
|
68
|
+
return response.transaction;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.DeliveryOrdersAPI = DeliveryOrdersAPI;
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sales/delivery-orders/index.ts"],"names":[],"mappings":";AAAA,qCAAqC;;;AAarC,MAAa,iBAAiB;IAC5B,YAAoB,QAAiC;QAAjC,aAAQ,GAAR,QAAQ,CAAyB;IAAG,CAAC;IAEzD,0BAA0B;IAE1B;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,IAAoC;QAEpC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,wBAAwB,EACxB,MAAM,EACN,IAAI,CACL,CAAC;QACF,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,MAAqC;QAErC,OAAO,IAAI,CAAC,QAAQ,CAClB,wBAAwB,EACxB,KAAK,EACL,SAAS,EACT,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CAAC,EAAmB;QAC3B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,0BAA0B,EAAE,EAAE,EAC9B,KAAK,CACN,CAAC;QACF,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CACV,EAAmB,EACnB,IAAoC;QAEpC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,0BAA0B,EAAE,EAAE,EAC9B,KAAK,EACL,IAAI,CACL,CAAC;QACF,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CAAC,EAAmB;QAC9B,MAAM,IAAI,CAAC,QAAQ,CAAO,0BAA0B,EAAE,E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