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.
Files changed (231) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +85 -0
  3. package/dist/accounting/accounts/index.d.ts +52 -0
  4. package/dist/accounting/accounts/index.d.ts.map +1 -0
  5. package/dist/accounting/accounts/index.js +72 -0
  6. package/dist/accounting/accounts/index.js.map +1 -0
  7. package/dist/accounting/accounts/type.d.ts +125 -0
  8. package/dist/accounting/accounts/type.d.ts.map +1 -0
  9. package/dist/accounting/accounts/type.js +4 -0
  10. package/dist/accounting/accounts/type.js.map +1 -0
  11. package/dist/accounting/index.d.ts +10 -0
  12. package/dist/accounting/index.d.ts.map +1 -0
  13. package/dist/accounting/index.js +16 -0
  14. package/dist/accounting/index.js.map +1 -0
  15. package/dist/accounting/journal-entries/index.d.ts +52 -0
  16. package/dist/accounting/journal-entries/index.d.ts.map +1 -0
  17. package/dist/accounting/journal-entries/index.js +72 -0
  18. package/dist/accounting/journal-entries/index.js.map +1 -0
  19. package/dist/accounting/journal-entries/type.d.ts +151 -0
  20. package/dist/accounting/journal-entries/type.d.ts.map +1 -0
  21. package/dist/accounting/journal-entries/type.js +4 -0
  22. package/dist/accounting/journal-entries/type.js.map +1 -0
  23. package/dist/common/type.d.ts +105 -0
  24. package/dist/common/type.d.ts.map +1 -0
  25. package/dist/common/type.js +3 -0
  26. package/dist/common/type.js.map +1 -0
  27. package/dist/contacts/contacts/index.d.ts +57 -0
  28. package/dist/contacts/contacts/index.d.ts.map +1 -0
  29. package/dist/contacts/contacts/index.js +82 -0
  30. package/dist/contacts/contacts/index.js.map +1 -0
  31. package/dist/contacts/contacts/type.d.ts +286 -0
  32. package/dist/contacts/contacts/type.d.ts.map +1 -0
  33. package/dist/contacts/contacts/type.js +4 -0
  34. package/dist/contacts/contacts/type.js.map +1 -0
  35. package/dist/contacts/groups/index.d.ts +42 -0
  36. package/dist/contacts/groups/index.d.ts.map +1 -0
  37. package/dist/contacts/groups/index.js +59 -0
  38. package/dist/contacts/groups/index.js.map +1 -0
  39. package/dist/contacts/groups/type.d.ts +34 -0
  40. package/dist/contacts/groups/type.d.ts.map +1 -0
  41. package/dist/contacts/groups/type.js +4 -0
  42. package/dist/contacts/groups/type.js.map +1 -0
  43. package/dist/contacts/index.d.ts +10 -0
  44. package/dist/contacts/index.d.ts.map +1 -0
  45. package/dist/contacts/index.js +15 -0
  46. package/dist/contacts/index.js.map +1 -0
  47. package/dist/control-panel/index.d.ts +15 -0
  48. package/dist/control-panel/index.d.ts.map +1 -0
  49. package/dist/control-panel/index.js +35 -0
  50. package/dist/control-panel/index.js.map +1 -0
  51. package/dist/control-panel/locations/index.d.ts +51 -0
  52. package/dist/control-panel/locations/index.d.ts.map +1 -0
  53. package/dist/control-panel/locations/index.js +70 -0
  54. package/dist/control-panel/locations/index.js.map +1 -0
  55. package/dist/control-panel/locations/type.d.ts +91 -0
  56. package/dist/control-panel/locations/type.d.ts.map +1 -0
  57. package/dist/control-panel/locations/type.js +4 -0
  58. package/dist/control-panel/locations/type.js.map +1 -0
  59. package/dist/control-panel/tag-groups/index.d.ts +44 -0
  60. package/dist/control-panel/tag-groups/index.d.ts.map +1 -0
  61. package/dist/control-panel/tag-groups/index.js +63 -0
  62. package/dist/control-panel/tag-groups/index.js.map +1 -0
  63. package/dist/control-panel/tag-groups/type.d.ts +64 -0
  64. package/dist/control-panel/tag-groups/type.d.ts.map +1 -0
  65. package/dist/control-panel/tag-groups/type.js +4 -0
  66. package/dist/control-panel/tag-groups/type.js.map +1 -0
  67. package/dist/control-panel/tags/index.d.ts +43 -0
  68. package/dist/control-panel/tags/index.d.ts.map +1 -0
  69. package/dist/control-panel/tags/index.js +60 -0
  70. package/dist/control-panel/tags/index.js.map +1 -0
  71. package/dist/control-panel/tags/type.d.ts +60 -0
  72. package/dist/control-panel/tags/type.d.ts.map +1 -0
  73. package/dist/control-panel/tags/type.js +4 -0
  74. package/dist/control-panel/tags/type.js.map +1 -0
  75. package/dist/files/index.d.ts +29 -0
  76. package/dist/files/index.d.ts.map +1 -0
  77. package/dist/files/index.js +42 -0
  78. package/dist/files/index.js.map +1 -0
  79. package/dist/files/type.d.ts +50 -0
  80. package/dist/files/type.d.ts.map +1 -0
  81. package/dist/files/type.js +4 -0
  82. package/dist/files/type.js.map +1 -0
  83. package/dist/index.d.ts +73 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.js +130 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/lists/index.d.ts +24 -0
  88. package/dist/lists/index.d.ts.map +1 -0
  89. package/dist/lists/index.js +33 -0
  90. package/dist/lists/index.js.map +1 -0
  91. package/dist/lists/type.d.ts +781 -0
  92. package/dist/lists/type.d.ts.map +1 -0
  93. package/dist/lists/type.js +3 -0
  94. package/dist/lists/type.js.map +1 -0
  95. package/dist/products/groups/index.d.ts +42 -0
  96. package/dist/products/groups/index.d.ts.map +1 -0
  97. package/dist/products/groups/index.js +59 -0
  98. package/dist/products/groups/index.js.map +1 -0
  99. package/dist/products/groups/type.d.ts +53 -0
  100. package/dist/products/groups/type.d.ts.map +1 -0
  101. package/dist/products/groups/type.js +5 -0
  102. package/dist/products/groups/type.js.map +1 -0
  103. package/dist/products/index.d.ts +10 -0
  104. package/dist/products/index.d.ts.map +1 -0
  105. package/dist/products/index.js +15 -0
  106. package/dist/products/index.js.map +1 -0
  107. package/dist/products/products/index.d.ts +51 -0
  108. package/dist/products/products/index.d.ts.map +1 -0
  109. package/dist/products/products/index.js +70 -0
  110. package/dist/products/products/index.js.map +1 -0
  111. package/dist/products/products/type.d.ts +270 -0
  112. package/dist/products/products/type.d.ts.map +1 -0
  113. package/dist/products/products/type.js +4 -0
  114. package/dist/products/products/type.js.map +1 -0
  115. package/dist/purchases/bills/index.d.ts +51 -0
  116. package/dist/purchases/bills/index.d.ts.map +1 -0
  117. package/dist/purchases/bills/index.js +75 -0
  118. package/dist/purchases/bills/index.js.map +1 -0
  119. package/dist/purchases/bills/type.d.ts +254 -0
  120. package/dist/purchases/bills/type.d.ts.map +1 -0
  121. package/dist/purchases/bills/type.js +4 -0
  122. package/dist/purchases/bills/type.js.map +1 -0
  123. package/dist/purchases/credit-notes/index.d.ts +51 -0
  124. package/dist/purchases/credit-notes/index.d.ts.map +1 -0
  125. package/dist/purchases/credit-notes/index.js +71 -0
  126. package/dist/purchases/credit-notes/index.js.map +1 -0
  127. package/dist/purchases/credit-notes/type.d.ts +204 -0
  128. package/dist/purchases/credit-notes/type.d.ts.map +1 -0
  129. package/dist/purchases/credit-notes/type.js +4 -0
  130. package/dist/purchases/credit-notes/type.js.map +1 -0
  131. package/dist/purchases/goods-received-notes/index.d.ts +51 -0
  132. package/dist/purchases/goods-received-notes/index.d.ts.map +1 -0
  133. package/dist/purchases/goods-received-notes/index.js +71 -0
  134. package/dist/purchases/goods-received-notes/index.js.map +1 -0
  135. package/dist/purchases/goods-received-notes/type.d.ts +184 -0
  136. package/dist/purchases/goods-received-notes/type.d.ts.map +1 -0
  137. package/dist/purchases/goods-received-notes/type.js +4 -0
  138. package/dist/purchases/goods-received-notes/type.js.map +1 -0
  139. package/dist/purchases/index.d.ts +18 -0
  140. package/dist/purchases/index.d.ts.map +1 -0
  141. package/dist/purchases/index.js +23 -0
  142. package/dist/purchases/index.js.map +1 -0
  143. package/dist/purchases/payments/index.d.ts +51 -0
  144. package/dist/purchases/payments/index.d.ts.map +1 -0
  145. package/dist/purchases/payments/index.js +71 -0
  146. package/dist/purchases/payments/index.js.map +1 -0
  147. package/dist/purchases/payments/type.d.ts +183 -0
  148. package/dist/purchases/payments/type.d.ts.map +1 -0
  149. package/dist/purchases/payments/type.js +4 -0
  150. package/dist/purchases/payments/type.js.map +1 -0
  151. package/dist/purchases/purchase-orders/index.d.ts +51 -0
  152. package/dist/purchases/purchase-orders/index.d.ts.map +1 -0
  153. package/dist/purchases/purchase-orders/index.js +71 -0
  154. package/dist/purchases/purchase-orders/index.js.map +1 -0
  155. package/dist/purchases/purchase-orders/type.d.ts +182 -0
  156. package/dist/purchases/purchase-orders/type.d.ts.map +1 -0
  157. package/dist/purchases/purchase-orders/type.js +4 -0
  158. package/dist/purchases/purchase-orders/type.js.map +1 -0
  159. package/dist/purchases/refunds/index.d.ts +51 -0
  160. package/dist/purchases/refunds/index.d.ts.map +1 -0
  161. package/dist/purchases/refunds/index.js +71 -0
  162. package/dist/purchases/refunds/index.js.map +1 -0
  163. package/dist/purchases/refunds/type.d.ts +181 -0
  164. package/dist/purchases/refunds/type.d.ts.map +1 -0
  165. package/dist/purchases/refunds/type.js +4 -0
  166. package/dist/purchases/refunds/type.js.map +1 -0
  167. package/dist/sales/credit-notes/index.d.ts +52 -0
  168. package/dist/sales/credit-notes/index.d.ts.map +1 -0
  169. package/dist/sales/credit-notes/index.js +72 -0
  170. package/dist/sales/credit-notes/index.js.map +1 -0
  171. package/dist/sales/credit-notes/type.d.ts +304 -0
  172. package/dist/sales/credit-notes/type.d.ts.map +1 -0
  173. package/dist/sales/credit-notes/type.js +4 -0
  174. package/dist/sales/credit-notes/type.js.map +1 -0
  175. package/dist/sales/delivery-orders/index.d.ts +51 -0
  176. package/dist/sales/delivery-orders/index.d.ts.map +1 -0
  177. package/dist/sales/delivery-orders/index.js +72 -0
  178. package/dist/sales/delivery-orders/index.js.map +1 -0
  179. package/dist/sales/delivery-orders/type.d.ts +212 -0
  180. package/dist/sales/delivery-orders/type.d.ts.map +1 -0
  181. package/dist/sales/delivery-orders/type.js +4 -0
  182. package/dist/sales/delivery-orders/type.js.map +1 -0
  183. package/dist/sales/index.d.ts +20 -0
  184. package/dist/sales/index.d.ts.map +1 -0
  185. package/dist/sales/index.js +24 -0
  186. package/dist/sales/index.js.map +1 -0
  187. package/dist/sales/invoices/index.d.ts +52 -0
  188. package/dist/sales/invoices/index.d.ts.map +1 -0
  189. package/dist/sales/invoices/index.js +73 -0
  190. package/dist/sales/invoices/index.js.map +1 -0
  191. package/dist/sales/invoices/type.d.ts +335 -0
  192. package/dist/sales/invoices/type.d.ts.map +1 -0
  193. package/dist/sales/invoices/type.js +4 -0
  194. package/dist/sales/invoices/type.js.map +1 -0
  195. package/dist/sales/payments/index.d.ts +52 -0
  196. package/dist/sales/payments/index.d.ts.map +1 -0
  197. package/dist/sales/payments/index.js +72 -0
  198. package/dist/sales/payments/index.js.map +1 -0
  199. package/dist/sales/payments/type.d.ts +242 -0
  200. package/dist/sales/payments/type.d.ts.map +1 -0
  201. package/dist/sales/payments/type.js +4 -0
  202. package/dist/sales/payments/type.js.map +1 -0
  203. package/dist/sales/quotations/index.d.ts +51 -0
  204. package/dist/sales/quotations/index.d.ts.map +1 -0
  205. package/dist/sales/quotations/index.js +71 -0
  206. package/dist/sales/quotations/index.js.map +1 -0
  207. package/dist/sales/quotations/type.d.ts +202 -0
  208. package/dist/sales/quotations/type.d.ts.map +1 -0
  209. package/dist/sales/quotations/type.js +3 -0
  210. package/dist/sales/quotations/type.js.map +1 -0
  211. package/dist/sales/refunds/index.d.ts +52 -0
  212. package/dist/sales/refunds/index.d.ts.map +1 -0
  213. package/dist/sales/refunds/index.js +72 -0
  214. package/dist/sales/refunds/index.js.map +1 -0
  215. package/dist/sales/refunds/type.d.ts +225 -0
  216. package/dist/sales/refunds/type.d.ts.map +1 -0
  217. package/dist/sales/refunds/type.js +4 -0
  218. package/dist/sales/refunds/type.js.map +1 -0
  219. package/dist/sales/sales-orders/index.d.ts +52 -0
  220. package/dist/sales/sales-orders/index.d.ts.map +1 -0
  221. package/dist/sales/sales-orders/index.js +72 -0
  222. package/dist/sales/sales-orders/index.js.map +1 -0
  223. package/dist/sales/sales-orders/type.d.ts +202 -0
  224. package/dist/sales/sales-orders/type.d.ts.map +1 -0
  225. package/dist/sales/sales-orders/type.js +4 -0
  226. package/dist/sales/sales-orders/type.js.map +1 -0
  227. package/dist/types.d.ts +17 -0
  228. package/dist/types.d.ts.map +1 -0
  229. package/dist/types.js +4 -0
  230. package/dist/types.js.map +1 -0
  231. package/package.json +44 -0
