rerobe-js-orm 3.9.0 → 3.9.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/lib/factories/Merchant/MerchantFromFormState.js +1 -0
- package/lib/form-states/Merchant/MerchantFormState.js +1 -0
- package/lib/helpers/OrderHelpers.js +9 -3
- package/lib/models/Merchant.d.ts +1 -0
- package/lib/models/Merchant.js +2 -0
- package/lib/types/merchant-types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ class MerchantFromFormState extends MerchantFactory_1.default {
|
|
|
21
21
|
primaryDomain: fs.fields.primaryDomain.inputValue,
|
|
22
22
|
socialLinks: fs.fields.socialLinks.selectedValue,
|
|
23
23
|
organizationNumber: fs.fields.organizationNumber.inputValue,
|
|
24
|
+
returnPolicy: fs.fields.returnPolicy.inputValue,
|
|
24
25
|
};
|
|
25
26
|
return new Merchant_1.default(Object.assign(Object.assign({}, fs.props), MerchantMutableData));
|
|
26
27
|
}
|
|
@@ -15,6 +15,7 @@ class MerchantFormState extends FormState_1.default {
|
|
|
15
15
|
this.fields.industry = this.fieldFactory('singleSelect', 'industry', options_1.industryOptions);
|
|
16
16
|
this.fields.legalName = this.fieldFactory('textInput', 'legalName');
|
|
17
17
|
this.fields.organizationNumber = this.fieldFactory('textInput', 'organizationNumber');
|
|
18
|
+
this.fields.returnPolicy = this.fieldFactory('textInput', 'returnPolicy');
|
|
18
19
|
this.fields.phone = this.fieldFactory('textInput', 'phone');
|
|
19
20
|
this.fields.address = this.fieldFactory('singleSelect', 'address');
|
|
20
21
|
this.fields.currency = this.fieldFactory('singleSelect', 'currency', options_1.currencyOptions);
|
|
@@ -549,7 +549,7 @@ class OrderHelpers {
|
|
|
549
549
|
}
|
|
550
550
|
buildReceiptObjFromOrder({ order, merchant, merchantLogoUrl = '', receiptNumber = '', additionalInfo = '', }) {
|
|
551
551
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
552
|
-
const { address: merchantAddress, legalName, name, contactEmail, phone = '', organizationNumber = '', primaryDomain, currency: storeCurrencyCode, } = merchant;
|
|
552
|
+
const { address: merchantAddress, legalName, name, contactEmail, phone = '', organizationNumber = '', primaryDomain, currency: storeCurrencyCode, returnPolicy, } = merchant;
|
|
553
553
|
const currencyCode = ((_a = order.totalPricePresentment) === null || _a === void 0 ? void 0 : _a.currencyCode) || storeCurrencyCode;
|
|
554
554
|
const presentmentLocale = (0, Utilities_1.getPresentmentLocaleByCurrencyCode)(currencyCode);
|
|
555
555
|
const mapLineItem = (l) => {
|
|
@@ -632,11 +632,17 @@ class OrderHelpers {
|
|
|
632
632
|
};
|
|
633
633
|
const paymentTerminalInfo = this.getPaymentTerminalReceiptInfo(order);
|
|
634
634
|
const receiptLabels = this.generateReceiptLabels(presentmentLocale, (_b = order.paymentType) !== null && _b !== void 0 ? _b : '', (_c = paymentTerminalInfo.entryMode) !== null && _c !== void 0 ? _c : '');
|
|
635
|
+
let info = additionalInfo;
|
|
636
|
+
if (returnPolicy) {
|
|
637
|
+
info = `${returnPolicy}`;
|
|
638
|
+
if (additionalInfo) {
|
|
639
|
+
info = `${info}\n\n${additionalInfo}`;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
635
642
|
return Object.assign(Object.assign({ merchantLogoUrl, merchantName: name, legalName, storeAddress: buildStoreAddress(), phone,
|
|
636
643
|
contactEmail,
|
|
637
644
|
organizationNumber,
|
|
638
|
-
primaryDomain, storeUrl: `https://${primaryDomain}`, orderDate: (0, Utilities_1.getFormattedTimestamp)(presentmentLocale), receiptNumber,
|
|
639
|
-
additionalInfo, lineItems: buildLineItems(), subTotal: (0, Utilities_1.formatPrice)({
|
|
645
|
+
primaryDomain, storeUrl: `https://${primaryDomain}`, orderDate: (0, Utilities_1.getFormattedTimestamp)(presentmentLocale), receiptNumber, additionalInfo: info, lineItems: buildLineItems(), subTotal: (0, Utilities_1.formatPrice)({
|
|
640
646
|
currencyCode,
|
|
641
647
|
amount: (_e = (_d = order.subtotalPricePresentment) === null || _d === void 0 ? void 0 : _d.amount) !== null && _e !== void 0 ? _e : '',
|
|
642
648
|
fractionDigits: 2,
|
package/lib/models/Merchant.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ export default class Merchant extends Base {
|
|
|
83
83
|
isZettleUser?: boolean;
|
|
84
84
|
hasStripeBluetoothReader?: boolean;
|
|
85
85
|
organizationNumber?: string;
|
|
86
|
+
returnPolicy?: string;
|
|
86
87
|
constructor(props?: any);
|
|
87
88
|
toObj(): MerchantObj;
|
|
88
89
|
toMerchantMutableData(): MerchantMutableData;
|
package/lib/models/Merchant.js
CHANGED
|
@@ -48,6 +48,7 @@ class Merchant extends Base_1.default {
|
|
|
48
48
|
tiktok: '',
|
|
49
49
|
};
|
|
50
50
|
this.organizationNumber = (props === null || props === void 0 ? void 0 : props.organizationNumber) || '';
|
|
51
|
+
this.returnPolicy = (props === null || props === void 0 ? void 0 : props.returnPolicy) || '';
|
|
51
52
|
if (props === null || props === void 0 ? void 0 : props.isChannelPartner) {
|
|
52
53
|
this.isChannelPartner = props.isChannelPartner;
|
|
53
54
|
}
|
|
@@ -87,6 +88,7 @@ class Merchant extends Base_1.default {
|
|
|
87
88
|
webshopHomePageId: this.webshopHomePageId,
|
|
88
89
|
socialLinks: this.socialLinks,
|
|
89
90
|
organizationNumber: this.organizationNumber,
|
|
91
|
+
returnPolicy: this.returnPolicy,
|
|
90
92
|
};
|
|
91
93
|
if (this.isChannelPartner) {
|
|
92
94
|
mObj.isChannelPartner = this.isChannelPartner;
|
|
@@ -23,6 +23,7 @@ type MerchantMutableData = {
|
|
|
23
23
|
webhooks: MerchantWebHook[];
|
|
24
24
|
socialLinks: SocialLinksType | null;
|
|
25
25
|
organizationNumber?: string;
|
|
26
|
+
returnPolicy?: string;
|
|
26
27
|
};
|
|
27
28
|
type MerchantSystemOnlyMutableData = {
|
|
28
29
|
paymentTier: RibbnPaymentTiers | string;
|
|
@@ -72,6 +73,7 @@ type MerchantFormFields = {
|
|
|
72
73
|
industry: SingleSelectFormField<string>;
|
|
73
74
|
legalName: TextInputFormField<string>;
|
|
74
75
|
organizationNumber: TextInputFormField<string>;
|
|
76
|
+
returnPolicy: TextInputFormField<string>;
|
|
75
77
|
phone: TextInputFormField<string>;
|
|
76
78
|
address: SingleSelectFormField<AddressInput>;
|
|
77
79
|
currency: SingleSelectFormField<string>;
|