@redneckz/wildless-cms-uni-blocks 0.14.977 → 0.14.979
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/bundle/bundle.umd.js +56 -13
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +10 -4
- package/bundle/retail/api/createUserTaskDebit.d.ts +1 -0
- package/bundle/retail/api/getClaimChannel.d.ts +8 -0
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +10 -4
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/retail/api/createUserTaskDebit.d.ts +1 -0
- package/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/dist/retail/api/getClaimChannel.d.ts +8 -0
- package/dist/retail/api/getClaimChannel.js +14 -0
- package/dist/retail/api/getClaimChannel.js.map +1 -0
- package/dist/retail/components/Fields/AddressRetailField.js +0 -3
- package/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/dist/retail/components/Fields/PaymentSystemField.js +9 -1
- package/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/dist/retail/components/Fields/RegionRetailField.js +29 -6
- package/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +10 -4
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/retail/api/createUserTaskDebit.d.ts +1 -0
- package/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/lib/retail/api/getClaimChannel.d.ts +8 -0
- package/lib/retail/api/getClaimChannel.js +11 -0
- package/lib/retail/api/getClaimChannel.js.map +1 -0
- package/lib/retail/components/Fields/AddressRetailField.js +0 -3
- package/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/lib/retail/components/Fields/PaymentSystemField.js +9 -1
- package/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/lib/retail/components/Fields/RegionRetailField.js +29 -6
- package/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +56 -13
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +10 -4
- package/mobile/bundle/retail/api/createUserTaskDebit.d.ts +1 -0
- package/mobile/bundle/retail/api/getClaimChannel.d.ts +8 -0
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +10 -4
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/retail/api/createUserTaskDebit.d.ts +1 -0
- package/mobile/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/dist/retail/api/getClaimChannel.d.ts +8 -0
- package/mobile/dist/retail/api/getClaimChannel.js +14 -0
- package/mobile/dist/retail/api/getClaimChannel.js.map +1 -0
- package/mobile/dist/retail/components/Fields/AddressRetailField.js +0 -3
- package/mobile/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js +9 -1
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/RegionRetailField.js +29 -6
- package/mobile/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +10 -4
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +2 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/retail/api/createUserTaskDebit.d.ts +1 -0
- package/mobile/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/lib/retail/api/getClaimChannel.d.ts +8 -0
- package/mobile/lib/retail/api/getClaimChannel.js +11 -0
- package/mobile/lib/retail/api/getClaimChannel.js.map +1 -0
- package/mobile/lib/retail/components/Fields/AddressRetailField.js +0 -3
- package/mobile/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js +9 -1
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/RegionRetailField.js +29 -6
- package/mobile/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +17 -8
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +8 -1
- package/mobile/src/retail/api/createUserTaskDebit.ts +1 -0
- package/mobile/src/retail/api/getClaimChannel.ts +24 -0
- package/mobile/src/retail/components/Fields/AddressRetailField.tsx +0 -4
- package/mobile/src/retail/components/Fields/PaymentSystemField.tsx +10 -1
- package/mobile/src/retail/components/Fields/RegionRetailField.tsx +38 -6
- package/package.json +2 -2
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +17 -8
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +8 -1
- package/src/retail/api/createUserTaskDebit.ts +1 -0
- package/src/retail/api/getClaimChannel.ts +24 -0
- package/src/retail/components/Fields/AddressRetailField.tsx +0 -4
- package/src/retail/components/Fields/PaymentSystemField.tsx +10 -1
- package/src/retail/components/Fields/RegionRetailField.tsx +38 -6
package/bundle/bundle.umd.js
CHANGED
|
@@ -4599,9 +4599,6 @@
|
|
|
4599
4599
|
const officesList = await fetchRegionOffices(regionValue?.key ?? '');
|
|
4600
4600
|
setOffices(officesList);
|
|
4601
4601
|
})();
|
|
4602
|
-
if (regionValue?.key) {
|
|
4603
|
-
addressField.onChange?.('');
|
|
4604
|
-
}
|
|
4605
4602
|
}, [regionValue.key]);
|
|
4606
4603
|
const { points } = useOfficesAtmsMapData({
|
|
4607
4604
|
data: offices,
|
|
@@ -5708,13 +5705,20 @@
|
|
|
5708
5705
|
}));
|
|
5709
5706
|
|
|
5710
5707
|
const optionKey = (option) => option?.key;
|
|
5708
|
+
const DEFAULT_BIBLIOLOBUS_PAYMENT_SYSTEMS = [
|
|
5709
|
+
{ key: 'PAYMENT_SYSTEM_TYPE_3', text: 'UnionPay' },
|
|
5710
|
+
];
|
|
5711
5711
|
const PaymentSystemField = JSX(({ field, input }) => {
|
|
5712
5712
|
const [paymentSystemOptions, setPaymentSystemOptions] = useState([]);
|
|
5713
5713
|
const localStore = useLocalStore();
|
|
5714
|
+
const sessionStore = useSessionStore();
|
|
5714
5715
|
useAsyncEffect(async () => {
|
|
5715
5716
|
const { programId } = localStore;
|
|
5717
|
+
const { claimChannelCode } = sessionStore;
|
|
5716
5718
|
if (programId) {
|
|
5717
|
-
const fetchedPaymentSystems =
|
|
5719
|
+
const fetchedPaymentSystems = claimChannelCode
|
|
5720
|
+
? DEFAULT_BIBLIOLOBUS_PAYMENT_SYSTEMS
|
|
5721
|
+
: await getPaymentSystems(programId);
|
|
5718
5722
|
setPaymentSystemOptions(fetchedPaymentSystems ?? []);
|
|
5719
5723
|
}
|
|
5720
5724
|
}, []);
|
|
@@ -5735,30 +5739,52 @@
|
|
|
5735
5739
|
return res || undefined;
|
|
5736
5740
|
};
|
|
5737
5741
|
|
|
5742
|
+
const DEFAULT_BIBLIOLOBUS_VALUES = {
|
|
5743
|
+
region: {
|
|
5744
|
+
key: 'REGION_77',
|
|
5745
|
+
text: 'Москва и Московская область',
|
|
5746
|
+
},
|
|
5747
|
+
office: {
|
|
5748
|
+
key: '3041100',
|
|
5749
|
+
text: 'Аэропорт Шереметьево, МО, г.Химки, Шереметьевское шоссе, вл39с1',
|
|
5750
|
+
},
|
|
5751
|
+
};
|
|
5738
5752
|
const RegionRetailField = JSX(({ field, input }) => {
|
|
5739
5753
|
const { programId, productType } = useRetailFormStore();
|
|
5740
5754
|
const { data: regions } = useLeadFormData('REGION_RF');
|
|
5741
5755
|
const { data: regionsDelivery } = useAsyncData('regionsDelivery', getRegionsCardDelivery);
|
|
5742
5756
|
const { data: productSettings } = useLeadFormData(getCurrentProductSettings(productType));
|
|
5757
|
+
const sessionStore = useSessionStore();
|
|
5743
5758
|
const isDebit = productType === 'debitCard';
|
|
5744
5759
|
const isSalaryCard = programId === '38';
|
|
5745
5760
|
const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
|
|
5746
5761
|
const formatRegions = regions?.map(({ key, value }) => ({ key, text: value }));
|
|
5747
5762
|
const isDeliveryActive = productSettings?.find((_) => _?.key === 'DELIVERY_ACTIVE')?.value === 'true';
|
|
5748
5763
|
const handleChangeRegion = field('regionRetail')?.onChange;
|
|
5764
|
+
const handleChangeOffice = field('addressRetail')?.onChange;
|
|
5749
5765
|
const handleChangeRegionHasDelivery = field('regionHasDelivery')?.onChange;
|
|
5750
5766
|
const handleChangeMethodObtain = field('methodObtain')?.onChange;
|
|
5767
|
+
const checkRegionDeliveryStatus = useCallback((value) => {
|
|
5768
|
+
const isDebitDeliveryActive = isDebit ? isEsiaAuth && !isSalaryCard : true;
|
|
5769
|
+
return (isDebitDeliveryActive &&
|
|
5770
|
+
isDeliveryActive &&
|
|
5771
|
+
regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg);
|
|
5772
|
+
}, [isDeliveryActive, regionsDelivery]);
|
|
5751
5773
|
const onChange = useCallback((value) => {
|
|
5752
|
-
const regionHasDelivery =
|
|
5753
|
-
? isEsiaAuth &&
|
|
5754
|
-
!isSalaryCard &&
|
|
5755
|
-
isDeliveryActive &&
|
|
5756
|
-
regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg
|
|
5757
|
-
: isDeliveryActive && regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg;
|
|
5774
|
+
const regionHasDelivery = checkRegionDeliveryStatus(value);
|
|
5758
5775
|
handleChangeRegionHasDelivery?.(regionHasDelivery);
|
|
5759
5776
|
handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
|
|
5760
5777
|
handleChangeRegion?.(value);
|
|
5778
|
+
handleChangeOffice?.('');
|
|
5761
5779
|
}, [regionsDelivery, isDeliveryActive, isEsiaAuth]);
|
|
5780
|
+
useEffect(() => {
|
|
5781
|
+
if (sessionStore.claimChannelCode) {
|
|
5782
|
+
handleChangeRegion?.(DEFAULT_BIBLIOLOBUS_VALUES.region);
|
|
5783
|
+
handleChangeOffice?.(DEFAULT_BIBLIOLOBUS_VALUES.office);
|
|
5784
|
+
handleChangeRegionHasDelivery?.(checkRegionDeliveryStatus(DEFAULT_BIBLIOLOBUS_VALUES.region));
|
|
5785
|
+
handleChangeMethodObtain?.('office');
|
|
5786
|
+
}
|
|
5787
|
+
}, [checkRegionDeliveryStatus]);
|
|
5762
5788
|
useEffect(() => {
|
|
5763
5789
|
if (!isEsiaAuth && isDebit) {
|
|
5764
5790
|
handleChangeRegionHasDelivery?.(false);
|
|
@@ -5962,6 +5988,16 @@
|
|
|
5962
5988
|
return res || {};
|
|
5963
5989
|
};
|
|
5964
5990
|
|
|
5991
|
+
const getClaimChannel = async () => {
|
|
5992
|
+
const claimChannelCode = await fetchRetailJSON('/claim-channel/', 'GET').then((res) => {
|
|
5993
|
+
const url = globalThis.location.href;
|
|
5994
|
+
const code = res?.find((_) => _ && url.includes(_.key))?.code;
|
|
5995
|
+
globalThis.sessionStorage.setItem('claimChannelCode', code ?? '');
|
|
5996
|
+
return code;
|
|
5997
|
+
});
|
|
5998
|
+
return claimChannelCode;
|
|
5999
|
+
};
|
|
6000
|
+
|
|
5965
6001
|
const getLastTaskStatus = async (body) => {
|
|
5966
6002
|
const res = await fetchRetailJSON('/user-data/getLastStatus', 'POST', body);
|
|
5967
6003
|
return res?.statusCd === 'DRAFT' ? res?.taskId : null;
|
|
@@ -6649,7 +6685,7 @@
|
|
|
6649
6685
|
...consents,
|
|
6650
6686
|
};
|
|
6651
6687
|
};
|
|
6652
|
-
const getDebitLeadFormTaskData = (formData, programId, marketingInfo) => {
|
|
6688
|
+
const getDebitLeadFormTaskData = ({ formData, programId, marketingInfo, claimChannelCode, }) => {
|
|
6653
6689
|
const { name, surname, middleName, limitedBirthday, phone, email } = formData;
|
|
6654
6690
|
const taskSource = getTaskSource(marketingInfo?.utm_source);
|
|
6655
6691
|
return {
|
|
@@ -6671,6 +6707,7 @@
|
|
|
6671
6707
|
},
|
|
6672
6708
|
],
|
|
6673
6709
|
marketingInfo,
|
|
6710
|
+
claimChannelCode,
|
|
6674
6711
|
},
|
|
6675
6712
|
};
|
|
6676
6713
|
};
|
|
@@ -6883,7 +6920,13 @@
|
|
|
6883
6920
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
6884
6921
|
try {
|
|
6885
6922
|
if (productType === 'debitCard') {
|
|
6886
|
-
const
|
|
6923
|
+
const claimChannelCode = await getClaimChannel();
|
|
6924
|
+
const debitData = await createUserTaskDebit(getDebitLeadFormTaskData({
|
|
6925
|
+
formData,
|
|
6926
|
+
programId,
|
|
6927
|
+
marketingInfo,
|
|
6928
|
+
claimChannelCode,
|
|
6929
|
+
}));
|
|
6887
6930
|
taskId = debitData.taskId;
|
|
6888
6931
|
participantId = debitData.participantId;
|
|
6889
6932
|
}
|
|
@@ -13074,7 +13117,7 @@
|
|
|
13074
13117
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
13075
13118
|
});
|
|
13076
13119
|
|
|
13077
|
-
const packageVersion = "0.14.
|
|
13120
|
+
const packageVersion = "0.14.978";
|
|
13078
13121
|
|
|
13079
13122
|
exports.Blocks = Blocks;
|
|
13080
13123
|
exports.ContentPage = ContentPage;
|