@shopfront/bridge 2.0.0 → 2.0.1
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/.idea/codeStyles/Project.xml +10 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/git_toolbox_blame.xml +6 -0
- package/.idea/git_toolbox_prj.xml +15 -0
- package/.idea/inspectionProfiles/Project_Default.xml +5 -0
- package/.idea/jsLinters/eslint.xml +6 -0
- package/.idea/modules.xml +1 -1
- package/.idea/php.xml +15 -0
- package/lib/APIs/Database/BaseDatabase.d.ts +28 -0
- package/lib/APIs/Database/BaseDatabase.js +5 -0
- package/lib/APIs/Database/Database.d.ts +19 -7
- package/lib/APIs/Database/Database.js +22 -12
- package/lib/APIs/Database/types/BaseBarcodeTemplateRepository.d.ts +8 -0
- package/lib/APIs/Database/types/BaseBarcodeTemplateRepository.js +1 -0
- package/lib/APIs/Database/types/BaseClassificationRepository.d.ts +11 -0
- package/lib/APIs/Database/types/BaseClassificationRepository.js +1 -0
- package/lib/APIs/Database/types/BaseCustomerDisplayRepository.d.ts +10 -0
- package/lib/APIs/Database/types/BaseCustomerDisplayRepository.js +1 -0
- package/lib/APIs/Database/types/BaseCustomerGroupRepository.d.ts +24 -0
- package/lib/APIs/Database/types/BaseCustomerGroupRepository.js +1 -0
- package/lib/APIs/Database/types/BaseCustomerRepository.d.ts +76 -0
- package/lib/APIs/Database/types/BaseCustomerRepository.js +1 -0
- package/lib/APIs/Database/types/BaseEnterpriseRepository.d.ts +8 -0
- package/lib/APIs/Database/types/BaseEnterpriseRepository.js +1 -0
- package/lib/APIs/Database/types/BaseGiftCardRepository.d.ts +18 -0
- package/lib/APIs/Database/types/BaseGiftCardRepository.js +1 -0
- package/lib/APIs/Database/types/BaseKitchenOrderRepository.d.ts +41 -0
- package/lib/APIs/Database/types/BaseKitchenOrderRepository.js +1 -0
- package/lib/APIs/Database/types/BaseKitchenScreenRepository.d.ts +16 -0
- package/lib/APIs/Database/types/BaseKitchenScreenRepository.js +1 -0
- package/lib/APIs/Database/types/BaseLockedResourceRepository.d.ts +12 -0
- package/lib/APIs/Database/types/BaseLockedResourceRepository.js +1 -0
- package/lib/APIs/Database/types/BaseLoyaltyRepository.d.ts +16 -0
- package/lib/APIs/Database/types/BaseLoyaltyRepository.js +1 -0
- package/lib/APIs/Database/types/BaseMovementRepository.d.ts +16 -0
- package/lib/APIs/Database/types/BaseMovementRepository.js +1 -0
- package/lib/APIs/Database/types/BaseOutletRepository.d.ts +19 -0
- package/lib/APIs/Database/types/BaseOutletRepository.js +1 -0
- package/lib/APIs/Database/types/BasePaymentMethodRepository.d.ts +27 -0
- package/lib/APIs/Database/types/BasePaymentMethodRepository.js +1 -0
- package/lib/APIs/Database/types/BasePriceListRepository.d.ts +40 -0
- package/lib/APIs/Database/types/BasePriceListRepository.js +1 -0
- package/lib/APIs/Database/types/BasePriceSetRepository.d.ts +6 -0
- package/lib/APIs/Database/types/BasePriceSetRepository.js +1 -0
- package/lib/APIs/Database/types/BaseProductRepository.d.ts +160 -0
- package/lib/APIs/Database/types/BaseProductRepository.js +1 -0
- package/lib/APIs/Database/types/BasePromotionCategoryRepository.d.ts +10 -0
- package/lib/APIs/Database/types/BasePromotionCategoryRepository.js +1 -0
- package/lib/APIs/Database/types/BasePromotionRepository.d.ts +72 -0
- package/lib/APIs/Database/types/BasePromotionRepository.js +1 -0
- package/lib/APIs/Database/types/BaseReceiptRepository.d.ts +31 -0
- package/lib/APIs/Database/types/BaseReceiptRepository.js +1 -0
- package/lib/APIs/Database/types/BaseRegisterRepository.d.ts +56 -0
- package/lib/APIs/Database/types/BaseRegisterRepository.js +1 -0
- package/lib/APIs/Database/types/BaseRepository.d.ts +41 -0
- package/lib/APIs/Database/types/BaseRepository.js +1 -0
- package/lib/APIs/Database/types/BaseSalesKeyRepository.d.ts +37 -0
- package/lib/APIs/Database/types/BaseSalesKeyRepository.js +1 -0
- package/lib/APIs/Database/types/BaseSalesRepository.d.ts +123 -0
- package/lib/APIs/Database/types/BaseSalesRepository.js +1 -0
- package/lib/APIs/Database/types/BaseSearchableRepository.d.ts +8 -0
- package/lib/APIs/Database/types/BaseSearchableRepository.js +1 -0
- package/lib/APIs/Database/types/BaseStocktakeAccumulatedRepository.d.ts +16 -0
- package/lib/APIs/Database/types/BaseStocktakeAccumulatedRepository.js +1 -0
- package/lib/APIs/Database/types/BaseStocktakeRepository.d.ts +8 -0
- package/lib/APIs/Database/types/BaseStocktakeRepository.js +1 -0
- package/lib/APIs/Database/types/BaseStocktakeScannedRepository.d.ts +24 -0
- package/lib/APIs/Database/types/BaseStocktakeScannedRepository.js +1 -0
- package/lib/APIs/Database/types/BaseSupplierRepository.d.ts +35 -0
- package/lib/APIs/Database/types/BaseSupplierRepository.js +1 -0
- package/lib/APIs/Database/types/BaseTakingsRepository.d.ts +13 -0
- package/lib/APIs/Database/types/BaseTakingsRepository.js +1 -0
- package/lib/APIs/Database/types/BaseTaxRateRepository.d.ts +9 -0
- package/lib/APIs/Database/types/BaseTaxRateRepository.js +1 -0
- package/lib/APIs/Database/types/BaseTransfereeRepository.d.ts +12 -0
- package/lib/APIs/Database/types/BaseTransfereeRepository.js +1 -0
- package/lib/APIs/Database/types/BaseVendorConnectionRepository.d.ts +7 -0
- package/lib/APIs/Database/types/BaseVendorConnectionRepository.js +1 -0
- package/lib/APIs/Database/types/DataSourceTables.d.ts +61 -0
- package/lib/APIs/Database/types/DataSourceTables.js +1 -0
- package/lib/APIs/Fulfilment/FulfilmentTypes.d.ts +2 -2
- package/lib/APIs/Fulfilment/FulfilmentTypes.js +1 -2
- package/lib/APIs/InternalMessages/InternalMessageSource.d.ts +6 -3
- package/lib/APIs/InternalMessages/InternalMessageSource.js +6 -7
- package/lib/APIs/Sale/BaseCurrentSale.d.ts +83 -0
- package/lib/APIs/Sale/BaseCurrentSale.js +13 -0
- package/lib/APIs/Sale/BaseSale.d.ts +3 -38
- package/lib/APIs/Sale/BaseSale.js +1 -40
- package/lib/APIs/Sale/CurrentSale.d.ts +19 -84
- package/lib/APIs/Sale/CurrentSale.js +32 -102
- package/lib/APIs/Sale/Exceptions.d.ts +3 -0
- package/lib/APIs/Sale/Exceptions.js +7 -7
- package/lib/APIs/Sale/Sale.d.ts +39 -7
- package/lib/APIs/Sale/Sale.js +41 -13
- package/lib/APIs/Sale/SaleCustomer.d.ts +0 -2
- package/lib/APIs/Sale/SaleCustomer.js +1 -7
- package/lib/APIs/Sale/SalePayment.d.ts +3 -22
- package/lib/APIs/Sale/SalePayment.js +7 -33
- package/lib/APIs/Sale/SaleProduct.d.ts +6 -46
- package/lib/APIs/Sale/SaleProduct.js +6 -53
- package/lib/APIs/Sale/ShopfrontSaleState.d.ts +7 -9
- package/lib/APIs/Sale/ShopfrontSaleState.js +1 -2
- package/lib/APIs/Sale/index.d.ts +9 -9
- package/lib/APIs/Sale/index.js +7 -39
- package/lib/Actions/BaseAction.d.ts +21 -5
- package/lib/Actions/BaseAction.js +155 -97
- package/lib/Actions/Button.d.ts +2 -2
- package/lib/Actions/Button.js +3 -7
- package/lib/Actions/CustomerListOption.d.ts +2 -2
- package/lib/Actions/CustomerListOption.js +2 -6
- package/lib/Actions/Dialog.d.ts +4 -4
- package/lib/Actions/Dialog.js +2 -6
- package/lib/Actions/Redirect.d.ts +2 -2
- package/lib/Actions/Redirect.js +7 -9
- package/lib/Actions/SaleKey.d.ts +2 -2
- package/lib/Actions/SaleKey.js +3 -7
- package/lib/Actions/SaleUpdate.d.ts +3 -3
- package/lib/Actions/SaleUpdate.js +3 -7
- package/lib/Actions/Toast.d.ts +3 -3
- package/lib/Actions/Toast.js +2 -6
- package/lib/Application.d.ts +114 -78
- package/lib/Application.js +207 -160
- package/lib/ApplicationEvents.d.ts +66 -53
- package/lib/ApplicationEvents.js +10 -6
- package/lib/BaseApplication.d.ts +169 -0
- package/lib/BaseApplication.js +40 -0
- package/lib/BaseBridge.d.ts +33 -0
- package/lib/BaseBridge.js +16 -0
- package/lib/Bridge.d.ts +46 -9
- package/lib/Bridge.js +42 -54
- package/lib/Common/EventEmitter.d.ts +10 -1
- package/lib/Common/EventEmitter.js +10 -5
- package/lib/Common/Serializable.d.ts +8 -6
- package/lib/Common/Serializable.js +1 -2
- package/lib/EmitableEvents/BaseEmitableEvent.d.ts +7 -1
- package/lib/EmitableEvents/BaseEmitableEvent.js +7 -5
- package/lib/EmitableEvents/Fulfilment/Options.d.ts +1 -1
- package/lib/EmitableEvents/Fulfilment/Options.js +4 -8
- package/lib/EmitableEvents/Fulfilment/OrderCancel.d.ts +1 -1
- package/lib/EmitableEvents/Fulfilment/OrderCancel.js +4 -8
- package/lib/EmitableEvents/Fulfilment/OrderCreate.d.ts +2 -2
- package/lib/EmitableEvents/Fulfilment/OrderCreate.js +4 -8
- package/lib/EmitableEvents/Fulfilment/OrderUpdate.d.ts +2 -2
- package/lib/EmitableEvents/Fulfilment/OrderUpdate.js +4 -8
- package/lib/EmitableEvents/Fulfilment/OrdersSync.d.ts +2 -2
- package/lib/EmitableEvents/Fulfilment/OrdersSync.js +4 -8
- package/lib/EmitableEvents/Fulfilment/RegisterIntent.d.ts +2 -2
- package/lib/EmitableEvents/Fulfilment/RegisterIntent.js +4 -8
- package/lib/EmitableEvents/Fulfilment/index.d.ts +7 -7
- package/lib/EmitableEvents/Fulfilment/index.js +6 -15
- package/lib/EmitableEvents/InternalMessage.d.ts +2 -2
- package/lib/EmitableEvents/InternalMessage.js +4 -8
- package/lib/EmitableEvents/SellScreenOption.d.ts +2 -2
- package/lib/EmitableEvents/SellScreenOption.js +7 -11
- package/lib/EmitableEvents/SellScreenPromotionApplicable.d.ts +1 -1
- package/lib/EmitableEvents/SellScreenPromotionApplicable.js +4 -8
- package/lib/EmitableEvents/TableUpdate.d.ts +2 -2
- package/lib/EmitableEvents/TableUpdate.js +4 -8
- package/lib/Events/AudioPermissionChange.d.ts +5 -2
- package/lib/Events/AudioPermissionChange.js +6 -7
- package/lib/Events/AudioReady.d.ts +5 -2
- package/lib/Events/AudioReady.js +6 -7
- package/lib/Events/BaseEvent.d.ts +8 -3
- package/lib/Events/BaseEvent.js +1 -6
- package/lib/Events/Callback.d.ts +5 -2
- package/lib/Events/Callback.js +5 -6
- package/lib/Events/FormatIntegratedProduct.d.ts +27 -32
- package/lib/Events/FormatIntegratedProduct.js +12 -9
- package/lib/Events/FulfilmentCollectOrder.d.ts +5 -2
- package/lib/Events/FulfilmentCollectOrder.js +5 -6
- package/lib/Events/FulfilmentCompleteOrder.d.ts +5 -2
- package/lib/Events/FulfilmentCompleteOrder.js +5 -6
- package/lib/Events/FulfilmentGetOrder.d.ts +12 -6
- package/lib/Events/FulfilmentGetOrder.js +10 -8
- package/lib/Events/FulfilmentOrderApproval.d.ts +5 -2
- package/lib/Events/FulfilmentOrderApproval.js +5 -6
- package/lib/Events/FulfilmentProcessOrder.d.ts +12 -10
- package/lib/Events/FulfilmentProcessOrder.js +7 -8
- package/lib/Events/FulfilmentVoidOrder.d.ts +5 -2
- package/lib/Events/FulfilmentVoidOrder.js +5 -6
- package/lib/Events/GiftCardCodeCheck.d.ts +19 -0
- package/lib/Events/GiftCardCodeCheck.js +23 -0
- package/lib/Events/InternalPageMessage.d.ts +10 -4
- package/lib/Events/InternalPageMessage.js +12 -10
- package/lib/Events/PaymentMethodsEnabled.d.ts +16 -11
- package/lib/Events/PaymentMethodsEnabled.js +10 -8
- package/lib/Events/Ready.d.ts +12 -7
- package/lib/Events/Ready.js +5 -6
- package/lib/Events/RegisterChanged.d.ts +12 -6
- package/lib/Events/RegisterChanged.js +6 -7
- package/lib/Events/RequestButtons.d.ts +17 -12
- package/lib/Events/RequestButtons.js +13 -11
- package/lib/Events/RequestCustomerListOptions.d.ts +11 -5
- package/lib/Events/RequestCustomerListOptions.js +12 -11
- package/lib/Events/RequestSaleKeys.d.ts +12 -6
- package/lib/Events/RequestSaleKeys.js +13 -11
- package/lib/Events/RequestSellScreenOptions.d.ts +18 -5
- package/lib/Events/RequestSellScreenOptions.js +17 -9
- package/lib/Events/RequestSettings.d.ts +11 -5
- package/lib/Events/RequestSettings.js +12 -10
- package/lib/Events/RequestTableColumns.d.ts +16 -11
- package/lib/Events/RequestTableColumns.js +12 -9
- package/lib/Events/SaleComplete.d.ts +15 -18
- package/lib/Events/SaleComplete.js +6 -7
- package/lib/Events/UIPipeline.d.ts +17 -5
- package/lib/Events/UIPipeline.js +17 -10
- package/lib/Mocks/APIs/Sale/MockCurrentSale.d.ts +99 -0
- package/lib/Mocks/APIs/Sale/MockCurrentSale.js +326 -0
- package/lib/Mocks/Database/MockDatabase.d.ts +96 -0
- package/lib/Mocks/Database/MockDatabase.js +89 -0
- package/lib/Mocks/MockApplication.d.ts +154 -0
- package/lib/Mocks/MockApplication.js +482 -0
- package/lib/Mocks/MockBridge.d.ts +31 -0
- package/lib/Mocks/MockBridge.js +77 -0
- package/lib/Mocks/index.d.ts +7 -0
- package/lib/Mocks/index.js +15 -0
- package/lib/Utilities/ActionEventRegistrar.d.ts +19 -4
- package/lib/Utilities/ActionEventRegistrar.js +19 -3
- package/lib/Utilities/MiscTypes.d.ts +6 -4
- package/lib/Utilities/MiscTypes.js +1 -2
- package/lib/Utilities/SaleCreate.d.ts +6 -2
- package/lib/Utilities/SaleCreate.js +10 -6
- package/lib/Utilities/Static.d.ts +3 -0
- package/lib/Utilities/Static.js +5 -7
- package/lib/Utilities/UUID.d.ts +9 -3
- package/lib/Utilities/UUID.js +10 -7
- package/lib/index.d.ts +16 -14
- package/lib/index.js +14 -49
- package/package.json +3 -2
- package/lib/APIs/CurrentSale/Exceptions.d.ts +0 -6
- package/lib/APIs/CurrentSale/Exceptions.js +0 -15
- package/lib/APIs/CurrentSale/Sale.d.ts +0 -182
- package/lib/APIs/CurrentSale/Sale.js +0 -290
- package/lib/APIs/CurrentSale/SaleCustomer.d.ts +0 -10
- package/lib/APIs/CurrentSale/SaleCustomer.js +0 -17
- package/lib/APIs/CurrentSale/SalePayment.d.ts +0 -68
- package/lib/APIs/CurrentSale/SalePayment.js +0 -99
- package/lib/APIs/CurrentSale/SaleProduct.d.ts +0 -121
- package/lib/APIs/CurrentSale/SaleProduct.js +0 -167
- package/lib/APIs/CurrentSale/ShopfrontSaleState.d.ts +0 -53
- package/lib/APIs/CurrentSale/ShopfrontSaleState.js +0 -2
- package/lib/APIs/CurrentSale/index.d.ts +0 -6
- package/lib/APIs/CurrentSale/index.js +0 -37
- /package/.idea/{embedded-bridge.iml → shopfront-embedded-bridge.iml} +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
import { BaseSearchableRepository } from "./BaseSearchableRepository.js";
|
|
3
|
+
export interface LocalDatabaseComponent {
|
|
4
|
+
add_price: number;
|
|
5
|
+
quantity: number;
|
|
6
|
+
remove_price: number;
|
|
7
|
+
uuid: string;
|
|
8
|
+
}
|
|
9
|
+
export interface LocalDatabaseCost {
|
|
10
|
+
outlet_id: string;
|
|
11
|
+
average_cost: number;
|
|
12
|
+
last_cost: number;
|
|
13
|
+
}
|
|
14
|
+
export interface LocalDatabaseInventory {
|
|
15
|
+
outlet_id: string;
|
|
16
|
+
single_level: number;
|
|
17
|
+
case_level: number;
|
|
18
|
+
single_reorder_level: number;
|
|
19
|
+
case_reorder_level: number;
|
|
20
|
+
single_reorder_amount: number;
|
|
21
|
+
case_reorder_amount: number;
|
|
22
|
+
single_reorder_limit: number | null;
|
|
23
|
+
case_reorder_limit: number | null;
|
|
24
|
+
single_max_quantity: number | null;
|
|
25
|
+
case_max_quantity: number | null;
|
|
26
|
+
reorder_rounding: "none" | "ceiling" | "floor" | "natural";
|
|
27
|
+
}
|
|
28
|
+
export interface LocalDatabaseLoyalty {
|
|
29
|
+
classification_id: string;
|
|
30
|
+
classification_type: string;
|
|
31
|
+
loyalty_value: number;
|
|
32
|
+
outlet_id: string;
|
|
33
|
+
quantity: number;
|
|
34
|
+
redeem_value: null | number;
|
|
35
|
+
}
|
|
36
|
+
export interface LocalDatabasePrice {
|
|
37
|
+
price: number;
|
|
38
|
+
price_set_id: null | string;
|
|
39
|
+
quantity: number;
|
|
40
|
+
loyalty_value?: null | string;
|
|
41
|
+
redemption_value?: null | string;
|
|
42
|
+
}
|
|
43
|
+
export type ProductTypeUnion = "normal" | "basket" | "voucher" | "package" | "component";
|
|
44
|
+
export type ProductStatusUnion = "active" | "inactive" | "not-selling" | "not-purchasing";
|
|
45
|
+
export interface LocalDatabaseProduct {
|
|
46
|
+
additional: Record<string, string>;
|
|
47
|
+
average_cost: number;
|
|
48
|
+
alternate_names: Array<{
|
|
49
|
+
host: string;
|
|
50
|
+
quantity: number | null;
|
|
51
|
+
name: string;
|
|
52
|
+
}>;
|
|
53
|
+
barcodes: Array<{
|
|
54
|
+
code: string;
|
|
55
|
+
host_deleted_at: string | null;
|
|
56
|
+
quantity: string;
|
|
57
|
+
template: string | null;
|
|
58
|
+
}>;
|
|
59
|
+
brand_id: null | string;
|
|
60
|
+
case_quantity: number;
|
|
61
|
+
category_id: null | string;
|
|
62
|
+
code_index: Array<string>;
|
|
63
|
+
components: Array<LocalDatabaseComponent>;
|
|
64
|
+
core_supplier_id: null | string;
|
|
65
|
+
cost: string;
|
|
66
|
+
cost_percentage: boolean;
|
|
67
|
+
costs: Array<LocalDatabaseCost>;
|
|
68
|
+
cost_tax_rate: null | {
|
|
69
|
+
amount: number;
|
|
70
|
+
uuid: string;
|
|
71
|
+
};
|
|
72
|
+
description: string;
|
|
73
|
+
family_id: null | string;
|
|
74
|
+
image: null | string;
|
|
75
|
+
inventory: Array<LocalDatabaseInventory>;
|
|
76
|
+
last_cost: number;
|
|
77
|
+
last_supplier_id: null | string;
|
|
78
|
+
loyalty_rates: Array<LocalDatabaseLoyalty>;
|
|
79
|
+
mdb_id: null | number;
|
|
80
|
+
name: string;
|
|
81
|
+
name_index: Array<string>;
|
|
82
|
+
order_notes: string;
|
|
83
|
+
invoice_notes: string;
|
|
84
|
+
parents: Array<string>;
|
|
85
|
+
prices: Array<LocalDatabasePrice>;
|
|
86
|
+
request_price: boolean;
|
|
87
|
+
request_quantity: boolean;
|
|
88
|
+
status: ProductStatusUnion;
|
|
89
|
+
prevent_manual_discounts: boolean;
|
|
90
|
+
ignore_price_host_changes: boolean;
|
|
91
|
+
ignore_barcode_host_changes: boolean;
|
|
92
|
+
suppliers: Array<{
|
|
93
|
+
supplier_code: string;
|
|
94
|
+
uuid: string;
|
|
95
|
+
minimum_order_quantity: number;
|
|
96
|
+
}>;
|
|
97
|
+
supplier_ids: Array<string>;
|
|
98
|
+
supplier_codes: Array<string>;
|
|
99
|
+
tags: Array<string>;
|
|
100
|
+
tax_rate: null | {
|
|
101
|
+
amount: string;
|
|
102
|
+
uuid: string;
|
|
103
|
+
};
|
|
104
|
+
track_inventory: boolean;
|
|
105
|
+
type: ProductTypeUnion;
|
|
106
|
+
use_barcode_templates: boolean;
|
|
107
|
+
use_scales: boolean;
|
|
108
|
+
uuid: string;
|
|
109
|
+
}
|
|
110
|
+
export interface ProductRepositorySearchOptions {
|
|
111
|
+
name: boolean;
|
|
112
|
+
barcode: boolean | string;
|
|
113
|
+
quantityCheck: boolean;
|
|
114
|
+
quantityCount: number;
|
|
115
|
+
sort: boolean;
|
|
116
|
+
filter: (product: LocalDatabaseProduct) => boolean;
|
|
117
|
+
exact: boolean;
|
|
118
|
+
limit: number;
|
|
119
|
+
}
|
|
120
|
+
export interface ProductSearchDataType {
|
|
121
|
+
quantity?: number;
|
|
122
|
+
kind?: "product";
|
|
123
|
+
searchBarcode?: string;
|
|
124
|
+
}
|
|
125
|
+
export type ProductSearchResultType = LocalDatabaseProduct & ProductSearchDataType;
|
|
126
|
+
export type ProductClassificationUnion = "category" | "brand" | "family" | "tag" | "supplier" | "supplier_code";
|
|
127
|
+
export interface BaseProductRepository extends BaseRepository<LocalDatabaseProduct>, BaseSearchableRepository<ProductSearchResultType, ProductRepositorySearchOptions> {
|
|
128
|
+
/**
|
|
129
|
+
* Retrieve all products with the specified classification type and classification ID
|
|
130
|
+
*/
|
|
131
|
+
getFromClassification(classificationType: ProductClassificationUnion, uuid: string): Promise<Array<LocalDatabaseProduct>>;
|
|
132
|
+
/**
|
|
133
|
+
* Retrieve all products with the specified status
|
|
134
|
+
*/
|
|
135
|
+
getByStatus(status: ProductStatusUnion | Array<ProductStatusUnion>): Promise<Array<LocalDatabaseProduct>>;
|
|
136
|
+
/**
|
|
137
|
+
* Retrieve all products with the specified type
|
|
138
|
+
*/
|
|
139
|
+
getByType(type: ProductTypeUnion | Array<ProductTypeUnion>): Promise<Array<LocalDatabaseProduct>>;
|
|
140
|
+
/**
|
|
141
|
+
* Retrieve all products with the specified IDs
|
|
142
|
+
*/
|
|
143
|
+
getBulk(ids: Array<string>): Promise<Array<LocalDatabaseProduct>>;
|
|
144
|
+
/**
|
|
145
|
+
* Retrieve all products with the specified MDB ID
|
|
146
|
+
*/
|
|
147
|
+
getByMDBId(mdbId: number): Promise<Array<LocalDatabaseProduct>>;
|
|
148
|
+
/**
|
|
149
|
+
* Retrieve all products with the specified supplier codes
|
|
150
|
+
*/
|
|
151
|
+
getBySupplierCodes(supplierCodes: Array<string>): Promise<Array<LocalDatabaseProduct>>;
|
|
152
|
+
/**
|
|
153
|
+
* Update a product's data
|
|
154
|
+
*/
|
|
155
|
+
update(id: string, changes: Partial<LocalDatabaseProduct>): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Clear the local product data cache
|
|
158
|
+
*/
|
|
159
|
+
clearCache(): void;
|
|
160
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
import { BaseSearchableRepository } from "./BaseSearchableRepository.js";
|
|
3
|
+
export interface LocalDatabasePromotionCategory {
|
|
4
|
+
source: null | string;
|
|
5
|
+
name: string;
|
|
6
|
+
uuid: string;
|
|
7
|
+
show_on_order: boolean;
|
|
8
|
+
include_in_integrations: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type BasePromotionCategoryRepository = BaseRepository<LocalDatabasePromotionCategory> & BaseSearchableRepository<LocalDatabasePromotionCategory>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
import { BaseSearchableRepository } from "./BaseSearchableRepository.js";
|
|
3
|
+
export type LocalDatabaseCriteriaTypeUnion = "sell-item" | "sell-total" | "discount-item-amount" | "discount-total-amount" | "discount-percentage" | "sell-rate" | "quantity-only";
|
|
4
|
+
interface LocalDatabaseCriteriaItem {
|
|
5
|
+
uuid: string;
|
|
6
|
+
rebate: string | number;
|
|
7
|
+
}
|
|
8
|
+
export interface LocalDatabasePromotionCriteria {
|
|
9
|
+
products: Array<LocalDatabaseCriteriaItem>;
|
|
10
|
+
brands: Array<LocalDatabaseCriteriaItem>;
|
|
11
|
+
categories: Array<LocalDatabaseCriteriaItem>;
|
|
12
|
+
families: Array<LocalDatabaseCriteriaItem>;
|
|
13
|
+
tags: Array<LocalDatabaseCriteriaItem>;
|
|
14
|
+
buy_amount: number;
|
|
15
|
+
buy_amount_max: number | null;
|
|
16
|
+
buy_amount_type: "quantity" | "amount";
|
|
17
|
+
discount_amount: number;
|
|
18
|
+
discount_everyday_promotions: boolean;
|
|
19
|
+
exclude_count_quantity: boolean;
|
|
20
|
+
exclude_price_points: boolean;
|
|
21
|
+
min_quantity: number | null;
|
|
22
|
+
mixed_only: boolean;
|
|
23
|
+
optional: boolean;
|
|
24
|
+
quantity_type: "exact" | "more";
|
|
25
|
+
type: LocalDatabaseCriteriaTypeUnion;
|
|
26
|
+
excludes: {
|
|
27
|
+
products: Array<string>;
|
|
28
|
+
categories: Array<string>;
|
|
29
|
+
brands: Array<string>;
|
|
30
|
+
families: Array<string>;
|
|
31
|
+
tags: Array<string>;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface LocalDatabasePromotion {
|
|
35
|
+
active: boolean;
|
|
36
|
+
available_to: null | Array<string>;
|
|
37
|
+
criteria: Array<LocalDatabasePromotionCriteria>;
|
|
38
|
+
end: string | null;
|
|
39
|
+
express: boolean;
|
|
40
|
+
mdb_id: number | null;
|
|
41
|
+
mix_criteria: boolean;
|
|
42
|
+
name: string;
|
|
43
|
+
outlets: Array<string>;
|
|
44
|
+
promotion_category_id: string | null;
|
|
45
|
+
start: string | null;
|
|
46
|
+
uuid: string;
|
|
47
|
+
has_schedule: boolean;
|
|
48
|
+
activated_by?: null | string;
|
|
49
|
+
}
|
|
50
|
+
export interface BasePromotionRepository extends BaseRepository<LocalDatabasePromotion>, BaseSearchableRepository<LocalDatabasePromotion> {
|
|
51
|
+
/**
|
|
52
|
+
* Update a promotion's data
|
|
53
|
+
*/
|
|
54
|
+
update(id: string, update: Partial<LocalDatabasePromotion>): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Retrieve all promotions that contain the specified product
|
|
57
|
+
*/
|
|
58
|
+
getPromotionsForProduct(product: string): Promise<Array<string>>;
|
|
59
|
+
/**
|
|
60
|
+
* Retrieve all promotions with the specified category ID
|
|
61
|
+
*/
|
|
62
|
+
getByCategory(id: string): Promise<Array<LocalDatabasePromotion>>;
|
|
63
|
+
/**
|
|
64
|
+
* Retrieve all promotions that pass the specified filter
|
|
65
|
+
*/
|
|
66
|
+
filter(filter: (promotion: LocalDatabasePromotion) => boolean): Promise<Array<LocalDatabasePromotion>>;
|
|
67
|
+
/**
|
|
68
|
+
* Retrieve all promotions with the specified IDs
|
|
69
|
+
*/
|
|
70
|
+
getBulk(ids: Array<string>): Promise<Array<LocalDatabasePromotion>>;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export type ReceiptTypeUnion = "receipt-text" | "receipt-full" | "a4" | "email";
|
|
3
|
+
export interface ReceiptPaddingType {
|
|
4
|
+
top: number | null;
|
|
5
|
+
left: number | null;
|
|
6
|
+
right: number | null;
|
|
7
|
+
bottom: number | null;
|
|
8
|
+
}
|
|
9
|
+
export interface LocalDatabaseReceipt {
|
|
10
|
+
accountReceipt: boolean;
|
|
11
|
+
components: string;
|
|
12
|
+
name: string;
|
|
13
|
+
receiptWidth: number;
|
|
14
|
+
type: ReceiptTypeUnion;
|
|
15
|
+
uuid: string;
|
|
16
|
+
padding: null | ReceiptPaddingType;
|
|
17
|
+
attachments: null | Array<{
|
|
18
|
+
receipt: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
export interface BaseReceiptRepository extends BaseRepository<LocalDatabaseReceipt> {
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve all receipts that pass the specified filter
|
|
25
|
+
*/
|
|
26
|
+
filter(filter: (item: LocalDatabaseReceipt) => boolean): Promise<Array<LocalDatabaseReceipt>>;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve all receipts with the specified type
|
|
29
|
+
*/
|
|
30
|
+
getByType(type: ReceiptTypeUnion): Promise<Array<LocalDatabaseReceipt>>;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export type ShouldPrintOptions = "table" | "total" | "none";
|
|
3
|
+
export interface LocalDatabaseRegister {
|
|
4
|
+
closure_print_settings: {
|
|
5
|
+
account: ShouldPrintOptions;
|
|
6
|
+
account_payments: ShouldPrintOptions;
|
|
7
|
+
discounts: ShouldPrintOptions;
|
|
8
|
+
gift_cards_redeemed: ShouldPrintOptions;
|
|
9
|
+
gift_cards_sold: ShouldPrintOptions;
|
|
10
|
+
movements: ShouldPrintOptions;
|
|
11
|
+
payments: ShouldPrintOptions;
|
|
12
|
+
refunds: ShouldPrintOptions;
|
|
13
|
+
tax: ShouldPrintOptions;
|
|
14
|
+
loyalty: ShouldPrintOptions;
|
|
15
|
+
notes: boolean;
|
|
16
|
+
tags: boolean;
|
|
17
|
+
payment_subtypes: boolean;
|
|
18
|
+
statistics: boolean;
|
|
19
|
+
};
|
|
20
|
+
close_register_tags: Array<string>;
|
|
21
|
+
float: {
|
|
22
|
+
monday: number;
|
|
23
|
+
tuesday: number;
|
|
24
|
+
wednesday: number;
|
|
25
|
+
thursday: number;
|
|
26
|
+
friday: number;
|
|
27
|
+
saturday: number;
|
|
28
|
+
sunday: number;
|
|
29
|
+
};
|
|
30
|
+
surcharges?: Array<{
|
|
31
|
+
id: number;
|
|
32
|
+
type: "PERCENTAGE" | "FIXED";
|
|
33
|
+
amount: number;
|
|
34
|
+
taxRate: string | null;
|
|
35
|
+
day: string;
|
|
36
|
+
start: string;
|
|
37
|
+
end: string;
|
|
38
|
+
name: string;
|
|
39
|
+
appliesTo: Array<{
|
|
40
|
+
id: string;
|
|
41
|
+
type: "Category" | "Tag";
|
|
42
|
+
}> | null;
|
|
43
|
+
}>;
|
|
44
|
+
surcharging_enabled: boolean;
|
|
45
|
+
name: string;
|
|
46
|
+
outlet_id: string;
|
|
47
|
+
payment_methods: Array<string>;
|
|
48
|
+
settings: Record<string, unknown>;
|
|
49
|
+
uuid: string;
|
|
50
|
+
}
|
|
51
|
+
export interface BaseRegisterRepository extends BaseRepository<LocalDatabaseRegister> {
|
|
52
|
+
/**
|
|
53
|
+
* Update a register's data
|
|
54
|
+
*/
|
|
55
|
+
update(id: string, changes: Partial<LocalDatabaseRegister>): Promise<void>;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export default interface BaseRepository<DataType extends object = object, IdType = string> {
|
|
2
|
+
/**
|
|
3
|
+
* Retrieve all items in the repository
|
|
4
|
+
* @param orderBy
|
|
5
|
+
*/
|
|
6
|
+
all(orderBy?: string): Promise<Array<DataType>>;
|
|
7
|
+
/**
|
|
8
|
+
* Retrieve an item by its UUID
|
|
9
|
+
* @param uuid
|
|
10
|
+
*/
|
|
11
|
+
get(uuid: IdType): Promise<DataType>;
|
|
12
|
+
/**
|
|
13
|
+
* Add an item to the repository
|
|
14
|
+
* @param item
|
|
15
|
+
*/
|
|
16
|
+
put(item: Array<DataType> | DataType): Promise<IdType>;
|
|
17
|
+
/**
|
|
18
|
+
* Update an item in the repository
|
|
19
|
+
* @param uuid
|
|
20
|
+
* @param changes
|
|
21
|
+
*/
|
|
22
|
+
update(uuid: IdType, changes: Partial<DataType>): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Return the number of items in the repository
|
|
25
|
+
*/
|
|
26
|
+
count(): Promise<number>;
|
|
27
|
+
/**
|
|
28
|
+
* Delete all items from the repository
|
|
29
|
+
*/
|
|
30
|
+
empty(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Delete multiple items from the repository
|
|
33
|
+
* @param items
|
|
34
|
+
*/
|
|
35
|
+
delete(items: IdType | Array<IdType>): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Invoke a callback for each item in the repository
|
|
38
|
+
* @param callback
|
|
39
|
+
*/
|
|
40
|
+
each(callback: (item: DataType) => void): Promise<void>;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export type SaleKeyActionType = "add-single" | "add-case" | "add-giftcard" | "product-details" | "case" | "open-drawer" | "add-note" | "create-customer" | "return-item" | "flip-sale" | "pay-exact" | "pay-amount" | "view-promotions" | "sale-search" | "cancel-sale" | "add-product" | "subtract-product" | "add-product-barcode" | "subtract-product-barcode" | "open-folder" | "previous-folder" | "display-classification" | "keyboard" | "reweigh" | "customer-list" | "live-profit" | "current-time" | "previous-date" | "add-component" | "remove-component" | "display-classification-case" | "change-price-set" | "add-customer" | "make-customer-payment" | "apply-discount" | "add-component-to-current" | "remove-component-from-current" | "add-order-reference" | "search-additional" | "show-backorders" | "pay-loyalty";
|
|
3
|
+
export type SaleKeyActionUnion = SaleKeyActionType | "noop" | string;
|
|
4
|
+
export interface SaleKeyType {
|
|
5
|
+
action: SaleKeyActionUnion;
|
|
6
|
+
actionargs: Record<string, unknown>;
|
|
7
|
+
background: string;
|
|
8
|
+
backgroundhover: string;
|
|
9
|
+
bordercolour: string;
|
|
10
|
+
constrainheight: boolean;
|
|
11
|
+
constrainwidth: boolean;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
fill: boolean;
|
|
14
|
+
hover: boolean;
|
|
15
|
+
hoveranimation: boolean;
|
|
16
|
+
image: string | null;
|
|
17
|
+
imagehover: string | null;
|
|
18
|
+
preventdisable: boolean;
|
|
19
|
+
text: string;
|
|
20
|
+
textcolour: string;
|
|
21
|
+
texthover: string;
|
|
22
|
+
texthovercolour: string;
|
|
23
|
+
top: number;
|
|
24
|
+
left: number;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
fontSize?: number;
|
|
28
|
+
bold?: boolean;
|
|
29
|
+
italic?: boolean;
|
|
30
|
+
underline?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface LocalDatabaseSaleKeys {
|
|
33
|
+
keys: Array<SaleKeyType>;
|
|
34
|
+
name: string;
|
|
35
|
+
uuid: string;
|
|
36
|
+
}
|
|
37
|
+
export type BaseSalesKeyRepository = BaseRepository<LocalDatabaseSaleKeys>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
type SaleActionType = "PRODUCT_SCAN" | "PRODUCT_SEARCH_ADD" | "PRODUCT_KEY_ADD" | "QUANTITY_OVERRIDE" | "INCREMENT" | "DECREMENT" | "REMOVE_PRODUCT" | "CUSTOMER_SCAN" | "CUSTOMER_SEARCH_ADD" | "CUSTOMER_KEY_ADD" | "REMOVE_CUSTOMER" | "ADD_PAYMENT" | "REMOVE_PAYMENT";
|
|
3
|
+
interface SaleAction {
|
|
4
|
+
timestamp: string;
|
|
5
|
+
action: SaleActionType;
|
|
6
|
+
value: string;
|
|
7
|
+
affecting: string;
|
|
8
|
+
user: string;
|
|
9
|
+
}
|
|
10
|
+
export type LocalDatabaseSalePaymentStatus = "cancelled" | "completed" | "failed";
|
|
11
|
+
type SaleStatus = "COMPLETED" | "CANCELLED" | "PARKED" | "INCOMPLETE" | "UNPARKED";
|
|
12
|
+
export interface LocalDatabaseSaleItemTypeProduct {
|
|
13
|
+
id: string;
|
|
14
|
+
type: "Product";
|
|
15
|
+
name: string;
|
|
16
|
+
}
|
|
17
|
+
export interface LocalDatabaseSaleItemTypeGiftCard {
|
|
18
|
+
type: "GiftCard";
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
code: string;
|
|
22
|
+
expiry: string;
|
|
23
|
+
source: string;
|
|
24
|
+
}
|
|
25
|
+
export interface LocalDatabaseSaleItemTypeSurcharge {
|
|
26
|
+
type: "Surcharge";
|
|
27
|
+
}
|
|
28
|
+
export type LocalDatabaseSaleItemType = LocalDatabaseSaleItemTypeProduct | LocalDatabaseSaleItemTypeGiftCard | LocalDatabaseSaleItemTypeSurcharge;
|
|
29
|
+
export interface LocalDatabaseSaleItemPromotion {
|
|
30
|
+
promotion: string;
|
|
31
|
+
rebateAmount: number;
|
|
32
|
+
rebateQuantity: number;
|
|
33
|
+
savings: number;
|
|
34
|
+
quantity: number;
|
|
35
|
+
}
|
|
36
|
+
export interface LocalDatabaseSaleItem {
|
|
37
|
+
basePrice: number;
|
|
38
|
+
caseQuantity: number;
|
|
39
|
+
cost?: number;
|
|
40
|
+
discount: {
|
|
41
|
+
amount: string;
|
|
42
|
+
reason: string;
|
|
43
|
+
};
|
|
44
|
+
item: LocalDatabaseSaleItemType;
|
|
45
|
+
loyaltyValue: number;
|
|
46
|
+
note: string;
|
|
47
|
+
products: Array<LocalDatabaseSaleItem>;
|
|
48
|
+
promotions: Array<LocalDatabaseSaleItemPromotion>;
|
|
49
|
+
quantity: number;
|
|
50
|
+
savings: number;
|
|
51
|
+
tax: number;
|
|
52
|
+
taxRate: string | null;
|
|
53
|
+
totalPrice: number;
|
|
54
|
+
priceList: boolean;
|
|
55
|
+
metaData: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
export interface LocalDatabaseSalePayment {
|
|
58
|
+
amount: number;
|
|
59
|
+
metaData?: unknown;
|
|
60
|
+
cashout: number;
|
|
61
|
+
rounding: number;
|
|
62
|
+
paymentMethodId: string;
|
|
63
|
+
registerId: string;
|
|
64
|
+
status: LocalDatabaseSalePaymentStatus;
|
|
65
|
+
processTime: string;
|
|
66
|
+
receipt: string | null;
|
|
67
|
+
subtype: null | string;
|
|
68
|
+
}
|
|
69
|
+
export interface LocalDatabaseSale {
|
|
70
|
+
cashout: number;
|
|
71
|
+
clientId?: string;
|
|
72
|
+
createdAt: string;
|
|
73
|
+
customerId: null | string;
|
|
74
|
+
discount: {
|
|
75
|
+
amount: string;
|
|
76
|
+
reason: string;
|
|
77
|
+
};
|
|
78
|
+
id: string;
|
|
79
|
+
invoiceId: string;
|
|
80
|
+
items: Array<LocalDatabaseSaleItem>;
|
|
81
|
+
linkedTo: null | string;
|
|
82
|
+
loyaltyValue: number;
|
|
83
|
+
notes: {
|
|
84
|
+
internal: string;
|
|
85
|
+
sale: string;
|
|
86
|
+
};
|
|
87
|
+
orderReference: string;
|
|
88
|
+
payments: Array<LocalDatabaseSalePayment>;
|
|
89
|
+
refundReason: null | string;
|
|
90
|
+
registerId: string;
|
|
91
|
+
status: SaleStatus;
|
|
92
|
+
totalBase: number;
|
|
93
|
+
totalChange: number;
|
|
94
|
+
totalCost: number;
|
|
95
|
+
totalPrice: number;
|
|
96
|
+
totalQuantity: number;
|
|
97
|
+
totalRounding: number;
|
|
98
|
+
totalTax: number;
|
|
99
|
+
updatedAt: string;
|
|
100
|
+
uploaded: boolean;
|
|
101
|
+
userId: string;
|
|
102
|
+
actions: Array<SaleAction>;
|
|
103
|
+
metaData: Record<string, unknown>;
|
|
104
|
+
}
|
|
105
|
+
export interface BaseSalesRepository extends BaseRepository<LocalDatabaseSale> {
|
|
106
|
+
/**
|
|
107
|
+
* Retrieve all parked sales
|
|
108
|
+
*/
|
|
109
|
+
parked(): Promise<Array<LocalDatabaseSale>>;
|
|
110
|
+
/**
|
|
111
|
+
* Retrieve all sales with the specified client ID
|
|
112
|
+
*/
|
|
113
|
+
getByClientId(id: string): Promise<Array<LocalDatabaseSale>>;
|
|
114
|
+
/**
|
|
115
|
+
* Retrieve all sales with the specified invoice ID
|
|
116
|
+
*/
|
|
117
|
+
search(invoiceId: string): Promise<Array<LocalDatabaseSale>>;
|
|
118
|
+
/**
|
|
119
|
+
* Retrieve all sales that pass the specified filter
|
|
120
|
+
*/
|
|
121
|
+
filter(callback: (sale: LocalDatabaseSale) => boolean): Promise<Array<LocalDatabaseSale>>;
|
|
122
|
+
}
|
|
123
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface BaseSearchableRepository<DataType extends object, SearchOptions = undefined> {
|
|
2
|
+
/**
|
|
3
|
+
* Search the repository for all items with the specified needle
|
|
4
|
+
* @param needle
|
|
5
|
+
* @param options
|
|
6
|
+
*/
|
|
7
|
+
search(needle: string, options?: Partial<SearchOptions>): Promise<Array<DataType>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export interface LocalDatabaseStocktakeAccumulated {
|
|
3
|
+
accumulated: number;
|
|
4
|
+
stocktake_id: string;
|
|
5
|
+
uuid: string;
|
|
6
|
+
}
|
|
7
|
+
export interface BaseStocktakeAccumulatedRepository extends BaseRepository<LocalDatabaseStocktakeAccumulated> {
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve all accumulated stocktakes by stocktake ID
|
|
10
|
+
*/
|
|
11
|
+
stocktake(stocktake: string): Promise<Array<LocalDatabaseStocktakeAccumulated>>;
|
|
12
|
+
/**
|
|
13
|
+
* Update an accumulated stocktake's data
|
|
14
|
+
*/
|
|
15
|
+
update(uuid: string, changes: Partial<LocalDatabaseStocktakeAccumulated>): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export interface LocalDatabaseStocktakeScanned {
|
|
3
|
+
id?: number;
|
|
4
|
+
accumulated: number;
|
|
5
|
+
linked_to: null | number;
|
|
6
|
+
product_id: string;
|
|
7
|
+
quantity: number;
|
|
8
|
+
removed: boolean;
|
|
9
|
+
stocktake_id: string;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
user_id: null | string;
|
|
12
|
+
barcode: string | undefined;
|
|
13
|
+
client_id: string;
|
|
14
|
+
}
|
|
15
|
+
export interface BaseStocktakeScannedRepository extends BaseRepository<LocalDatabaseStocktakeScanned, number> {
|
|
16
|
+
/**
|
|
17
|
+
* Retrieve all scanned stocktakes by stocktake ID
|
|
18
|
+
*/
|
|
19
|
+
stocktake(stocktake: string): Promise<Array<LocalDatabaseStocktakeScanned>>;
|
|
20
|
+
/**
|
|
21
|
+
* Update a scanned stocktake's data
|
|
22
|
+
*/
|
|
23
|
+
update(id: number, changes: Partial<LocalDatabaseStocktakeScanned>): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { LocalDatabaseContact } from "./BaseCustomerRepository.js";
|
|
2
|
+
import BaseRepository from "./BaseRepository.js";
|
|
3
|
+
import { BaseSearchableRepository } from "./BaseSearchableRepository.js";
|
|
4
|
+
export interface LocalDatabaseSupplier {
|
|
5
|
+
account_number: string;
|
|
6
|
+
business_number: string;
|
|
7
|
+
comments: string;
|
|
8
|
+
contact: LocalDatabaseContact;
|
|
9
|
+
default_order_tax: "inc_tax" | "ex_tax" | "ex_wet";
|
|
10
|
+
distribute_fees: "proportionally" | "evenly";
|
|
11
|
+
distribute_freight: "items" | "cases" | "mixed";
|
|
12
|
+
email_format: "inline" | "csv" | "pdf";
|
|
13
|
+
fee_amount: number;
|
|
14
|
+
mdb_id: null | number;
|
|
15
|
+
name: string;
|
|
16
|
+
status: "ACTIVE" | "INACTIVE";
|
|
17
|
+
order_automatic_email: boolean;
|
|
18
|
+
order_notes: string;
|
|
19
|
+
order_internal_notes: string;
|
|
20
|
+
uuid: string;
|
|
21
|
+
freight_included_on_invoices: boolean;
|
|
22
|
+
freight_tax_id: string | null;
|
|
23
|
+
fees_tax_id: string | null;
|
|
24
|
+
minimum_order_value: null | number;
|
|
25
|
+
maximum_order_value: null | number;
|
|
26
|
+
allow_order_below_minimum: boolean;
|
|
27
|
+
default_days_until_due: number | null;
|
|
28
|
+
freight_fixed_cost_per_case: number | null;
|
|
29
|
+
additional_contacts: Array<LocalDatabaseAdditionalContact>;
|
|
30
|
+
}
|
|
31
|
+
export interface LocalDatabaseAdditionalContact {
|
|
32
|
+
name: string;
|
|
33
|
+
contact: LocalDatabaseContact;
|
|
34
|
+
}
|
|
35
|
+
export type BaseSupplierRepository = BaseRepository<LocalDatabaseSupplier> & BaseSearchableRepository<LocalDatabaseSupplier>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|