@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,10 @@
|
|
|
1
|
+
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
+
<code_scheme name="Project" version="173">
|
|
3
|
+
<JSCodeStyleSettings version="0">
|
|
4
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
5
|
+
</JSCodeStyleSettings>
|
|
6
|
+
<TypeScriptCodeStyleSettings version="0">
|
|
7
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
8
|
+
</TypeScriptCodeStyleSettings>
|
|
9
|
+
</code_scheme>
|
|
10
|
+
</component>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="GitToolBoxProjectSettings">
|
|
4
|
+
<option name="commitMessageIssueKeyValidationOverride">
|
|
5
|
+
<BoolValueOverride>
|
|
6
|
+
<option name="enabled" value="true" />
|
|
7
|
+
</BoolValueOverride>
|
|
8
|
+
</option>
|
|
9
|
+
<option name="commitMessageValidationEnabledOverride">
|
|
10
|
+
<BoolValueOverride>
|
|
11
|
+
<option name="enabled" value="true" />
|
|
12
|
+
</BoolValueOverride>
|
|
13
|
+
</option>
|
|
14
|
+
</component>
|
|
15
|
+
</project>
|
|
@@ -2,5 +2,10 @@
|
|
|
2
2
|
<profile version="1.0">
|
|
3
3
|
<option name="myName" value="Project Default" />
|
|
4
4
|
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
5
|
+
<inspection_tool class="ImplicitTypeConversion" enabled="true" level="WARNING" enabled_by_default="true">
|
|
6
|
+
<option name="BITS" value="1720" />
|
|
7
|
+
<option name="FLAG_EXPLICIT_CONVERSION" value="true" />
|
|
8
|
+
<option name="IGNORE_NODESET_TO_BOOLEAN_VIA_STRING" value="true" />
|
|
9
|
+
</inspection_tool>
|
|
5
10
|
</profile>
|
|
6
11
|
</component>
|
package/.idea/modules.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<project version="4">
|
|
3
3
|
<component name="ProjectModuleManager">
|
|
4
4
|
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/embedded-bridge.iml" filepath="$PROJECT_DIR$/.idea/embedded-bridge.iml" />
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/shopfront-embedded-bridge.iml" filepath="$PROJECT_DIR$/.idea/shopfront-embedded-bridge.iml" />
|
|
6
6
|
</modules>
|
|
7
7
|
</component>
|
|
8
8
|
</project>
|
package/.idea/php.xml
CHANGED
|
@@ -9,9 +9,24 @@
|
|
|
9
9
|
<component name="PHPCodeSnifferOptionsConfiguration">
|
|
10
10
|
<option name="transferred" value="true" />
|
|
11
11
|
</component>
|
|
12
|
+
<component name="PhpCodeSniffer">
|
|
13
|
+
<phpcs_settings>
|
|
14
|
+
<phpcs_by_interpreter asDefaultInterpreter="true" interpreter_id="bb870563-23b2-4cfc-9ac5-70a3316d78e5" timeout="30000" />
|
|
15
|
+
</phpcs_settings>
|
|
16
|
+
</component>
|
|
17
|
+
<component name="PhpStan">
|
|
18
|
+
<PhpStan_settings>
|
|
19
|
+
<phpstan_by_interpreter asDefaultInterpreter="true" interpreter_id="bb870563-23b2-4cfc-9ac5-70a3316d78e5" timeout="60000" />
|
|
20
|
+
</PhpStan_settings>
|
|
21
|
+
</component>
|
|
12
22
|
<component name="PhpStanOptionsConfiguration">
|
|
13
23
|
<option name="transferred" value="true" />
|
|
14
24
|
</component>
|
|
25
|
+
<component name="Psalm">
|
|
26
|
+
<Psalm_settings>
|
|
27
|
+
<psalm_fixer_by_interpreter asDefaultInterpreter="true" interpreter_id="bb870563-23b2-4cfc-9ac5-70a3316d78e5" timeout="60000" />
|
|
28
|
+
</Psalm_settings>
|
|
29
|
+
</component>
|
|
15
30
|
<component name="PsalmOptionsConfiguration">
|
|
16
31
|
<option name="transferred" value="true" />
|
|
17
32
|
</component>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseBridge } from "../../BaseBridge.js";
|
|
2
|
+
import { AnyFunction } from "../../Utilities/MiscTypes.js";
|
|
3
|
+
import { DataSourceTables } from "./types/DataSourceTables.js";
|
|
4
|
+
export type DatabaseTable = keyof DataSourceTables;
|
|
5
|
+
export type DatabaseMethodName<Table extends DatabaseTable> = {
|
|
6
|
+
[K in keyof DataSourceTables[Table]]: DataSourceTables[Table][K] extends AnyFunction ? K : never;
|
|
7
|
+
};
|
|
8
|
+
export type DatabaseCallReturn<Table extends DatabaseTable, Method extends keyof DatabaseMethodName<Table>> = ReturnType<Extract<DataSourceTables[Table][Method], AnyFunction>>;
|
|
9
|
+
export declare abstract class BaseDatabase<BridgeType extends BaseBridge = BaseBridge> {
|
|
10
|
+
protected bridge: BridgeType;
|
|
11
|
+
protected constructor(bridge: BridgeType);
|
|
12
|
+
/**
|
|
13
|
+
* Makes a request to the Shopfront local database
|
|
14
|
+
*/
|
|
15
|
+
abstract callMethod<Table extends DatabaseTable, Method extends keyof DatabaseMethodName<Table>, ExpectedResult extends DatabaseCallReturn<Table, Method>>(table: Table, method: Method, args: Array<unknown>): Promise<ExpectedResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves all items in the specified table
|
|
18
|
+
*/
|
|
19
|
+
abstract all<Table extends DatabaseTable>(table: Table): Promise<DatabaseCallReturn<Table, "all">>;
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves all items that match the given ID in the specified table
|
|
22
|
+
*/
|
|
23
|
+
abstract get<Table extends DatabaseTable>(table: Table, id: string | number): Promise<DatabaseCallReturn<Table, "get">>;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the item count of the specified table
|
|
26
|
+
*/
|
|
27
|
+
abstract count(table: DatabaseTable): Promise<number>;
|
|
28
|
+
}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import { Bridge } from "../../Bridge";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Bridge } from "../../Bridge.js";
|
|
2
|
+
import { BaseDatabase, DatabaseCallReturn, DatabaseMethodName, DatabaseTable } from "./BaseDatabase.js";
|
|
3
|
+
export declare class Database extends BaseDatabase<Bridge> {
|
|
4
4
|
constructor(bridge: Bridge);
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @inheritDoc
|
|
7
|
+
*/
|
|
8
|
+
callMethod<Table extends DatabaseTable, Method extends keyof DatabaseMethodName<Table>, ExpectedResult extends DatabaseCallReturn<Table, Method>>(table: Table, method: Method, args: Array<unknown>): Promise<ExpectedResult>;
|
|
9
|
+
/**
|
|
10
|
+
* @inheritDoc
|
|
11
|
+
*/
|
|
12
|
+
all<Table extends DatabaseTable>(table: Table): Promise<DatabaseCallReturn<Table, "all">>;
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
get<Table extends DatabaseTable>(table: Table, id: string | number): Promise<DatabaseCallReturn<Table, "get">>;
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
count(table: DatabaseTable): Promise<number>;
|
|
9
21
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const ApplicationEvents_1 = require("../../ApplicationEvents");
|
|
5
|
-
class Database {
|
|
1
|
+
import { ToShopfront } from "../../ApplicationEvents.js";
|
|
2
|
+
import { BaseDatabase, } from "./BaseDatabase.js";
|
|
3
|
+
export class Database extends BaseDatabase {
|
|
6
4
|
constructor(bridge) {
|
|
7
|
-
|
|
5
|
+
super(bridge);
|
|
8
6
|
}
|
|
9
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @inheritDoc
|
|
9
|
+
*/
|
|
10
|
+
async callMethod(table, method, args) {
|
|
10
11
|
const databaseRequest = `DatabaseRequest-${Math.random()}-${Date.now()}`;
|
|
11
12
|
const promise = new Promise((res, rej) => {
|
|
13
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
12
14
|
const listener = (event, data) => {
|
|
13
15
|
if (event !== "RESPONSE_DATABASE_REQUEST") {
|
|
14
16
|
return;
|
|
@@ -25,7 +27,7 @@ class Database {
|
|
|
25
27
|
};
|
|
26
28
|
this.bridge.addEventListener(listener);
|
|
27
29
|
});
|
|
28
|
-
this.bridge.sendMessage(
|
|
30
|
+
this.bridge.sendMessage(ToShopfront.DATABASE_REQUEST, {
|
|
29
31
|
requestId: databaseRequest,
|
|
30
32
|
table,
|
|
31
33
|
method,
|
|
@@ -33,14 +35,22 @@ class Database {
|
|
|
33
35
|
});
|
|
34
36
|
return promise;
|
|
35
37
|
}
|
|
36
|
-
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
async all(table) {
|
|
37
42
|
return this.callMethod(table, "all", []);
|
|
38
43
|
}
|
|
39
|
-
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
async get(table, id) {
|
|
40
48
|
return this.callMethod(table, "get", [id]);
|
|
41
49
|
}
|
|
42
|
-
|
|
50
|
+
/**
|
|
51
|
+
* @inheritDoc
|
|
52
|
+
*/
|
|
53
|
+
async count(table) {
|
|
43
54
|
return this.callMethod(table, "count", []);
|
|
44
55
|
}
|
|
45
56
|
}
|
|
46
|
-
exports.Database = Database;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export interface LocalDatabaseBarcodeTemplate {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
recalculate_quantity: boolean;
|
|
6
|
+
template: string;
|
|
7
|
+
}
|
|
8
|
+
export type BaseBarcodeTemplateRepository = BaseRepository<LocalDatabaseBarcodeTemplate, number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
import { BaseSearchableRepository } from "./BaseSearchableRepository.js";
|
|
3
|
+
export interface LocalDatabaseClassification {
|
|
4
|
+
name: string;
|
|
5
|
+
uuid: string;
|
|
6
|
+
mdb_id: number | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface LocalDatabaseCategory extends LocalDatabaseClassification {
|
|
9
|
+
metcash_msc: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export type BaseClassificationRepository = BaseRepository<LocalDatabaseClassification> & BaseSearchableRepository<LocalDatabaseClassification>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export interface LocalDatabaseCustomerDisplay {
|
|
3
|
+
idle_display: string;
|
|
4
|
+
main_colour: string;
|
|
5
|
+
name: string;
|
|
6
|
+
sale_display: string;
|
|
7
|
+
text_colour: string;
|
|
8
|
+
uuid: string;
|
|
9
|
+
}
|
|
10
|
+
export type BaseCustomerDisplayRepository = BaseRepository<LocalDatabaseCustomerDisplay>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
import { BaseSearchableRepository } from "./BaseSearchableRepository.js";
|
|
3
|
+
export interface LocalDatabaseCustomerGroup {
|
|
4
|
+
account_limit: number | null;
|
|
5
|
+
account_receipt_id: string | null;
|
|
6
|
+
allow_account_sales: boolean;
|
|
7
|
+
auto_email_receipt: boolean;
|
|
8
|
+
autoprint_account_receipt: boolean;
|
|
9
|
+
autoprint_receipt: boolean;
|
|
10
|
+
autoprint_parked_receipt: boolean;
|
|
11
|
+
credit_terms: null | Array<string>;
|
|
12
|
+
disable_promotions: boolean;
|
|
13
|
+
email_receipt_id: null | string;
|
|
14
|
+
loyalty: boolean;
|
|
15
|
+
loyalty_rate: number | null;
|
|
16
|
+
name: string;
|
|
17
|
+
pricelist_id: null | string;
|
|
18
|
+
receipt_id: null | string;
|
|
19
|
+
statement_template_id: null | string;
|
|
20
|
+
require_order_reference: 0 | 1;
|
|
21
|
+
updated_at: string;
|
|
22
|
+
uuid: string;
|
|
23
|
+
}
|
|
24
|
+
export type BaseCustomerGroupRepository = BaseRepository<LocalDatabaseCustomerGroup> & BaseSearchableRepository<LocalDatabaseCustomerGroup>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
import { BaseSearchableRepository } from "./BaseSearchableRepository.js";
|
|
3
|
+
export interface CustomerRepositorySearchOptions {
|
|
4
|
+
name: boolean;
|
|
5
|
+
code: boolean;
|
|
6
|
+
email: boolean;
|
|
7
|
+
phone: boolean;
|
|
8
|
+
company: boolean;
|
|
9
|
+
customerGroups: Array<string>;
|
|
10
|
+
exactMatch: boolean;
|
|
11
|
+
sort: boolean;
|
|
12
|
+
limit: number;
|
|
13
|
+
filter: ((customer: LocalDatabaseCustomer) => boolean) | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface LocalDatabaseContact {
|
|
16
|
+
address_city: string;
|
|
17
|
+
address_country: string;
|
|
18
|
+
address_postcode: string;
|
|
19
|
+
address_state: string;
|
|
20
|
+
address_street_1: string;
|
|
21
|
+
address_street_2: string;
|
|
22
|
+
address_suburb: string;
|
|
23
|
+
email: string;
|
|
24
|
+
facebook: string;
|
|
25
|
+
fax: string;
|
|
26
|
+
mobile: string;
|
|
27
|
+
phone: string;
|
|
28
|
+
twitter: string;
|
|
29
|
+
website: string;
|
|
30
|
+
}
|
|
31
|
+
export interface LocalDatabaseCustomer {
|
|
32
|
+
account_limit: null | number;
|
|
33
|
+
account_receipt: null | string;
|
|
34
|
+
allow_account_sales: boolean;
|
|
35
|
+
autoprint_account_receipt: boolean;
|
|
36
|
+
autoprint_receipt: boolean;
|
|
37
|
+
autoprint_parked_receipt: boolean;
|
|
38
|
+
billing: LocalDatabaseContact;
|
|
39
|
+
birthday: null | string;
|
|
40
|
+
business_number: string;
|
|
41
|
+
client_id: string;
|
|
42
|
+
code: string;
|
|
43
|
+
comments: string;
|
|
44
|
+
company: string;
|
|
45
|
+
current_owing: number;
|
|
46
|
+
customer_group_id: null | string;
|
|
47
|
+
delivery: LocalDatabaseContact;
|
|
48
|
+
disable_promotions: boolean;
|
|
49
|
+
email: string;
|
|
50
|
+
first_name: string;
|
|
51
|
+
full_name: string;
|
|
52
|
+
gender: string;
|
|
53
|
+
invoice_message: string;
|
|
54
|
+
last_name: string;
|
|
55
|
+
loyalty: boolean;
|
|
56
|
+
loyalty_points: number;
|
|
57
|
+
loyalty_rate: number | null;
|
|
58
|
+
override_customer_group: boolean;
|
|
59
|
+
phones: Array<string>;
|
|
60
|
+
pricelist_id: null | string;
|
|
61
|
+
receipt: null | string;
|
|
62
|
+
require_order_reference: 0 | 1;
|
|
63
|
+
uuid: string;
|
|
64
|
+
}
|
|
65
|
+
export interface BaseCustomerRepository extends BaseRepository<LocalDatabaseCustomer>, BaseSearchableRepository<LocalDatabaseCustomer, CustomerRepositorySearchOptions> {
|
|
66
|
+
/**
|
|
67
|
+
* Retrieve all customers with the specified customer group ID
|
|
68
|
+
* @param customerGroupId
|
|
69
|
+
*/
|
|
70
|
+
getByCustomerGroup(customerGroupId: string): Promise<Array<LocalDatabaseCustomer>>;
|
|
71
|
+
/**
|
|
72
|
+
* Retrieve all customers with the specified price list ID
|
|
73
|
+
* @param priceListId
|
|
74
|
+
*/
|
|
75
|
+
getByPriceList(priceListId: string): Promise<Array<LocalDatabaseCustomer>>;
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
import { BaseSearchableRepository } from "./BaseSearchableRepository.js";
|
|
3
|
+
export interface LocalDatabaseEnterprise {
|
|
4
|
+
auth: string;
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export type BaseEnterpriseRepository = BaseRepository<LocalDatabaseEnterprise> & BaseSearchableRepository<LocalDatabaseEnterprise>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export interface LocalDatabaseGiftCard {
|
|
3
|
+
client_id: string;
|
|
4
|
+
code: string;
|
|
5
|
+
current_amount: string;
|
|
6
|
+
expiry: string;
|
|
7
|
+
original_amount: string;
|
|
8
|
+
outlet_id: string;
|
|
9
|
+
status: "active" | "cancelled" | "pending";
|
|
10
|
+
updated_at: string;
|
|
11
|
+
uuid: string;
|
|
12
|
+
}
|
|
13
|
+
export interface BaseGiftCardRepository extends BaseRepository<LocalDatabaseGiftCard> {
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve all gift cards with the specified code
|
|
16
|
+
*/
|
|
17
|
+
code(code: string): Promise<Array<LocalDatabaseGiftCard>>;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
interface KitchenOrderItemComponent {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
quantity: number;
|
|
6
|
+
components: Array<KitchenOrderItemComponent>;
|
|
7
|
+
}
|
|
8
|
+
interface KitchenOrderItem {
|
|
9
|
+
id: string;
|
|
10
|
+
product: string;
|
|
11
|
+
ready: boolean;
|
|
12
|
+
category: string;
|
|
13
|
+
tags: Array<string>;
|
|
14
|
+
name: string;
|
|
15
|
+
quantity: number;
|
|
16
|
+
note: string;
|
|
17
|
+
components: Array<KitchenOrderItemComponent>;
|
|
18
|
+
}
|
|
19
|
+
interface KitchenOrder {
|
|
20
|
+
id: string;
|
|
21
|
+
register: string;
|
|
22
|
+
outlet: string;
|
|
23
|
+
invoiceId: string;
|
|
24
|
+
note: string;
|
|
25
|
+
internalNote: string;
|
|
26
|
+
saleTime: string;
|
|
27
|
+
customerName: null | string;
|
|
28
|
+
items: Array<KitchenOrderItem>;
|
|
29
|
+
}
|
|
30
|
+
export interface LocalKitchenOrder {
|
|
31
|
+
version: number;
|
|
32
|
+
id: string;
|
|
33
|
+
order: KitchenOrder;
|
|
34
|
+
}
|
|
35
|
+
export interface BaseKitchenOrderRepository extends BaseRepository<LocalKitchenOrder> {
|
|
36
|
+
/**
|
|
37
|
+
* Delete any orders below the specified version
|
|
38
|
+
*/
|
|
39
|
+
removeVersionsBefore(version: number): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export type KitchenDisplayRuleReady = "NOT_DONE" | "NOT_STARTED" | "STARTED" | "DONE";
|
|
3
|
+
export interface KitchenDisplayFilterRules {
|
|
4
|
+
ready: KitchenDisplayRuleReady;
|
|
5
|
+
categories: Array<string>;
|
|
6
|
+
tags: Array<string>;
|
|
7
|
+
registers: Array<string>;
|
|
8
|
+
outlets: Array<string>;
|
|
9
|
+
}
|
|
10
|
+
export interface LocalKitchenScreen {
|
|
11
|
+
uuid: string;
|
|
12
|
+
name: string;
|
|
13
|
+
rules: KitchenDisplayFilterRules;
|
|
14
|
+
}
|
|
15
|
+
export interface BaseKitchenScreenRepository extends BaseRepository<LocalKitchenScreen> {
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export interface LocalDatabaseLockedResource {
|
|
3
|
+
type: string;
|
|
4
|
+
uuid: string;
|
|
5
|
+
resource: string;
|
|
6
|
+
}
|
|
7
|
+
export interface BaseLockedResourceRepository extends BaseRepository<LocalDatabaseLockedResource> {
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve all locked resources with the specified resource
|
|
10
|
+
*/
|
|
11
|
+
getByResource(resource: string): Promise<LocalDatabaseLockedResource>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export type LoyaltyUnion = "brand" | "category" | "family" | "tag" | "product";
|
|
3
|
+
export interface LocalDatabaseLoyalty {
|
|
4
|
+
id: number;
|
|
5
|
+
loyalty_value: null | string;
|
|
6
|
+
quantity: string;
|
|
7
|
+
redeem_value: null | string;
|
|
8
|
+
type: LoyaltyUnion;
|
|
9
|
+
uuid: string;
|
|
10
|
+
}
|
|
11
|
+
export interface BaseLoyaltyRepository extends BaseRepository<LocalDatabaseLoyalty, number> {
|
|
12
|
+
/**
|
|
13
|
+
* Retrieve all loyalty rates with the specified ID and type
|
|
14
|
+
*/
|
|
15
|
+
getByType(id: string, type: LoyaltyUnion): Promise<Array<LocalDatabaseLoyalty>>;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export interface LocalDatabaseMovement {
|
|
3
|
+
amount: string;
|
|
4
|
+
denominations: Array<{
|
|
5
|
+
direction: "IN" | "OUT";
|
|
6
|
+
denomination: number;
|
|
7
|
+
amount: number;
|
|
8
|
+
}>;
|
|
9
|
+
paymentMethod: string;
|
|
10
|
+
reason: string;
|
|
11
|
+
register: string;
|
|
12
|
+
timestamp: string;
|
|
13
|
+
user: string;
|
|
14
|
+
uuid: string;
|
|
15
|
+
}
|
|
16
|
+
export type BaseMovementRepository = BaseRepository<LocalDatabaseMovement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LocalDatabaseContact } from "./BaseCustomerRepository.js";
|
|
2
|
+
import BaseRepository from "./BaseRepository.js";
|
|
3
|
+
export interface LocalDatabaseOutlet {
|
|
4
|
+
loyalty_enabled: boolean;
|
|
5
|
+
loyalty_name: string;
|
|
6
|
+
has_kitchen_screen: boolean;
|
|
7
|
+
name: string;
|
|
8
|
+
business_number: string;
|
|
9
|
+
contact: LocalDatabaseContact | null;
|
|
10
|
+
logo: string | null;
|
|
11
|
+
settings: Record<string, unknown>;
|
|
12
|
+
uuid: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BaseOutletRepository extends BaseRepository<LocalDatabaseOutlet> {
|
|
15
|
+
/**
|
|
16
|
+
* Update the outlet data
|
|
17
|
+
*/
|
|
18
|
+
update(id: string, changes: Partial<LocalDatabaseOutlet>): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
export type PaymentMethodTypeUnion = "global" | "cash" | "eftpos" | "giftcard" | "voucher" | "cheque" | "pc-eftpos" | "linkly-vaa" | "direct-deposit" | "tyro" | "custom";
|
|
3
|
+
export interface LocalDatabasePaymentMethod {
|
|
4
|
+
action: string;
|
|
5
|
+
actual_denominations: string;
|
|
6
|
+
allow_cash_out: boolean;
|
|
7
|
+
always_open_drawer: boolean;
|
|
8
|
+
always_print: boolean;
|
|
9
|
+
background_colour: string;
|
|
10
|
+
cashout_method_id: null | string;
|
|
11
|
+
default_pay_exact: boolean;
|
|
12
|
+
denominations: string;
|
|
13
|
+
gateway_url: string;
|
|
14
|
+
name: string;
|
|
15
|
+
surcharge: string;
|
|
16
|
+
text_colour: string;
|
|
17
|
+
type: PaymentMethodTypeUnion;
|
|
18
|
+
updated_at: string;
|
|
19
|
+
use_rounding: boolean;
|
|
20
|
+
uuid: string;
|
|
21
|
+
}
|
|
22
|
+
export interface BasePaymentMethodRepository extends BaseRepository<LocalDatabasePaymentMethod> {
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve all payment methods with the specified type
|
|
25
|
+
*/
|
|
26
|
+
getByType(type: PaymentMethodTypeUnion | Array<PaymentMethodTypeUnion>): Promise<Array<LocalDatabasePaymentMethod>>;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import BaseRepository from "./BaseRepository.js";
|
|
2
|
+
import { BaseSearchableRepository } from "./BaseSearchableRepository.js";
|
|
3
|
+
type Override<Original, ToOverride> = Omit<Original, keyof ToOverride> & ToOverride;
|
|
4
|
+
export type PriceListRuleBaseUnion = "discount-percentage" | "discount-amount" | "discount-item-amount" | "cost-percentage" | "cost-amount" | "last-cost-percentage" | "last-cost-amount";
|
|
5
|
+
export type PriceListRuleUnion = PriceListRuleBaseUnion | "override";
|
|
6
|
+
export interface PriceListRulePrice {
|
|
7
|
+
quantity: string;
|
|
8
|
+
price: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LocalDatabasePriceListFallback {
|
|
11
|
+
min_rule: "no-minimum" | PriceListRuleBaseUnion;
|
|
12
|
+
min_rule_amount: string;
|
|
13
|
+
rule: PriceListRuleBaseUnion;
|
|
14
|
+
rule_amount: string;
|
|
15
|
+
}
|
|
16
|
+
export interface LocalDatabasePriceListRule extends LocalDatabasePriceListFallback {
|
|
17
|
+
uuid: string;
|
|
18
|
+
}
|
|
19
|
+
export type LocalDatabasePriceListWithPricesRule = Override<LocalDatabasePriceListRule, {
|
|
20
|
+
min_rule: "no-minimum" | PriceListRuleUnion;
|
|
21
|
+
rule: PriceListRuleUnion;
|
|
22
|
+
min_prices: Array<PriceListRulePrice>;
|
|
23
|
+
prices: Array<PriceListRulePrice>;
|
|
24
|
+
}>;
|
|
25
|
+
export type PriceListItemTypeUnion = "products" | "categories" | "brands" | "families" | "tags";
|
|
26
|
+
export interface LocalDatabasePriceList {
|
|
27
|
+
active: boolean;
|
|
28
|
+
allow_higher_price: boolean;
|
|
29
|
+
brands: Array<LocalDatabasePriceListRule>;
|
|
30
|
+
categories: Array<LocalDatabasePriceListRule>;
|
|
31
|
+
families: Array<LocalDatabasePriceListWithPricesRule>;
|
|
32
|
+
tags: Array<LocalDatabasePriceListRule>;
|
|
33
|
+
excludes: Record<PriceListItemTypeUnion, Array<string>>;
|
|
34
|
+
fallback_rule: null | LocalDatabasePriceListFallback;
|
|
35
|
+
name: string;
|
|
36
|
+
products: Array<LocalDatabasePriceListWithPricesRule>;
|
|
37
|
+
uuid: string;
|
|
38
|
+
}
|
|
39
|
+
export type BasePriceListRepository = BaseRepository<LocalDatabasePriceList> & BaseSearchableRepository<LocalDatabasePriceList>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|