@redneckz/wildless-cms-uni-blocks 0.14.690 → 0.14.691

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.
@@ -1,16 +1,24 @@
1
1
  import { type FormState } from '../ApplicationLeadForm/getInitialFormState';
2
2
  export declare const getDeliveryData: (formData: FormState) => {
3
- courierDeliveryFlg: boolean;
3
+ courierDeliveryFlg: true;
4
4
  deliveryDate: string;
5
5
  deliveryTimeCd: {
6
6
  value: string;
7
7
  };
8
+ } | {
9
+ courierDeliveryFlg?: undefined;
10
+ deliveryDate?: undefined;
11
+ deliveryTimeCd?: undefined;
8
12
  };
9
13
  export declare const getOfficeCode: (formData: FormState) => {
10
14
  office: {
11
15
  id: string;
12
- } | undefined;
16
+ };
17
+ } | {
18
+ office?: undefined;
13
19
  };
14
20
  export declare const getSixthStepData: (formData: FormState) => {
15
21
  participantAddresses: any[];
22
+ } | {
23
+ participantAddresses?: undefined;
16
24
  };
@@ -1,16 +1,24 @@
1
1
  import { type FormState } from '../ApplicationLeadForm/getInitialFormState';
2
2
  export declare const getDeliveryData: (formData: FormState) => {
3
- courierDeliveryFlg: boolean;
3
+ courierDeliveryFlg: true;
4
4
  deliveryDate: string;
5
5
  deliveryTimeCd: {
6
6
  value: string;
7
7
  };
8
+ } | {
9
+ courierDeliveryFlg?: undefined;
10
+ deliveryDate?: undefined;
11
+ deliveryTimeCd?: undefined;
8
12
  };
9
13
  export declare const getOfficeCode: (formData: FormState) => {
10
14
  office: {
11
15
  id: string;
12
- } | undefined;
16
+ };
17
+ } | {
18
+ office?: undefined;
13
19
  };
14
20
  export declare const getSixthStepData: (formData: FormState) => {
15
21
  participantAddresses: any[];
22
+ } | {
23
+ participantAddresses?: undefined;
16
24
  };
@@ -4,25 +4,34 @@ const dateToISO_1 = require("../../utils/dateToISO");
4
4
  const utils_1 = require("../CreditForm/utils");
5
5
  const getDeliveryData = (formData) => {
6
6
  const { methodObtain, deliveryDate = '' } = formData;
7
- return {
8
- courierDeliveryFlg: methodObtain === 'courier',
9
- deliveryDate: (0, dateToISO_1.dateToISO)(deliveryDate),
10
- deliveryTimeCd: { value: 'TIME_2' },
11
- };
7
+ const isCourierDelivery = methodObtain === 'courier';
8
+ return isCourierDelivery
9
+ ? {
10
+ courierDeliveryFlg: isCourierDelivery,
11
+ deliveryDate: (0, dateToISO_1.dateToISO)(deliveryDate),
12
+ deliveryTimeCd: { value: 'TIME_2' },
13
+ }
14
+ : {};
12
15
  };
13
16
  exports.getDeliveryData = getDeliveryData;
14
17
  const getOfficeCode = (formData) => {
15
- const { addressRetail } = formData;
16
- return {
17
- office: addressRetail?.key ? { id: addressRetail.key } : undefined,
18
- };
18
+ const { addressRetail, methodObtain } = formData;
19
+ const isOfficeObtain = addressRetail?.key && methodObtain === 'office';
20
+ return isOfficeObtain
21
+ ? {
22
+ office: { id: addressRetail.key },
23
+ }
24
+ : {};
19
25
  };
20
26
  exports.getOfficeCode = getOfficeCode;
21
27
  const getSixthStepData = (formData) => {
22
- const { addressCourier } = formData;
23
- return {
24
- participantAddresses: (0, utils_1.getParticipantAddresses)({ addressCourier }),
25
- };
28
+ const { addressCourier, methodObtain } = formData;
29
+ const isCourierDelivery = methodObtain === 'courier';
30
+ return isCourierDelivery
31
+ ? {
32
+ participantAddresses: (0, utils_1.getParticipantAddresses)({ addressCourier }),
33
+ }
34
+ : {};
26
35
  };
27
36
  exports.getSixthStepData = getSixthStepData;
