@managesome/eposmatic-toolkit 0.2.454 → 0.2.457
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/lib/constants/WORKER_ENDPOINTS.d.ts +2 -0
- package/lib/constants/WORKER_ENDPOINTS.js +3 -0
- package/lib/helpers/store/common-warehouse-internal-movement-actions.d.ts +12 -0
- package/lib/helpers/store/common-warehouse-internal-movement-actions.js +33 -0
- package/lib/helpers/store/common-warehouse-purchase-order-receipt-actions.d.ts +12 -0
- package/lib/helpers/store/common-warehouse-purchase-order-receipt-actions.js +37 -0
- package/lib/helpers/store/index.d.ts +2 -0
- package/lib/helpers/store/index.js +2 -0
- package/lib/helpers/types/workers.d.ts +16 -1
- package/lib/schemas/models/index.d.ts +1 -0
- package/lib/schemas/models/index.js +1 -0
- package/lib/schemas/models/warehouse_internal_movements.d.ts +3 -3
- package/lib/schemas/models/warehouse_inventory_lot_serial_numbers.d.ts +3 -3
- package/lib/schemas/models/warehouse_sale_deliveries.d.ts +3 -3
- package/lib/schemas/models/warehouse_sale_invoices.d.ts +3 -3
- package/lib/schemas/types/index.d.ts +2 -0
- package/lib/schemas/types/index.js +2 -0
- package/package.json +1 -1
- package/lib/constants/PURCHASE_ORDER.d.ts +0 -16
- package/lib/constants/PURCHASE_ORDER.js +0 -100
- package/lib/constants/RFQ.d.ts +0 -0
- package/lib/constants/RFQ.js +0 -1
- package/lib/helpers/order/generate-purchase-order-rfq.d.ts +0 -3
- package/lib/helpers/order/generate-purchase-order-rfq.js +0 -64
- package/lib/helpers/order/generate-purchase-order.d.ts +0 -11
- package/lib/helpers/order/generate-purchase-order.js +0 -196
- package/lib/helpers/store/all-purchase-orders-actions.d.ts +0 -13
- package/lib/helpers/store/all-purchase-orders-actions.js +0 -56
- package/lib/helpers/store/all-sale-orders-actions.d.ts +0 -2
- package/lib/helpers/store/all-sale-orders-actions.js +0 -8
- package/lib/helpers/store/all-warehouse-sale-orders-actions.d.ts +0 -2
- package/lib/helpers/store/all-warehouse-sale-orders-actions.js +0 -8
- package/lib/helpers/store/common-purchase-order-actions.d.ts +0 -31
- package/lib/helpers/store/common-purchase-order-actions.js +0 -543
- package/lib/helpers/store/common-sale-order-actions.d.ts +0 -5
- package/lib/helpers/store/common-sale-order-actions.js +0 -65
- package/lib/helpers/store/purchase-order-rfq-cart-actions.d.ts +0 -19
- package/lib/helpers/store/purchase-order-rfq-cart-actions.js +0 -373
- package/lib/helpers/store/purchase-orders-cart-actions.d.ts +0 -57
- package/lib/helpers/store/purchase-orders-cart-actions.js +0 -486
- package/lib/helpers/types/purchase-order-cart-actions.d.ts +0 -26
- package/lib/helpers/types/purchase-order-cart-actions.js +0 -2
- package/lib/helpers/utils/invoice-x-report-helpers.d.ts +0 -58
- package/lib/helpers/utils/invoice-x-report-helpers.js +0 -1432
- package/lib/helpers/utils/purchase-order-engine.d.ts +0 -9
- package/lib/helpers/utils/purchase-order-engine.js +0 -34
- package/lib/helpers/utils/purchase-order-receipt-engine.d.ts +0 -149
- package/lib/helpers/utils/purchase-order-receipt-engine.js +0 -214
- package/lib/helpers/utils/purchase-order-x-report-helpers.d.ts +0 -58
- package/lib/helpers/utils/purchase-order-x-report-helpers.js +0 -1440
- package/lib/helpers/utils/sale-order-x-report-helpers.d.ts +0 -44
- package/lib/helpers/utils/sale-order-x-report-helpers.js +0 -22
- package/lib/helpers/utils/sale-x-report-helpers.d.ts +0 -58
- package/lib/helpers/utils/sale-x-report-helpers.js +0 -1456
- package/lib/helpers/utils/terminal-devices-helpers.d.ts +0 -2
- package/lib/helpers/utils/terminal-devices-helpers.js +0 -13
- package/lib/helpers/utils/void-purchase-order-items-helpers.d.ts +0 -3
- package/lib/helpers/utils/void-purchase-order-items-helpers.js +0 -38
- package/lib/helpers/utils/void-purchase-order-items-report-helpers.d.ts +0 -13
- package/lib/helpers/utils/void-purchase-order-items-report-helpers.js +0 -22
- package/lib/schemas/models/applied-order-discounts.d.ts +0 -80
- package/lib/schemas/models/applied-order-discounts.js +0 -106
- package/lib/schemas/models/brand.d.ts +0 -45
- package/lib/schemas/models/brand.js +0 -45
- package/lib/schemas/models/category.d.ts +0 -60
- package/lib/schemas/models/category.js +0 -67
- package/lib/schemas/models/dinein_table_fingerprints.d.ts +0 -65
- package/lib/schemas/models/dinein_table_fingerprints.js +0 -85
- package/lib/schemas/models/expense_category.d.ts +0 -83
- package/lib/schemas/models/expense_category.js +0 -64
- package/lib/schemas/models/internal_movements.d.ts +0 -357
- package/lib/schemas/models/internal_movements.js +0 -323
- package/lib/schemas/models/inventory.d.ts +0 -99
- package/lib/schemas/models/inventory.js +0 -87
- package/lib/schemas/models/inventory_lot_serial_numbers.d.ts +0 -154
- package/lib/schemas/models/inventory_lot_serial_numbers.js +0 -193
- package/lib/schemas/models/item.d.ts +0 -11269
- package/lib/schemas/models/item.js +0 -333
- package/lib/schemas/models/menu.d.ts +0 -941
- package/lib/schemas/models/menu.js +0 -69
- package/lib/schemas/models/order.d.ts +0 -15437
- package/lib/schemas/models/order.js +0 -891
- package/lib/schemas/models/purchase_order_receipts.d.ts +0 -165
- package/lib/schemas/models/purchase_order_receipts.js +0 -151
- package/lib/schemas/models/purchase_order_rfq.d.ts +0 -1959
- package/lib/schemas/models/purchase_order_rfq.js +0 -328
- package/lib/schemas/models/purchase_order_rfqs.d.ts +0 -1959
- package/lib/schemas/models/purchase_order_rfqs.js +0 -328
- package/lib/schemas/models/purchase_order_vendor_returns.d.ts +0 -234
- package/lib/schemas/models/purchase_order_vendor_returns.js +0 -188
- package/lib/schemas/models/purchase_orders.d.ts +0 -2678
- package/lib/schemas/models/purchase_orders.js +0 -336
- package/lib/schemas/models/rider.d.ts +0 -65
- package/lib/schemas/models/rider.js +0 -74
- package/lib/schemas/models/sale_order_deliveries.d.ts +0 -167
- package/lib/schemas/models/sale_order_deliveries.js +0 -155
- package/lib/schemas/models/sale_order_invoices.d.ts +0 -227
- package/lib/schemas/models/sale_order_invoices.js +0 -206
- package/lib/schemas/models/sale_order_rfq.d.ts +0 -1938
- package/lib/schemas/models/sale_order_rfq.js +0 -309
- package/lib/schemas/models/sale_orders.d.ts +0 -1943
- package/lib/schemas/models/sale_orders.js +0 -324
- package/lib/schemas/models/tenant.d.ts +0 -528
- package/lib/schemas/models/tenant.js +0 -755
- package/lib/schemas/models/tenant_staff.d.ts +0 -932
- package/lib/schemas/models/tenant_staff.js +0 -96
- package/lib/schemas/models/track_order_number.d.ts +0 -413
- package/lib/schemas/models/track_order_number.js +0 -45
- package/lib/schemas/models/void_purchase_order_items.d.ts +0 -176
- package/lib/schemas/models/void_purchase_order_items.js +0 -177
- package/lib/schemas/models/void_warehouse_invoice_items.d.ts +0 -176
- package/lib/schemas/models/void_warehouse_invoice_items.js +0 -176
- package/lib/schemas/models/wallet.d.ts +0 -38
- package/lib/schemas/models/wallet.js +0 -37
- package/lib/schemas/models/warehouse-communications.d.ts +0 -228
- package/lib/schemas/models/warehouse-communications.js +0 -216
- package/lib/schemas/models/warehouse.d.ts +0 -162
- package/lib/schemas/models/warehouse.js +0 -222
- package/lib/schemas/models/warehouse_staff.d.ts +0 -65
- package/lib/schemas/models/warehouse_staff.js +0 -78
- package/lib/schemas/models/warehouse_track_order_number.d.ts +0 -50
- package/lib/schemas/models/warehouse_track_order_number.js +0 -52
- package/lib/schemas/types/applied-order-discounts.d.ts +0 -22
- package/lib/schemas/types/applied-order-discounts.js +0 -2
- package/lib/schemas/types/brand.d.ts +0 -32
- package/lib/schemas/types/brand.js +0 -2
- package/lib/schemas/types/category.d.ts +0 -15
- package/lib/schemas/types/category.js +0 -2
- package/lib/schemas/types/expense_category.d.ts +0 -20
- package/lib/schemas/types/expense_category.js +0 -2
- package/lib/schemas/types/internal_movements.d.ts +0 -73
- package/lib/schemas/types/internal_movements.js +0 -2
- package/lib/schemas/types/inventory.d.ts +0 -48
- package/lib/schemas/types/inventory.js +0 -2
- package/lib/schemas/types/inventory_lot_serial_numbers.d.ts +0 -85
- package/lib/schemas/types/inventory_lot_serial_numbers.js +0 -4
- package/lib/schemas/types/item.d.ts +0 -89
- package/lib/schemas/types/item.js +0 -2
- package/lib/schemas/types/menu.d.ts +0 -17
- package/lib/schemas/types/menu.js +0 -2
- package/lib/schemas/types/order.d.ts +0 -242
- package/lib/schemas/types/order.js +0 -2
- package/lib/schemas/types/purchase_order_common.d.ts +0 -39
- package/lib/schemas/types/purchase_order_common.js +0 -2
- package/lib/schemas/types/purchase_order_receipts.d.ts +0 -39
- package/lib/schemas/types/purchase_order_receipts.js +0 -21
- package/lib/schemas/types/purchase_order_rfq.d.ts +0 -33
- package/lib/schemas/types/purchase_order_rfq.js +0 -2
- package/lib/schemas/types/purchase_order_rfqs.d.ts +0 -33
- package/lib/schemas/types/purchase_order_rfqs.js +0 -2
- package/lib/schemas/types/purchase_order_vendor_returns.d.ts +0 -49
- package/lib/schemas/types/purchase_order_vendor_returns.js +0 -42
- package/lib/schemas/types/purchase_orders.d.ts +0 -33
- package/lib/schemas/types/purchase_orders.js +0 -2
- package/lib/schemas/types/rider.d.ts +0 -16
- package/lib/schemas/types/rider.js +0 -2
- package/lib/schemas/types/sale_order_common.d.ts +0 -39
- package/lib/schemas/types/sale_order_common.js +0 -2
- package/lib/schemas/types/sale_order_deliveries.d.ts +0 -67
- package/lib/schemas/types/sale_order_deliveries.js +0 -2
- package/lib/schemas/types/sale_order_invoices.d.ts +0 -49
- package/lib/schemas/types/sale_order_invoices.js +0 -2
- package/lib/schemas/types/sale_order_rfq.d.ts +0 -25
- package/lib/schemas/types/sale_order_rfq.js +0 -2
- package/lib/schemas/types/sale_orders.d.ts +0 -30
- package/lib/schemas/types/sale_orders.js +0 -2
- package/lib/schemas/types/tenant.d.ts +0 -205
- package/lib/schemas/types/tenant.js +0 -2
- package/lib/schemas/types/tenant_staff.d.ts +0 -22
- package/lib/schemas/types/tenant_staff.js +0 -2
- package/lib/schemas/types/track_order_number.d.ts +0 -10
- package/lib/schemas/types/track_order_number.js +0 -2
- package/lib/schemas/types/void_purchase_order_items.d.ts +0 -37
- package/lib/schemas/types/void_purchase_order_items.js +0 -2
- package/lib/schemas/types/void_warehouse_invoice_items.d.ts +0 -37
- package/lib/schemas/types/void_warehouse_invoice_items.js +0 -2
- package/lib/schemas/types/wallet.d.ts +0 -7
- package/lib/schemas/types/wallet.js +0 -2
- package/lib/schemas/types/warehouse-communications.d.ts +0 -54
- package/lib/schemas/types/warehouse-communications.js +0 -2
- package/lib/schemas/types/warehouse.d.ts +0 -49
- package/lib/schemas/types/warehouse.js +0 -2
- package/lib/schemas/types/warehouse_purchase_order_common.d.ts +0 -39
- package/lib/schemas/types/warehouse_purchase_order_common.js +0 -2
- package/lib/schemas/types/warehouse_sale_order_common.d.ts +0 -39
- package/lib/schemas/types/warehouse_sale_order_common.js +0 -2
- package/lib/schemas/types/warehouse_staff.d.ts +0 -17
- package/lib/schemas/types/warehouse_staff.js +0 -2
- package/lib/schemas/types/warehouse_track_order_number.d.ts +0 -11
- package/lib/schemas/types/warehouse_track_order_number.js +0 -2
|
@@ -61,4 +61,6 @@ export declare const WORKER_ENDPOINTS: {
|
|
|
61
61
|
readonly UPDATED_FOODSTREET_SPLIT_ORDER: "/updated-foodstreet-split-order";
|
|
62
62
|
readonly REOPENED_FOODSTREET_ORIGINAL_ORDER: "/reopened-foodstreet-original-order";
|
|
63
63
|
readonly REOPENED_FOODSTREET_SPLIT_ORDER: "/reopened-foodstreet-split-order";
|
|
64
|
+
readonly POST_WAREHOUSE_ACTIVITY_LOG: "/post-warehouse-activity-log";
|
|
65
|
+
readonly POST_WAREHOUSE_ACTIVITY_MULTIPLE_LOGS: "/post-warehouse-activity-multiple-logs";
|
|
64
66
|
};
|
|
@@ -74,4 +74,7 @@ exports.WORKER_ENDPOINTS = {
|
|
|
74
74
|
UPDATED_FOODSTREET_SPLIT_ORDER: '/updated-foodstreet-split-order',
|
|
75
75
|
REOPENED_FOODSTREET_ORIGINAL_ORDER: '/reopened-foodstreet-original-order',
|
|
76
76
|
REOPENED_FOODSTREET_SPLIT_ORDER: '/reopened-foodstreet-split-order',
|
|
77
|
+
// ========================>> Activity Logs <<======================= //
|
|
78
|
+
POST_WAREHOUSE_ACTIVITY_LOG: '/post-warehouse-activity-log',
|
|
79
|
+
POST_WAREHOUSE_ACTIVITY_MULTIPLE_LOGS: '/post-warehouse-activity-multiple-logs',
|
|
77
80
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IWarehouseInternalMovement, IWarehouseInternalMovementItem } from '../../schemas';
|
|
2
|
+
/**
|
|
3
|
+
* Convert unit_price on every internal movement item.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getWarehouseInternalMovementItemsWithPrice(items: IWarehouseInternalMovementItem[] | undefined, convertToPrice: (price: number) => number): IWarehouseInternalMovementItem[];
|
|
6
|
+
/**
|
|
7
|
+
* Convert all monetary fields on an internal movement.
|
|
8
|
+
*
|
|
9
|
+
* - `writeable = true` → decimal → cents (before sending to backend)
|
|
10
|
+
* - `writeable = false` → cents → decimal (after receiving from backend)
|
|
11
|
+
*/
|
|
12
|
+
export declare function getWarehouseInternalMovementWithPrice<T extends Partial<IWarehouseInternalMovement> | IWarehouseInternalMovement>(order: T, writeable?: boolean): T;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWarehouseInternalMovementItemsWithPrice = getWarehouseInternalMovementItemsWithPrice;
|
|
4
|
+
exports.getWarehouseInternalMovementWithPrice = getWarehouseInternalMovementWithPrice;
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Convert unit_price on every internal movement item.
|
|
8
|
+
*/
|
|
9
|
+
function getWarehouseInternalMovementItemsWithPrice(items, convertToPrice) {
|
|
10
|
+
if (!items)
|
|
11
|
+
return [];
|
|
12
|
+
return items.map((item) => ({
|
|
13
|
+
...item,
|
|
14
|
+
unit_price: item.unit_price != null ? convertToPrice(item.unit_price) : undefined,
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Convert all monetary fields on an internal movement.
|
|
19
|
+
*
|
|
20
|
+
* - `writeable = true` → decimal → cents (before sending to backend)
|
|
21
|
+
* - `writeable = false` → cents → decimal (after receiving from backend)
|
|
22
|
+
*/
|
|
23
|
+
function getWarehouseInternalMovementWithPrice(order, writeable) {
|
|
24
|
+
const convertToPrice = writeable ? utils_1.convertDecimalToInt : utils_1.convertIntToDecimal;
|
|
25
|
+
return {
|
|
26
|
+
...order,
|
|
27
|
+
...(order.items != null
|
|
28
|
+
? {
|
|
29
|
+
items: getWarehouseInternalMovementItemsWithPrice(order.items, convertToPrice),
|
|
30
|
+
}
|
|
31
|
+
: {}),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IWarehousePurchaseOrderReceipt, IWarehousePurchaseOrderReceiptItem } from '../../schemas';
|
|
2
|
+
/**
|
|
3
|
+
* Convert price, subtotal on every receipt item.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getWarehousePurchaseOrderReceiptItemsWithPrice(items: IWarehousePurchaseOrderReceiptItem[] | undefined, convertToPrice: (price: number) => number): IWarehousePurchaseOrderReceiptItem[];
|
|
6
|
+
/**
|
|
7
|
+
* Convert all monetary fields on a purchase order receipt.
|
|
8
|
+
*
|
|
9
|
+
* - `writeable = true` → decimal → cents (before sending to backend)
|
|
10
|
+
* - `writeable = false` → cents → decimal (after receiving from backend)
|
|
11
|
+
*/
|
|
12
|
+
export declare function getWarehousePurchaseOrderReceiptWithPrice<T extends Partial<IWarehousePurchaseOrderReceipt> | IWarehousePurchaseOrderReceipt>(order: T, writeable?: boolean): T;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWarehousePurchaseOrderReceiptItemsWithPrice = getWarehousePurchaseOrderReceiptItemsWithPrice;
|
|
4
|
+
exports.getWarehousePurchaseOrderReceiptWithPrice = getWarehousePurchaseOrderReceiptWithPrice;
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/**
|
|
7
|
+
* Convert price, subtotal on every receipt item.
|
|
8
|
+
*/
|
|
9
|
+
function getWarehousePurchaseOrderReceiptItemsWithPrice(items, convertToPrice) {
|
|
10
|
+
if (!items)
|
|
11
|
+
return [];
|
|
12
|
+
return items.map((item) => ({
|
|
13
|
+
...item,
|
|
14
|
+
price: convertToPrice(item.price),
|
|
15
|
+
subtotal: convertToPrice(item.subtotal),
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Convert all monetary fields on a purchase order receipt.
|
|
20
|
+
*
|
|
21
|
+
* - `writeable = true` → decimal → cents (before sending to backend)
|
|
22
|
+
* - `writeable = false` → cents → decimal (after receiving from backend)
|
|
23
|
+
*/
|
|
24
|
+
function getWarehousePurchaseOrderReceiptWithPrice(order, writeable) {
|
|
25
|
+
const convertToPrice = writeable ? utils_1.convertDecimalToInt : utils_1.convertIntToDecimal;
|
|
26
|
+
return {
|
|
27
|
+
...order,
|
|
28
|
+
...(order.items != null
|
|
29
|
+
? {
|
|
30
|
+
items: getWarehousePurchaseOrderReceiptItemsWithPrice(order.items, convertToPrice),
|
|
31
|
+
}
|
|
32
|
+
: {}),
|
|
33
|
+
...(order.total_received_amount != null
|
|
34
|
+
? { total_received_amount: convertToPrice(order.total_received_amount) }
|
|
35
|
+
: {}),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -9,7 +9,9 @@ export * from './catalog-actions';
|
|
|
9
9
|
export * from './common-order-actions';
|
|
10
10
|
export * from './common-tenant-purchase-order-actions';
|
|
11
11
|
export * from './common-warehouse-invoice-actions';
|
|
12
|
+
export * from './common-warehouse-internal-movement-actions';
|
|
12
13
|
export * from './common-warehouse-purchase-order-actions';
|
|
14
|
+
export * from './common-warehouse-purchase-order-receipt-actions';
|
|
13
15
|
export * from './common-warehouse-purchase-order-rfq-actions';
|
|
14
16
|
export * from './common-warehouse-purchase-order-vendor-return-actions';
|
|
15
17
|
export * from './common-warehouse-sale-order-actions';
|
|
@@ -25,7 +25,9 @@ __exportStar(require("./catalog-actions"), exports);
|
|
|
25
25
|
__exportStar(require("./common-order-actions"), exports);
|
|
26
26
|
__exportStar(require("./common-tenant-purchase-order-actions"), exports);
|
|
27
27
|
__exportStar(require("./common-warehouse-invoice-actions"), exports);
|
|
28
|
+
__exportStar(require("./common-warehouse-internal-movement-actions"), exports);
|
|
28
29
|
__exportStar(require("./common-warehouse-purchase-order-actions"), exports);
|
|
30
|
+
__exportStar(require("./common-warehouse-purchase-order-receipt-actions"), exports);
|
|
29
31
|
__exportStar(require("./common-warehouse-purchase-order-rfq-actions"), exports);
|
|
30
32
|
__exportStar(require("./common-warehouse-purchase-order-vendor-return-actions"), exports);
|
|
31
33
|
__exportStar(require("./common-warehouse-sale-order-actions"), exports);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { CARD_PROCESSING_PROVIDERS_ENUM, CURRENCY_SYMBOL_ENUM, DELIVERY_STATUS_ENUM, ORDER_STATUS_ENUM, PLATFORM_TYPE_ENUM, PLATFORMS_ENUM, VOID_ORDER_ITEM_TYPE_ENUM, WALLET_ASSET_TYPE_ENUM, WALLET_ASSIGNMENT_BEHAVIOR_ENUM, WAREHOUSE_INTERNAL_MOVEMENT_STATUS_ENUM, WAREHOUSE_INVOICE_STATUS_ENUM, WAREHOUSE_REMOVAL_STRATEGY_ENUM, WAREHOUSE_TRACKING_MODE_ENUM } from '../../constants';
|
|
1
|
+
import { CARD_PROCESSING_PROVIDERS_ENUM, CURRENCY_SYMBOL_ENUM, DELIVERY_STATUS_ENUM, ORDER_STATUS_ENUM, PLATFORM_TYPE_ENUM, PLATFORMS_ENUM, VOID_ORDER_ITEM_TYPE_ENUM, WALLET_ASSET_TYPE_ENUM, WALLET_ASSIGNMENT_BEHAVIOR_ENUM, WAREHOUSE_ACTIVITY_LOG_ACTION_ENUM, WAREHOUSE_ACTIVITY_LOG_ENTITY_TYPE_ENUM, WAREHOUSE_INTERNAL_MOVEMENT_STATUS_ENUM, WAREHOUSE_INVOICE_STATUS_ENUM, WAREHOUSE_REMOVAL_STRATEGY_ENUM, WAREHOUSE_TRACKING_MODE_ENUM } from '../../constants';
|
|
2
2
|
import { IDineinTableFingerprint, IInternalLead, IModifierExtra, IOrder, IOrderItem, IOrderPayment, ITenantPurchaseOrder, IWarehouseClientInvoice, IWarehouseInternalMovement, IWarehousePurchaseOrder, IWarehousePurchaseOrderReceipt, IWarehousePurchaseOrderVendorReturn, IWarehouseSaleOrder, IWarehouseSaleOrderDelivery } from '../../schemas';
|
|
3
|
+
import { IWarehouseActivityLogChange } from '../../schemas/types/warehouse-activity-logs';
|
|
3
4
|
import { ISwitchPayEWalletRequestBody, ISwitchPayRefundRequestBody } from './switchpay';
|
|
4
5
|
export interface IWorker_CreateDelivery {
|
|
5
6
|
order: IOrder;
|
|
@@ -407,3 +408,17 @@ export interface ITrackedRollbackPlanLine {
|
|
|
407
408
|
tracking_mode: WAREHOUSE_TRACKING_MODE_ENUM.LOT | WAREHOUSE_TRACKING_MODE_ENUM.SERIAL;
|
|
408
409
|
quantity: number;
|
|
409
410
|
}
|
|
411
|
+
export interface IWorker_PostWarehouseActivityLog {
|
|
412
|
+
warehouse_id: string;
|
|
413
|
+
entity_type: WAREHOUSE_ACTIVITY_LOG_ENTITY_TYPE_ENUM;
|
|
414
|
+
entity_id: string;
|
|
415
|
+
entity_number?: number | null;
|
|
416
|
+
action: WAREHOUSE_ACTIVITY_LOG_ACTION_ENUM;
|
|
417
|
+
title: string;
|
|
418
|
+
description?: string | null;
|
|
419
|
+
changes?: IWarehouseActivityLogChange[];
|
|
420
|
+
staff_id?: string;
|
|
421
|
+
}
|
|
422
|
+
export interface IWorker_PostWarehouseActivityMultipleLogs {
|
|
423
|
+
logs: IWorker_PostWarehouseActivityLog[];
|
|
424
|
+
}
|
|
@@ -64,6 +64,7 @@ export * from './vouchers';
|
|
|
64
64
|
export * from './wallet_transactions';
|
|
65
65
|
export * from './wallets';
|
|
66
66
|
export * from './warehouse-activity-logs';
|
|
67
|
+
export * from './warehouse-activity-logs';
|
|
67
68
|
export * from './warehouse_categories';
|
|
68
69
|
export * from './warehouse_clients';
|
|
69
70
|
export * from './warehouse_communications';
|
|
@@ -80,6 +80,7 @@ __exportStar(require("./vouchers"), exports);
|
|
|
80
80
|
__exportStar(require("./wallet_transactions"), exports);
|
|
81
81
|
__exportStar(require("./wallets"), exports);
|
|
82
82
|
__exportStar(require("./warehouse-activity-logs"), exports);
|
|
83
|
+
__exportStar(require("./warehouse-activity-logs"), exports);
|
|
83
84
|
__exportStar(require("./warehouse_categories"), exports);
|
|
84
85
|
__exportStar(require("./warehouse_clients"), exports);
|
|
85
86
|
__exportStar(require("./warehouse_communications"), exports);
|
|
@@ -46,8 +46,8 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
|
|
|
46
46
|
name: string;
|
|
47
47
|
uid: string;
|
|
48
48
|
};
|
|
49
|
-
doc_number: string;
|
|
50
49
|
ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
|
|
50
|
+
doc_number: string;
|
|
51
51
|
record_type: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_RECORD_TYPE_ENUM;
|
|
52
52
|
flow: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_FLOW_ENUM;
|
|
53
53
|
source_id: string;
|
|
@@ -164,8 +164,8 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
|
|
|
164
164
|
name: string;
|
|
165
165
|
uid: string;
|
|
166
166
|
};
|
|
167
|
-
doc_number: string;
|
|
168
167
|
ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
|
|
168
|
+
doc_number: string;
|
|
169
169
|
record_type: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_RECORD_TYPE_ENUM;
|
|
170
170
|
flow: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_FLOW_ENUM;
|
|
171
171
|
source_id: string;
|
|
@@ -282,8 +282,8 @@ export declare const WarehouseInternalMovementsSchema: Schema<any, import("mongo
|
|
|
282
282
|
name: string;
|
|
283
283
|
uid: string;
|
|
284
284
|
};
|
|
285
|
-
doc_number: string;
|
|
286
285
|
ref_type: import("../../constants").WAREHOUSE_REF_TYPE_ENUM;
|
|
286
|
+
doc_number: string;
|
|
287
287
|
record_type: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_RECORD_TYPE_ENUM;
|
|
288
288
|
flow: import("../../constants").WAREHOUSE_INTERNAL_MOVEMENT_FLOW_ENUM;
|
|
289
289
|
source_id: string;
|
|
@@ -13,8 +13,8 @@ export declare const WarehouseInventoryLotSerialNumberSchema: Schema<any, import
|
|
|
13
13
|
updatedAt: NativeDate;
|
|
14
14
|
inventory_code: string;
|
|
15
15
|
ref_id: string;
|
|
16
|
-
tracking_mode: WAREHOUSE_TRACKING_MODE_ENUM;
|
|
17
16
|
ref_type: string;
|
|
17
|
+
tracking_mode: WAREHOUSE_TRACKING_MODE_ENUM;
|
|
18
18
|
doc_type: WAREHOUSE_LOT_SERIAL_DOC_TYPE_ENUM;
|
|
19
19
|
source?: import("../../constants").WAREHOUSE_LOT_SERIAL_MOVEMENT_SOURCE_ENUM | null | undefined;
|
|
20
20
|
quantity?: number | null | undefined;
|
|
@@ -60,8 +60,8 @@ export declare const WarehouseInventoryLotSerialNumberSchema: Schema<any, import
|
|
|
60
60
|
updatedAt: NativeDate;
|
|
61
61
|
inventory_code: string;
|
|
62
62
|
ref_id: string;
|
|
63
|
-
tracking_mode: WAREHOUSE_TRACKING_MODE_ENUM;
|
|
64
63
|
ref_type: string;
|
|
64
|
+
tracking_mode: WAREHOUSE_TRACKING_MODE_ENUM;
|
|
65
65
|
doc_type: WAREHOUSE_LOT_SERIAL_DOC_TYPE_ENUM;
|
|
66
66
|
source?: import("../../constants").WAREHOUSE_LOT_SERIAL_MOVEMENT_SOURCE_ENUM | null | undefined;
|
|
67
67
|
quantity?: number | null | undefined;
|
|
@@ -107,8 +107,8 @@ export declare const WarehouseInventoryLotSerialNumberSchema: Schema<any, import
|
|
|
107
107
|
updatedAt: NativeDate;
|
|
108
108
|
inventory_code: string;
|
|
109
109
|
ref_id: string;
|
|
110
|
-
tracking_mode: WAREHOUSE_TRACKING_MODE_ENUM;
|
|
111
110
|
ref_type: string;
|
|
111
|
+
tracking_mode: WAREHOUSE_TRACKING_MODE_ENUM;
|
|
112
112
|
doc_type: WAREHOUSE_LOT_SERIAL_DOC_TYPE_ENUM;
|
|
113
113
|
source?: import("../../constants").WAREHOUSE_LOT_SERIAL_MOVEMENT_SOURCE_ENUM | null | undefined;
|
|
114
114
|
quantity?: number | null | undefined;
|
|
@@ -44,12 +44,12 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
|
|
|
44
44
|
name: string;
|
|
45
45
|
} | null | undefined;
|
|
46
46
|
cancelled_at?: NativeDate | null | undefined;
|
|
47
|
-
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
48
47
|
delivered_at?: NativeDate | null | undefined;
|
|
49
48
|
delivered_by?: {
|
|
50
49
|
_id: string;
|
|
51
50
|
name: string;
|
|
52
51
|
} | null | undefined;
|
|
52
|
+
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
53
53
|
inventory_restocked?: boolean | null | undefined;
|
|
54
54
|
returned_by?: {
|
|
55
55
|
_id: string;
|
|
@@ -96,12 +96,12 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
|
|
|
96
96
|
name: string;
|
|
97
97
|
} | null | undefined;
|
|
98
98
|
cancelled_at?: NativeDate | null | undefined;
|
|
99
|
-
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
100
99
|
delivered_at?: NativeDate | null | undefined;
|
|
101
100
|
delivered_by?: {
|
|
102
101
|
_id: string;
|
|
103
102
|
name: string;
|
|
104
103
|
} | null | undefined;
|
|
104
|
+
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
105
105
|
inventory_restocked?: boolean | null | undefined;
|
|
106
106
|
returned_by?: {
|
|
107
107
|
_id: string;
|
|
@@ -148,12 +148,12 @@ export declare const SaleOrderDeliveriesSchema: Schema<any, import("mongoose").M
|
|
|
148
148
|
name: string;
|
|
149
149
|
} | null | undefined;
|
|
150
150
|
cancelled_at?: NativeDate | null | undefined;
|
|
151
|
-
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
152
151
|
delivered_at?: NativeDate | null | undefined;
|
|
153
152
|
delivered_by?: {
|
|
154
153
|
_id: string;
|
|
155
154
|
name: string;
|
|
156
155
|
} | null | undefined;
|
|
156
|
+
applied_to_doc_id?: import("mongoose").Types.ObjectId | null | undefined;
|
|
157
157
|
inventory_restocked?: boolean | null | undefined;
|
|
158
158
|
returned_by?: {
|
|
159
159
|
_id: string;
|
|
@@ -35,9 +35,9 @@ export declare const WarehouseSaleOrderInvoiceSchema: Schema<any, import("mongoo
|
|
|
35
35
|
amount: number;
|
|
36
36
|
payments: any[];
|
|
37
37
|
warehouse_id: string;
|
|
38
|
+
doc_number: number;
|
|
38
39
|
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
|
|
39
40
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
40
|
-
doc_number: number;
|
|
41
41
|
invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
42
42
|
amount_paid?: number | null | undefined;
|
|
43
43
|
cancel_reason?: string | null | undefined;
|
|
@@ -107,9 +107,9 @@ export declare const WarehouseSaleOrderInvoiceSchema: Schema<any, import("mongoo
|
|
|
107
107
|
amount: number;
|
|
108
108
|
payments: any[];
|
|
109
109
|
warehouse_id: string;
|
|
110
|
+
doc_number: number;
|
|
110
111
|
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
|
|
111
112
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
112
|
-
doc_number: number;
|
|
113
113
|
invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
114
114
|
amount_paid?: number | null | undefined;
|
|
115
115
|
cancel_reason?: string | null | undefined;
|
|
@@ -179,9 +179,9 @@ export declare const WarehouseSaleOrderInvoiceSchema: Schema<any, import("mongoo
|
|
|
179
179
|
amount: number;
|
|
180
180
|
payments: any[];
|
|
181
181
|
warehouse_id: string;
|
|
182
|
+
doc_number: number;
|
|
182
183
|
doc_kind: import("../../constants").WAREHOUSE_SALE_ORDER_FIN_DOC_KIND_ENUM;
|
|
183
184
|
sale_order_id: import("mongoose").Types.ObjectId;
|
|
184
|
-
doc_number: number;
|
|
185
185
|
invoice_type: import("../../constants").WAREHOUSE_SALE_ORDER_INVOICE_TYPE_ENUM;
|
|
186
186
|
amount_paid?: number | null | undefined;
|
|
187
187
|
cancel_reason?: string | null | undefined;
|
|
@@ -67,6 +67,8 @@ export * from './vouchers';
|
|
|
67
67
|
export * from './wallet_transactions';
|
|
68
68
|
export * from './wallets';
|
|
69
69
|
export * from './warehouse-activity-logs';
|
|
70
|
+
export * from './warehouse-activity-logs';
|
|
71
|
+
export * from './warehouse-activity-logs';
|
|
70
72
|
export * from './warehouse_categories';
|
|
71
73
|
export * from './warehouse_clients';
|
|
72
74
|
export * from './warehouse_communications';
|
|
@@ -83,6 +83,8 @@ __exportStar(require("./vouchers"), exports);
|
|
|
83
83
|
__exportStar(require("./wallet_transactions"), exports);
|
|
84
84
|
__exportStar(require("./wallets"), exports);
|
|
85
85
|
__exportStar(require("./warehouse-activity-logs"), exports);
|
|
86
|
+
__exportStar(require("./warehouse-activity-logs"), exports);
|
|
87
|
+
__exportStar(require("./warehouse-activity-logs"), exports);
|
|
86
88
|
__exportStar(require("./warehouse_categories"), exports);
|
|
87
89
|
__exportStar(require("./warehouse_clients"), exports);
|
|
88
90
|
__exportStar(require("./warehouse_communications"), exports);
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IWarehousePurchaseOrderVendorReturnStatus } from '../schemas';
|
|
2
|
-
import { WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM } from './WAREHOUSE_ENUMS';
|
|
3
|
-
export interface IPurchaseOrderStatus {
|
|
4
|
-
status: WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM;
|
|
5
|
-
color: string;
|
|
6
|
-
contrast_color: string;
|
|
7
|
-
priority: number;
|
|
8
|
-
}
|
|
9
|
-
export interface IPurchaseOrderStatusColorCode {
|
|
10
|
-
color: string;
|
|
11
|
-
contrast_color: string;
|
|
12
|
-
}
|
|
13
|
-
export type IPurchaseOrderStatusColorCodeMap = Record<WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM, IPurchaseOrderStatusColorCode>;
|
|
14
|
-
export declare const DEFAULT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP: IPurchaseOrderStatusColorCodeMap;
|
|
15
|
-
export declare const DEFAULT_PURCHASE_ORDER_STATUS: IPurchaseOrderStatus[];
|
|
16
|
-
export declare const DEFAULT_PURCHASE_ORDER_VENDOR_RETURN_STATUSES: IWarehousePurchaseOrderVendorReturnStatus[];
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_PURCHASE_ORDER_VENDOR_RETURN_STATUSES = exports.DEFAULT_PURCHASE_ORDER_STATUS = exports.DEFAULT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP = void 0;
|
|
4
|
-
const WAREHOUSE_ENUMS_1 = require("./WAREHOUSE_ENUMS");
|
|
5
|
-
exports.DEFAULT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP = {
|
|
6
|
-
[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.DRAFT]: {
|
|
7
|
-
color: '#727472',
|
|
8
|
-
contrast_color: '#FFFFFF',
|
|
9
|
-
},
|
|
10
|
-
[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.SUBMITTED]: {
|
|
11
|
-
color: '#0000FF',
|
|
12
|
-
contrast_color: '#FFFFFF',
|
|
13
|
-
},
|
|
14
|
-
[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.PARTIALLY_RECEIVED]: {
|
|
15
|
-
color: '#E67E22',
|
|
16
|
-
contrast_color: '#FFFFFF',
|
|
17
|
-
},
|
|
18
|
-
[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.RECEIVED]: {
|
|
19
|
-
color: '#FBB117',
|
|
20
|
-
contrast_color: '#FFFFFF',
|
|
21
|
-
},
|
|
22
|
-
[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.COMPLETED]: {
|
|
23
|
-
color: '#4CC417',
|
|
24
|
-
contrast_color: '#FFFFFF',
|
|
25
|
-
},
|
|
26
|
-
[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED]: {
|
|
27
|
-
color: '#FF0000',
|
|
28
|
-
contrast_color: '#FFFFFF',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
exports.DEFAULT_PURCHASE_ORDER_STATUS = [
|
|
32
|
-
{
|
|
33
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.DRAFT,
|
|
34
|
-
...exports.DEFAULT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.DRAFT],
|
|
35
|
-
priority: 0,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.SUBMITTED,
|
|
39
|
-
...exports.DEFAULT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.SUBMITTED],
|
|
40
|
-
priority: 1,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.PARTIALLY_RECEIVED,
|
|
44
|
-
...exports.DEFAULT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.PARTIALLY_RECEIVED],
|
|
45
|
-
priority: 2,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.RECEIVED,
|
|
49
|
-
...exports.DEFAULT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.RECEIVED],
|
|
50
|
-
priority: 3,
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.COMPLETED,
|
|
54
|
-
...exports.DEFAULT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.COMPLETED],
|
|
55
|
-
priority: 4,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED,
|
|
59
|
-
...exports.DEFAULT_PURCHASE_ORDER_STATUS_COLOR_CODE_MAP[WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_STATUS_ENUM.CANCELLED],
|
|
60
|
-
priority: 5,
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
exports.DEFAULT_PURCHASE_ORDER_VENDOR_RETURN_STATUSES = [
|
|
64
|
-
{
|
|
65
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.CREATED,
|
|
66
|
-
color: '#727472',
|
|
67
|
-
contrast_color: '#FFFFFF',
|
|
68
|
-
priority: 0,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.APPROVED,
|
|
72
|
-
color: '#0000FF',
|
|
73
|
-
contrast_color: '#FFFFFF',
|
|
74
|
-
priority: 1,
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.DISPATCHED,
|
|
78
|
-
color: '#FBB117',
|
|
79
|
-
contrast_color: '#FFFFFF',
|
|
80
|
-
priority: 2,
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.VENDOR_CONFIRMED,
|
|
84
|
-
color: '#17A2B8',
|
|
85
|
-
contrast_color: '#FFFFFF',
|
|
86
|
-
priority: 3,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.COMPLETED,
|
|
90
|
-
color: '#4CC417',
|
|
91
|
-
contrast_color: '#FFFFFF',
|
|
92
|
-
priority: 4,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
status: WAREHOUSE_ENUMS_1.WAREHOUSE_PURCHASE_ORDER_VENDOR_RETURN_STATUS_ENUM.CANCELLED,
|
|
96
|
-
color: '#FF0000',
|
|
97
|
-
contrast_color: '#FFFFFF',
|
|
98
|
-
priority: 5,
|
|
99
|
-
},
|
|
100
|
-
];
|
package/lib/constants/RFQ.d.ts
DELETED
|
File without changes
|
package/lib/constants/RFQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { WarehouseIPurchaseOrderRFQ, WarehouseIPurchaseOrderRFQIteration } from '../../schemas';
|
|
2
|
-
export declare function generatePurchaseOrderRfqCategories(categories?: WarehouseIPurchaseOrderRFQ['categories']): WarehouseIPurchaseOrderRFQ['categories'];
|
|
3
|
-
export declare function generatePurchaseOrderRfqIteration(order: WarehouseIPurchaseOrderRFQ | WarehouseIPurchaseOrderRFQIteration, partial?: boolean, skipItemMetadata?: boolean): WarehouseIPurchaseOrderRFQIteration;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generatePurchaseOrderRfqCategories = generatePurchaseOrderRfqCategories;
|
|
7
|
-
exports.generatePurchaseOrderRfqIteration = generatePurchaseOrderRfqIteration;
|
|
8
|
-
const mongoose_1 = __importDefault(require("mongoose"));
|
|
9
|
-
const common_warehouse_purchase_order_actions_1 = require("../store/common-warehouse-purchase-order-actions");
|
|
10
|
-
function generatePurchaseOrderRfqCategories(categories) {
|
|
11
|
-
if (!categories)
|
|
12
|
-
return [];
|
|
13
|
-
return categories.map((category) => ({
|
|
14
|
-
...category,
|
|
15
|
-
category_id: new mongoose_1.default.Types.ObjectId(category.category_id),
|
|
16
|
-
items: category.items.map((item) => ({
|
|
17
|
-
...item,
|
|
18
|
-
_id: new mongoose_1.default.Types.ObjectId(item._id),
|
|
19
|
-
item_id: new mongoose_1.default.Types.ObjectId(item.item_id),
|
|
20
|
-
})),
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
function getCommonOptionalBoolFieldsRfqIteration(order, partial) {
|
|
24
|
-
const defaultValue = partial ? undefined : false;
|
|
25
|
-
return {
|
|
26
|
-
is_gst_inclusive: order.is_gst_inclusive || defaultValue,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function getCommonOptionalNumFieldsRfqIteration(order, partial) {
|
|
30
|
-
const defaultValue = partial ? undefined : 0;
|
|
31
|
-
return {
|
|
32
|
-
gst: order.gst || defaultValue,
|
|
33
|
-
gst_amount: order.gst_amount || defaultValue,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function generatePurchaseOrderRfqIteration(order, partial = true, skipItemMetadata) {
|
|
37
|
-
const iteration = {
|
|
38
|
-
...getCommonOptionalBoolFieldsRfqIteration(order, partial),
|
|
39
|
-
...getCommonOptionalNumFieldsRfqIteration(order, partial),
|
|
40
|
-
...(skipItemMetadata && order.categories != null
|
|
41
|
-
? {
|
|
42
|
-
categories: (0, common_warehouse_purchase_order_actions_1.skipItemMetadataFromPurchaseOrderCategories)(order.categories),
|
|
43
|
-
}
|
|
44
|
-
: {
|
|
45
|
-
categories: generatePurchaseOrderRfqCategories(order.categories),
|
|
46
|
-
}),
|
|
47
|
-
staff_details: order.staff_details,
|
|
48
|
-
special_instructions: order.special_instructions,
|
|
49
|
-
order_status: order.order_status,
|
|
50
|
-
price: order.price,
|
|
51
|
-
amount_earned: order.amount_earned,
|
|
52
|
-
grand_total: order.grand_total,
|
|
53
|
-
tax_number: order.tax_number,
|
|
54
|
-
updatedAt: order.updatedAt,
|
|
55
|
-
};
|
|
56
|
-
if (partial) {
|
|
57
|
-
Object.keys(iteration).forEach((key) => {
|
|
58
|
-
if (iteration[key] === undefined) {
|
|
59
|
-
delete iteration[key];
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return iteration;
|
|
64
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { WarehouseIPurchaseOrder, WarehouseIPurchaseOrderIteration } from '../../schemas';
|
|
2
|
-
export declare function generatePurchaseOrderCategories(categories?: WarehouseIPurchaseOrder['categories']): WarehouseIPurchaseOrder['categories'];
|
|
3
|
-
export declare function generatePurchaseOrderIteration(order: WarehouseIPurchaseOrder | WarehouseIPurchaseOrderIteration, partial?: boolean, skipItemMetadata?: boolean): WarehouseIPurchaseOrderIteration;
|
|
4
|
-
export declare function generatePurchaseOrderOnCreate<T extends WarehouseIPurchaseOrder | Partial<WarehouseIPurchaseOrder>>(order: T, withIterations?: boolean): T;
|
|
5
|
-
export declare function generatePurchaseOrderOnUpdate(partialUpdatedOrder: Partial<WarehouseIPurchaseOrder>): {
|
|
6
|
-
updateOperation: {
|
|
7
|
-
$unset?: Partial<Record<keyof WarehouseIPurchaseOrder, any>> | undefined;
|
|
8
|
-
$set?: Partial<Record<keyof WarehouseIPurchaseOrder, any>> | undefined;
|
|
9
|
-
};
|
|
10
|
-
partialResponseOrder: Partial<WarehouseIPurchaseOrder>;
|
|
11
|
-
};
|