@centry-digital/bukku-mcp 1.1.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 (97) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +269 -0
  3. package/build/client/bukku-client.d.ts +62 -0
  4. package/build/client/bukku-client.js +195 -0
  5. package/build/config/env.d.ts +19 -0
  6. package/build/config/env.js +36 -0
  7. package/build/errors/transform.d.ts +14 -0
  8. package/build/errors/transform.js +141 -0
  9. package/build/errors/transform.test.d.ts +1 -0
  10. package/build/errors/transform.test.js +101 -0
  11. package/build/index.d.ts +13 -0
  12. package/build/index.js +52 -0
  13. package/build/tools/cache/reference-cache.d.ts +42 -0
  14. package/build/tools/cache/reference-cache.js +63 -0
  15. package/build/tools/configs/account.d.ts +17 -0
  16. package/build/tools/configs/account.js +28 -0
  17. package/build/tools/configs/bank-money-in.d.ts +10 -0
  18. package/build/tools/configs/bank-money-in.js +22 -0
  19. package/build/tools/configs/bank-money-out.d.ts +10 -0
  20. package/build/tools/configs/bank-money-out.js +22 -0
  21. package/build/tools/configs/bank-transfer.d.ts +11 -0
  22. package/build/tools/configs/bank-transfer.js +23 -0
  23. package/build/tools/configs/contact-group.d.ts +11 -0
  24. package/build/tools/configs/contact-group.js +19 -0
  25. package/build/tools/configs/contact.d.ts +14 -0
  26. package/build/tools/configs/contact.js +25 -0
  27. package/build/tools/configs/delivery-order.d.ts +8 -0
  28. package/build/tools/configs/delivery-order.js +20 -0
  29. package/build/tools/configs/file.d.ts +18 -0
  30. package/build/tools/configs/file.js +26 -0
  31. package/build/tools/configs/goods-received-note.d.ts +8 -0
  32. package/build/tools/configs/goods-received-note.js +20 -0
  33. package/build/tools/configs/journal-entry.d.ts +14 -0
  34. package/build/tools/configs/journal-entry.js +26 -0
  35. package/build/tools/configs/location.d.ts +20 -0
  36. package/build/tools/configs/location.js +28 -0
  37. package/build/tools/configs/product-bundle.d.ts +18 -0
  38. package/build/tools/configs/product-bundle.js +29 -0
  39. package/build/tools/configs/product-group.d.ts +14 -0
  40. package/build/tools/configs/product-group.js +22 -0
  41. package/build/tools/configs/product.d.ts +24 -0
  42. package/build/tools/configs/product.js +35 -0
  43. package/build/tools/configs/purchase-bill.d.ts +9 -0
  44. package/build/tools/configs/purchase-bill.js +21 -0
  45. package/build/tools/configs/purchase-credit-note.d.ts +8 -0
  46. package/build/tools/configs/purchase-credit-note.js +20 -0
  47. package/build/tools/configs/purchase-order.d.ts +8 -0
  48. package/build/tools/configs/purchase-order.js +20 -0
  49. package/build/tools/configs/purchase-payment.d.ts +8 -0
  50. package/build/tools/configs/purchase-payment.js +20 -0
  51. package/build/tools/configs/purchase-refund.d.ts +8 -0
  52. package/build/tools/configs/purchase-refund.js +20 -0
  53. package/build/tools/configs/sales-credit-note.d.ts +8 -0
  54. package/build/tools/configs/sales-credit-note.js +20 -0
  55. package/build/tools/configs/sales-invoice.d.ts +8 -0
  56. package/build/tools/configs/sales-invoice.js +20 -0
  57. package/build/tools/configs/sales-order.d.ts +8 -0
  58. package/build/tools/configs/sales-order.js +20 -0
  59. package/build/tools/configs/sales-payment.d.ts +8 -0
  60. package/build/tools/configs/sales-payment.js +20 -0
  61. package/build/tools/configs/sales-quote.d.ts +8 -0
  62. package/build/tools/configs/sales-quote.js +20 -0
  63. package/build/tools/configs/sales-refund.d.ts +8 -0
  64. package/build/tools/configs/sales-refund.js +20 -0
  65. package/build/tools/configs/tag-group.d.ts +11 -0
  66. package/build/tools/configs/tag-group.js +22 -0
  67. package/build/tools/configs/tag.d.ts +11 -0
  68. package/build/tools/configs/tag.js +22 -0
  69. package/build/tools/custom/account-tools.d.ts +21 -0
  70. package/build/tools/custom/account-tools.js +119 -0
  71. package/build/tools/custom/contact-archive.d.ts +17 -0
  72. package/build/tools/custom/contact-archive.js +72 -0
  73. package/build/tools/custom/control-panel-archive.d.ts +17 -0
  74. package/build/tools/custom/control-panel-archive.js +72 -0
  75. package/build/tools/custom/file-upload.d.ts +17 -0
  76. package/build/tools/custom/file-upload.js +43 -0
  77. package/build/tools/custom/journal-entry-tools.d.ts +20 -0
  78. package/build/tools/custom/journal-entry-tools.js +109 -0
  79. package/build/tools/custom/location-tools.d.ts +20 -0
  80. package/build/tools/custom/location-tools.js +96 -0
  81. package/build/tools/custom/product-archive.d.ts +17 -0
  82. package/build/tools/custom/product-archive.js +124 -0
  83. package/build/tools/custom/reference-data.d.ts +21 -0
  84. package/build/tools/custom/reference-data.js +108 -0
  85. package/build/tools/factory.d.ts +26 -0
  86. package/build/tools/factory.js +224 -0
  87. package/build/tools/registry.d.ts +22 -0
  88. package/build/tools/registry.js +140 -0
  89. package/build/tools/validation/double-entry.d.ts +46 -0
  90. package/build/tools/validation/double-entry.js +66 -0
  91. package/build/types/api-responses.d.ts +21 -0
  92. package/build/types/api-responses.js +6 -0
  93. package/build/types/bukku.d.ts +93 -0
  94. package/build/types/bukku.js +11 -0
  95. package/build/utils/logger.d.ts +6 -0
  96. package/build/utils/logger.js +8 -0
  97. package/package.json +51 -0
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Delivery Order Entity Configuration
3
+ *
4
+ * API: /sales/delivery_orders
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ */
7
+ export const deliveryOrderConfig = {
8
+ entity: "delivery-order",
9
+ apiBasePath: "/sales/delivery_orders",
10
+ singularKey: "transaction",
11
+ pluralKey: "transactions",
12
+ description: "delivery order",
13
+ operations: ["list", "get", "create", "update", "delete"],
14
+ hasStatusUpdate: true,
15
+ listFilters: ["contact_id", "email_status", "transfer_status"],
16
+ businessRules: {
17
+ delete: "Only draft and void delivery orders can be deleted. Ready or pending approval delivery orders cannot be deleted — use update-delivery-order-status to void a ready delivery order instead.",
18
+ statusTransitions: "Valid transitions: draft -> pending_approval, draft -> ready, pending_approval -> ready, ready -> void. A void delivery order is final and cannot be changed. There is no way to revert from ready, pending_approval, or void back to draft.",
19
+ },
20
+ };
@@ -0,0 +1,18 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * File Entity Configuration
4
+ *
5
+ * API: /files
6
+ * Response keys: file (singular), files (plural)
7
+ *
8
+ * Files are typically attached to sales and purchase transactions using file_ids arrays.
9
+ * The create operation is handled by a custom upload-file tool (not the factory create tool)
10
+ * because file upload requires multipart/form-data, not JSON.
11
+ *
12
+ * API limitations:
13
+ * - No delete endpoint (files are permanent once uploaded)
14
+ * - No update endpoint (files are immutable)
15
+ * - No pagination support for list (returns ALL files)
16
+ * - No list filters (API spec shows no query parameters)
17
+ */
18
+ export declare const fileConfig: CrudEntityConfig;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * File Entity Configuration
3
+ *
4
+ * API: /files
5
+ * Response keys: file (singular), files (plural)
6
+ *
7
+ * Files are typically attached to sales and purchase transactions using file_ids arrays.
8
+ * The create operation is handled by a custom upload-file tool (not the factory create tool)
9
+ * because file upload requires multipart/form-data, not JSON.
10
+ *
11
+ * API limitations:
12
+ * - No delete endpoint (files are permanent once uploaded)
13
+ * - No update endpoint (files are immutable)
14
+ * - No pagination support for list (returns ALL files)
15
+ * - No list filters (API spec shows no query parameters)
16
+ */
17
+ export const fileConfig = {
18
+ entity: "file",
19
+ apiBasePath: "/files",
20
+ singularKey: "file",
21
+ pluralKey: "files",
22
+ description: "file. Files are typically attached to sales and purchase transactions using file_ids arrays. Use upload-file to add new files.",
23
+ operations: ["list", "get"],
24
+ hasStatusUpdate: false,
25
+ listFilters: [],
26
+ };
@@ -0,0 +1,8 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Goods Received Note Entity Configuration
4
+ *
5
+ * API: /purchases/goods_received_notes
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ */
8
+ export declare const goodsReceivedNoteConfig: CrudEntityConfig;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Goods Received Note Entity Configuration
3
+ *
4
+ * API: /purchases/goods_received_notes
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ */
7
+ export const goodsReceivedNoteConfig = {
8
+ entity: "goods-received-note",
9
+ apiBasePath: "/purchases/goods_received_notes",
10
+ singularKey: "transaction",
11
+ pluralKey: "transactions",
12
+ description: "goods received note",
13
+ operations: ["list", "get", "create", "update", "delete"],
14
+ hasStatusUpdate: true,
15
+ listFilters: ["contact_id", "email_status", "transfer_status"],
16
+ businessRules: {
17
+ delete: "Only draft and void goods received notes can be deleted. Ready or pending approval goods received notes cannot be deleted — use update-goods-received-note-status to void a ready goods received note instead.",
18
+ statusTransitions: "Valid transitions: draft -> pending_approval, draft -> ready, pending_approval -> ready, ready -> void. A void goods received note is final and cannot be changed. There is no way to revert from ready, pending_approval, or void back to draft.",
19
+ },
20
+ };
@@ -0,0 +1,14 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Journal Entry Entity Configuration
4
+ *
5
+ * API: /journal_entries
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ * Operations: list, get, delete ONLY
8
+ * - Create and update are handled by custom tools (journal-entry-tools.ts)
9
+ * because they require double-entry validation (debits == credits)
10
+ * - Status updates use standard factory pattern (hasStatusUpdate: true)
11
+ * Status lifecycle: draft -> ready (posted), ready -> void (final)
12
+ * Delete constraint: Only draft and void entries can be deleted
13
+ */
14
+ export declare const journalEntryConfig: CrudEntityConfig;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Journal Entry Entity Configuration
3
+ *
4
+ * API: /journal_entries
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ * Operations: list, get, delete ONLY
7
+ * - Create and update are handled by custom tools (journal-entry-tools.ts)
8
+ * because they require double-entry validation (debits == credits)
9
+ * - Status updates use standard factory pattern (hasStatusUpdate: true)
10
+ * Status lifecycle: draft -> ready (posted), ready -> void (final)
11
+ * Delete constraint: Only draft and void entries can be deleted
12
+ */
13
+ export const journalEntryConfig = {
14
+ entity: "journal-entry",
15
+ apiBasePath: "/journal_entries",
16
+ singularKey: "transaction",
17
+ pluralKey: "transactions",
18
+ description: "journal entry",
19
+ operations: ["list", "get", "delete"],
20
+ hasStatusUpdate: true,
21
+ listFilters: [],
22
+ businessRules: {
23
+ delete: "Only draft and void journal entries can be deleted. Ready journal entries cannot be deleted -- use update-journal-entry-status to void a ready entry instead.",
24
+ statusTransitions: "Valid transitions: draft -> ready, ready -> void. A void entry is final and cannot be changed.",
25
+ },
26
+ };
@@ -0,0 +1,20 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Location Entity Configuration
4
+ *
5
+ * API: /locations (list, create) and /location/{id} (get, update, delete)
6
+ * Response keys: location (singular), locations (plural)
7
+ *
8
+ * API PATH INCONSISTENCY:
9
+ * - List/create use /locations (plural)
10
+ * - Get/update/delete use /location/{id} (singular)
11
+ *
12
+ * The factory generates tools based on apiBasePath, which would produce:
13
+ * - /locations for list/create ✓
14
+ * - /locations/{id} for get/update/delete ✗ (incorrect)
15
+ *
16
+ * Therefore, this config only enables list and create operations.
17
+ * Get/update/delete operations are handled by custom tools in location-tools.ts
18
+ * which use the correct /location/{id} singular path.
19
+ */
20
+ export declare const locationConfig: CrudEntityConfig;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Location Entity Configuration
3
+ *
4
+ * API: /locations (list, create) and /location/{id} (get, update, delete)
5
+ * Response keys: location (singular), locations (plural)
6
+ *
7
+ * API PATH INCONSISTENCY:
8
+ * - List/create use /locations (plural)
9
+ * - Get/update/delete use /location/{id} (singular)
10
+ *
11
+ * The factory generates tools based on apiBasePath, which would produce:
12
+ * - /locations for list/create ✓
13
+ * - /locations/{id} for get/update/delete ✗ (incorrect)
14
+ *
15
+ * Therefore, this config only enables list and create operations.
16
+ * Get/update/delete operations are handled by custom tools in location-tools.ts
17
+ * which use the correct /location/{id} singular path.
18
+ */
19
+ export const locationConfig = {
20
+ entity: "location",
21
+ apiBasePath: "/locations",
22
+ singularKey: "location",
23
+ pluralKey: "locations",
24
+ description: "location for multi-branch accounting. Use locations to track which branch or office a transaction belongs to.",
25
+ operations: ["list", "create"],
26
+ hasStatusUpdate: false,
27
+ listFilters: ["include_archived"],
28
+ };
@@ -0,0 +1,18 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Product Bundle Entity Configuration
4
+ *
5
+ * API: /products/bundles
6
+ * Response keys: bundle (singular), bundles (plural) — custom wrapper keys
7
+ * Bundles aggregate multiple products with optional discounts.
8
+ * Archive/unarchive is handled by separate custom tools (product-archive.ts),
9
+ * NOT the factory status tool, because the API expects { is_archived: boolean }
10
+ * instead of { status: string }.
11
+ *
12
+ * Note: Bukku API has no GET /products/bundles endpoint.
13
+ * To list bundles, use GET /products?type=bundle (the list-products tool with type=bundle filter).
14
+ *
15
+ * Cross-references:
16
+ * - Use list-products to find product IDs for bundle items
17
+ */
18
+ export declare const productBundleConfig: CrudEntityConfig;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Product Bundle Entity Configuration
3
+ *
4
+ * API: /products/bundles
5
+ * Response keys: bundle (singular), bundles (plural) — custom wrapper keys
6
+ * Bundles aggregate multiple products with optional discounts.
7
+ * Archive/unarchive is handled by separate custom tools (product-archive.ts),
8
+ * NOT the factory status tool, because the API expects { is_archived: boolean }
9
+ * instead of { status: string }.
10
+ *
11
+ * Note: Bukku API has no GET /products/bundles endpoint.
12
+ * To list bundles, use GET /products?type=bundle (the list-products tool with type=bundle filter).
13
+ *
14
+ * Cross-references:
15
+ * - Use list-products to find product IDs for bundle items
16
+ */
17
+ export const productBundleConfig = {
18
+ entity: "product-bundle",
19
+ apiBasePath: "/products/bundles",
20
+ singularKey: "bundle",
21
+ pluralKey: "bundles",
22
+ description: "product bundle. Bundles aggregate multiple products with optional discounts. To list bundles, use list-products with type=bundle. Use list-products to find product IDs for bundle items.",
23
+ operations: ["get", "create", "update", "delete"],
24
+ hasStatusUpdate: false,
25
+ listFilters: [],
26
+ businessRules: {
27
+ delete: "Only bundles that are not used in any transactions can be deleted.",
28
+ },
29
+ };
@@ -0,0 +1,14 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Product Group Entity Configuration
4
+ *
5
+ * API: /products/groups
6
+ * Response keys: group (singular), groups (plural)
7
+ * Groups organize products into categories.
8
+ * Simplest entity config — no status operations, no entity-specific filters,
9
+ * no business rules. Factory provides base pagination parameters.
10
+ *
11
+ * Cross-references:
12
+ * - Use list-products to find product IDs for the product_ids array
13
+ */
14
+ export declare const productGroupConfig: CrudEntityConfig;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Product Group Entity Configuration
3
+ *
4
+ * API: /products/groups
5
+ * Response keys: group (singular), groups (plural)
6
+ * Groups organize products into categories.
7
+ * Simplest entity config — no status operations, no entity-specific filters,
8
+ * no business rules. Factory provides base pagination parameters.
9
+ *
10
+ * Cross-references:
11
+ * - Use list-products to find product IDs for the product_ids array
12
+ */
13
+ export const productGroupConfig = {
14
+ entity: "product-group",
15
+ apiBasePath: "/products/groups",
16
+ singularKey: "group",
17
+ pluralKey: "groups",
18
+ description: "product group. Groups organize products into categories. Use list-products to find product IDs for the product_ids array.",
19
+ operations: ["list", "get", "create", "update", "delete"],
20
+ hasStatusUpdate: false,
21
+ listFilters: [],
22
+ };
@@ -0,0 +1,24 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Product Entity Configuration
4
+ *
5
+ * API: /products
6
+ * Response keys: product (singular), products (plural) — NOT transaction/transactions
7
+ * Products are non-transaction entities with custom wrapper keys.
8
+ * Archive/unarchive is handled by separate custom tools (product-archive.ts),
9
+ * NOT the factory status tool, because the API expects { is_archived: boolean }
10
+ * instead of { status: string }.
11
+ *
12
+ * List filters:
13
+ * - search: Text search across product name/code
14
+ * - stock_level: Filter by stock level (low, medium, high)
15
+ * - mode: Filter by product mode (sale, purchase, both)
16
+ * - type: Filter by product type (tracked, untracked, service)
17
+ * - include_archived: Boolean to include archived products in results
18
+ *
19
+ * Cross-references:
20
+ * - Use list-tax-codes to find valid tax code IDs for sale_tax_code_id and purchase_tax_code_id
21
+ * - Use list-accounts to find valid account IDs for sale_account_id, purchase_account_id, and inventory_account_id
22
+ * - Use list-product-groups to find group IDs for group_ids array
23
+ */
24
+ export declare const productConfig: CrudEntityConfig;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Product Entity Configuration
3
+ *
4
+ * API: /products
5
+ * Response keys: product (singular), products (plural) — NOT transaction/transactions
6
+ * Products are non-transaction entities with custom wrapper keys.
7
+ * Archive/unarchive is handled by separate custom tools (product-archive.ts),
8
+ * NOT the factory status tool, because the API expects { is_archived: boolean }
9
+ * instead of { status: string }.
10
+ *
11
+ * List filters:
12
+ * - search: Text search across product name/code
13
+ * - stock_level: Filter by stock level (low, medium, high)
14
+ * - mode: Filter by product mode (sale, purchase, both)
15
+ * - type: Filter by product type (tracked, untracked, service)
16
+ * - include_archived: Boolean to include archived products in results
17
+ *
18
+ * Cross-references:
19
+ * - Use list-tax-codes to find valid tax code IDs for sale_tax_code_id and purchase_tax_code_id
20
+ * - Use list-accounts to find valid account IDs for sale_account_id, purchase_account_id, and inventory_account_id
21
+ * - Use list-product-groups to find group IDs for group_ids array
22
+ */
23
+ export const productConfig = {
24
+ entity: "product",
25
+ apiBasePath: "/products",
26
+ singularKey: "product",
27
+ pluralKey: "products",
28
+ description: "product. Use list-tax-codes to find valid tax code IDs for sale_tax_code_id and purchase_tax_code_id. Use list-accounts to find valid account IDs for sale_account_id, purchase_account_id, and inventory_account_id. Use list-product-groups to find group IDs for group_ids.",
29
+ operations: ["list", "get", "create", "update", "delete"],
30
+ hasStatusUpdate: false,
31
+ listFilters: ["search", "stock_level", "mode", "type", "include_archived"],
32
+ businessRules: {
33
+ delete: "Only products that are not used in any transactions can be deleted. Archive instead if the product has transaction history.",
34
+ },
35
+ };
@@ -0,0 +1,9 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Purchase Bill Entity Configuration
4
+ *
5
+ * API: /purchases/bills
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ * Note: payment_mode filter includes 'claim' option for expense claims/reimbursements
8
+ */
9
+ export declare const purchaseBillConfig: CrudEntityConfig;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Purchase Bill Entity Configuration
3
+ *
4
+ * API: /purchases/bills
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ * Note: payment_mode filter includes 'claim' option for expense claims/reimbursements
7
+ */
8
+ export const purchaseBillConfig = {
9
+ entity: "purchase-bill",
10
+ apiBasePath: "/purchases/bills",
11
+ singularKey: "transaction",
12
+ pluralKey: "transactions",
13
+ description: "purchase bill",
14
+ operations: ["list", "get", "create", "update", "delete"],
15
+ hasStatusUpdate: true,
16
+ listFilters: ["contact_id", "payment_status", "payment_mode"],
17
+ businessRules: {
18
+ delete: "Only draft and void bills can be deleted. Ready or pending approval bills cannot be deleted — use update-purchase-bill-status to void a ready bill instead.",
19
+ statusTransitions: "Valid transitions: draft -> pending_approval, draft -> ready, pending_approval -> ready, ready -> void. A void bill is final and cannot be changed. There is no way to revert from ready, pending_approval, or void back to draft.",
20
+ },
21
+ };
@@ -0,0 +1,8 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Purchase Credit Note Entity Configuration
4
+ *
5
+ * API: /purchases/credit_notes
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ */
8
+ export declare const purchaseCreditNoteConfig: CrudEntityConfig;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Purchase Credit Note Entity Configuration
3
+ *
4
+ * API: /purchases/credit_notes
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ */
7
+ export const purchaseCreditNoteConfig = {
8
+ entity: "purchase-credit-note",
9
+ apiBasePath: "/purchases/credit_notes",
10
+ singularKey: "transaction",
11
+ pluralKey: "transactions",
12
+ description: "purchase credit note",
13
+ operations: ["list", "get", "create", "update", "delete"],
14
+ hasStatusUpdate: true,
15
+ listFilters: ["contact_id", "payment_status"],
16
+ businessRules: {
17
+ delete: "Only draft and void credit notes can be deleted. Ready or pending approval credit notes cannot be deleted — use update-purchase-credit-note-status to void a ready credit note instead.",
18
+ statusTransitions: "Valid transitions: draft -> pending_approval, draft -> ready, pending_approval -> ready, ready -> void. A void credit note is final and cannot be changed. There is no way to revert from ready, pending_approval, or void back to draft.",
19
+ },
20
+ };
@@ -0,0 +1,8 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Purchase Order Entity Configuration
4
+ *
5
+ * API: /purchases/orders
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ */
8
+ export declare const purchaseOrderConfig: CrudEntityConfig;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Purchase Order Entity Configuration
3
+ *
4
+ * API: /purchases/orders
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ */
7
+ export const purchaseOrderConfig = {
8
+ entity: "purchase-order",
9
+ apiBasePath: "/purchases/orders",
10
+ singularKey: "transaction",
11
+ pluralKey: "transactions",
12
+ description: "purchase order",
13
+ operations: ["list", "get", "create", "update", "delete"],
14
+ hasStatusUpdate: true,
15
+ listFilters: ["contact_id", "email_status", "transfer_status"],
16
+ businessRules: {
17
+ delete: "Only draft and void purchase orders can be deleted. Ready or pending approval purchase orders cannot be deleted — use update-purchase-order-status to void a ready purchase order instead.",
18
+ statusTransitions: "Valid transitions: draft -> pending_approval, draft -> ready, pending_approval -> ready, ready -> void. A void purchase order is final and cannot be changed. There is no way to revert from ready, pending_approval, or void back to draft.",
19
+ },
20
+ };
@@ -0,0 +1,8 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Purchase Payment Entity Configuration
4
+ *
5
+ * API: /purchases/payments
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ */
8
+ export declare const purchasePaymentConfig: CrudEntityConfig;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Purchase Payment Entity Configuration
3
+ *
4
+ * API: /purchases/payments
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ */
7
+ export const purchasePaymentConfig = {
8
+ entity: "purchase-payment",
9
+ apiBasePath: "/purchases/payments",
10
+ singularKey: "transaction",
11
+ pluralKey: "transactions",
12
+ description: "purchase payment",
13
+ operations: ["list", "get", "create", "update", "delete"],
14
+ hasStatusUpdate: true,
15
+ listFilters: ["contact_id", "email_status", "payment_status", "account_id"],
16
+ businessRules: {
17
+ delete: "Only draft and void payments can be deleted. Ready or pending approval payments cannot be deleted — use update-purchase-payment-status to void a ready payment instead.",
18
+ statusTransitions: "Valid transitions: draft -> pending_approval, draft -> ready, pending_approval -> ready, ready -> void. A void payment is final and cannot be changed. There is no way to revert from ready, pending_approval, or void back to draft.",
19
+ },
20
+ };
@@ -0,0 +1,8 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Purchase Refund Entity Configuration
4
+ *
5
+ * API: /purchases/refunds
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ */
8
+ export declare const purchaseRefundConfig: CrudEntityConfig;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Purchase Refund Entity Configuration
3
+ *
4
+ * API: /purchases/refunds
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ */
7
+ export const purchaseRefundConfig = {
8
+ entity: "purchase-refund",
9
+ apiBasePath: "/purchases/refunds",
10
+ singularKey: "transaction",
11
+ pluralKey: "transactions",
12
+ description: "purchase refund",
13
+ operations: ["list", "get", "create", "update", "delete"],
14
+ hasStatusUpdate: true,
15
+ listFilters: ["contact_id", "email_status", "payment_status", "account_id"],
16
+ businessRules: {
17
+ delete: "Only draft and void refunds can be deleted. Ready or pending approval refunds cannot be deleted — use update-purchase-refund-status to void a ready refund instead.",
18
+ statusTransitions: "Valid transitions: draft -> pending_approval, draft -> ready, pending_approval -> ready, ready -> void. A void refund is final and cannot be changed. There is no way to revert from ready, pending_approval, or void back to draft.",
19
+ },
20
+ };
@@ -0,0 +1,8 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Sales Credit Note Entity Configuration
4
+ *
5
+ * API: /sales/credit_notes
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ */
8
+ export declare const salesCreditNoteConfig: CrudEntityConfig;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Sales Credit Note Entity Configuration
3
+ *
4
+ * API: /sales/credit_notes
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ */
7
+ export const salesCreditNoteConfig = {
8
+ entity: "sales-credit-note",
9
+ apiBasePath: "/sales/credit_notes",
10
+ singularKey: "transaction",
11
+ pluralKey: "transactions",
12
+ description: "sales credit note",
13
+ operations: ["list", "get", "create", "update", "delete"],
14
+ hasStatusUpdate: true,
15
+ listFilters: ["contact_id", "email_status"],
16
+ businessRules: {
17
+ delete: "Only draft and void credit notes can be deleted. Ready or pending approval credit notes cannot be deleted — use update-sales-credit-note-status to void a ready credit note instead.",
18
+ statusTransitions: "Valid transitions: draft -> pending_approval, draft -> ready, pending_approval -> ready, ready -> void. A void credit note is final and cannot be changed. There is no way to revert from ready, pending_approval, or void back to draft.",
19
+ },
20
+ };
@@ -0,0 +1,8 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Sales Invoice Entity Configuration
4
+ *
5
+ * API: /sales/invoices
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ */
8
+ export declare const salesInvoiceConfig: CrudEntityConfig;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Sales Invoice Entity Configuration
3
+ *
4
+ * API: /sales/invoices
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ */
7
+ export const salesInvoiceConfig = {
8
+ entity: "sales-invoice",
9
+ apiBasePath: "/sales/invoices",
10
+ singularKey: "transaction",
11
+ pluralKey: "transactions",
12
+ description: "sales invoice",
13
+ operations: ["list", "get", "create", "update", "delete"],
14
+ hasStatusUpdate: true,
15
+ listFilters: ["contact_id", "email_status", "transfer_status", "payment_status"],
16
+ businessRules: {
17
+ delete: "Only draft and void invoices can be deleted. Ready or pending approval invoices cannot be deleted — use update-sales-invoice-status to void a ready invoice instead.",
18
+ statusTransitions: "Valid transitions: draft -> pending_approval, draft -> ready, pending_approval -> ready, ready -> void. A void invoice is final and cannot be changed. There is no way to revert from ready, pending_approval, or void back to draft.",
19
+ },
20
+ };
@@ -0,0 +1,8 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Sales Order Entity Configuration
4
+ *
5
+ * API: /sales/orders
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ */
8
+ export declare const salesOrderConfig: CrudEntityConfig;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Sales Order Entity Configuration
3
+ *
4
+ * API: /sales/orders
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ */
7
+ export const salesOrderConfig = {
8
+ entity: "sales-order",
9
+ apiBasePath: "/sales/orders",
10
+ singularKey: "transaction",
11
+ pluralKey: "transactions",
12
+ description: "sales order",
13
+ operations: ["list", "get", "create", "update", "delete"],
14
+ hasStatusUpdate: true,
15
+ listFilters: ["contact_id", "email_status", "transfer_status"],
16
+ businessRules: {
17
+ delete: "Only draft and void orders can be deleted. Ready or pending approval orders cannot be deleted — use update-sales-order-status to void a ready order instead.",
18
+ statusTransitions: "Valid transitions: draft -> pending_approval, draft -> ready, pending_approval -> ready, ready -> void. A void order is final and cannot be changed. There is no way to revert from ready, pending_approval, or void back to draft.",
19
+ },
20
+ };
@@ -0,0 +1,8 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Sales Payment Entity Configuration
4
+ *
5
+ * API: /sales/payments
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ */
8
+ export declare const salesPaymentConfig: CrudEntityConfig;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Sales Payment Entity Configuration
3
+ *
4
+ * API: /sales/payments
5
+ * Response keys: transaction (singular), transactions (plural)
6
+ */
7
+ export const salesPaymentConfig = {
8
+ entity: "sales-payment",
9
+ apiBasePath: "/sales/payments",
10
+ singularKey: "transaction",
11
+ pluralKey: "transactions",
12
+ description: "sales payment",
13
+ operations: ["list", "get", "create", "update", "delete"],
14
+ hasStatusUpdate: true,
15
+ listFilters: ["contact_id", "payment_mode"],
16
+ businessRules: {
17
+ delete: "Only draft and void payments can be deleted. Ready or pending approval payments cannot be deleted — use update-sales-payment-status to void a ready payment instead.",
18
+ statusTransitions: "Valid transitions: draft -> pending_approval, draft -> ready, pending_approval -> ready, ready -> void. A void payment is final and cannot be changed. There is no way to revert from ready, pending_approval, or void back to draft.",
19
+ },
20
+ };
@@ -0,0 +1,8 @@
1
+ import type { CrudEntityConfig } from "../../types/bukku.js";
2
+ /**
3
+ * Sales Quote Entity Configuration
4
+ *
5
+ * API: /sales/quotes
6
+ * Response keys: transaction (singular), transactions (plural)
7
+ */
8
+ export declare const salesQuoteConfig: CrudEntityConfig;