28
37
  //# sourceMappingURL=getSixthStepData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSixthStepData.js","sourceRoot":"","sources":["../../../src/components/CreditCardForm/getSixthStepData.ts"],"names":[],"mappings":";;AAAA,qDAAkD;AAElD,+CAA8D;AAEvD,MAAM,eAAe,GAAG,CAAC,QAAmB,EAAE,EAAE;IACrD,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,QAAQ,CAAC;IAErD,OAAO;QACL,kBAAkB,EAAE,YAAY,KAA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,MAAM,aAAa,GAAG,CAAC,QAAmB,EAAE,EAAE;IACnD,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;IAEjD,MAAM,cAAc,GAAG,aAAa,EAAE,GAAG,IAAI,YAAY,KAAK,QAAQ,CAAC;IAEvE,OAAO,cAAc;QACnB,CAAC,CAAC;YACE,MAAM,EAAE,EAAE,EAAE,EAAE,aAAa,CAAC,GAAG,EAAE;SAClC;QACH,CAAC,CAAC,EAAE,CAAC;AACT,CAAC,CAAC;AAVW,QAAA,aAAa,iBAUxB;AAEK,MAAM,gBAAgB,GAAG,CAAC,QAAmB,EAAE,EAAE;IACtD,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;IAElD,MAAM,iBAAiB,GAAG,YAAY,KAAK,SAAS,CAAC;IAErD,OAAO,iBAAiB;QACtB,CAAC,CAAC;YACE,oBAAoB,EAAE,IAAA,+BAAuB,EAAC,EAAE,cAAc,EAAE,CAAC;SAClE;QACH,CAAC,CAAC,EAAE,CAAC;AACT,CAAC,CAAC;AAVW,QAAA,gBAAgB,oBAU3B"}
@@ -1,16 +1,24 @@
1
1
  import { type FormState } from '../ApplicationLeadForm/getInitialFormState';
2
2
  export declare const getDeliveryData: (formData: FormState) => {
3
- courierDeliveryFlg: boolean;
3
+ courierDeliveryFlg: true;
4
4
  deliveryDate: string;
5
5
  deliveryTimeCd: {
6
6
  value: string;
7
7
  };
8
+ } | {
9
+ courierDeliveryFlg?: undefined;
10
+ deliveryDate?: undefined;
11
+ deliveryTimeCd?: undefined;
8
12
  };
9
13
  export declare const getOfficeCode: (formData: FormState) => {
10
14
  office: {
11
15
  id: string;
12
- } | undefined;
16
+ };
17
+ } | {
18
+ office?: undefined;
13
19
  };
14
20
  export declare const getSixthStepData: (formData: FormState) => {
15
21
  participantAddresses: any[];
22
+ } | {
23
+ participantAddresses?: undefined;
16
24
  };
@@ -2,22 +2,31 @@ import { dateToISO } from '../../utils/dateToISO.js';
2
2
  import { getParticipantAddresses } from '../CreditForm/utils.js';
3
3
  export const getDeliveryData = (formData) => {
4
4
  const { methodObtain, deliveryDate = '' } = formData;
5
- return {
6
- courierDeliveryFlg: methodObtain === 'courier',
7
- deliveryDate: dateToISO(deliveryDate),
8
- deliveryTimeCd: { value: 'TIME_2' },
9
- };
5
+ const isCourierDelivery = methodObtain === 'courier';
6
+ return isCourierDelivery
7
+ ? {
8
+ courierDeliveryFlg: isCourierDelivery,
9
+ deliveryDate: dateToISO(deliveryDate),
10
+ deliveryTimeCd: { value: 'TIME_2' },
11
+ }
12
+ : {};
10
13
  };
11
14
  export const getOfficeCode = (formData) => {
12
- const { addressRetail } = formData;
13
- return {
14
- office: addressRetail?.key ? { id: addressRetail.key } : undefined,
15
- };
15
+ const { addressRetail, methodObtain } = formData;
16
+ const isOfficeObtain = addressRetail?.key && methodObtain === 'office';
17
+ return isOfficeObtain
18
+ ? {
19
+ office: { id: addressRetail.key },
20
+ }
21
+ : {};
16
22
  };
17
23
  export const getSixthStepData = (formData) => {
18
- const { addressCourier } = formData;
19
- return {
20
- participantAddresses: getParticipantAddresses({ addressCourier }),
21
- };
24
+ const { addressCourier, methodObtain } = formData;
25
+ const isCourierDelivery = methodObtain === 'courier';
26
+ return isCourierDelivery
27
+ ? {
28
+ participantAddresses: getParticipantAddresses({ addressCourier }),
29
+ }
30
+ : {};
22
31
  };
