rerobe-js-orm 3.8.8 → 3.9.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.
@@ -20,6 +20,7 @@ class MerchantFromFormState extends MerchantFactory_1.default {
20
20
  webhooks: fs.fields.webhooks.selectedValues,
21
21
  primaryDomain: fs.fields.primaryDomain.inputValue,
22
22
  socialLinks: fs.fields.socialLinks.selectedValue,
23
+ organizationNumber: fs.fields.organizationNumber.inputValue,
23
24
  };
24
25
  return new Merchant_1.default(Object.assign(Object.assign({}, fs.props), MerchantMutableData));
25
26
  }
@@ -14,6 +14,7 @@ class MerchantFormState extends FormState_1.default {
14
14
  this.fields.senderEmail = this.fieldFactory('textInput', 'senderEmail');
15
15
  this.fields.industry = this.fieldFactory('singleSelect', 'industry', options_1.industryOptions);
16
16
  this.fields.legalName = this.fieldFactory('textInput', 'legalName');
17
+ this.fields.organizationNumber = this.fieldFactory('textInput', 'organizationNumber');
17
18
  this.fields.phone = this.fieldFactory('textInput', 'phone');
18
19
  this.fields.address = this.fieldFactory('singleSelect', 'address');
19
20
  this.fields.currency = this.fieldFactory('singleSelect', 'currency', options_1.currencyOptions);
@@ -217,10 +217,11 @@ export default class OrderHelpers {
217
217
  getPaymentTerminalReceiptInfo(payload?: any): PaymentTerminalReceiptInfo;
218
218
  getFormattedFulfillmentLocation(order: ReRobeOrderObj): string;
219
219
  generateReceiptLabels(locale: string, paymentMethod: string, entryMode?: string): ReceiptLabels;
220
- buildReceiptObjFromOrder({ order, merchant, merchantLogoUrl, receiptNumber, }: {
220
+ buildReceiptObjFromOrder({ order, merchant, merchantLogoUrl, receiptNumber, additionalInfo, }: {
221
221
  order: ReRobeOrderObj;
222
222
  merchant: MerchantObj;
223
223
  merchantLogoUrl: string;
224
224
  receiptNumber: string;
225
+ additionalInfo: string;
225
226
  }): ReceiptObj;
226
227
  }
@@ -547,9 +547,9 @@ class OrderHelpers {
547
547
  entryModeLabel,
548
548
  };
549
549
  }
550
- buildReceiptObjFromOrder({ order, merchant, merchantLogoUrl = '', receiptNumber = '', }) {
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, contactEmail, phone = '', organizationNumber = '', primaryDomain, currency: storeCurrencyCode, } = merchant;
552
+ const { address: merchantAddress, legalName, name, contactEmail, phone = '', organizationNumber = '', primaryDomain, currency: storeCurrencyCode, } = 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,10 +632,11 @@ 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
- return Object.assign(Object.assign({ merchantLogoUrl, merchantName: legalName, storeAddress: buildStoreAddress(), phone,
635
+ return Object.assign(Object.assign({ merchantLogoUrl, merchantName: name, legalName, storeAddress: buildStoreAddress(), phone,
636
636
  contactEmail,
637
637
  organizationNumber,
638
- primaryDomain, storeUrl: `https://${primaryDomain}`, orderDate: (0, Utilities_1.getFormattedTimestamp)(presentmentLocale), receiptNumber, lineItems: buildLineItems(), subTotal: (0, Utilities_1.formatPrice)({
638
+ primaryDomain, storeUrl: `https://${primaryDomain}`, orderDate: (0, Utilities_1.getFormattedTimestamp)(presentmentLocale), receiptNumber,
639
+ additionalInfo, lineItems: buildLineItems(), subTotal: (0, Utilities_1.formatPrice)({
639
640
  currencyCode,
640
641
  amount: (_e = (_d = order.subtotalPricePresentment) === null || _d === void 0 ? void 0 : _d.amount) !== null && _e !== void 0 ? _e : '',
641
642
  fractionDigits: 2,
@@ -81,6 +81,8 @@ export default class Merchant extends Base {
81
81
  socialLinks: SocialLinksType | null;
82
82
  isChannelPartner?: boolean;
83
83
  isZettleUser?: boolean;
84
+ hasStripeBluetoothReader?: boolean;
85
+ organizationNumber?: string;
84
86
  constructor(props?: any);
85
87
  toObj(): MerchantObj;
86
88
  toMerchantMutableData(): MerchantMutableData;
@@ -47,12 +47,16 @@ class Merchant extends Base_1.default {
47
47
  pinterest: '',
48
48
  tiktok: '',
49
49
  };
50
+ this.organizationNumber = (props === null || props === void 0 ? void 0 : props.organizationNumber) || '';
50
51
  if (props === null || props === void 0 ? void 0 : props.isChannelPartner) {
51
52
  this.isChannelPartner = props.isChannelPartner;
52
53
  }
53
54
  if (props === null || props === void 0 ? void 0 : props.isZettleUser) {
54
55
  this.isZettleUser = props.isZettleUser;
55
56
  }
57
+ if (props === null || props === void 0 ? void 0 : props.hasStripeBluetoothReader) {
58
+ this.hasStripeBluetoothReader = props.hasStripeBluetoothReader;
59
+ }
56
60
  }
57
61
  toObj() {
58
62
  const mObj = {
@@ -82,6 +86,7 @@ class Merchant extends Base_1.default {
82
86
  primaryDomain: this.primaryDomain,
83
87
  webshopHomePageId: this.webshopHomePageId,
84
88
  socialLinks: this.socialLinks,
89
+ organizationNumber: this.organizationNumber,
85
90
  };
86
91
  if (this.isChannelPartner) {
87
92
  mObj.isChannelPartner = this.isChannelPartner;
@@ -89,6 +94,9 @@ class Merchant extends Base_1.default {
89
94
  if (this.isZettleUser) {
90
95
  mObj.isZettleUser = this.isZettleUser;
91
96
  }
97
+ if (this.hasStripeBluetoothReader) {
98
+ mObj.hasStripeBluetoothReader = this.hasStripeBluetoothReader;
99
+ }
92
100
  return mObj;
93
101
  }
94
102
  toMerchantMutableData() {
@@ -38,6 +38,7 @@ type MerchantSystemOnlyMutableData = {
38
38
  defaultLocation: string;
39
39
  isZettleUser?: boolean;
40
40
  isChannelPartner?: boolean;
41
+ hasStripeBluetoothReader?: boolean;
41
42
  };
42
43
  type MerchantObj = MerchantMutableData & MerchantSystemOnlyMutableData;
43
44
  type MerchantTypes = 'INDIVIDUAL' | 'BUSINESS';
@@ -70,6 +71,7 @@ type MerchantFormFields = {
70
71
  senderEmail: TextInputFormField<string>;
71
72
  industry: SingleSelectFormField<string>;
72
73
  legalName: TextInputFormField<string>;
74
+ organizationNumber: TextInputFormField<string>;
73
75
  phone: TextInputFormField<string>;
74
76
  address: SingleSelectFormField<AddressInput>;
75
77
  currency: SingleSelectFormField<string>;
@@ -57,6 +57,7 @@ type ReceiptLabelsAndPaymentTerminalInfo = ReceiptLabels & PaymentTerminalReceip
57
57
  type ReceiptObj = {
58
58
  merchantLogoUrl: string;
59
59
  merchantName: string;
60
+ legalName: string;
60
61
  storeAddress: string;
61
62
  phone: string;
62
63
  contactEmail: string;
@@ -73,6 +74,7 @@ type ReceiptObj = {
73
74
  taxRates: {
74
75
  [key: string]: string;
75
76
  };
77
+ additionalInfo: string;
76
78
  } & ReceiptLabelsAndPaymentTerminalInfo;
77
79
  type ReRobeOrderObj = {
78
80
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.8.8",
3
+ "version": "3.9.0",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",