@shopfront/bridge 2.0.0 → 2.0.2
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 +481 -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
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SaleProduct = void 0;
|
|
4
|
-
class SaleProduct {
|
|
5
|
-
constructor(id, quantity, price, indexAddress) {
|
|
6
|
-
this.metaData = {};
|
|
7
|
-
this.id = id;
|
|
8
|
-
this.quantity = quantity;
|
|
9
|
-
this.price = price;
|
|
10
|
-
this.indexAddress = indexAddress || [];
|
|
11
|
-
this.contains = [];
|
|
12
|
-
this.edited = typeof price !== "undefined";
|
|
13
|
-
this.note = "";
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Hydrate a sale product from the SaleState.
|
|
17
|
-
*
|
|
18
|
-
* @internal
|
|
19
|
-
* @param {ShopfrontSaleProduct} product
|
|
20
|
-
* @param {Array<number>} indexAddress
|
|
21
|
-
* @returns {SaleProduct}
|
|
22
|
-
* @constructor
|
|
23
|
-
*/
|
|
24
|
-
static HydrateFromState(product, indexAddress) {
|
|
25
|
-
const hydrated = new SaleProduct(product.uuid, product.quantity, product.prices.price, indexAddress);
|
|
26
|
-
hydrated.setInternal(product, indexAddress);
|
|
27
|
-
return hydrated;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Append a product to this product's list of contained products.
|
|
31
|
-
*
|
|
32
|
-
* @protected
|
|
33
|
-
* @param {SaleProduct} product
|
|
34
|
-
*/
|
|
35
|
-
appendProduct(product) {
|
|
36
|
-
this.contains.push(product);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Set the internal data for the product.
|
|
40
|
-
* This method is for hydration of the product from Shopfront, it's highly recommend that you DO NOT use this method.
|
|
41
|
-
*
|
|
42
|
-
* @internal
|
|
43
|
-
* @param {ShopfrontSaleProduct} data
|
|
44
|
-
* @param {Array<number>} indexAddress
|
|
45
|
-
*/
|
|
46
|
-
setInternal(data, indexAddress) {
|
|
47
|
-
this.name = data.name;
|
|
48
|
-
this.type = data.type;
|
|
49
|
-
this.taxRateAmount = data.tax?.amount || 0;
|
|
50
|
-
this.note = data.note;
|
|
51
|
-
this.edited = data.edited;
|
|
52
|
-
this.caseQuantity = data.caseQuantity;
|
|
53
|
-
this.metaData = data.metaData;
|
|
54
|
-
for (let i = 0, l = data.products.length; i < l; i++) {
|
|
55
|
-
this.appendProduct(SaleProduct.HydrateFromState(data.products[i], [
|
|
56
|
-
...indexAddress,
|
|
57
|
-
i,
|
|
58
|
-
]));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Get the ID of the product.
|
|
63
|
-
* @returns {string}
|
|
64
|
-
*/
|
|
65
|
-
getId() {
|
|
66
|
-
return this.id;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Get the current sale quantity of the product.
|
|
70
|
-
* @returns {number}
|
|
71
|
-
*/
|
|
72
|
-
getQuantity() {
|
|
73
|
-
return this.quantity;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Get the current price of the product.
|
|
77
|
-
* @returns {number | undefined}
|
|
78
|
-
*/
|
|
79
|
-
getPrice() {
|
|
80
|
-
return this.price;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Get the index address of the product.
|
|
84
|
-
* This is the internal address of where the product is in the sale.
|
|
85
|
-
* (e.g. if the address is [1, 3] it's the fourth contained product in the second sale line).
|
|
86
|
-
*
|
|
87
|
-
* @returns {Array<number>}
|
|
88
|
-
*/
|
|
89
|
-
getIndexAddress() {
|
|
90
|
-
return this.indexAddress;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Get the name of the product.
|
|
94
|
-
*
|
|
95
|
-
* @returns {string | undefined}
|
|
96
|
-
*/
|
|
97
|
-
getName() {
|
|
98
|
-
return this.name;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Get the type of product this product is.
|
|
102
|
-
*
|
|
103
|
-
* @returns {ShopfrontSaleProductType | undefined}
|
|
104
|
-
*/
|
|
105
|
-
getType() {
|
|
106
|
-
return this.type;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Get the tax rate amount.
|
|
110
|
-
* This is the rate of the tax rate (e.g. 10 is a tax rate of 10%).
|
|
111
|
-
*
|
|
112
|
-
* @returns {number | undefined}
|
|
113
|
-
*/
|
|
114
|
-
getTaxRateAmount() {
|
|
115
|
-
return this.taxRateAmount;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Get the sale note attached to this product.
|
|
119
|
-
*
|
|
120
|
-
* @returns {string}
|
|
121
|
-
*/
|
|
122
|
-
getNote() {
|
|
123
|
-
return this.note;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Get the products this product contains.
|
|
127
|
-
*
|
|
128
|
-
* @returns {Array<SaleProduct>}
|
|
129
|
-
*/
|
|
130
|
-
getContains() {
|
|
131
|
-
return this.contains;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Get whether this product has been "edited".
|
|
135
|
-
* Typically, being edited just means that this product has been discounted.
|
|
136
|
-
*
|
|
137
|
-
* @returns {boolean}
|
|
138
|
-
*/
|
|
139
|
-
getEdited() {
|
|
140
|
-
return this.edited;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Get the case quantity for this product.
|
|
144
|
-
*
|
|
145
|
-
* @returns {number | undefined}
|
|
146
|
-
*/
|
|
147
|
-
getCaseQuantity() {
|
|
148
|
-
return this.caseQuantity;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Get the meta data for the product.
|
|
152
|
-
*
|
|
153
|
-
* @returns {Record<string, unknown>}
|
|
154
|
-
*/
|
|
155
|
-
getMetaData() {
|
|
156
|
-
return this.metaData;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Set the metaData for a product
|
|
160
|
-
* @param key
|
|
161
|
-
* @param value
|
|
162
|
-
*/
|
|
163
|
-
setMetaData(key, value) {
|
|
164
|
-
this.metaData[key] = value;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
exports.SaleProduct = SaleProduct;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export declare type ShopfrontSalePaymentStatus = "completed" | "cancelled" | "failed";
|
|
2
|
-
export declare type ShopfrontSaleProductType = "Normal" | "Basket" | "Package" | "Component" | "Voucher";
|
|
3
|
-
export interface ShopfrontSaleProduct {
|
|
4
|
-
uuid: string;
|
|
5
|
-
type: ShopfrontSaleProductType;
|
|
6
|
-
name: string;
|
|
7
|
-
quantity: number;
|
|
8
|
-
prices: {
|
|
9
|
-
price: number;
|
|
10
|
-
normal: number;
|
|
11
|
-
};
|
|
12
|
-
tax: null | {
|
|
13
|
-
id: string;
|
|
14
|
-
amount: number;
|
|
15
|
-
};
|
|
16
|
-
note: string;
|
|
17
|
-
products: Array<ShopfrontSaleProduct>;
|
|
18
|
-
edited: boolean;
|
|
19
|
-
caseQuantity: number;
|
|
20
|
-
metaData: Record<string, unknown>;
|
|
21
|
-
}
|
|
22
|
-
interface ShopfrontSaleCustomer {
|
|
23
|
-
uuid: string;
|
|
24
|
-
}
|
|
25
|
-
export interface ShopfrontSalePayment {
|
|
26
|
-
method: string;
|
|
27
|
-
type: string;
|
|
28
|
-
status: ShopfrontSalePaymentStatus;
|
|
29
|
-
amount: number;
|
|
30
|
-
cashout: number;
|
|
31
|
-
rounding: number;
|
|
32
|
-
}
|
|
33
|
-
export interface ShopfrontSaleState {
|
|
34
|
-
products: Array<ShopfrontSaleProduct>;
|
|
35
|
-
customer: false | ShopfrontSaleCustomer;
|
|
36
|
-
payments: Array<ShopfrontSalePayment>;
|
|
37
|
-
notes: {
|
|
38
|
-
internal: string;
|
|
39
|
-
sale: string;
|
|
40
|
-
};
|
|
41
|
-
totals: {
|
|
42
|
-
sale: number;
|
|
43
|
-
paid: number;
|
|
44
|
-
savings: number;
|
|
45
|
-
discount: number;
|
|
46
|
-
};
|
|
47
|
-
linkedTo: string;
|
|
48
|
-
orderReference: string;
|
|
49
|
-
refundReason: string;
|
|
50
|
-
priceSet: string | null;
|
|
51
|
-
metaData: Record<string, unknown>;
|
|
52
|
-
}
|
|
53
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { Sale } from "./Sale";
|
|
2
|
-
export { SaleProduct } from "./SaleProduct";
|
|
3
|
-
export { SalePayment } from "./SalePayment";
|
|
4
|
-
export { SalePaymentStatus } from "./SalePayment";
|
|
5
|
-
export { SaleCustomer } from "./SaleCustomer";
|
|
6
|
-
export * as Exceptions from "./Exceptions";
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Exceptions = exports.SaleCustomer = exports.SalePaymentStatus = exports.SalePayment = exports.SaleProduct = exports.Sale = void 0;
|
|
27
|
-
var Sale_1 = require("./Sale");
|
|
28
|
-
Object.defineProperty(exports, "Sale", { enumerable: true, get: function () { return Sale_1.Sale; } });
|
|
29
|
-
var SaleProduct_1 = require("./SaleProduct");
|
|
30
|
-
Object.defineProperty(exports, "SaleProduct", { enumerable: true, get: function () { return SaleProduct_1.SaleProduct; } });
|
|
31
|
-
var SalePayment_1 = require("./SalePayment");
|
|
32
|
-
Object.defineProperty(exports, "SalePayment", { enumerable: true, get: function () { return SalePayment_1.SalePayment; } });
|
|
33
|
-
var SalePayment_2 = require("./SalePayment");
|
|
34
|
-
Object.defineProperty(exports, "SalePaymentStatus", { enumerable: true, get: function () { return SalePayment_2.SalePaymentStatus; } });
|
|
35
|
-
var SaleCustomer_1 = require("./SaleCustomer");
|
|
36
|
-
Object.defineProperty(exports, "SaleCustomer", { enumerable: true, get: function () { return SaleCustomer_1.SaleCustomer; } });
|
|
37
|
-
exports.Exceptions = __importStar(require("./Exceptions"));
|
|
File without changes
|