23
32
  //# sourceMappingURL=getSixthStepData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSixthStepData.js","sourceRoot":"","sources":["../../../src/components/CreditCardForm/getSixthStepData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAmB,EAAE,EAAE;IACrD,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,QAA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EAAE,CAAC;AACT,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAmB,EAAE,EAAE;IACnD,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;IAEjD,MAAM,cAAc,GAAG,aAAa,EAAE,GAAG,IAAI,YAAY,KAAK,QAAQ,CAAC;IAEvE,OAAO,cAAc;QACnB,CAAC,CAAC;YACE,MAAM,EAAE,EAAE,EAAE,EAAE,aAAa,CAAC,GAAG,EAAE;SAClC;QACH,CAAC,CAAC,EAAE,CAAC;AACT,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAmB,EAAE,EAAE;IACtD,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC;IAElD,MAAM,iBAAiB,GAAG,YAAY,KAAK,SAAS,CAAC;IAErD,OAAO,iBAAiB;QACtB,CAAC,CAAC;YACE,oBAAoB,EAAE,uBAAuB,CAAC,EAAE,cAAc,EAAE,CAAC;SAClE;QACH,CAAC,CAAC,EAAE,CAAC;AACT,CAAC,CAAC"}
@@ -5,25 +5,37 @@ import { getParticipantAddresses } from '../CreditForm/utils';
5
5
  export const getDeliveryData = (formData: FormState) => {
6
6
  const { methodObtain, deliveryDate = '' } = formData;
7
7
 
8
- return {
9
- courierDeliveryFlg: methodObtain === 'courier',
10
- deliveryDate: dateToISO(deliveryDate),
11
- deliveryTimeCd: { value: 'TIME_2' },
12
- };
8
+ const isCourierDelivery = methodObtain === 'courier';
9
+
10
+ return isCourierDelivery
11
+ ? {
12
+ courierDeliveryFlg: isCourierDelivery,
13
+ deliveryDate: dateToISO(deliveryDate),
14
+ deliveryTimeCd: { value: 'TIME_2' },
15
+ }
16
+ : {};
13
17
  };
14
18
 
15
19
  export const getOfficeCode = (formData: FormState) => {
16
- const { addressRetail } = formData;
20
+ const { addressRetail, methodObtain } = formData;
21
+
22
+ const isOfficeObtain = addressRetail?.key && methodObtain === 'office';
17
23
 
18
- return {
19
- office: addressRetail?.key ? { id: addressRetail.key } : undefined,
20
- };
24
+ return isOfficeObtain
25
+ ? {
26
+ office: { id: addressRetail.key },
27
+ }
28
+ : {};
21
29
  };
22
30
 
23
31
  export const getSixthStepData = (formData: FormState) => {
24
- const { addressCourier } = formData;
32
+ const { addressCourier, methodObtain } = formData;
33
+
34
+ const isCourierDelivery = methodObtain === 'courier';
25
35
 
26
- return {
27
- participantAddresses: getParticipantAddresses({ addressCourier }),
28
- };
36
+ return isCourierDelivery
37
+ ? {
38
+ participantAddresses: getParticipantAddresses({ addressCourier }),
39
+ }
40
+ : {};
29
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.690",
3
+ "version": "0.14.691",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -5,25 +5,37 @@ import { getParticipantAddresses } from '../CreditForm/utils';
5
5
  export const getDeliveryData = (formData: FormState) => {
6
6
  const { methodObtain, deliveryDate = '' } = formData;
7
7
 
8
- return {
9
- courierDeliveryFlg: methodObtain === 'courier',
10
- deliveryDate: dateToISO(deliveryDate),
11
- deliveryTimeCd: { value: 'TIME_2' },
12
- };
8
+ const isCourierDelivery = methodObtain === 'courier';
9
+
10
+ return isCourierDelivery
11
+ ? {
12
+ courierDeliveryFlg: isCourierDelivery,
13
+ deliveryDate: dateToISO(deliveryDate),
14
+ deliveryTimeCd: { value: 'TIME_2' },
15
+ }
16
+ : {};
13
17
  };
14
18
 
15
19
  export const getOfficeCode = (formData: FormState) => {
16
- const { addressRetail } = formData;
20
+ const { addressRetail, methodObtain } = formData;
21
+
22
+ const isOfficeObtain = addressRetail?.key && methodObtain === 'office';
17
23
 
18
- return {
19
- office: addressRetail?.key ? { id: addressRetail.key } : undefined,
20
- };
24
+ return isOfficeObtain
25
+ ? {
26
+ office: { id: addressRetail.key },
27
+ }
28
+ : {};
21
29
  };
22
30
 
23
31
  export const getSixthStepData = (formData: FormState) => {
24
- const { addressCourier } = formData;
32
+ const { addressCourier, methodObtain } = formData;
33
+
34
+ const isCourierDelivery = methodObtain === 'courier';
25
35
 
26
- return {
27
- participantAddresses: getParticipantAddresses({ addressCourier }),
28
- };
36
+ return isCourierDelivery
37
+ ? {
38
+ participantAddresses: getParticipantAddresses({ addressCourier }),
39
+ }
40
+ : {};
29
41
  };