@aptos-scp/scp-component-store-selling-features-domain-model 1.0.12 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/domain/UIBusinessEventTypes.d.ts +1 -0
- package/lib/domain/UIBusinessEventTypes.js +1 -0
- package/lib/domain/model/Constants.d.ts +1 -0
- package/lib/domain/model/Constants.js +1 -0
- package/lib/domain/model/configuration/IFeesConfig.d.ts +2 -1
- package/lib/domain/model/configuration/IFeesConfig.js +1 -0
- package/lib/domain/model/fee/IFee.d.ts +13 -0
- package/lib/domain/model/fee/IFee.js +3 -0
- package/lib/domain/model/fee/index.d.ts +1 -0
- package/lib/domain/model/transaction/order/OrderReferenceLine.d.ts +9 -1
- package/lib/domain/model/transaction/order/OrderReferenceLine.js +15 -4
- package/package.json +1 -1
|
@@ -158,6 +158,7 @@ export declare const ITEM_PICKUP_SIGNATURE_EVENT: string;
|
|
|
158
158
|
export declare const TERMINAL_STATE_SYNC_EVENT: string;
|
|
159
159
|
export declare const TRANSACTION_FEE_CHANGE_QUANTITY_EVENT = "ChangeTransactionFeeQuantity";
|
|
160
160
|
export declare const TRANSACTION_FEE_EVENT = "TransactionFee";
|
|
161
|
+
export declare const TRANSACTION_FEE_REFUND_EVENT: string;
|
|
161
162
|
export declare const MAKE_DONATION_EVENT = "MakeDonation";
|
|
162
163
|
export declare const TRANSACTION_RECEIPTS_EVENT = "TransactionReceipts";
|
|
163
164
|
export declare const TRANSACTION_TAX_EXEMPT_EVENT = "TransactionTaxExempt";
|
|
@@ -161,6 +161,7 @@ exports.ITEM_PICKUP_SIGNATURE_EVENT = "ItemPickupSignature";
|
|
|
161
161
|
exports.TERMINAL_STATE_SYNC_EVENT = "TerminalStatusSync";
|
|
162
162
|
exports.TRANSACTION_FEE_CHANGE_QUANTITY_EVENT = "ChangeTransactionFeeQuantity";
|
|
163
163
|
exports.TRANSACTION_FEE_EVENT = "TransactionFee";
|
|
164
|
+
exports.TRANSACTION_FEE_REFUND_EVENT = "TransactionRefundFee";
|
|
164
165
|
exports.MAKE_DONATION_EVENT = "MakeDonation";
|
|
165
166
|
exports.TRANSACTION_RECEIPTS_EVENT = "TransactionReceipts";
|
|
166
167
|
exports.TRANSACTION_TAX_EXEMPT_EVENT = "TransactionTaxExempt";
|
|
@@ -249,6 +249,7 @@ export declare enum UiInputKey {
|
|
|
249
249
|
SALESPERSON_ID = "input_salespersonId",
|
|
250
250
|
SELECTED_ORDER_ITEMS = "input_selectedOrderItems",
|
|
251
251
|
CANCELLED_ORDER_ITEM_LINE_NUMBER = "input_cancelledOrderItemLineNumber",
|
|
252
|
+
FEE_DETAILS = "input_feeDetails",
|
|
252
253
|
SUBSCRIPTIONS = "input_subscriptions",
|
|
253
254
|
VAT_NUMBER = "input_vatNumber",
|
|
254
255
|
CUSTOMER_TYPE = "input_customerType",
|
|
@@ -252,6 +252,7 @@ var UiInputKey;
|
|
|
252
252
|
UiInputKey["SALESPERSON_ID"] = "input_salespersonId";
|
|
253
253
|
UiInputKey["SELECTED_ORDER_ITEMS"] = "input_selectedOrderItems";
|
|
254
254
|
UiInputKey["CANCELLED_ORDER_ITEM_LINE_NUMBER"] = "input_cancelledOrderItemLineNumber";
|
|
255
|
+
UiInputKey["FEE_DETAILS"] = "input_feeDetails";
|
|
255
256
|
UiInputKey["SUBSCRIPTIONS"] = "input_subscriptions";
|
|
256
257
|
UiInputKey["VAT_NUMBER"] = "input_vatNumber";
|
|
257
258
|
UiInputKey["CUSTOMER_TYPE"] = "input_customerType";
|
|
@@ -43,7 +43,8 @@ export declare enum DisplayRules {
|
|
|
43
43
|
}
|
|
44
44
|
export declare enum ReturnRule {
|
|
45
45
|
WithItem = "WithItem",
|
|
46
|
-
NonReturnable = "NonReturnable"
|
|
46
|
+
NonReturnable = "NonReturnable",
|
|
47
|
+
OnOrderCancel = "OnOrderCancel"
|
|
47
48
|
}
|
|
48
49
|
export declare enum Taxability {
|
|
49
50
|
FollowItemTax = "FollowItemTax"
|
|
@@ -19,6 +19,7 @@ var ReturnRule;
|
|
|
19
19
|
(function (ReturnRule) {
|
|
20
20
|
ReturnRule["WithItem"] = "WithItem";
|
|
21
21
|
ReturnRule["NonReturnable"] = "NonReturnable";
|
|
22
|
+
ReturnRule["OnOrderCancel"] = "OnOrderCancel";
|
|
22
23
|
})(ReturnRule = exports.ReturnRule || (exports.ReturnRule = {}));
|
|
23
24
|
var Taxability;
|
|
24
25
|
(function (Taxability) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Money } from "@aptos-scp/scp-component-business-core";
|
|
2
|
+
import { FeeType } from "@aptos-scp/scp-types-commerce-transaction/lib/TransactionLine";
|
|
3
|
+
export interface IFee {
|
|
4
|
+
unitAmount: Money;
|
|
5
|
+
extendedNetAmount: Money;
|
|
6
|
+
feeType: FeeType;
|
|
7
|
+
feeId?: string;
|
|
8
|
+
alternativeFeeId?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
shortDescription?: string;
|
|
11
|
+
longDescription?: string;
|
|
12
|
+
customFeeType?: FeeType;
|
|
13
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ITransactionLine, UiBusinessEvent } from "@aptos-scp/scp-component-store-selling-core";
|
|
2
2
|
import { IOrderReferenceInfo } from "@aptos-scp/scp-types-commerce-transaction";
|
|
3
|
+
import { CustomerOrder } from "@aptos-scp/scp-types-orders";
|
|
3
4
|
import { BaseTransactionLine } from "../../BaseTransactionLine";
|
|
4
5
|
export declare const ORDER_REFERENCE_LINE_TYPE: string;
|
|
5
6
|
export declare class OrderReferenceLine extends BaseTransactionLine {
|
|
6
7
|
private _orderReference;
|
|
8
|
+
private _order;
|
|
7
9
|
/**
|
|
8
10
|
* The create method is called by the transaction line factory to create an instance and initialize it from the
|
|
9
11
|
* data collected during the qualification process.
|
|
@@ -19,7 +21,13 @@ export declare class OrderReferenceLine extends BaseTransactionLine {
|
|
|
19
21
|
static createFromJsonObject(transactionLineJsonObj: any): OrderReferenceLine;
|
|
20
22
|
get couldAffectPricing(): boolean;
|
|
21
23
|
get orderReference(): IOrderReferenceInfo;
|
|
22
|
-
|
|
24
|
+
/**
|
|
25
|
+
* This is the order from OMS.
|
|
26
|
+
* It is provided here for reference within the app.
|
|
27
|
+
* It MUST NOT be included in the internal/postable transaction.
|
|
28
|
+
*/
|
|
29
|
+
get order(): CustomerOrder;
|
|
30
|
+
protected constructor(lineNumber: number, lineType: string, orderReference: IOrderReferenceInfo, omsOrder: CustomerOrder);
|
|
23
31
|
protected newTransactionLine(): BaseTransactionLine;
|
|
24
32
|
}
|
|
25
33
|
export declare function isOrderReferenceLine(transactionLine: ITransactionLine): transactionLine is OrderReferenceLine;
|
|
@@ -5,9 +5,10 @@ const Constants_1 = require("../../Constants");
|
|
|
5
5
|
exports.ORDER_REFERENCE_LINE_TYPE = "OrderReference";
|
|
6
6
|
class OrderReferenceLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
7
7
|
// Since the constructor is only called from the create methods it is made protected to prevent use by others.
|
|
8
|
-
constructor(lineNumber, lineType, orderReference) {
|
|
8
|
+
constructor(lineNumber, lineType, orderReference, omsOrder) {
|
|
9
9
|
super(lineNumber, lineType);
|
|
10
10
|
this._orderReference = orderReference;
|
|
11
|
+
this._order = omsOrder;
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
14
|
* The create method is called by the transaction line factory to create an instance and initialize it from the
|
|
@@ -22,14 +23,16 @@ class OrderReferenceLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
22
23
|
*/
|
|
23
24
|
static create(lineNumber, lineType, uiBusinessEvent, collectedData) {
|
|
24
25
|
const orderReference = collectedData.get(Constants_1.CollectedDataKey.OrderReference);
|
|
25
|
-
const
|
|
26
|
+
const order = collectedData.get(Constants_1.CollectedDataKey.Order);
|
|
27
|
+
const orderReferenceLine = new OrderReferenceLine(lineNumber, lineType, orderReference, order);
|
|
26
28
|
return orderReferenceLine;
|
|
27
29
|
}
|
|
28
30
|
static createFromJsonObject(transactionLineJsonObj) {
|
|
29
31
|
const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
|
|
30
32
|
const lineType = BaseTransactionLine_1.BaseTransactionLine.lineTypeFromJsonObject(transactionLineJsonObj);
|
|
31
33
|
const orderReference = transactionLineJsonObj._orderReference;
|
|
32
|
-
const
|
|
34
|
+
const order = transactionLineJsonObj._order;
|
|
35
|
+
const orderReferenceLine = new OrderReferenceLine(lineNumber, lineType, orderReference, order);
|
|
33
36
|
return orderReferenceLine;
|
|
34
37
|
}
|
|
35
38
|
get couldAffectPricing() {
|
|
@@ -38,8 +41,16 @@ class OrderReferenceLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
38
41
|
get orderReference() {
|
|
39
42
|
return this._orderReference;
|
|
40
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* This is the order from OMS.
|
|
46
|
+
* It is provided here for reference within the app.
|
|
47
|
+
* It MUST NOT be included in the internal/postable transaction.
|
|
48
|
+
*/
|
|
49
|
+
get order() {
|
|
50
|
+
return this._order;
|
|
51
|
+
}
|
|
41
52
|
newTransactionLine() {
|
|
42
|
-
return new OrderReferenceLine(this.lineNumber, this.lineType, this._orderReference);
|
|
53
|
+
return new OrderReferenceLine(this.lineNumber, this.lineType, this._orderReference, this._order);
|
|
43
54
|
}
|
|
44
55
|
}
|
|
45
56
|
exports.OrderReferenceLine = OrderReferenceLine;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-scp/scp-component-store-selling-features-domain-model",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "This component library provides the common components to handle the coordination of processing the business events from the UI.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|