@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,132 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { SaleUpdate, SaleUpdateChanges } from "../../Actions/SaleUpdate";
|
|
8
|
-
export declare class CurrentSale extends BaseSale {
|
|
9
|
-
protected application: Application;
|
|
10
|
-
protected cancelled: boolean;
|
|
1
|
+
import { SaleUpdate, SaleUpdateChanges } from "../../Actions/SaleUpdate.js";
|
|
2
|
+
import { BaseCurrentSale } from "./BaseCurrentSale.js";
|
|
3
|
+
import { SaleCustomer } from "./SaleCustomer.js";
|
|
4
|
+
import { SalePayment } from "./SalePayment.js";
|
|
5
|
+
import { SaleProduct } from "./SaleProduct.js";
|
|
6
|
+
export declare class CurrentSale extends BaseCurrentSale {
|
|
11
7
|
/**
|
|
12
|
-
*
|
|
13
|
-
* It's highly recommend to not construct a sale manually, instead use application.getCurrentSale().
|
|
14
|
-
*
|
|
15
|
-
* @param {Application} application
|
|
16
|
-
* @param {ShopfrontSaleState} saleState
|
|
17
|
-
*/
|
|
18
|
-
constructor(application: Application, saleState: ShopfrontSaleState);
|
|
19
|
-
/**
|
|
20
|
-
* Update the sale to be the latest sale that exists on the sell screen.
|
|
21
|
-
*
|
|
22
|
-
* @returns {Promise<void>}
|
|
8
|
+
* @inheritDoc
|
|
23
9
|
*/
|
|
24
10
|
refreshSale(): Promise<void>;
|
|
25
11
|
/**
|
|
26
12
|
* Check if the sale has already been cancelled, if it has, throw a SaleCancelledError.
|
|
27
|
-
*
|
|
28
|
-
* @protected
|
|
29
13
|
*/
|
|
30
14
|
protected checkIfCancelled(): void;
|
|
31
15
|
/**
|
|
32
16
|
* Send a sale update to Shopfront.
|
|
33
|
-
*
|
|
34
|
-
* @protected
|
|
35
|
-
* @param {SaleUpdate} update
|
|
36
|
-
* @returns {Promise<void>}
|
|
37
17
|
*/
|
|
38
18
|
protected sendSaleUpdate(update: SaleUpdate<keyof SaleUpdateChanges>): Promise<void>;
|
|
39
19
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* @returns {Promise<void>}
|
|
20
|
+
* @inheritDoc
|
|
43
21
|
*/
|
|
44
22
|
cancelSale(): Promise<void>;
|
|
45
23
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* @param {SaleProduct} product
|
|
49
|
-
* @returns {Promise<void>}
|
|
24
|
+
* @inheritDoc
|
|
50
25
|
*/
|
|
51
26
|
addProduct(product: SaleProduct): Promise<void>;
|
|
52
27
|
/**
|
|
53
|
-
*
|
|
54
|
-
* It's highly recommended that you pass in a product that has been retrieved using sale.getProducts().
|
|
55
|
-
*
|
|
56
|
-
* @param {SaleProduct} product
|
|
57
|
-
* @returns {Promise<void>}
|
|
28
|
+
* @inheritDoc
|
|
58
29
|
*/
|
|
59
30
|
removeProduct(product: SaleProduct): Promise<void>;
|
|
60
31
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* If you specify a payment with a status, it will bypass the payment gateway (i.e. it won't request that the
|
|
64
|
-
* user takes money from the customer).
|
|
65
|
-
*
|
|
66
|
-
* If you don't specify a cashout amount, it will automatically determine if the payment method normally requests
|
|
67
|
-
* cashout (from the payment method settings).
|
|
68
|
-
*
|
|
69
|
-
* @param {SalePayment} payment
|
|
70
|
-
* @returns {Promise<void>}
|
|
32
|
+
* @inheritDoc
|
|
71
33
|
*/
|
|
72
34
|
addPayment(payment: SalePayment): Promise<void>;
|
|
73
35
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* This is used to issue a refund to the customer. The sale payment amount should be positive.
|
|
77
|
-
*
|
|
78
|
-
* @param {SalePayment} payment
|
|
79
|
-
* @returns {Promise<void>}
|
|
36
|
+
* @inheritDoc
|
|
80
37
|
*/
|
|
81
38
|
reversePayment(payment: SalePayment): Promise<void>;
|
|
82
39
|
/**
|
|
83
|
-
*
|
|
84
|
-
* If there is already a customer on the sale this will override that customer.
|
|
85
|
-
*
|
|
86
|
-
* @param {SaleCustomer} customer
|
|
87
|
-
* @returns {Promise<void>}
|
|
40
|
+
* @inheritDoc
|
|
88
41
|
*/
|
|
89
42
|
addCustomer(customer: SaleCustomer): Promise<void>;
|
|
90
43
|
/**
|
|
91
|
-
*
|
|
92
|
-
* If there is no customer currently on the sale this will be ignored.
|
|
93
|
-
* If there are "on account" or loyalty payments still on the sale, this will be ignored.
|
|
94
|
-
*
|
|
95
|
-
* @returns {Promise<void>}
|
|
44
|
+
* @inheritDoc
|
|
96
45
|
*/
|
|
97
46
|
removeCustomer(): Promise<void>;
|
|
98
47
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* @param {string} note The note to set.
|
|
102
|
-
* @param {boolean} append Whether to append the note to the current sale note.
|
|
103
|
-
* @returns {Promise<void>}
|
|
48
|
+
* @inheritDoc
|
|
104
49
|
*/
|
|
105
50
|
setExternalNote(note: string, append?: boolean): Promise<void>;
|
|
106
51
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* @param {string} note The note to set.
|
|
110
|
-
* @param {boolean} append Whether to append the note to the current sale note.
|
|
111
|
-
* @returns {Promise<void>}
|
|
52
|
+
* @inheritDoc
|
|
112
53
|
*/
|
|
113
54
|
setInternalNote(note: string, append?: boolean): Promise<void>;
|
|
114
55
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* @param {string} reference
|
|
118
|
-
* @returns {Promise<void>}
|
|
56
|
+
* @inheritDoc
|
|
119
57
|
*/
|
|
120
58
|
setOrderReference(reference: string): Promise<void>;
|
|
121
59
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* @param metaData
|
|
60
|
+
* @inheritDoc
|
|
125
61
|
*/
|
|
126
62
|
setMetaData(metaData: Record<string, unknown>): Promise<void>;
|
|
127
63
|
/**
|
|
128
|
-
*
|
|
129
|
-
* @param product
|
|
64
|
+
* @inheritDoc
|
|
130
65
|
*/
|
|
131
66
|
updateProduct(product: SaleProduct): Promise<void>;
|
|
132
67
|
}
|
|
@@ -1,52 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const SaleUpdate_1 = require("../../Actions/SaleUpdate");
|
|
6
|
-
const Exceptions_1 = require("./Exceptions");
|
|
7
|
-
const Sale_1 = require("./Sale");
|
|
8
|
-
class CurrentSale extends BaseSale_1.BaseSale {
|
|
1
|
+
import { SaleUpdate } from "../../Actions/SaleUpdate.js";
|
|
2
|
+
import { BaseCurrentSale } from "./BaseCurrentSale.js";
|
|
3
|
+
import { InvalidSaleDeviceError, SaleCancelledError } from "./Exceptions.js";
|
|
4
|
+
export class CurrentSale extends BaseCurrentSale {
|
|
9
5
|
/**
|
|
10
|
-
*
|
|
11
|
-
* It's highly recommend to not construct a sale manually, instead use application.getCurrentSale().
|
|
12
|
-
*
|
|
13
|
-
* @param {Application} application
|
|
14
|
-
* @param {ShopfrontSaleState} saleState
|
|
15
|
-
*/
|
|
16
|
-
constructor(application, saleState) {
|
|
17
|
-
super(Sale_1.Sale.buildSaleData(saleState));
|
|
18
|
-
this.application = application;
|
|
19
|
-
this.cancelled = false;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Update the sale to be the latest sale that exists on the sell screen.
|
|
23
|
-
*
|
|
24
|
-
* @returns {Promise<void>}
|
|
6
|
+
* @inheritDoc
|
|
25
7
|
*/
|
|
26
8
|
async refreshSale() {
|
|
27
9
|
this.checkIfCancelled();
|
|
28
10
|
const newSale = await this.application.getCurrentSale();
|
|
29
11
|
if (newSale === false) {
|
|
30
|
-
throw new
|
|
12
|
+
throw new InvalidSaleDeviceError();
|
|
31
13
|
}
|
|
32
14
|
this.hydrate(newSale);
|
|
33
15
|
}
|
|
34
16
|
/**
|
|
35
17
|
* Check if the sale has already been cancelled, if it has, throw a SaleCancelledError.
|
|
36
|
-
*
|
|
37
|
-
* @protected
|
|
38
18
|
*/
|
|
39
19
|
checkIfCancelled() {
|
|
40
20
|
if (this.cancelled) {
|
|
41
|
-
throw new
|
|
21
|
+
throw new SaleCancelledError();
|
|
42
22
|
}
|
|
43
23
|
}
|
|
44
24
|
/**
|
|
45
25
|
* Send a sale update to Shopfront.
|
|
46
|
-
*
|
|
47
|
-
* @protected
|
|
48
|
-
* @param {SaleUpdate} update
|
|
49
|
-
* @returns {Promise<void>}
|
|
50
26
|
*/
|
|
51
27
|
sendSaleUpdate(update) {
|
|
52
28
|
this.checkIfCancelled();
|
|
@@ -54,22 +30,17 @@ class CurrentSale extends BaseSale_1.BaseSale {
|
|
|
54
30
|
return this.refreshSale();
|
|
55
31
|
}
|
|
56
32
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* @returns {Promise<void>}
|
|
33
|
+
* @inheritDoc
|
|
60
34
|
*/
|
|
61
35
|
async cancelSale() {
|
|
62
|
-
await this.sendSaleUpdate(new
|
|
36
|
+
await this.sendSaleUpdate(new SaleUpdate("SALE_CANCEL", {}));
|
|
63
37
|
this.cancelled = true;
|
|
64
38
|
}
|
|
65
39
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* @param {SaleProduct} product
|
|
69
|
-
* @returns {Promise<void>}
|
|
40
|
+
* @inheritDoc
|
|
70
41
|
*/
|
|
71
42
|
addProduct(product) {
|
|
72
|
-
return this.sendSaleUpdate(new
|
|
43
|
+
return this.sendSaleUpdate(new SaleUpdate("PRODUCT_ADD", {
|
|
73
44
|
id: product.getId(),
|
|
74
45
|
quantity: product.getQuantity(),
|
|
75
46
|
price: product.getPrice(),
|
|
@@ -78,32 +49,19 @@ class CurrentSale extends BaseSale_1.BaseSale {
|
|
|
78
49
|
}));
|
|
79
50
|
}
|
|
80
51
|
/**
|
|
81
|
-
*
|
|
82
|
-
* It's highly recommended that you pass in a product that has been retrieved using sale.getProducts().
|
|
83
|
-
*
|
|
84
|
-
* @param {SaleProduct} product
|
|
85
|
-
* @returns {Promise<void>}
|
|
52
|
+
* @inheritDoc
|
|
86
53
|
*/
|
|
87
54
|
removeProduct(product) {
|
|
88
|
-
return this.sendSaleUpdate(new
|
|
55
|
+
return this.sendSaleUpdate(new SaleUpdate("PRODUCT_REMOVE", {
|
|
89
56
|
id: product.getId(),
|
|
90
57
|
indexAddress: product.getIndexAddress(),
|
|
91
58
|
}));
|
|
92
59
|
}
|
|
93
60
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* If you specify a payment with a status, it will bypass the payment gateway (i.e. it won't request that the
|
|
97
|
-
* user takes money from the customer).
|
|
98
|
-
*
|
|
99
|
-
* If you don't specify a cashout amount, it will automatically determine if the payment method normally requests
|
|
100
|
-
* cashout (from the payment method settings).
|
|
101
|
-
*
|
|
102
|
-
* @param {SalePayment} payment
|
|
103
|
-
* @returns {Promise<void>}
|
|
61
|
+
* @inheritDoc
|
|
104
62
|
*/
|
|
105
63
|
addPayment(payment) {
|
|
106
|
-
return this.sendSaleUpdate(new
|
|
64
|
+
return this.sendSaleUpdate(new SaleUpdate("PAYMENT_ADD", {
|
|
107
65
|
id: payment.getId(),
|
|
108
66
|
amount: payment.getAmount(),
|
|
109
67
|
cashout: payment.getCashout(),
|
|
@@ -111,15 +69,10 @@ class CurrentSale extends BaseSale_1.BaseSale {
|
|
|
111
69
|
}));
|
|
112
70
|
}
|
|
113
71
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* This is used to issue a refund to the customer. The sale payment amount should be positive.
|
|
117
|
-
*
|
|
118
|
-
* @param {SalePayment} payment
|
|
119
|
-
* @returns {Promise<void>}
|
|
72
|
+
* @inheritDoc
|
|
120
73
|
*/
|
|
121
74
|
reversePayment(payment) {
|
|
122
|
-
return this.sendSaleUpdate(new
|
|
75
|
+
return this.sendSaleUpdate(new SaleUpdate("PAYMENT_REVERSE", {
|
|
123
76
|
id: payment.getId(),
|
|
124
77
|
amount: payment.getAmount(),
|
|
125
78
|
cashout: payment.getCashout(),
|
|
@@ -127,82 +80,60 @@ class CurrentSale extends BaseSale_1.BaseSale {
|
|
|
127
80
|
}));
|
|
128
81
|
}
|
|
129
82
|
/**
|
|
130
|
-
*
|
|
131
|
-
* If there is already a customer on the sale this will override that customer.
|
|
132
|
-
*
|
|
133
|
-
* @param {SaleCustomer} customer
|
|
134
|
-
* @returns {Promise<void>}
|
|
83
|
+
* @inheritDoc
|
|
135
84
|
*/
|
|
136
85
|
addCustomer(customer) {
|
|
137
|
-
return this.sendSaleUpdate(new
|
|
86
|
+
return this.sendSaleUpdate(new SaleUpdate("CUSTOMER_ADD", {
|
|
138
87
|
id: customer.getId(),
|
|
139
88
|
}));
|
|
140
89
|
}
|
|
141
90
|
/**
|
|
142
|
-
*
|
|
143
|
-
* If there is no customer currently on the sale this will be ignored.
|
|
144
|
-
* If there are "on account" or loyalty payments still on the sale, this will be ignored.
|
|
145
|
-
*
|
|
146
|
-
* @returns {Promise<void>}
|
|
91
|
+
* @inheritDoc
|
|
147
92
|
*/
|
|
148
93
|
removeCustomer() {
|
|
149
|
-
return this.sendSaleUpdate(new
|
|
94
|
+
return this.sendSaleUpdate(new SaleUpdate("CUSTOMER_REMOVE", {}));
|
|
150
95
|
}
|
|
151
96
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* @param {string} note The note to set.
|
|
155
|
-
* @param {boolean} append Whether to append the note to the current sale note.
|
|
156
|
-
* @returns {Promise<void>}
|
|
97
|
+
* @inheritDoc
|
|
157
98
|
*/
|
|
158
99
|
setExternalNote(note, append = false) {
|
|
159
|
-
return this.sendSaleUpdate(new
|
|
100
|
+
return this.sendSaleUpdate(new SaleUpdate("SALE_EXTERNAL_NOTE", {
|
|
160
101
|
note,
|
|
161
102
|
append,
|
|
162
103
|
}));
|
|
163
104
|
}
|
|
164
105
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* @param {string} note The note to set.
|
|
168
|
-
* @param {boolean} append Whether to append the note to the current sale note.
|
|
169
|
-
* @returns {Promise<void>}
|
|
106
|
+
* @inheritDoc
|
|
170
107
|
*/
|
|
171
108
|
setInternalNote(note, append = false) {
|
|
172
|
-
return this.sendSaleUpdate(new
|
|
109
|
+
return this.sendSaleUpdate(new SaleUpdate("SALE_INTERNAL_NOTE", {
|
|
173
110
|
note,
|
|
174
111
|
append,
|
|
175
112
|
}));
|
|
176
113
|
}
|
|
177
114
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* @param {string} reference
|
|
181
|
-
* @returns {Promise<void>}
|
|
115
|
+
* @inheritDoc
|
|
182
116
|
*/
|
|
183
117
|
setOrderReference(reference) {
|
|
184
|
-
return this.sendSaleUpdate(new
|
|
118
|
+
return this.sendSaleUpdate(new SaleUpdate("SALE_ORDER_REFERENCE", {
|
|
185
119
|
reference,
|
|
186
120
|
}));
|
|
187
121
|
}
|
|
188
122
|
/**
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* @param metaData
|
|
123
|
+
* @inheritDoc
|
|
192
124
|
*/
|
|
193
125
|
setMetaData(metaData) {
|
|
194
|
-
return this.sendSaleUpdate(new
|
|
126
|
+
return this.sendSaleUpdate(new SaleUpdate("SALE_META_DATA", {
|
|
195
127
|
metaData,
|
|
196
128
|
}));
|
|
197
129
|
}
|
|
198
130
|
/**
|
|
199
|
-
*
|
|
200
|
-
* @param product
|
|
131
|
+
* @inheritDoc
|
|
201
132
|
*/
|
|
202
133
|
updateProduct(product) {
|
|
203
134
|
const updateData = {
|
|
204
135
|
id: product.getId(),
|
|
205
|
-
indexAddress: product.getIndexAddress()
|
|
136
|
+
indexAddress: product.getIndexAddress(),
|
|
206
137
|
};
|
|
207
138
|
if (product.wasQuantityModified()) {
|
|
208
139
|
updateData.quantity = product.getQuantity();
|
|
@@ -214,7 +145,6 @@ class CurrentSale extends BaseSale_1.BaseSale {
|
|
|
214
145
|
updateData.metaData = product.getMetaData();
|
|
215
146
|
}
|
|
216
147
|
product.clearModificationFlags();
|
|
217
|
-
return this.sendSaleUpdate(new
|
|
148
|
+
return this.sendSaleUpdate(new SaleUpdate("PRODUCT_UPDATE", updateData));
|
|
218
149
|
}
|
|
219
150
|
}
|
|
220
|
-
exports.CurrentSale = CurrentSale;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InvalidSaleDeviceError = exports.SaleCancelledError = void 0;
|
|
4
|
-
class SaleCancelledError extends Error {
|
|
1
|
+
export class SaleCancelledError extends Error {
|
|
5
2
|
constructor() {
|
|
6
3
|
super("The sale is no longer active.");
|
|
7
4
|
}
|
|
8
5
|
}
|
|
9
|
-
|
|
10
|
-
class InvalidSaleDeviceError extends Error {
|
|
6
|
+
export class InvalidSaleDeviceError extends Error {
|
|
11
7
|
constructor() {
|
|
12
8
|
super("This device is no longer a register able to perform a sale.");
|
|
13
9
|
}
|
|
14
10
|
}
|
|
15
|
-
|
|
11
|
+
export class ProductNotExistsError extends Error {
|
|
12
|
+
constructor() {
|
|
13
|
+
super("Product does not exist in the sale");
|
|
14
|
+
}
|
|
15
|
+
}
|
package/lib/APIs/Sale/Sale.d.ts
CHANGED
|
@@ -1,23 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ShopfrontSaleState } from "./ShopfrontSaleState";
|
|
1
|
+
import { Application } from "../../Application.js";
|
|
2
|
+
import { BaseSale, SaleData } from "./BaseSale.js";
|
|
3
|
+
import { SaleCustomer } from "./SaleCustomer.js";
|
|
4
|
+
import { SalePayment } from "./SalePayment.js";
|
|
5
|
+
import { SaleProduct } from "./SaleProduct.js";
|
|
6
|
+
import { ShopfrontSaleState } from "./ShopfrontSaleState.js";
|
|
7
7
|
export declare class Sale extends BaseSale {
|
|
8
8
|
protected created: boolean;
|
|
9
9
|
protected creating: boolean;
|
|
10
10
|
constructor(data: SaleData);
|
|
11
|
+
/**
|
|
12
|
+
* Add a customer to the sale
|
|
13
|
+
*/
|
|
11
14
|
addCustomer(customer: SaleCustomer): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Add a payment to the sale
|
|
17
|
+
*/
|
|
12
18
|
addPayment(payment: SalePayment): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Add a product to the sale
|
|
21
|
+
*/
|
|
13
22
|
addProduct(product: SaleProduct): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Remove the customer from the sale
|
|
25
|
+
*/
|
|
14
26
|
removeCustomer(): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Remove a product from the sale
|
|
29
|
+
*/
|
|
15
30
|
removeProduct(product: SaleProduct): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Remove a payment from the sale
|
|
33
|
+
*/
|
|
16
34
|
removePayment(payment: SalePayment): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Add / append an external note to the sale
|
|
37
|
+
*/
|
|
17
38
|
setExternalNote(note: string, append?: boolean): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Add / append an internal note to the sale
|
|
41
|
+
*/
|
|
18
42
|
setInternalNote(note: string, append?: boolean): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Set the sale's meta-data
|
|
45
|
+
*/
|
|
19
46
|
setMetaData(metaData: Record<string, unknown>): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Set the sale's order reference
|
|
49
|
+
*/
|
|
20
50
|
setOrderReference(reference: string): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Update a product in the sale
|
|
53
|
+
*/
|
|
21
54
|
updateProduct(product: SaleProduct): Promise<void>;
|
|
22
55
|
/**
|
|
23
56
|
* Create the sale on the server
|
|
@@ -28,7 +61,6 @@ export declare class Sale extends BaseSale {
|
|
|
28
61
|
}>;
|
|
29
62
|
/**
|
|
30
63
|
* Converts the sale state to the sale data
|
|
31
|
-
* @param saleState
|
|
32
64
|
*/
|
|
33
65
|
static buildSaleData(saleState: ShopfrontSaleState): SaleData;
|
|
34
66
|
}
|
package/lib/APIs/Sale/Sale.js
CHANGED
|
@@ -1,34 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const SalePayment_1 = require("./SalePayment");
|
|
7
|
-
const SaleProduct_1 = require("./SaleProduct");
|
|
8
|
-
class Sale extends BaseSale_1.BaseSale {
|
|
1
|
+
import { BaseSale } from "./BaseSale.js";
|
|
2
|
+
import { SaleCustomer } from "./SaleCustomer.js";
|
|
3
|
+
import { SalePayment } from "./SalePayment.js";
|
|
4
|
+
import { SaleProduct } from "./SaleProduct.js";
|
|
5
|
+
export class Sale extends BaseSale {
|
|
9
6
|
constructor(data) {
|
|
10
7
|
super(data);
|
|
11
8
|
this.created = false;
|
|
12
9
|
this.creating = false;
|
|
13
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Add a customer to the sale
|
|
13
|
+
*/
|
|
14
14
|
async addCustomer(customer) {
|
|
15
15
|
this.customer = customer;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Add a payment to the sale
|
|
19
|
+
*/
|
|
17
20
|
async addPayment(payment) {
|
|
18
21
|
if (this.payments.find(p => p.internalId === payment.internalId)) {
|
|
19
22
|
throw new TypeError("Payment has already been added to sale.");
|
|
20
23
|
}
|
|
21
24
|
this.payments.push(payment);
|
|
22
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Add a product to the sale
|
|
28
|
+
*/
|
|
23
29
|
async addProduct(product) {
|
|
24
30
|
if (this.products.find(p => p.internalId === product.internalId)) {
|
|
25
31
|
throw new TypeError("Product has already been added to sale.");
|
|
26
32
|
}
|
|
27
33
|
this.products.push(product);
|
|
28
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Remove the customer from the sale
|
|
37
|
+
*/
|
|
29
38
|
async removeCustomer() {
|
|
30
39
|
this.customer = null;
|
|
31
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Remove a product from the sale
|
|
43
|
+
*/
|
|
32
44
|
async removeProduct(product) {
|
|
33
45
|
const index = this.products.findIndex(p => p.internalId === product.internalId);
|
|
34
46
|
if (index === -1) {
|
|
@@ -36,6 +48,9 @@ class Sale extends BaseSale_1.BaseSale {
|
|
|
36
48
|
}
|
|
37
49
|
this.products.splice(index, 1);
|
|
38
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Remove a payment from the sale
|
|
53
|
+
*/
|
|
39
54
|
async removePayment(payment) {
|
|
40
55
|
const index = this.payments.findIndex(p => p.internalId === payment.internalId);
|
|
41
56
|
if (index === -1) {
|
|
@@ -43,6 +58,9 @@ class Sale extends BaseSale_1.BaseSale {
|
|
|
43
58
|
}
|
|
44
59
|
this.payments.splice(index, 1);
|
|
45
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Add / append an external note to the sale
|
|
63
|
+
*/
|
|
46
64
|
async setExternalNote(note, append) {
|
|
47
65
|
if (append) {
|
|
48
66
|
this.sale.notes.sale += note;
|
|
@@ -51,6 +69,9 @@ class Sale extends BaseSale_1.BaseSale {
|
|
|
51
69
|
this.sale.notes.sale = note;
|
|
52
70
|
}
|
|
53
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Add / append an internal note to the sale
|
|
74
|
+
*/
|
|
54
75
|
async setInternalNote(note, append) {
|
|
55
76
|
if (append) {
|
|
56
77
|
this.sale.notes.internal += note;
|
|
@@ -59,12 +80,21 @@ class Sale extends BaseSale_1.BaseSale {
|
|
|
59
80
|
this.sale.notes.internal = note;
|
|
60
81
|
}
|
|
61
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Set the sale's meta-data
|
|
85
|
+
*/
|
|
62
86
|
async setMetaData(metaData) {
|
|
63
87
|
this.sale.metaData = metaData;
|
|
64
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Set the sale's order reference
|
|
91
|
+
*/
|
|
65
92
|
async setOrderReference(reference) {
|
|
66
93
|
this.sale.orderReference = reference;
|
|
67
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Update a product in the sale
|
|
97
|
+
*/
|
|
68
98
|
async updateProduct(product) {
|
|
69
99
|
const index = this.products.findIndex(p => p.internalId === product.internalId);
|
|
70
100
|
if (index === -1) {
|
|
@@ -92,7 +122,6 @@ class Sale extends BaseSale_1.BaseSale {
|
|
|
92
122
|
}
|
|
93
123
|
/**
|
|
94
124
|
* Converts the sale state to the sale data
|
|
95
|
-
* @param saleState
|
|
96
125
|
*/
|
|
97
126
|
static buildSaleData(saleState) {
|
|
98
127
|
return {
|
|
@@ -105,12 +134,11 @@ class Sale extends BaseSale_1.BaseSale {
|
|
|
105
134
|
refundReason: saleState.refundReason,
|
|
106
135
|
priceSet: saleState.priceSet,
|
|
107
136
|
metaData: saleState.metaData,
|
|
108
|
-
customer: saleState.customer ? new
|
|
109
|
-
payments: saleState.payments.map(
|
|
137
|
+
customer: saleState.customer ? new SaleCustomer(saleState.customer.uuid) : null,
|
|
138
|
+
payments: saleState.payments.map(SalePayment.HydrateFromState),
|
|
110
139
|
products: saleState.products.map((product, index) => {
|
|
111
|
-
return
|
|
140
|
+
return SaleProduct.HydrateFromState(product, [index]);
|
|
112
141
|
}),
|
|
113
142
|
};
|
|
114
143
|
}
|
|
115
144
|
}
|
|
116
|
-
exports.Sale = Sale;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SaleCustomer = void 0;
|
|
4
|
-
class SaleCustomer {
|
|
1
|
+
export class SaleCustomer {
|
|
5
2
|
constructor(id) {
|
|
6
3
|
this.id = id;
|
|
7
4
|
}
|
|
8
5
|
/**
|
|
9
6
|
* Get the ID of the customer.
|
|
10
|
-
*
|
|
11
|
-
* @returns {string}
|
|
12
7
|
*/
|
|
13
8
|
getId() {
|
|
14
9
|
return this.id;
|
|
15
10
|
}
|
|
16
11
|
}
|
|
17
|
-
exports.SaleCustomer = SaleCustomer;
|