@infosoftas/s4-orders-js-sdk 0.1.14 → 0.1.15
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 +1 -1
- package/src/types/general.ts +2 -0
- package/src/utils/order.helper.ts +10 -0
package/package.json
CHANGED
package/src/types/general.ts
CHANGED
|
@@ -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;
|