@@ -0,0 +1,242 @@
1
+ import { BukkuEmailDetails, BukkuFileAttachment, BukkuListPagination } from "../../common/type";
2
+ /**
3
+ * Represents a link item for creating a Bukku Payment, specifying where credit is applied.
4
+ */
5
+ export interface BukkuPaymentLinkItemCreateParams {
6
+ /** The id of the link item, required when you're updating an item. */
7
+ id?: number;
8
+ /** The target transaction to apply the amount to. */
9
+ target_transaction_id: number;
10
+ /** The amount to apply. */
11
+ apply_amount: number;
12
+ }
13
+ /**
14
+ * Represents a deposit item for creating a Bukku Payment.
15
+ */
16
+ export interface BukkuPaymentDepositItemCreateParams {
17
+ /** The id of the deposit item, required when you're updating an item. */
18
+ id?: number;
19
+ /** The id of the payment method. */
20
+ payment_method_id?: number;
21
+ /** The deposit account for the payment. */
22
+ account_id: number;
23
+ /** The amount received. */
24
+ amount: number;
25
+ /** The payment reference number. */
26
+ number?: string;
27
+ /** The fee incurred for the amount paid. Include '%', if it's a percentage. */
28
+ fee_text?: string;
29
+ /** The account for the fee incurred, required if the fee_text is present. */
30
+ fee_account_id?: number;
31
+ }
32
+ /**
33
+ * Parameters for creating a Bukku Payment.
34
+ * Based on POST /sales/payments
35
+ */
36
+ export interface BukkuPaymentCreateParams {
37
+ contact_id: number;
38
+ number?: string;
39
+ number2?: string;
40
+ date: string;
41
+ currency_code: string;
42
+ exchange_rate: number;
43
+ amount: number;
44
+ tag_ids?: number[];
45
+ description?: string;
46
+ remarks?: string;
47
+ link_items?: Array<BukkuPaymentLinkItemCreateParams>;
48
+ deposit_items: Array<BukkuPaymentDepositItemCreateParams>;
49
+ status: "draft" | "pending_approval" | "ready";
50
+ email?: BukkuEmailDetails;
51
+ files?: Array<BukkuFileAttachment>;
52
+ }
53
+ /**
54
+ * Represents a link item in a Bukku Payment response (credit applied to).
55
+ * Based on `link_items` in the sample response.
56
+ */
57
+ export interface BukkuPaymentLinkItem {
58
+ id: number;
59
+ target_transaction_id: number;
60
+ type: string;
61
+ number: string;
62
+ date: string;
63
+ description?: string;
64
+ amount: number;
65
+ balance: number;
66
+ }
67
+ /**
68
+ * Represents a linked item in a Bukku Payment response (origin of credit).
69
+ * Based on `linked_items` in the sample response. Note: This appears to show what this payment is linked FROM,
70
+ * which is unusual for a payment creation but present in the sample.
71
+ * It might represent allocations if this payment is e.g. from a credit note.
72
+ * For a standard payment against an invoice, `link_items` is more typical for "what this payment pays".
73
+ */
74
+ export interface BukkuPaymentLinkedItem {
75
+ id: number;
76
+ origin_transaction_id: number;
77
+ type: string;
78
+ number: string;
79
+ date: string;
80
+ amount: number;
81
+ balance: number;
82
+ apply_amount: number;
83
+ }
84
+ /**
85
+ * Represents a deposit item within a Bukku Payment response.
86
+ */
87
+ export interface BukkuPaymentDepositItem {
88
+ id: number;
89
+ line: number;
90
+ payment_method_id: number;
91
+ account_id: number;
92
+ amount: number;
93
+ number: string | null;
94
+ fee_text: number | string | null;
95
+ fee_account_id: number | null;
96
+ }
97
+ /**
98
+ * Represents the detailed file information within a Bukku Payment's file entry.
99
+ */
100
+ export interface BukkuPaymentFileDetail {
101
+ id: number;
102
+ url: string;
103
+ filename: string;
104
+ mime_type: string;
105
+ size: number;
106
+ created_at: string;
107
+ }
108
+ /**
109
+ * Represents a file entry attached to a Bukku Payment.
110
+ */
111
+ export interface BukkuPaymentFileEntry {
112
+ id: number;
113
+ file_id: number;
114
+ file: BukkuPaymentFileDetail[];
115
+ is_shared: boolean;
116
+ created_at: string;
117
+ }
118
+ /**
119
+ * Represents a Bukku Payment object as returned by the API.
120
+ */
121
+ export interface BukkuPayment {
122
+ id: number;
123
+ contact_id: number;
124
+ contact_name: string;
125
+ date: string;
126
+ currency_code: string;
127
+ currency_symbol: string;
128
+ exchange_rate: number;
129
+ amount: number;
130
+ number: string;
131
+ number2?: string | null;
132
+ tag_ids: number[];
133
+ tag_names: string[];
134
+ link_items: BukkuPaymentLinkItem[];
135
+ linked_items: BukkuPaymentLinkedItem[];
136
+ deposit_items: BukkuPaymentDepositItem[];
137
+ remarks: string | null;
138
+ description: string | null;
139
+ balance: number;
140
+ status: string;
141
+ type: string;
142
+ short_link: string;
143
+ files: BukkuPaymentFileEntry[];
144
+ }
145
+ /**
146
+ * Represents the API response structure when a payment is created or retrieved.
147
+ */
148
+ export interface BukkuPaymentResponse {
149
+ transaction: BukkuPayment;
150
+ }
151
+ /**
152
+ * Parameters for updating a Bukku Payment.
153
+ * 'status' is typically managed by a separate PATCH endpoint.
154
+ * 'number' becomes a required field for update.
155
+ */
156
+ export interface BukkuPaymentUpdateParams {
157
+ contact_id: number;
158
+ number: string;
159
+ number2?: string;
160
+ date: string;
161
+ currency_code: string;
162
+ exchange_rate: number;
163
+ amount: number;
164
+ tag_ids?: number[];
165
+ description?: string;
166
+ remarks?: string;
167
+ link_items?: Array<BukkuPaymentLinkItemCreateParams>;
168
+ deposit_items: Array<BukkuPaymentDepositItemCreateParams>;
169
+ email?: BukkuEmailDetails;
170
+ files?: Array<BukkuFileAttachment>;
171
+ }
172
+ /**
173
+ * Parameters for updating the status of a Bukku Payment.
174
+ */
175
+ export interface BukkuPaymentStatusUpdateParams {
176
+ /** The new status for the payment. */
177
+ status: "ready" | "draft" | "pending_approval" | "void";
178
+ }
179
+ /**
180
+ * Parameters for listing Bukku Payments (GET /sales/payments - assumed endpoint).
181
+ */
182
+ export interface BukkuPaymentListParams {
183
+ /** Search for keywords in No., Reference No., Description, Contact Name. Max 100 chars. */
184
+ search?: string;
185
+ /** Search for keywords within custom fields. Max 100 chars. */
186
+ custom_search?: string;
187
+ /** Search by contact ID. */
188
+ contact_id?: number;
189
+ /** Search for transactions on and after the date (YYYY-MM-DD). */
190
+ date_from?: string;
191
+ /** Search for transactions on and before the date (YYYY-MM-DD). */
192
+ date_to?: string;
193
+ /** Search by status, default to All but Void. */
194
+ status?: "all" | "draft" | "pending_approval" | "ready" | "void";
195
+ /** Filter by payment status. */
196
+ payment_status?: "paid" | "outstanding";
197
+ /** Search by the latest email status. */
198
+ email_status?: "UNSENT" | "PENDING" | "SENT" | "BOUNCED" | "OPENED" | "VIEWED";
199
+ /** Filter by accounts in Current Assets, Non-Current Assets, Current Liabilities and Equity. */
200
+ account_id?: string;
201
+ /** Sort by field. */
202
+ sort_by?: "number" | "date" | "contact_name" | "number2" | "description" | "amount" | "balance" | "created_at";
203
+ /** Sort the list in ascending or descending order. */
204
+ sort_dir?: "asc" | "desc";
205
+ /** The current page number. Default: 1, Min: 1. */
206
+ page?: number;
207
+ /** Number of records per page. Default: 30. */
208
+ page_size?: number;
209
+ [key: string]: any;
210
+ }
211
+ /**
212
+ * Represents a summary of a Bukku Payment as it appears in a list.
213
+ */
214
+ export interface BukkuPaymentListItem {
215
+ id: number;
216
+ number: string;
217
+ number2?: string | null;
218
+ contact_id: number;
219
+ contact_name: string;
220
+ contact_email?: string;
221
+ date: string;
222
+ currency_code: string;
223
+ currency_symbol: string;
224
+ exchange_rate: number;
225
+ amount: number;
226
+ balance?: number;
227
+ status: string;
228
+ email_status?: string;
229
+ file_count?: number;
230
+ short_link?: string;
231
+ created_by?: string;
232
+ created_at: string;
233
+ updated_at: string;
234
+ }
235
+ /**
236
+ * Represents the API response structure for listing payments.
237
+ */
238
+ export interface BukkuPaymentListApiResponse {
239
+ paging: BukkuListPagination;
240
+ transactions: BukkuPaymentListItem[];
241
+ }
242
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/sales/payments/type.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAI3B;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,sEAAsE;IACtE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAClD,yEA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EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CAEpB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,mBAAmB,CAAC;IAC5B,YAAY,EAAE,oBAAoB,EAAE,CAAC;CACtC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // src/sales/payments/type.ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/sales/payments/type.ts"],"names":[],"mappings":";AAAA,6BAA6B"}
@@ -0,0 +1,51 @@
1
+ import type { BukkuAPIRequestFunction } from "../../types";
2
+ import { BukkuQuotationCreateParams, BukkuQuotation, BukkuQuotationListParams, BukkuQuotationListApiResponse, BukkuQuotationUpdateParams, BukkuQuotationStatusUpdateParams } from "./type";
3
+ export declare class QuotationsAPI {
4
+ private _request;
5
+ constructor(_request: BukkuAPIRequestFunction);
6
+ /**
7
+ * Creates a new quotation.
8
+ * Endpoint: POST /sales/quotes
9
+ * @param data - The data for the new quotation.
10
+ * @returns A promise that resolves to the created quotation.
11
+ */
12
+ create(data: BukkuQuotationCreateParams): Promise<BukkuQuotation>;
13
+ /**
14
+ * Retrieves a paginated list of quotations.
15
+ * Endpoint: GET /sales/quotes
16
+ * @param params - Optional parameters for filtering and pagination.
17
+ * @returns A promise that resolves to the API response for listing quotations.
18
+ */
19
+ list(params?: BukkuQuotationListParams): Promise<BukkuQuotationListApiResponse>;
20
+ /**
21
+ * Retrieves a specific quotation by its ID.
22
+ * Endpoint: GET /sales/quotes/{id}
23
+ * @param id - The ID of the quotation to retrieve.
24
+ * @returns A promise that resolves to the quotation.
25
+ */
26
+ get(id: string | number): Promise<BukkuQuotation>;
27
+ /**
28
+ * Updates an existing quotation.
29
+ * Endpoint: PUT /sales/quotes/{id}
30
+ * @param id - The ID of the quotation to update.
31
+ * @param data - The data to update the quotation with.
32
+ * @returns A promise that resolves to the updated quotation.
33
+ */
34
+ update(id: string | number, data: BukkuQuotationUpdateParams): Promise<BukkuQuotation>;
35
+ /**
36
+ * Deletes a quotation.
37
+ * Endpoint: DELETE /sales/quotes/{id}
38
+ * @param id - The ID of the quotation to delete.
39
+ * @returns A promise that resolves when the quotation is deleted.
40
+ */
41
+ delete(id: string | number): Promise<void>;
42
+ /**
43
+ * Updates the status of an existing quotation.
44
+ * Endpoint: PATCH /sales/quotes/{id}
45
+ * @param id - The ID of the quotation to update.
46
+ * @param data - The data containing the new status.
47
+ * @returns A promise that resolves to the updated quotation.
48
+ */
49
+ updateStatus(id: string | number, data: BukkuQuotationStatusUpdateParams): Promise<BukkuQuotation>;
50
+ }
51
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sales/quotations/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,0BAA0B,EAC1B,cAAc,EAEd,wBAAwB,EACxB,6BAA6B,EAC7B,0BAA0B,EAC1B,gCAAgC,EACjC,MAAM,QAAQ,CAAC;AAEhB,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,uBAAuB;IAErD;;;;;OAKG;IACG,MAAM,CACV,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,cAAc,CAAC;IAS1B;;;;;OAKG;IACG,IAAI,CACR,MAAM,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,6BAA6B,CAAC;IASzC;;;;;OAKG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAQvD;;;;;;OAMG;IACG,MAAM,CACV,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,cAAc,CAAC;IAS1B;;;;;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,gCAAgC,GACrC,OAAO,CAAC,cAAc,CAAC;CAQ3B"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ // src/sales/quotations/index.ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.QuotationsAPI = void 0;
5
+ class QuotationsAPI {
6
+ constructor(_request) {
7
+ this._request = _request;
8
+ }
9
+ /**
10
+ * Creates a new quotation.
11
+ * Endpoint: POST /sales/quotes
12
+ * @param data - The data for the new quotation.
13
+ * @returns A promise that resolves to the created quotation.
14
+ */
15
+ async create(data) {
16
+ const response = await this._request("/sales/quotes", "POST", data);
17
+ return response.transaction;
18
+ }
19
+ /**
20
+ * Retrieves a paginated list of quotations.
21
+ * Endpoint: GET /sales/quotes
22
+ * @param params - Optional parameters for filtering and pagination.
23
+ * @returns A promise that resolves to the API response for listing quotations.
24
+ */
25
+ async list(params) {
26
+ return this._request("/sales/quotes", "GET", undefined, params);
27
+ }
28
+ /**
29
+ * Retrieves a specific quotation by its ID.
30
+ * Endpoint: GET /sales/quotes/{id}
31
+ * @param id - The ID of the quotation to retrieve.
32
+ * @returns A promise that resolves to the quotation.
33
+ */
34
+ async get(id) {
35
+ const response = await this._request(`/sales/quotes/${id}`, "GET");
36
+ return response.transaction;
37
+ }
38
+ /**
39
+ * Updates an existing quotation.
40
+ * Endpoint: PUT /sales/quotes/{id}
41
+ * @param id - The ID of the quotation to update.
42
+ * @param data - The data to update the quotation with.
43
+ * @returns A promise that resolves to the updated quotation.
44
+ */
45
+ async update(id, data) {
46
+ const response = await this._request(`/sales/quotes/${id}`, "PUT", data);
47
+ return response.transaction;
48
+ }
49
+ /**
50
+ * Deletes a quotation.
51
+ * Endpoint: DELETE /sales/quotes/{id}
52
+ * @param id - The ID of the quotation to delete.
53
+ * @returns A promise that resolves when the quotation is deleted.
54
+ */
55
+ async delete(id) {
56
+ await this._request(`/sales/quotes/${id}`, "DELETE");
57
+ }
58
+ /**
59
+ * Updates the status of an existing quotation.
60
+ * Endpoint: PATCH /sales/quotes/{id}
61
+ * @param id - The ID of the quotation to update.
62
+ * @param data - The data containing the new status.
63
+ * @returns A promise that resolves to the updated quotation.
64
+ */
65
+ async updateStatus(id, data) {
66
+ const response = await this._request(`/sales/quotes/${id}`, "PATCH", data);
67
+ return response.transaction;
68
+ }
69
+ }
70
+ exports.QuotationsAPI = QuotationsAPI;
71
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sales/quotations/index.ts"],"names":[],"mappings":";AAAA,gCAAgC;;;AAahC,MAAa,aAAa;IACxB,YAAoB,QAAiC;QAAjC,aAAQ,GAAR,QAAQ,CAAyB;IAAG,CAAC;IAEzD;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,IAAgC;QAEhC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,eAAe,EACf,MAAM,EACN,IAAI,CACL,CAAC;QACF,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,MAAiC;QAEjC,OAAO,IAAI,CAAC,QAAQ,CAClB,eAAe,EACf,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,iBAAiB,EAAE,EAAE,EACrB,KAAK,CACN,CAAC;QACF,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CACV,EAAmB,EACnB,IAAgC;QAEhC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,iBAAiB,EAAE,EAAE,EACrB,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,iBAAiB,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,YAAY,CAChB,EAAmB,EACnB,IAAsC;QAEtC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAClC,iBAAiB,EAAE,EAAE,EACrB,OAAO,EACP,IAAI,CACL,CAAC;QACF,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;CACF;AAlGD,sCAkGC"}
@@ -0,0 +1,202 @@
1
+ import { BukkuEmailDetails } from "../../common/type";
2
+ import { BukkuFileAttachment } from "../../common/type";
3
+ import { BukkuListPagination } from "../../common/type";
4
+ import { BukkuAttachedFileResponse } from "../../common/type";
5
+ /**
6
+ * Represents a form item for creating or updating a Bukku Quotation.
7
+ * This defines the fields expected when providing form items in a create/update payload.
8
+ */
9
+ export interface BukkuQuotationFormItemCreateParams {
10
+ /** The id of the item, required when you're updating an item. */
11
+ id?: number;
12
+ /** The type of the item, leave null for normal item. */
13
+ type?: "bundle" | "subtitle" | "subtotal" | "bundle_item" | null;
14
+ /** The account of the item, required for normal item. */
15
+ account_id?: number;
16
+ /** The description of the item, required for normal / bundle & subtitle items. */
17
+ description?: string;
18
+ /** The service date of the item, following format YYYY-MM-DD. */
19
+ service_date?: string;
20
+ /** The product of the item. */
21
+ product_id?: number;
22
+ /** The product unit / UOM of the product, leave blank to use the product's default unit. */
23
+ product_unit_id?: number;
24
+ /** The location of the product, used for inventory product, leave blank to use the system default location. */
25
+ location_id?: number;
26
+ /** The unit price of the item, supports up to 4 decimal points, required for normal items. */
27
+ unit_price?: number;
28
+ /** The quantity of the item, supports up to 4 decimal points, required for normal items. */
29
+ quantity?: number;
30
+ /** The discount of the item, supports value (eg. 255.12) or percentage (eg. 10%). Max 14 chars. */
31
+ discount?: string;
32
+ /** The tax code of the item. */
33
+ tax_code_id?: number;
34
+ /** The child items, used by bundle. */
35
+ children?: BukkuQuotationFormItemCreateParams[];
36
+ }
37
+ /**
38
+ * Parameters for creating a Bukku Quotation.
39
+ * Based on POST /sales/quotes
40
+ */
41
+ export interface BukkuQuotationCreateParams {
42
+ contact_id: number;
43
+ number?: string;
44
+ number2?: string;
45
+ date: string;
46
+ currency_code: string;
47
+ exchange_rate: number;
48
+ billing_party?: string;
49
+ show_shipping?: boolean;
50
+ shipping_party?: string;
51
+ shipping_info?: string;
52
+ tag_ids?: number[];
53
+ term_id?: number;
54
+ title?: string;
55
+ description?: string;
56
+ remarks?: string;
57
+ tax_mode: "inclusive" | "exclusive";
58
+ form_items: Array<BukkuQuotationFormItemCreateParams>;
59
+ status: "draft" | "pending_approval" | "ready";
60
+ email?: BukkuEmailDetails;
61
+ files?: Array<BukkuFileAttachment>;
62
+ }
63
+ /**
64
+ * Parameters for updating a Bukku Quotation.
65
+ * This is similar to BukkuQuotationCreateParams but typically omits fields like 'status'
66
+ * which are managed by specific actions (e.g., PATCH for status update).
67
+ */
68
+ export interface BukkuQuotationUpdateParams {
69
+ contact_id: number;
70
+ number?: string;
71
+ number2?: string;
72
+ date: string;
73
+ currency_code: string;
74
+ exchange_rate: number;
75
+ billing_party?: string;
76
+ show_shipping?: boolean;
77
+ shipping_party?: string;
78
+ shipping_info?: string;
79
+ tag_ids?: number[];
80
+ term_id?: number;
81
+ title?: string;
82
+ description?: string;
83
+ remarks?: string;
84
+ tax_mode: "inclusive" | "exclusive";
85
+ form_items: Array<BukkuQuotationFormItemCreateParams>;
86
+ email?: BukkuEmailDetails;
87
+ files?: Array<BukkuFileAttachment>;
88
+ }
89
+ /**
90
+ * Represents a Bukku Quotation object as returned by the API (e.g., in the 'transaction' field of a response).
91
+ */
92
+ export interface BukkuQuotation {
93
+ id: number;
94
+ contact_id: number;
95
+ contact_name?: string;
96
+ number?: string;
97
+ number2?: string;
98
+ date: string;
99
+ currency_code: string;
100
+ currency_symbol?: string;
101
+ exchange_rate: number;
102
+ billing_party?: string;
103
+ show_shipping?: boolean;
104
+ shipping_info?: string;
105
+ shipping_party?: string;
106
+ tag_ids?: number[];
107
+ tag_names?: string[];
108
+ term_id?: number;
109
+ term_name?: string;
110
+ title?: string;
111
+ description?: string;
112
+ remarks?: string;
113
+ tax_mode: "inclusive" | "exclusive";
114
+ amount?: number;
115
+ status: string;
116
+ type?: string;
117
+ short_link?: string;
118
+ files?: BukkuAttachedFileResponse[];
119
+ created_at?: string;
120
+ updated_at?: string;
121
+ }
122
+ /**
123
+ * Represents the API response structure when a quotation is created or retrieved.
124
+ */
125
+ export interface BukkuQuotationResponse {
126
+ transaction: BukkuQuotation;
127
+ }
128
+ /**
129
+ * Parameters for listing Bukku Quotations (GET /sales/quotes).
130
+ */
131
+ export interface BukkuQuotationListParams {
132
+ /** Search for keywords in No., Reference No., Title, Remarks, Description, Contact Name, Billing Party & Shipping Party. Max 100 chars. */
133
+ search?: string;
134
+ /** Search for keywords within custom fields, use format DD/MM/YYYY for a date. Max 100 chars. */
135
+ custom_search?: string;
136
+ /** Search by contact ID. */
137
+ contact_id?: number;
138
+ /** Search for transactions on and after the date (YYYY-MM-DD). */
139
+ date_from?: string;
140
+ /** Search for transactions on and before the date (YYYY-MM-DD). */
141
+ date_to?: string;
142
+ /** Search by status, default to All but Void. */
143
+ status?: "all" | "draft" | "pending_approval" | "ready" | "void";
144
+ /** Search by the latest email status. */
145
+ email_status?: "UNSENT" | "PENDING" | "SENT" | "BOUNCED" | "OPENED" | "VIEWED";
146
+ /** Search by transfer status. */
147
+ transfer_status?: "ALL" | "NOT_TRANSFERRED" | "PARTIAL_TRANSFERRED" | "TRANSFERRED";
148
+ /** The current page number. Default: 1, Min: 1. */
149
+ page?: number;
150
+ /** Number of records per page. Default: 30. */
151
+ page_size?: number;
152
+ /** Sort by field. */
153
+ sort_by?: "number" | "date" | "contact_name" | "number2" | "title" | "description" | "amount" | "created_at";
154
+ /** Sort the list in ascending or descending order. */
155
+ sort_dir?: "asc" | "desc";
156
+ [key: string]: any;
157
+ }
158
+ /**
159
+ * Represents a summary of a Bukku Quotation as it appears in a list.
160
+ */
161
+ export interface BukkuQuotationListItem {
162
+ id: number;
163
+ number?: string;
164
+ number2?: string;
165
+ contact_id: number;
166
+ contact_name?: string;
167
+ contact_email?: string;
168
+ date: string;
169
+ billing_party?: string;
170
+ shipping_party?: string;
171
+ tag_names?: string[];
172
+ title?: string;
173
+ description?: string;
174
+ currency_code: string;
175
+ currency_symbol?: string;
176
+ exchange_rate: number;
177
+ amount?: number;
178
+ status: string;
179
+ transfer_status?: string;
180
+ email_status?: string;
181
+ file_count?: number;
182
+ short_link?: string;
183
+ created_by?: string;
184
+ created_at: string;
185
+ updated_at: string;
186
+ }
187
+ /**
188
+ * Represents the API response structure for listing quotations.
189
+ */
190
+ export interface BukkuQuotationListApiResponse {
191
+ paging: BukkuListPagination;
192
+ transactions: BukkuQuotationListItem[];
193
+ }
194
+ /**
195
+ * Parameters for updating the status of a Bukku Quotation.
196
+ * Based on PATCH /sales/quotes/{id}
197
+ */
198
+ export interface BukkuQuotationStatusUpdateParams {
199
+ /** The new status for the quotation. */
200
+ status: "ready" | "draft" | "pending_approval" | "void";
201
+ }
202
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/sales/quotations/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,kCAAkC;IACjD,iEAAiE;IACjE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,IAAI,CAAC;IACjE,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,WA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 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/sales/quotations/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,52 @@
1
+ import type { BukkuAPIRequestFunction } from "../../types";
2
+ import { BukkuRefund, BukkuRefundCreateParams, BukkuRefundListParams, BukkuRefundListApiResponse, BukkuRefundUpdateParams, BukkuRefundStatusUpdateParams } from "./type";
3
+ export declare class RefundsAPI {
4
+ private _request;
5
+ constructor(_request: BukkuAPIRequestFunction);
6
+ /**
7
+ * Creates a new refund.
8
+ * Endpoint: POST /sales/refunds
9
+ * @param data - The data for the new refund.
10
+ * @returns A promise that resolves to the created refund.
11
+ */
12
+ create(data: BukkuRefundCreateParams): Promise<BukkuRefund>;
13
+ /**
14
+ * Retrieves a paginated list of refunds.
15
+ * Endpoint: GET /sales/refunds
16
+ * @param params - Optional parameters for filtering and pagination.
17
+ * @returns A promise that resolves to the API response for listing refunds.
18
+ */
19
+ list(params?: BukkuRefundListParams): Promise<BukkuRefundListApiResponse>;
20
+ /**
21
+ * Retrieves a specific refund by its ID.
22
+ * Endpoint: GET /sales/refunds/{id}
23
+ * @param id - The ID of the refund to retrieve.
24
+ * @returns A promise that resolves to the refund.
25
+ */
26
+ get(id: string | number): Promise<BukkuRefund>;
27
+ /**
28
+ * Updates an existing refund.
29
+ * Endpoint: PUT /sales/refunds/{id}
30
+ * @param id - The ID of the refund to update.
31
+ * @param data - The data to update the refund with.
32
+ * @returns A promise that resolves to the updated refund.
33
+ */
34
+ update(id: string | number, data: BukkuRefundUpdateParams): Promise<BukkuRefund>;
35
+ /**
36
+ * Deletes a refund.
37
+ * Endpoint: DELETE /sales/refunds/{id}
38
+ * Note: Only transactions with draft and void statuses can be deleted.
39
+ * @param id - The ID of the refund to delete.
40
+ * @returns A promise that resolves when the refund is deleted.
41
+ */
42
+ delete(id: string | number): Promise<void>;
43
+ /**
44
+ * Updates the status of an existing refund.
45
+ * Endpoint: PATCH /sales/refunds/{id}
46
+ * @param id - The ID of the refund to update.
47
+ * @param data - The data containing the new status.
48
+ * @returns A promise that resolves to the updated refund.
49
+ */
50
+ updateStatus(id: string | number, data: BukkuRefundStatusUpdateParams): Promise<BukkuRefund>;
51
+ }
52
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sales/refunds/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EACL,WAAW,EACX,uBAAuB,EAEvB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,QAAQ,CAAC;AAEhB,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,uBAAuB;IAErD;;;;;OAKG;IACG,MAAM,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,WAAW,CAAC;IASjE;;;;;OAKG;IACG,IAAI,CACR,MAAM,CAAC,EAAE,qBAAqB,GAC7B,OAAO,CAAC,0BAA0B,CAAC;IAStC;;;;;OAKG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAQpD;;;;;;OAMG;IACG,MAAM,CACV,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,WAAW,CAAC;IASvB;;;;;;OAMG;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,6BAA6B,GAClC,OAAO,CAAC,WAAW,CAAC;CAQxB"}