@aptos-scp/scp-component-store-selling-features-domain-model 1.37.0 → 1.38.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/model/Constants.d.ts +4 -0
- package/lib/domain/model/Constants.js +4 -0
- package/lib/domain/model/receipt/GiftReceiptLine.d.ts +4 -1
- package/lib/domain/model/receipt/GiftReceiptLine.js +10 -4
- package/lib/domain/model/receipt/IReprintGiftReceipt.d.ts +11 -0
- package/lib/domain/model/receipt/IReprintGiftReceipt.js +3 -0
- package/lib/domain/model/receipt/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -235,6 +235,7 @@ export declare enum UiInputKey {
|
|
|
235
235
|
RECEIPT_CATEGORY = "input_receiptCategory",
|
|
236
236
|
RECEIPT_CATEGORIES = "input_receiptCategories",
|
|
237
237
|
REPRINT_RECEIPT_COUNT = "input_reprintReceiptCount",
|
|
238
|
+
REPRINT_GIFT_RECEIPT_OPTION = "input_reprintGiftReceiptOption",
|
|
238
239
|
RECEIPT_TYPE = "input_receiptType",
|
|
239
240
|
TENDER_REFERENCE_DATA = "input_tenderReferenceData",
|
|
240
241
|
RESUME_TRANSACTION = "input_resumeTransaction",
|
|
@@ -664,6 +665,9 @@ export declare enum CollectedDataKey {
|
|
|
664
665
|
ReprintTransaction = "reprintTransaction",
|
|
665
666
|
ReprintTransactionType = "reprintTransactionType",
|
|
666
667
|
ReprintReceiptCount = "reprintReceiptCount",
|
|
668
|
+
ReprintGiftReceiptOption = "reprintGiftReceiptOption",
|
|
669
|
+
GiftItems = "giftItems",
|
|
670
|
+
GiftItemForReprint = "giftItemForReprint",
|
|
667
671
|
ResultCashDrawerStatusCode = "ResultCashDrawerStatusCode",
|
|
668
672
|
ResumeTransaction = "resumeTransaction",
|
|
669
673
|
ResumeCompleteEvent = "resumeCompleteEvent",
|
|
@@ -238,6 +238,7 @@ var UiInputKey;
|
|
|
238
238
|
UiInputKey["RECEIPT_CATEGORY"] = "input_receiptCategory";
|
|
239
239
|
UiInputKey["RECEIPT_CATEGORIES"] = "input_receiptCategories";
|
|
240
240
|
UiInputKey["REPRINT_RECEIPT_COUNT"] = "input_reprintReceiptCount";
|
|
241
|
+
UiInputKey["REPRINT_GIFT_RECEIPT_OPTION"] = "input_reprintGiftReceiptOption";
|
|
241
242
|
UiInputKey["RECEIPT_TYPE"] = "input_receiptType";
|
|
242
243
|
UiInputKey["TENDER_REFERENCE_DATA"] = "input_tenderReferenceData";
|
|
243
244
|
UiInputKey["RESUME_TRANSACTION"] = "input_resumeTransaction";
|
|
@@ -673,6 +674,9 @@ var CollectedDataKey;
|
|
|
673
674
|
CollectedDataKey["ReprintTransaction"] = "reprintTransaction";
|
|
674
675
|
CollectedDataKey["ReprintTransactionType"] = "reprintTransactionType";
|
|
675
676
|
CollectedDataKey["ReprintReceiptCount"] = "reprintReceiptCount";
|
|
677
|
+
CollectedDataKey["ReprintGiftReceiptOption"] = "reprintGiftReceiptOption";
|
|
678
|
+
CollectedDataKey["GiftItems"] = "giftItems";
|
|
679
|
+
CollectedDataKey["GiftItemForReprint"] = "giftItemForReprint";
|
|
676
680
|
CollectedDataKey["ResultCashDrawerStatusCode"] = "ResultCashDrawerStatusCode";
|
|
677
681
|
CollectedDataKey["ResumeTransaction"] = "resumeTransaction";
|
|
678
682
|
CollectedDataKey["ResumeCompleteEvent"] = "resumeCompleteEvent";
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { ITransactionLine, UiBusinessEvent } from "@aptos-scp/scp-component-store-selling-core";
|
|
2
2
|
import { ISameTransactionLineReference } from "@aptos-scp/scp-types-commerce-transaction";
|
|
3
|
+
import { IGiftItem } from "../../../index";
|
|
3
4
|
import { GiftReceiptMode } from "../../model/Constants";
|
|
4
5
|
import { BaseTransactionLine } from "../BaseTransactionLine";
|
|
5
6
|
export declare const GIFT_RECEIPT_LINE_TYPE = "GiftReceipt";
|
|
6
7
|
export declare class GiftReceiptLine extends BaseTransactionLine {
|
|
7
8
|
private _itemLineReference;
|
|
8
9
|
private _giftReceiptMode;
|
|
10
|
+
private _originalGiftItem;
|
|
9
11
|
static createFromJsonObject(transactionLineJsonObj: any): GiftReceiptLine;
|
|
10
12
|
static create(lineNumber: number, lineType: string, uiBusinessEvent: UiBusinessEvent, collectedData: Readonly<Map<string, any>>): GiftReceiptLine;
|
|
11
|
-
protected constructor(lineNumber: number, lineType: string, itemLineReference: ISameTransactionLineReference, giftReceiptMode: GiftReceiptMode);
|
|
13
|
+
protected constructor(lineNumber: number, lineType: string, itemLineReference: ISameTransactionLineReference, giftReceiptMode: GiftReceiptMode, originalGiftItem: IGiftItem);
|
|
12
14
|
protected newTransactionLine(): BaseTransactionLine;
|
|
13
15
|
get itemLineReference(): ISameTransactionLineReference;
|
|
14
16
|
get giftReceiptMode(): GiftReceiptMode;
|
|
17
|
+
get originalGiftItem(): IGiftItem;
|
|
15
18
|
get couldAffectPricing(): boolean;
|
|
16
19
|
}
|
|
17
20
|
export declare function isGiftReceiptLine(transactionLine: ITransactionLine): transactionLine is GiftReceiptLine;
|
|
@@ -6,17 +6,19 @@ const Constants_1 = require("../../model/Constants");
|
|
|
6
6
|
const BaseTransactionLine_1 = require("../BaseTransactionLine");
|
|
7
7
|
exports.GIFT_RECEIPT_LINE_TYPE = "GiftReceipt";
|
|
8
8
|
class GiftReceiptLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
9
|
-
constructor(lineNumber, lineType, itemLineReference, giftReceiptMode) {
|
|
9
|
+
constructor(lineNumber, lineType, itemLineReference, giftReceiptMode, originalGiftItem) {
|
|
10
10
|
super(lineNumber, lineType);
|
|
11
11
|
this._itemLineReference = itemLineReference;
|
|
12
12
|
this._giftReceiptMode = giftReceiptMode;
|
|
13
|
+
this._originalGiftItem = originalGiftItem;
|
|
13
14
|
}
|
|
14
15
|
static createFromJsonObject(transactionLineJsonObj) {
|
|
15
16
|
const lineNumber = BaseTransactionLine_1.BaseTransactionLine.lineNumberFromJsonObject(transactionLineJsonObj);
|
|
16
17
|
const lineType = BaseTransactionLine_1.BaseTransactionLine.lineTypeFromJsonObject(transactionLineJsonObj);
|
|
17
18
|
const itemLineReference = transactionLineJsonObj._changeLineNumber;
|
|
18
19
|
const giftReceiptMode = transactionLineJsonObj._giftReceiptMode;
|
|
19
|
-
const
|
|
20
|
+
const originalGiftItem = transactionLineJsonObj._originalGiftItem;
|
|
21
|
+
const giftReceiptLine = new GiftReceiptLine(lineNumber, lineType, itemLineReference, giftReceiptMode, originalGiftItem);
|
|
20
22
|
giftReceiptLine.loadFromJsonObject(transactionLineJsonObj);
|
|
21
23
|
return giftReceiptLine;
|
|
22
24
|
}
|
|
@@ -27,11 +29,12 @@ class GiftReceiptLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
27
29
|
const itemLineReference = collectedData.get(Constants_1.CollectedDataKey.ItemLineReference);
|
|
28
30
|
const lineReference = itemLineReference && itemLineReference.lineNumber ? itemLineReference : undefined;
|
|
29
31
|
const giftReceiptMode = collectedData.get(Constants_1.CollectedDataKey.GiftReceiptMode);
|
|
30
|
-
const
|
|
32
|
+
const originalGiftItem = collectedData.get(Constants_1.CollectedDataKey.GiftItemForReprint);
|
|
33
|
+
const giftReceiptLine = new GiftReceiptLine(lineNumber, exports.GIFT_RECEIPT_LINE_TYPE, lineReference, giftReceiptMode, originalGiftItem);
|
|
31
34
|
return giftReceiptLine;
|
|
32
35
|
}
|
|
33
36
|
newTransactionLine() {
|
|
34
|
-
return new GiftReceiptLine(this.lineNumber, exports.GIFT_RECEIPT_LINE_TYPE, this._itemLineReference, this._giftReceiptMode);
|
|
37
|
+
return new GiftReceiptLine(this.lineNumber, exports.GIFT_RECEIPT_LINE_TYPE, this._itemLineReference, this._giftReceiptMode, this._originalGiftItem);
|
|
35
38
|
}
|
|
36
39
|
get itemLineReference() {
|
|
37
40
|
return this._itemLineReference;
|
|
@@ -39,6 +42,9 @@ class GiftReceiptLine extends BaseTransactionLine_1.BaseTransactionLine {
|
|
|
39
42
|
get giftReceiptMode() {
|
|
40
43
|
return this._giftReceiptMode;
|
|
41
44
|
}
|
|
45
|
+
get originalGiftItem() {
|
|
46
|
+
return this._originalGiftItem;
|
|
47
|
+
}
|
|
42
48
|
get couldAffectPricing() {
|
|
43
49
|
return false;
|
|
44
50
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Quantity } from "@aptos-scp/scp-component-business-core";
|
|
2
|
+
import { GiftReceiptMode, ItemLookupKey } from "..";
|
|
3
|
+
export interface IReprintGiftReceiptOption {
|
|
4
|
+
lineNumbers: number[];
|
|
5
|
+
giftReceiptMode: GiftReceiptMode;
|
|
6
|
+
}
|
|
7
|
+
export interface IGiftItem {
|
|
8
|
+
name: string;
|
|
9
|
+
itemLookupKey: ItemLookupKey;
|
|
10
|
+
quantity: Quantity;
|
|
11
|
+
}
|
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.
|
|
3
|
+
"version": "1.38.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",
|