@infosoftas/s4-orders-js-sdk 0.1.14 → 0.1.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infosoftas/s4-orders-js-sdk",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "scripts": {
5
5
  "build": "rimraf lib && webpack --mode production",
6
6
  "release": "release-it"
@@ -327,6 +327,10 @@ const useOrderForm = ({
327
327
  void fetchDenialFallbackOffer(organizationId)
328
328
  .then((offer) => {
329
329
  setOrderDenialFallbackOffer(offer);
330
+ if (offer?.templatePackageId) {
331
+ fallbackOfferTemplatePackageIdRef.current =
332
+ offer.templatePackageId;
333
+ }
330
334
  })
331
335
  .catch(() => {
332
336
  setOrderDenialFallbackOffer(undefined);
@@ -34,6 +34,8 @@ export type ContactRequestType = {
34
34
  city?: string;
35
35
  zip?: string;
36
36
  careOf?: string;
37
+ organizationNumber?: string;
38
+ gln?: string;
37
39
  };
38
40
 
39
41
  export type OrderDenialFallbackOfferType = {
@@ -112,6 +112,11 @@ export const prepareContactModel = ({
112
112
  data,
113
113
  orderFields,
114
114
  }: ContactModelType) => {
115
+ const organizationNumber =
116
+ data.paymentMethod === PaymentMethodEnum.OIO
117
+ ? data.cvr?.trim() || undefined
118
+ : data.organizationNumber?.trim() || undefined;
119
+
115
120
  const model = {
116
121
  name: orderFields.find((i) => i.name === 'name')
117
122
  ? data.name?.trim() || undefined
@@ -143,6 +148,11 @@ export const prepareContactModel = ({
143
148
  careOf: orderFields.find((i) => i.name === 'careOf')
144
149
  ? data.careOf?.trim() || undefined
145
150
  : undefined,
151
+ organizationNumber,
152
+ gln:
153
+ data.paymentMethod === PaymentMethodEnum.OIO
154
+ ? data.gln?.trim() || undefined
155
+ : undefined,
146
156
  };
147
157
 
148
158
  return model;