@redneckz/wildless-cms-uni-blocks 0.14.1005 → 0.14.1007
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 +18 -7
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/retail/api/apiBaseUrl.d.ts +2 -1
- package/bundle/retail/components/Fields/{DeliveryDateFiels.d.ts → DeliveryDateField.d.ts} +1 -1
- package/bundle/retail/utils/getBaseUrl.d.ts +1 -0
- package/dist/retail/api/apiBaseUrl.d.ts +2 -1
- package/dist/retail/api/apiBaseUrl.js +3 -2
- package/dist/retail/api/apiBaseUrl.js.map +1 -1
- package/dist/retail/api/doRequest.js +3 -4
- package/dist/retail/api/doRequest.js.map +1 -1
- package/dist/retail/components/Fields/{DeliveryDateFiels.d.ts → DeliveryDateField.d.ts} +1 -1
- package/{mobile/dist/retail/components/Fields/DeliveryDateFiels.js → dist/retail/components/Fields/DeliveryDateField.js} +3 -3
- package/{mobile/dist/retail/components/Fields/DeliveryDateFiels.js.map → dist/retail/components/Fields/DeliveryDateField.js.map} +1 -1
- package/dist/retail/hooks/useLeadFormData.js +3 -2
- package/dist/retail/hooks/useLeadFormData.js.map +1 -1
- package/dist/retail/inputs.js +2 -2
- package/dist/retail/utils/getBaseUrl.d.ts +1 -0
- package/dist/retail/utils/getBaseUrl.js +13 -0
- package/dist/retail/utils/getBaseUrl.js.map +1 -0
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.fixture.d.ts +1 -0
- package/lib/retail/api/apiBaseUrl.d.ts +2 -1
- package/lib/retail/api/apiBaseUrl.js +2 -1
- package/lib/retail/api/apiBaseUrl.js.map +1 -1
- package/lib/retail/api/doRequest.js +3 -4
- package/lib/retail/api/doRequest.js.map +1 -1
- package/lib/retail/components/Fields/{DeliveryDateFiels.d.ts → DeliveryDateField.d.ts} +1 -1
- package/lib/retail/components/Fields/{DeliveryDateFiels.js → DeliveryDateField.js} +2 -2
- package/lib/retail/components/Fields/{DeliveryDateFiels.js.map → DeliveryDateField.js.map} +1 -1
- package/lib/retail/hooks/useLeadFormData.js +3 -2
- package/lib/retail/hooks/useLeadFormData.js.map +1 -1
- package/lib/retail/inputs.js +2 -2
- package/lib/retail/utils/getBaseUrl.d.ts +1 -0
- package/lib/retail/utils/getBaseUrl.js +10 -0
- package/lib/retail/utils/getBaseUrl.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +18 -7
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/retail/api/apiBaseUrl.d.ts +2 -1
- package/mobile/bundle/retail/components/Fields/{DeliveryDateFiels.d.ts → DeliveryDateField.d.ts} +1 -1
- package/mobile/bundle/retail/utils/getBaseUrl.d.ts +1 -0
- package/mobile/dist/retail/api/apiBaseUrl.d.ts +2 -1
- package/mobile/dist/retail/api/apiBaseUrl.js +3 -2
- package/mobile/dist/retail/api/apiBaseUrl.js.map +1 -1
- package/mobile/dist/retail/api/doRequest.js +3 -4
- package/mobile/dist/retail/api/doRequest.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DeliveryDateField.d.ts +2 -0
- package/{dist/retail/components/Fields/DeliveryDateFiels.js → mobile/dist/retail/components/Fields/DeliveryDateField.js} +3 -3
- package/{dist/retail/components/Fields/DeliveryDateFiels.js.map → mobile/dist/retail/components/Fields/DeliveryDateField.js.map} +1 -1
- package/mobile/dist/retail/hooks/useLeadFormData.js +3 -2
- package/mobile/dist/retail/hooks/useLeadFormData.js.map +1 -1
- package/mobile/dist/retail/inputs.js +2 -2
- package/mobile/dist/retail/utils/getBaseUrl.d.ts +1 -0
- package/mobile/dist/retail/utils/getBaseUrl.js +13 -0
- package/mobile/dist/retail/utils/getBaseUrl.js.map +1 -0
- package/mobile/lib/retail/api/apiBaseUrl.d.ts +2 -1
- package/mobile/lib/retail/api/apiBaseUrl.js +2 -1
- package/mobile/lib/retail/api/apiBaseUrl.js.map +1 -1
- package/mobile/lib/retail/api/doRequest.js +3 -4
- package/mobile/lib/retail/api/doRequest.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DeliveryDateField.d.ts +2 -0
- package/mobile/lib/retail/components/Fields/{DeliveryDateFiels.js → DeliveryDateField.js} +2 -2
- package/mobile/lib/retail/components/Fields/{DeliveryDateFiels.js.map → DeliveryDateField.js.map} +1 -1
- package/mobile/lib/retail/hooks/useLeadFormData.js +3 -2
- package/mobile/lib/retail/hooks/useLeadFormData.js.map +1 -1
- package/mobile/lib/retail/inputs.js +2 -2
- package/mobile/lib/retail/utils/getBaseUrl.d.ts +1 -0
- package/mobile/lib/retail/utils/getBaseUrl.js +10 -0
- package/mobile/lib/retail/utils/getBaseUrl.js.map +1 -0
- package/mobile/src/retail/api/apiBaseUrl.ts +2 -1
- package/mobile/src/retail/api/doRequest.ts +13 -17
- package/mobile/src/retail/components/Fields/{DeliveryDateFiels.tsx → DeliveryDateField.tsx} +1 -1
- package/mobile/src/retail/hooks/useLeadFormData.ts +4 -3
- package/mobile/src/retail/inputs.tsx +2 -2
- package/mobile/src/retail/utils/getBaseUrl.ts +17 -0
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +15 -0
- package/src/retail/api/apiBaseUrl.ts +2 -1
- package/src/retail/api/doRequest.ts +13 -17
- package/src/retail/components/Fields/{DeliveryDateFiels.tsx → DeliveryDateField.tsx} +1 -1
- package/src/retail/hooks/useLeadFormData.ts +4 -3
- package/src/retail/inputs.tsx +2 -2
- package/src/retail/utils/getBaseUrl.ts +17 -0
- package/mobile/dist/retail/components/Fields/DeliveryDateFiels.d.ts +0 -2
- package/mobile/lib/retail/components/Fields/DeliveryDateFiels.d.ts +0 -2
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const RETAIL_API_BASE_URI = "/light-api-cash/v1";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const NEW_RETAIL_CREDIT_API_BASE_URI = "/api/credit-application";
|
|
3
|
+
export declare const NEW_RETAIL_CREDIT_CARD_API_BASE_URI = "/api/creditcard-application";
|
package/mobile/bundle/retail/components/Fields/{DeliveryDateFiels.d.ts → DeliveryDateField.d.ts}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const DeliveryDateField: import("@redneckz/uni-jsx").UNIComponent<CustomFieldProps, any, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getBaseUrl: () => "/light-api-cash/v1" | "/api/credit-application" | "/api/creditcard-application";
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const RETAIL_API_BASE_URI = "/light-api-cash/v1";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const NEW_RETAIL_CREDIT_API_BASE_URI = "/api/credit-application";
|
|
3
|
+
export declare const NEW_RETAIL_CREDIT_CARD_API_BASE_URI = "/api/creditcard-application";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.
|
|
2
|
+
exports.NEW_RETAIL_CREDIT_CARD_API_BASE_URI = exports.NEW_RETAIL_CREDIT_API_BASE_URI = exports.RETAIL_API_BASE_URI = void 0;
|
|
3
3
|
exports.RETAIL_API_BASE_URI = '/light-api-cash/v1';
|
|
4
|
-
exports.
|
|
4
|
+
exports.NEW_RETAIL_CREDIT_API_BASE_URI = '/api/credit-application';
|
|
5
|
+
exports.NEW_RETAIL_CREDIT_CARD_API_BASE_URI = '/api/creditcard-application';
|
|
5
6
|
//# sourceMappingURL=apiBaseUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiBaseUrl.js","sourceRoot":"","sources":["../../../src/retail/api/apiBaseUrl.ts"],"names":[],"mappings":";;AAAa,QAAA,mBAAmB,GAAG,oBAAoB,CAAC;AAC3C,QAAA,
|
|
1
|
+
{"version":3,"file":"apiBaseUrl.js","sourceRoot":"","sources":["../../../src/retail/api/apiBaseUrl.ts"],"names":[],"mappings":";;AAAa,QAAA,mBAAmB,GAAG,oBAAoB,CAAC;AAC3C,QAAA,8BAA8B,GAAG,yBAAyB,CAAC;AAC3D,QAAA,mCAAmC,GAAG,6BAA6B,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
2
|
exports.getAuthorizationHeaders = exports.doRequest = exports.fetchRetailJSON = void 0;
|
|
3
|
-
const
|
|
4
|
-
const apiBaseUrl_1 = require("./apiBaseUrl");
|
|
3
|
+
const getBaseUrl_1 = require("../utils/getBaseUrl");
|
|
5
4
|
const getTraceId_1 = require("./getTraceId");
|
|
6
5
|
const fetchRetailJSON = async (url, method, body) => {
|
|
7
6
|
try {
|
|
@@ -15,9 +14,9 @@ const fetchRetailJSON = async (url, method, body) => {
|
|
|
15
14
|
};
|
|
16
15
|
exports.fetchRetailJSON = fetchRetailJSON;
|
|
17
16
|
async function doRequest(url, method, body) {
|
|
18
|
-
const
|
|
17
|
+
const baseUrl = (0, getBaseUrl_1.getBaseUrl)();
|
|
19
18
|
const traceId = (0, getTraceId_1.getTraceId)();
|
|
20
|
-
return globalThis?.fetch?.(`${
|
|
19
|
+
return globalThis?.fetch?.(`${baseUrl}${url}`, {
|
|
21
20
|
method,
|
|
22
21
|
headers: {
|
|
23
22
|
'Content-Type': 'application/json',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doRequest.js","sourceRoot":"","sources":["../../../src/retail/api/doRequest.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"doRequest.js","sourceRoot":"","sources":["../../../src/retail/api/doRequest.ts"],"names":[],"mappings":";;AAAA,oDAAiD;AACjD,6CAA0C;AAEnC,MAAM,eAAe,GAAG,KAAK,EAClC,GAAW,EACX,MAA8B,EAC9B,IAAU,EACS,EAAE;IACrB,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAEpD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;KACxB;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEnB,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAdW,QAAA,eAAe,mBAc1B;AAEK,KAAK,UAAU,SAAS,CAC7B,GAAW,EACX,MAA8B,EAC9B,IAAU;IAEV,MAAM,OAAO,GAAG,IAAA,uBAAU,GAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,IAAA,uBAAU,GAAE,CAAC;IAE7B,OAAO,UAAU,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,GAAG,GAAG,EAAE,EAAE;QAC7C,MAAM;QACN,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,cAAc,EAAE,GAAG;YACnB,aAAa,EAAE,OAAO;YACtB,cAAc,EAAE,OAAO;YACvB,GAAG,IAAA,+BAAuB,GAAE;SAC7B;QACD,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;KACzC,CAAC,CAAC;AACL,CAAC;AApBD,8BAoBC;AAEM,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAEpD,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7D,CAAC,CAAC;AAJW,QAAA,uBAAuB,2BAIlC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.
|
|
2
|
+
exports.DeliveryDateField = void 0;
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
5
|
const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
|
|
@@ -7,7 +7,7 @@ const DatePickerControl_1 = require("../../../ui-kit/DatePicker/DatePickerContro
|
|
|
7
7
|
const useLeadFormData_1 = require("../../hooks/useLeadFormData");
|
|
8
8
|
const useRetailFormStore_1 = require("../../hooks/useRetailFormStore");
|
|
9
9
|
const MIN_DATE = new Date(Date.now() + 1 * 24 * 60 * 60 * 1000);
|
|
10
|
-
exports.
|
|
10
|
+
exports.DeliveryDateField = (0, uni_jsx_1.JSX)(({ field, input }) => {
|
|
11
11
|
const { productType } = (0, useRetailFormStore_1.useRetailFormStore)();
|
|
12
12
|
const isDebit = productType === 'debitCard';
|
|
13
13
|
const minDate = isDebit ? MIN_DATE : new Date();
|
|
@@ -21,4 +21,4 @@ exports.DeliveryDateFiels = (0, uni_jsx_1.JSX)(({ field, input }) => {
|
|
|
21
21
|
}, [data]);
|
|
22
22
|
return ((0, jsx_runtime_1.jsx)(DatePickerControl_1.DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? ''), minDate: minDate, weekends: isDebit ? weekends : [] }));
|
|
23
23
|
});
|
|
24
|
-
//# sourceMappingURL=
|
|
24
|
+
//# sourceMappingURL=DeliveryDateField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"DeliveryDateField.js","sourceRoot":"","sources":["../../../../src/retail/components/Fields/DeliveryDateField.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAsD;AACtD,oFAAiF;AAEjF,iEAA8D;AAC9D,uEAAoE;AAEpE,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;AAEnD,QAAA,iBAAiB,GAAG,IAAA,aAAG,EAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1E,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAC7C,MAAM,OAAO,GAAG,WAAW,KAAK,WAAW,CAAC;IAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;IAChD,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAe,EAAC,wBAAwB,CAAC,CAAC;IAE3D,MAAM,QAAQ,GAAa,IAAA,eAAO,EAAC,GAAG,EAAE;QACtC,MAAM,WAAW,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC;QACjE,IAAI,WAAW,IAAI,WAAW,CAAC,KAAK,EAAE;YACpC,OAAO,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACjD;QAED,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,CACL,uBAAC,qCAAiB,IAChB,KAAK,EAAC,2EAAe,KACjB,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,EAC5B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GACjC,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -2,11 +2,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.useLeadFormData = void 0;
|
|
3
3
|
const useAsyncData_1 = require("@redneckz/uni-jsx/lib/hooks/useAsyncData");
|
|
4
4
|
const fetchJSON_1 = require("../../utils/fetchJSON");
|
|
5
|
-
const apiBaseUrl_1 = require("../api/apiBaseUrl");
|
|
6
5
|
const checkNewMicroservice_1 = require("../utils/checkNewMicroservice");
|
|
6
|
+
const getBaseUrl_1 = require("../utils/getBaseUrl");
|
|
7
7
|
const useLeadFormData = (typeField) => {
|
|
8
8
|
const isNewMicroservice = (0, checkNewMicroservice_1.checkNewMicroservice)();
|
|
9
|
-
const
|
|
9
|
+
const baseUrl = (0, getBaseUrl_1.getBaseUrl)();
|
|
10
|
+
const { data, error } = (0, useAsyncData_1.useAsyncData)(`${baseUrl}${isNewMicroservice ? `/public-data` : ''}/dictionary?dictionaryType=${encodeURIComponent(typeField)}`, fetchData);
|
|
10
11
|
if (data && 'errorMessage' in data) {
|
|
11
12
|
return { error };
|
|
12
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLeadFormData.js","sourceRoot":"","sources":["../../../src/retail/hooks/useLeadFormData.ts"],"names":[],"mappings":";;AAAA,2EAAwE;AACxE,qDAAkD;
|
|
1
|
+
{"version":3,"file":"useLeadFormData.js","sourceRoot":"","sources":["../../../src/retail/hooks/useLeadFormData.ts"],"names":[],"mappings":";;AAAA,2EAAwE;AACxE,qDAAkD;AAElD,wEAAqE;AACrE,oDAAiD;AAM1C,MAAM,eAAe,GAAG,CAAC,SAAiB,EAAE,EAAE;IACnD,MAAM,iBAAiB,GAAG,IAAA,2CAAoB,GAAE,CAAC;IACjD,MAAM,OAAO,GAAG,IAAA,uBAAU,GAAE,CAAC;IAE7B,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAA,2BAAY,EAClC,GAAG,OAAO,GACR,iBAAiB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EACvC,8BAA8B,kBAAkB,CAAC,SAAS,CAAC,EAAE,EAC7D,SAAS,CACV,CAAC;IACF,IAAI,IAAI,IAAI,cAAc,IAAI,IAAI,EAAE;QAClC,OAAO,EAAE,KAAK,EAAE,CAAC;KAClB;IAED,OAAO,EAAE,IAAI,EAAE,IAAwB,EAAE,KAAK,EAAE,CAAC;AACnD,CAAC,CAAC;AAfW,QAAA,eAAe,mBAe1B;AAEF,MAAM,SAAS,GAAG,KAAK,EAAE,GAAW,EAA0C,EAAE;IAC9E,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAAgC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAEvF,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB,CAAC,CAAC"}
|
|
@@ -23,7 +23,7 @@ const CreditCalcField_1 = require("./components/Fields/CreditCalcField");
|
|
|
23
23
|
const CreditInRshbCdField_1 = require("./components/Fields/CreditInRshbCdField");
|
|
24
24
|
const CurrencyField_1 = require("./components/Fields/CurrencyField");
|
|
25
25
|
const DaDataInnField_1 = require("./components/Fields/DaDataInnField");
|
|
26
|
-
const
|
|
26
|
+
const DeliveryDateField_1 = require("./components/Fields/DeliveryDateField");
|
|
27
27
|
const DeliveryTimeField_1 = require("./components/Fields/DeliveryTimeField");
|
|
28
28
|
const DependentsField_1 = require("./components/Fields/DependentsField");
|
|
29
29
|
const DulIssueDateField_1 = require("./components/Fields/DulIssueDateField");
|
|
@@ -148,7 +148,7 @@ exports.InputRetailCardMap = {
|
|
|
148
148
|
cardCategory: CardCategoryField_1.CardCategoryField,
|
|
149
149
|
codeWord: CodeWordField_1.CodeWordField,
|
|
150
150
|
methodObtain: MethodObtainField_1.MethodObtainField,
|
|
151
|
-
deliveryDate:
|
|
151
|
+
deliveryDate: DeliveryDateField_1.DeliveryDateField,
|
|
152
152
|
latinName: LatinNameField_1.LatinNameField,
|
|
153
153
|
latinSurname: LatinSurnameField_1.LatinSurnameField,
|
|
154
154
|
deliveryTime: DeliveryTimeField_1.DeliveryTimeField,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getBaseUrl: () => "/light-api-cash/v1" | "/api/credit-application" | "/api/creditcard-application";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.getBaseUrl = void 0;
|
|
3
|
+
const apiBaseUrl_1 = require("../api/apiBaseUrl");
|
|
4
|
+
const getBaseUrl = () => {
|
|
5
|
+
const isNewMicroservice = globalThis.sessionStorage?.getItem('isNewMicroservice');
|
|
6
|
+
const productType = globalThis.localStorage?.getItem('productType');
|
|
7
|
+
const newRetailApi = productType === '"credit"'
|
|
8
|
+
? apiBaseUrl_1.NEW_RETAIL_CREDIT_API_BASE_URI
|
|
9
|
+
: apiBaseUrl_1.NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
|
|
10
|
+
return isNewMicroservice ? newRetailApi : apiBaseUrl_1.RETAIL_API_BASE_URI;
|
|
11
|
+
};
|
|
12
|
+
exports.getBaseUrl = getBaseUrl;
|
|
13
|
+
//# sourceMappingURL=getBaseUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBaseUrl.js","sourceRoot":"","sources":["../../../src/retail/utils/getBaseUrl.ts"],"names":[],"mappings":";;AAAA,kDAI2B;AAEpB,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,iBAAiB,GAAG,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClF,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAEpE,MAAM,YAAY,GAChB,WAAW,KAAK,UAAU;QACxB,CAAC,CAAC,2CAA8B;QAChC,CAAC,CAAC,gDAAmC,CAAC;IAE1C,OAAO,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,gCAAmB,CAAC;AAChE,CAAC,CAAC;AAVW,QAAA,UAAU,cAUrB"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const RETAIL_API_BASE_URI = "/light-api-cash/v1";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const NEW_RETAIL_CREDIT_API_BASE_URI = "/api/credit-application";
|
|
3
|
+
export declare const NEW_RETAIL_CREDIT_CARD_API_BASE_URI = "/api/creditcard-application";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export const RETAIL_API_BASE_URI = '/light-api-cash/v1';
|
|
2
|
-
export const
|
|
2
|
+
export const NEW_RETAIL_CREDIT_API_BASE_URI = '/api/credit-application';
|
|
3
|
+
export const NEW_RETAIL_CREDIT_CARD_API_BASE_URI = '/api/creditcard-application';
|
|
3
4
|
//# sourceMappingURL=apiBaseUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiBaseUrl.js","sourceRoot":"","sources":["../../../src/retail/api/apiBaseUrl.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AACxD,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"apiBaseUrl.js","sourceRoot":"","sources":["../../../src/retail/api/apiBaseUrl.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AACxD,MAAM,CAAC,MAAM,8BAA8B,GAAG,yBAAyB,CAAC;AACxE,MAAM,CAAC,MAAM,mCAAmC,GAAG,6BAA6B,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NEW_RETAIL_API_BASE_URI, RETAIL_API_BASE_URI } from './apiBaseUrl.js';
|
|
1
|
+
import { getBaseUrl } from '../utils/getBaseUrl.js';
|
|
3
2
|
import { getTraceId } from './getTraceId.js';
|
|
4
3
|
export const fetchRetailJSON = async (url, method, body) => {
|
|
5
4
|
try {
|
|
@@ -12,9 +11,9 @@ export const fetchRetailJSON = async (url, method, body) => {
|
|
|
12
11
|
}
|
|
13
12
|
};
|
|
14
13
|
export async function doRequest(url, method, body) {
|
|
15
|
-
const
|
|
14
|
+
const baseUrl = getBaseUrl();
|
|
16
15
|
const traceId = getTraceId();
|
|
17
|
-
return globalThis?.fetch?.(`${
|
|
16
|
+
return globalThis?.fetch?.(`${baseUrl}${url}`, {
|
|
18
17
|
method,
|
|
19
18
|
headers: {
|
|
20
19
|
'Content-Type': 'application/json',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doRequest.js","sourceRoot":"","sources":["../../../src/retail/api/doRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"doRequest.js","sourceRoot":"","sources":["../../../src/retail/api/doRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAClC,GAAW,EACX,MAA8B,EAC9B,IAAU,EACS,EAAE;IACrB,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAEpD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;KACxB;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEnB,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,GAAW,EACX,MAA8B,EAC9B,IAAU;IAEV,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,OAAO,UAAU,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,GAAG,GAAG,EAAE,EAAE;QAC7C,MAAM;QACN,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,cAAc,EAAE,GAAG;YACnB,aAAa,EAAE,OAAO;YACtB,cAAc,EAAE,OAAO;YACvB,GAAG,uBAAuB,EAAE;SAC7B;QACD,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;KACzC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAEpD,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7D,CAAC,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { DatePickerControl } from '../../../ui-kit/DatePicker/DatePickerControl.
|
|
|
5
5
|
import { useLeadFormData } from '../../hooks/useLeadFormData.js';
|
|
6
6
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore.js';
|
|
7
7
|
const MIN_DATE = new Date(Date.now() + 1 * 24 * 60 * 60 * 1000);
|
|
8
|
-
export const
|
|
8
|
+
export const DeliveryDateField = JSX(({ field, input }) => {
|
|
9
9
|
const { productType } = useRetailFormStore();
|
|
10
10
|
const isDebit = productType === 'debitCard';
|
|
11
11
|
const minDate = isDebit ? MIN_DATE : new Date();
|
|
@@ -19,4 +19,4 @@ export const DeliveryDateFiels = JSX(({ field, input }) => {
|
|
|
19
19
|
}, [data]);
|
|
20
20
|
return (_jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? ''), minDate: minDate, weekends: isDebit ? weekends : [] }));
|
|
21
21
|
});
|
|
22
|
-
//# sourceMappingURL=
|
|
22
|
+
//# sourceMappingURL=DeliveryDateField.js.map
|
package/mobile/lib/retail/components/Fields/{DeliveryDateFiels.js.map → DeliveryDateField.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"DeliveryDateField.js","sourceRoot":"","sources":["../../../../src/retail/components/Fields/DeliveryDateField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1E,MAAM,EAAE,WAAW,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAG,WAAW,KAAK,WAAW,CAAC;IAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;IAChD,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,wBAAwB,CAAC,CAAC;IAE3D,MAAM,QAAQ,GAAa,OAAO,CAAC,GAAG,EAAE;QACtC,MAAM,WAAW,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC;QACjE,IAAI,WAAW,IAAI,WAAW,CAAC,KAAK,EAAE;YACpC,OAAO,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACjD;QAED,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,CACL,KAAC,iBAAiB,IAChB,KAAK,EAAC,2EAAe,KACjB,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,EAC5B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GACjC,CACH,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
2
|
import { fetchJSON } from '../../utils/fetchJSON.js';
|
|
3
|
-
import { NEW_RETAIL_API_BASE_URI, RETAIL_API_BASE_URI } from '../api/apiBaseUrl.js';
|
|
4
3
|
import { checkNewMicroservice } from '../utils/checkNewMicroservice.js';
|
|
4
|
+
import { getBaseUrl } from '../utils/getBaseUrl.js';
|
|
5
5
|
export const useLeadFormData = (typeField) => {
|
|
6
6
|
const isNewMicroservice = checkNewMicroservice();
|
|
7
|
-
const
|
|
7
|
+
const baseUrl = getBaseUrl();
|
|
8
|
+
const { data, error } = useAsyncData(`${baseUrl}${isNewMicroservice ? `/public-data` : ''}/dictionary?dictionaryType=${encodeURIComponent(typeField)}`, fetchData);
|
|
8
9
|
if (data && 'errorMessage' in data) {
|
|
9
10
|
return { error };
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLeadFormData.js","sourceRoot":"","sources":["../../../src/retail/hooks/useLeadFormData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"useLeadFormData.js","sourceRoot":"","sources":["../../../src/retail/hooks/useLeadFormData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAMjD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,SAAiB,EAAE,EAAE;IACnD,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;IACjD,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,YAAY,CAClC,GAAG,OAAO,GACR,iBAAiB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EACvC,8BAA8B,kBAAkB,CAAC,SAAS,CAAC,EAAE,EAC7D,SAAS,CACV,CAAC;IACF,IAAI,IAAI,IAAI,cAAc,IAAI,IAAI,EAAE;QAClC,OAAO,EAAE,KAAK,EAAE,CAAC;KAClB;IAED,OAAO,EAAE,IAAI,EAAE,IAAwB,EAAE,KAAK,EAAE,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,KAAK,EAAE,GAAW,EAA0C,EAAE;IAC9E,MAAM,MAAM,GAAG,MAAM,SAAS,CAAgC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAEvF,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB,CAAC,CAAC"}
|
|
@@ -21,7 +21,7 @@ import { CreditCalcField } from './components/Fields/CreditCalcField.js';
|
|
|
21
21
|
import { CreditInRshbCdField } from './components/Fields/CreditInRshbCdField.js';
|
|
22
22
|
import { CurrencyField } from './components/Fields/CurrencyField.js';
|
|
23
23
|
import { DaDataInnField } from './components/Fields/DaDataInnField.js';
|
|
24
|
-
import {
|
|
24
|
+
import { DeliveryDateField } from './components/Fields/DeliveryDateField.js';
|
|
25
25
|
import { DeliveryTimeField } from './components/Fields/DeliveryTimeField.js';
|
|
26
26
|
import { DependentsField } from './components/Fields/DependentsField.js';
|
|
27
27
|
import { DulIssueDateField } from './components/Fields/DulIssueDateField.js';
|
|
@@ -146,7 +146,7 @@ export const InputRetailCardMap = {
|
|
|
146
146
|
cardCategory: CardCategoryField,
|
|
147
147
|
codeWord: CodeWordField,
|
|
148
148
|
methodObtain: MethodObtainField,
|
|
149
|
-
deliveryDate:
|
|
149
|
+
deliveryDate: DeliveryDateField,
|
|
150
150
|
latinName: LatinNameField,
|
|
151
151
|
latinSurname: LatinSurnameField,
|
|
152
152
|
deliveryTime: DeliveryTimeField,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getBaseUrl: () => "/light-api-cash/v1" | "/api/credit-application" | "/api/creditcard-application";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NEW_RETAIL_CREDIT_API_BASE_URI, NEW_RETAIL_CREDIT_CARD_API_BASE_URI, RETAIL_API_BASE_URI, } from '../api/apiBaseUrl.js';
|
|
2
|
+
export const getBaseUrl = () => {
|
|
3
|
+
const isNewMicroservice = globalThis.sessionStorage?.getItem('isNewMicroservice');
|
|
4
|
+
const productType = globalThis.localStorage?.getItem('productType');
|
|
5
|
+
const newRetailApi = productType === '"credit"'
|
|
6
|
+
? NEW_RETAIL_CREDIT_API_BASE_URI
|
|
7
|
+
: NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
|
|
8
|
+
return isNewMicroservice ? newRetailApi : RETAIL_API_BASE_URI;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=getBaseUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBaseUrl.js","sourceRoot":"","sources":["../../../src/retail/utils/getBaseUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,mCAAmC,EACnC,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,iBAAiB,GAAG,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClF,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAEpE,MAAM,YAAY,GAChB,WAAW,KAAK,UAAU;QACxB,CAAC,CAAC,8BAA8B;QAChC,CAAC,CAAC,mCAAmC,CAAC;IAE1C,OAAO,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,mBAAmB,CAAC;AAChE,CAAC,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export const RETAIL_API_BASE_URI = '/light-api-cash/v1';
|
|
2
|
-
export const
|
|
2
|
+
export const NEW_RETAIL_CREDIT_API_BASE_URI = '/api/credit-application';
|
|
3
|
+
export const NEW_RETAIL_CREDIT_CARD_API_BASE_URI = '/api/creditcard-application';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NEW_RETAIL_API_BASE_URI, RETAIL_API_BASE_URI } from './apiBaseUrl';
|
|
1
|
+
import { getBaseUrl } from '../utils/getBaseUrl';
|
|
3
2
|
import { getTraceId } from './getTraceId';
|
|
4
3
|
|
|
5
4
|
export const fetchRetailJSON = async <R>(
|
|
@@ -23,24 +22,21 @@ export async function doRequest(
|
|
|
23
22
|
method: 'POST' | 'GET' | 'PUT',
|
|
24
23
|
body?: any,
|
|
25
24
|
): Promise<Response> {
|
|
26
|
-
const
|
|
25
|
+
const baseUrl = getBaseUrl();
|
|
27
26
|
const traceId = getTraceId();
|
|
28
27
|
|
|
29
|
-
return globalThis?.fetch?.(
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
'X-B3-Traceid': traceId,
|
|
38
|
-
...getAuthorizationHeaders(),
|
|
39
|
-
},
|
|
40
|
-
credentials: 'include',
|
|
41
|
-
body: body ? JSON.stringify(body) : null,
|
|
28
|
+
return globalThis?.fetch?.(`${baseUrl}${url}`, {
|
|
29
|
+
method,
|
|
30
|
+
headers: {
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
'X-B3-Sampled': '1',
|
|
33
|
+
'X-B3-Spanid': traceId,
|
|
34
|
+
'X-B3-Traceid': traceId,
|
|
35
|
+
...getAuthorizationHeaders(),
|
|
42
36
|
},
|
|
43
|
-
|
|
37
|
+
credentials: 'include',
|
|
38
|
+
body: body ? JSON.stringify(body) : null,
|
|
39
|
+
});
|
|
44
40
|
}
|
|
45
41
|
|
|
46
42
|
export const getAuthorizationHeaders = () => {
|
|
@@ -7,7 +7,7 @@ import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
|
7
7
|
|
|
8
8
|
const MIN_DATE = new Date(Date.now() + 1 * 24 * 60 * 60 * 1000);
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const DeliveryDateField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
11
11
|
const { productType } = useRetailFormStore();
|
|
12
12
|
const isDebit = productType === 'debitCard';
|
|
13
13
|
const minDate = isDebit ? MIN_DATE : new Date();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
2
|
import { fetchJSON } from '../../utils/fetchJSON';
|
|
3
|
-
import { NEW_RETAIL_API_BASE_URI, RETAIL_API_BASE_URI } from '../api/apiBaseUrl';
|
|
4
3
|
import { type DictionaryItem } from '../model/LeadFormData';
|
|
5
4
|
import { checkNewMicroservice } from '../utils/checkNewMicroservice';
|
|
5
|
+
import { getBaseUrl } from '../utils/getBaseUrl';
|
|
6
6
|
|
|
7
7
|
type ErrorProps = {
|
|
8
8
|
errorMessage?: string;
|
|
@@ -10,10 +10,11 @@ type ErrorProps = {
|
|
|
10
10
|
|
|
11
11
|
export const useLeadFormData = (typeField: string) => {
|
|
12
12
|
const isNewMicroservice = checkNewMicroservice();
|
|
13
|
+
const baseUrl = getBaseUrl();
|
|
13
14
|
|
|
14
15
|
const { data, error } = useAsyncData(
|
|
15
|
-
`${
|
|
16
|
-
isNewMicroservice ?
|
|
16
|
+
`${baseUrl}${
|
|
17
|
+
isNewMicroservice ? `/public-data` : ''
|
|
17
18
|
}/dictionary?dictionaryType=${encodeURIComponent(typeField)}`,
|
|
18
19
|
fetchData,
|
|
19
20
|
);
|
|
@@ -22,7 +22,7 @@ import { CreditCalcField } from './components/Fields/CreditCalcField';
|
|
|
22
22
|
import { CreditInRshbCdField } from './components/Fields/CreditInRshbCdField';
|
|
23
23
|
import { CurrencyField } from './components/Fields/CurrencyField';
|
|
24
24
|
import { DaDataInnField } from './components/Fields/DaDataInnField';
|
|
25
|
-
import {
|
|
25
|
+
import { DeliveryDateField } from './components/Fields/DeliveryDateField';
|
|
26
26
|
import { DeliveryTimeField } from './components/Fields/DeliveryTimeField';
|
|
27
27
|
import { DependentsField } from './components/Fields/DependentsField';
|
|
28
28
|
import { DulIssueDateField } from './components/Fields/DulIssueDateField';
|
|
@@ -154,7 +154,7 @@ export const InputRetailCardMap = {
|
|
|
154
154
|
cardCategory: CardCategoryField,
|
|
155
155
|
codeWord: CodeWordField,
|
|
156
156
|
methodObtain: MethodObtainField,
|
|
157
|
-
deliveryDate:
|
|
157
|
+
deliveryDate: DeliveryDateField,
|
|
158
158
|
latinName: LatinNameField,
|
|
159
159
|
latinSurname: LatinSurnameField,
|
|
160
160
|
deliveryTime: DeliveryTimeField,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NEW_RETAIL_CREDIT_API_BASE_URI,
|
|
3
|
+
NEW_RETAIL_CREDIT_CARD_API_BASE_URI,
|
|
4
|
+
RETAIL_API_BASE_URI,
|
|
5
|
+
} from '../api/apiBaseUrl';
|
|
6
|
+
|
|
7
|
+
export const getBaseUrl = () => {
|
|
8
|
+
const isNewMicroservice = globalThis.sessionStorage?.getItem('isNewMicroservice');
|
|
9
|
+
const productType = globalThis.localStorage?.getItem('productType');
|
|
10
|
+
|
|
11
|
+
const newRetailApi =
|
|
12
|
+
productType === '"credit"'
|
|
13
|
+
? NEW_RETAIL_CREDIT_API_BASE_URI
|
|
14
|
+
: NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
|
|
15
|
+
|
|
16
|
+
return isNewMicroservice ? newRetailApi : RETAIL_API_BASE_URI;
|
|
17
|
+
};
|
package/package.json
CHANGED
|
@@ -39,6 +39,21 @@ export default {
|
|
|
39
39
|
</div>
|
|
40
40
|
),
|
|
41
41
|
|
|
42
|
+
newMicroserviceCC: (
|
|
43
|
+
<div className="container grid grid-cols-12">
|
|
44
|
+
<ApplicationLeadForm
|
|
45
|
+
className="col-span-12"
|
|
46
|
+
title="Заявка на кредит"
|
|
47
|
+
programId="13"
|
|
48
|
+
productType="creditCard"
|
|
49
|
+
button={button}
|
|
50
|
+
isNewMicroservice={true}
|
|
51
|
+
/>
|
|
52
|
+
<PopupManager />
|
|
53
|
+
<DialogManager />
|
|
54
|
+
</div>
|
|
55
|
+
),
|
|
56
|
+
|
|
42
57
|
creditCard: (
|
|
43
58
|
<div className="container grid grid-cols-12">
|
|
44
59
|
<ApplicationLeadForm
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export const RETAIL_API_BASE_URI = '/light-api-cash/v1';
|
|
2
|
-
export const
|
|
2
|
+
export const NEW_RETAIL_CREDIT_API_BASE_URI = '/api/credit-application';
|
|
3
|
+
export const NEW_RETAIL_CREDIT_CARD_API_BASE_URI = '/api/creditcard-application';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NEW_RETAIL_API_BASE_URI, RETAIL_API_BASE_URI } from './apiBaseUrl';
|
|
1
|
+
import { getBaseUrl } from '../utils/getBaseUrl';
|
|
3
2
|
import { getTraceId } from './getTraceId';
|
|
4
3
|
|
|
5
4
|
export const fetchRetailJSON = async <R>(
|
|
@@ -23,24 +22,21 @@ export async function doRequest(
|
|
|
23
22
|
method: 'POST' | 'GET' | 'PUT',
|
|
24
23
|
body?: any,
|
|
25
24
|
): Promise<Response> {
|
|
26
|
-
const
|
|
25
|
+
const baseUrl = getBaseUrl();
|
|
27
26
|
const traceId = getTraceId();
|
|
28
27
|
|
|
29
|
-
return globalThis?.fetch?.(
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
'X-B3-Traceid': traceId,
|
|
38
|
-
...getAuthorizationHeaders(),
|
|
39
|
-
},
|
|
40
|
-
credentials: 'include',
|
|
41
|
-
body: body ? JSON.stringify(body) : null,
|
|
28
|
+
return globalThis?.fetch?.(`${baseUrl}${url}`, {
|
|
29
|
+
method,
|
|
30
|
+
headers: {
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
'X-B3-Sampled': '1',
|
|
33
|
+
'X-B3-Spanid': traceId,
|
|
34
|
+
'X-B3-Traceid': traceId,
|
|
35
|
+
...getAuthorizationHeaders(),
|
|
42
36
|
},
|
|
43
|
-
|
|
37
|
+
credentials: 'include',
|
|
38
|
+
body: body ? JSON.stringify(body) : null,
|
|
39
|
+
});
|
|
44
40
|
}
|
|
45
41
|
|
|
46
42
|
export const getAuthorizationHeaders = () => {
|
|
@@ -7,7 +7,7 @@ import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
|
7
7
|
|
|
8
8
|
const MIN_DATE = new Date(Date.now() + 1 * 24 * 60 * 60 * 1000);
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const DeliveryDateField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
11
11
|
const { productType } = useRetailFormStore();
|
|
12
12
|
const isDebit = productType === 'debitCard';
|
|
13
13
|
const minDate = isDebit ? MIN_DATE : new Date();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
2
|
import { fetchJSON } from '../../utils/fetchJSON';
|
|
3
|
-
import { NEW_RETAIL_API_BASE_URI, RETAIL_API_BASE_URI } from '../api/apiBaseUrl';
|
|
4
3
|
import { type DictionaryItem } from '../model/LeadFormData';
|
|
5
4
|
import { checkNewMicroservice } from '../utils/checkNewMicroservice';
|
|
5
|
+
import { getBaseUrl } from '../utils/getBaseUrl';
|
|
6
6
|
|
|
7
7
|
type ErrorProps = {
|
|
8
8
|
errorMessage?: string;
|
|
@@ -10,10 +10,11 @@ type ErrorProps = {
|
|
|
10
10
|
|
|
11
11
|
export const useLeadFormData = (typeField: string) => {
|
|
12
12
|
const isNewMicroservice = checkNewMicroservice();
|
|
13
|
+
const baseUrl = getBaseUrl();
|
|
13
14
|
|
|
14
15
|
const { data, error } = useAsyncData(
|
|
15
|
-
`${
|
|
16
|
-
isNewMicroservice ?
|
|
16
|
+
`${baseUrl}${
|
|
17
|
+
isNewMicroservice ? `/public-data` : ''
|
|
17
18
|
}/dictionary?dictionaryType=${encodeURIComponent(typeField)}`,
|
|
18
19
|
fetchData,
|
|
19
20
|
);
|
package/src/retail/inputs.tsx
CHANGED
|
@@ -22,7 +22,7 @@ import { CreditCalcField } from './components/Fields/CreditCalcField';
|
|
|
22
22
|
import { CreditInRshbCdField } from './components/Fields/CreditInRshbCdField';
|
|
23
23
|
import { CurrencyField } from './components/Fields/CurrencyField';
|
|
24
24
|
import { DaDataInnField } from './components/Fields/DaDataInnField';
|
|
25
|
-
import {
|
|
25
|
+
import { DeliveryDateField } from './components/Fields/DeliveryDateField';
|
|
26
26
|
import { DeliveryTimeField } from './components/Fields/DeliveryTimeField';
|
|
27
27
|
import { DependentsField } from './components/Fields/DependentsField';
|
|
28
28
|
import { DulIssueDateField } from './components/Fields/DulIssueDateField';
|
|
@@ -154,7 +154,7 @@ export const InputRetailCardMap = {
|
|
|
154
154
|
cardCategory: CardCategoryField,
|
|
155
155
|
codeWord: CodeWordField,
|
|
156
156
|
methodObtain: MethodObtainField,
|
|
157
|
-
deliveryDate:
|
|
157
|
+
deliveryDate: DeliveryDateField,
|
|
158
158
|
latinName: LatinNameField,
|
|
159
159
|
latinSurname: LatinSurnameField,
|
|
160
160
|
deliveryTime: DeliveryTimeField,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NEW_RETAIL_CREDIT_API_BASE_URI,
|
|
3
|
+
NEW_RETAIL_CREDIT_CARD_API_BASE_URI,
|
|
4
|
+
RETAIL_API_BASE_URI,
|
|
5
|
+
} from '../api/apiBaseUrl';
|
|
6
|
+
|
|
7
|
+
export const getBaseUrl = () => {
|
|
8
|
+
const isNewMicroservice = globalThis.sessionStorage?.getItem('isNewMicroservice');
|
|
9
|
+
const productType = globalThis.localStorage?.getItem('productType');
|
|
10
|
+
|
|
11
|
+
const newRetailApi =
|
|
12
|
+
productType === '"credit"'
|
|
13
|
+
? NEW_RETAIL_CREDIT_API_BASE_URI
|
|
14
|
+
: NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
|
|
15
|
+
|
|
16
|
+
return isNewMicroservice ? newRetailApi : RETAIL_API_BASE_URI;
|
|
17
|
+
};
|