digipay-utility-payment 0.0.11 → 0.0.12

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.
Binary file
@@ -1306,7 +1306,7 @@ class FormlyHorizontalWrapperComponent extends FieldWrapper {
1306
1306
  <em class="text-danger">*</em>
1307
1307
  }
1308
1308
  </label>
1309
- <div class="col-md-5">
1309
+ <div class="col-md-7">
1310
1310
  <ng-template #fieldComponent></ng-template>
1311
1311
  @if (showError) {
1312
1312
  <div class="invalid-feedback d-block">
@@ -1331,7 +1331,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
1331
1331
  <em class="text-danger">*</em>
1332
1332
  }
1333
1333
  </label>
1334
- <div class="col-md-5">
1334
+ <div class="col-md-7">
1335
1335
  <ng-template #fieldComponent></ng-template>
1336
1336
  @if (showError) {
1337
1337
  <div class="invalid-feedback d-block">
@@ -1928,19 +1928,16 @@ class BillWorkflowComponent {
1928
1928
  this.topupAndBillpaymentService.vendorProvider.pipe(takeUntil(this.destroy$)).subscribe(data => {
1929
1929
  if (isNotNull(data)) {
1930
1930
  this.vendorProvider = data;
1931
- console.log("vendorProvider==>", this.vendorProvider);
1932
1931
  }
1933
1932
  });
1934
1933
  this.topupAndBillpaymentService.workFlowUserInput.pipe(takeUntil(this.destroy$)).subscribe((data) => {
1935
1934
  if (isNotNull(data)) {
1936
1935
  this.workFlowUserInput = data;
1937
- console.log("workFlowUserInput==>", this.workFlowUserInput);
1938
1936
  }
1939
1937
  });
1940
1938
  this.topupAndBillpaymentService.vendorPlan.pipe(takeUntil(this.destroy$)).subscribe((data) => {
1941
1939
  if (isNotNull(data)) {
1942
1940
  this.selectedProduct = data;
1943
- console.log("selectedProduct==>", this.selectedProduct);
1944
1941
  }
1945
1942
  });
1946
1943
  this.topupAndBillpaymentService.currentScreenStep.pipe(takeUntil(this.destroy$)).subscribe((index) => {
@@ -1959,7 +1956,6 @@ class BillWorkflowComponent {
1959
1956
  this.topupAndBillpaymentService.workflowData.pipe(takeUntil(this.destroy$)).subscribe((data) => {
1960
1957
  if (isNotNull(data)) {
1961
1958
  this.allWorkflowData = data;
1962
- console.log("allWorkflowData==>", this.allWorkflowData);
1963
1959
  }
1964
1960
  });
1965
1961
  // Create form with updateOn: 'change' for real-time validation
@@ -2087,7 +2083,36 @@ class BillWorkflowComponent {
2087
2083
  }
2088
2084
  }
2089
2085
  submitForm() {
2090
- if (!this.validateEnteredAmountAgainstBill()) {
2086
+ // Mark all fields as touched to show validation errors
2087
+ this.fieldsArray.forEach((field) => {
2088
+ if (!field.key)
2089
+ return;
2090
+ const formControl = this.detailsForm.get(field?.key.toString());
2091
+ if (formControl) {
2092
+ formControl.markAsTouched();
2093
+ formControl.updateValueAndValidity();
2094
+ }
2095
+ });
2096
+ // Check if any required fields are empty
2097
+ let hasEmptyFields = false;
2098
+ this.fieldsArray.forEach((field) => {
2099
+ const isRequired = field?.templateOptions?.required;
2100
+ const fieldKey = field.key?.toString();
2101
+ if (!fieldKey)
2102
+ return;
2103
+ const formControl = this.detailsForm.get(fieldKey);
2104
+ const fieldValue = formControl?.value;
2105
+ if (isRequired && (!fieldValue || fieldValue === '' || fieldValue === null || fieldValue === undefined)) {
2106
+ hasEmptyFields = true;
2107
+ if (formControl) {
2108
+ formControl.setErrors({ required: true });
2109
+ formControl.markAsTouched();
2110
+ }
2111
+ }
2112
+ });
2113
+ if (hasEmptyFields || !this.detailsForm.valid) {
2114
+ // Show error message when form is invalid or has empty required fields
2115
+ this.toasterService.error(this.translationService.translate("LABEL_PLEASE_FILL_ALL_REQUIRED_FIELDS"));
2091
2116
  return;
2092
2117
  }
2093
2118
  // Validate amount range for products with range price type
@@ -2253,210 +2278,242 @@ class BillWorkflowComponent {
2253
2278
  this.topupAndBillpaymentService.saveWorkflowData(workflowState);
2254
2279
  }
2255
2280
  getExtraFieldsToShow(field) {
2256
- if (field) {
2257
- let isReadOnly = false;
2258
- let fieldValue = null;
2259
- let customValidators = {};
2260
- if (field?.external_field_key === "dial_code") {
2261
- isReadOnly = true;
2262
- fieldValue = this.currentUserDetails?.dial_code;
2263
- this.fieldsModel = { "dial_code": fieldValue };
2264
- }
2265
- // Check if this is an amount field and we have a selected product
2266
- const isAmountField = field?.external_field_key?.toLowerCase().includes("amount") ||
2267
- field?.field_title?.toLowerCase().includes("amount");
2268
- if (isAmountField && this.selectedProduct) {
2269
- if (this.selectedProduct?.product_price_type === PRODUCT_PRICE_TYPE.FIXED) {
2270
- // Fixed price: make field readonly and set the fixed price
2271
- isReadOnly = true;
2272
- fieldValue = this.selectedProduct?.product_fixed_price || 0;
2273
- if (this.fieldsModel) {
2274
- this.fieldsModel[field.external_field_key] = fieldValue;
2275
- }
2276
- else {
2277
- this.fieldsModel = { [field.external_field_key]: fieldValue };
2278
- }
2279
- }
2280
- else if (this.selectedProduct?.product_price_type === PRODUCT_PRICE_TYPE.RANGE) {
2281
- const rangeMin = Number(this.selectedProduct?.product_range_price?.min) || 0;
2282
- const rangeMax = Number(this.selectedProduct?.product_range_price?.max) || 0;
2283
- customValidators = {
2284
- ...customValidators,
2285
- // Range validator - checks if value is within the allowed range
2286
- // Allows typing leading zeros (e.g., "01", "08") but validates the numeric value
2287
- range: {
2288
- expression: (control) => {
2289
- const value = control?.value;
2290
- if (value === null || value === undefined || value === '') {
2291
- return true; // No error if empty
2292
- }
2293
- const valueStr = String(value).trim();
2294
- // Convert string to number (handles leading zeros: "01" becomes 1, "08" becomes 8)
2295
- const numValue = Number(valueStr);
2296
- if (isNaN(numValue) || !isFinite(numValue)) {
2297
- return true; // Skip validation for invalid numbers
2298
- }
2299
- // Return true if value is IN range (no error), false if out of range (error)
2300
- return numValue >= rangeMin && numValue <= rangeMax;
2301
- },
2302
- message: () => `${this.translationService.translate("COMMON_LABEL_AMOUNT_MUST_BE_BETWEEN")} ${rangeMin} ${this.translationService.translate("COMMON_LABEL_AND")} ${rangeMax}`
2303
- }
2304
- };
2305
- }
2306
- }
2307
- if (isAmountField) {
2308
- const billAmount = this.getBillAmount();
2309
- if (billAmount !== null) {
2310
- customValidators = {
2311
- ...customValidators,
2312
- billAmountMax: {
2313
- expression: (control) => {
2314
- const enteredAmount = this.parseFormAmount(control?.value);
2315
- if (enteredAmount === null) {
2316
- return true;
2317
- }
2318
- return enteredAmount <= billAmount;
2319
- },
2320
- message: () => this.translationService.translate("COMMON_LABEL_AMOUNT_MUST_NOT_EXCEED_BILL_AMOUNT"),
2321
- },
2322
- };
2323
- }
2281
+ if (!field)
2282
+ return undefined; // Early return for falsy field
2283
+ let isReadOnly = false;
2284
+ if (field?.external_field_key === "dial_code") {
2285
+ isReadOnly = true;
2286
+ this.fieldsModel = { "dial_code": this.currentUserDetails?.dial_code };
2287
+ }
2288
+ const validations = field?.field_validation || [];
2289
+ let isRequired = false;
2290
+ let minLength;
2291
+ let maxLength;
2292
+ let minValue;
2293
+ let maxValue;
2294
+ const validationMessages = {};
2295
+ validations.forEach((validation) => {
2296
+ const fieldType = validation?.field_types;
2297
+ const fieldValue = validation?.field_values;
2298
+ const fieldError = validation?.field_error;
2299
+ if (fieldType === 1) {
2300
+ isRequired = fieldValue === "true" || fieldValue === true || fieldValue === "1";
2301
+ }
2302
+ else if (fieldType === 2) {
2303
+ maxLength = parseInt(fieldValue);
2304
+ if (fieldError)
2305
+ validationMessages.maxlength = fieldError;
2306
+ }
2307
+ else if (fieldType === 3) {
2308
+ minValue = parseFloat(fieldValue);
2309
+ if (fieldError)
2310
+ validationMessages.min = fieldError;
2311
+ }
2312
+ else if (fieldType === 4) {
2313
+ minLength = parseInt(fieldValue);
2314
+ if (fieldError)
2315
+ validationMessages.minlength = fieldError;
2316
+ if (!isRequired)
2317
+ isRequired = true;
2324
2318
  }
2325
- const validations = field?.field_validation || [];
2326
- const normalizedFieldType = this.normalizeFieldType(field?.field_type);
2327
- const normalizedValidations = this.normalizeValidations(validations);
2328
- const isRequired = normalizedValidations.isRequired;
2329
- const minLength = normalizedValidations.minLength;
2330
- const maxLength = normalizedValidations.maxLength;
2331
- let minValue = normalizedValidations.minValue;
2332
- let maxValue = normalizedValidations.maxValue;
2333
- // For range products, don't set HTML5 min/max to allow typing any value
2334
- // We'll validate using custom validator only
2335
- // This prevents HTML5 from blocking input before validation
2336
- if (isAmountField && this.selectedProduct?.product_price_type === PRODUCT_PRICE_TYPE.RANGE) {
2337
- // Don't override min/max - let custom validator handle it
2338
- // This allows users to type any value, then validate on blur/submit
2319
+ else if (fieldType === 5) {
2320
+ maxValue = parseFloat(fieldValue);
2321
+ if (fieldError)
2322
+ validationMessages.max = fieldError;
2339
2323
  }
2340
- let res = {
2341
- key: field.external_field_key,
2342
- templateOptions: {},
2343
- className: "col-12",
2344
- wrappers: ["form-field-horizontal"],
2345
- type: "input",
2346
- // Enable real-time validation on change/input
2347
- modelOptions: {
2348
- updateOn: 'change'
2349
- },
2350
- // Show errors in real-time (even when not touched)
2351
- expressionProperties: {
2352
- 'templateOptions.disabled': 'formState.disabled',
2353
- },
2354
- // Mark field as touched on value change to show errors immediately
2355
- hooks: {
2356
- onInit: (field) => {
2357
- const control = field.formControl;
2358
- if (control) {
2359
- // Subscribe to value changes and mark as touched to show errors immediately
2360
- control.valueChanges.subscribe(() => {
2361
- if (control.invalid && control.value !== null && control.value !== '') {
2362
- control.markAsTouched();
2363
- }
2364
- });
2365
- }
2324
+ });
2325
+ let res = {
2326
+ key: field.external_field_key,
2327
+ templateOptions: {},
2328
+ className: "col-sm-6",
2329
+ wrappers: ["form-field-horizontal"],
2330
+ type: "input",
2331
+ modelOptions: { updateOn: 'change' },
2332
+ expressionProperties: {
2333
+ 'templateOptions.disabled': 'formState.disabled',
2334
+ },
2335
+ hooks: {
2336
+ onInit: (field) => {
2337
+ const control = field.formControl;
2338
+ if (control) {
2339
+ control.valueChanges.subscribe(() => {
2340
+ if (control.invalid && control.value !== null && control.value !== '') {
2341
+ control.markAsTouched();
2342
+ }
2343
+ });
2366
2344
  }
2367
2345
  }
2368
- };
2369
- // Add custom validators if any
2370
- if (Object.keys(customValidators).length > 0) {
2371
- res["validators"] = customValidators;
2372
2346
  }
2373
- if (normalizedFieldType == TOPUP_BILL_PAYMENT_FIELD_TYPE.TEXT_BOX) {
2374
- res["templateOptions"] = {
2375
- label: `${field.field_title} `,
2376
- placeholder: `${this.translationService.translate("COMMON_LABEL_PLEASE_ENTER")} ${field.field_title}`,
2377
- required: isRequired,
2378
- minLength: minLength,
2379
- maxLength: maxLength,
2380
- readonly: isReadOnly,
2381
- };
2382
- if (fieldValue !== null) {
2383
- res["defaultValue"] = fieldValue;
2384
- }
2385
- }
2386
- else if (normalizedFieldType == TOPUP_BILL_PAYMENT_FIELD_TYPE.NUMERIC) {
2387
- // For range products, don't set min/max in templateOptions to allow typing
2388
- // Custom validator will handle validation
2389
- const templateOptions = {
2390
- label: `${field.field_title} `,
2391
- placeholder: `${this.translationService.translate("COMMON_LABEL_PLEASE_ENTER")} ${field.field_title}`,
2392
- required: isRequired,
2393
- minLength: minLength,
2394
- maxLength: maxLength,
2395
- readonly: isReadOnly,
2396
- };
2397
- // Only set min/max if NOT a range product (to allow typing any value for range products)
2398
- if (!(isAmountField && this.selectedProduct?.product_price_type === PRODUCT_PRICE_TYPE.RANGE)) {
2399
- templateOptions.min = minValue;
2400
- templateOptions.max = maxValue;
2401
- }
2402
- res["templateOptions"] = templateOptions;
2403
- res["type"] = "number-field";
2404
- if (fieldValue !== null) {
2405
- res["defaultValue"] = fieldValue;
2406
- }
2407
- }
2408
- return res;
2347
+ };
2348
+ if (isRequired) {
2349
+ validationMessages.required = `${field.field_title} ${this.translationService.translate("LABEL_IS_REQUIRED")}`;
2350
+ }
2351
+ if (Object.keys(validationMessages).length > 0) {
2352
+ res["validation"] = { messages: validationMessages };
2353
+ }
2354
+ if (field.field_type == TOPUP_BILL_PAYMENT_FIELD_TYPE.TEXT_BOX) {
2355
+ res["templateOptions"] = {
2356
+ label: `${field.field_title} `,
2357
+ placeholder: `${this.translationService.translate("COMMON_LABEL_PLEASE_ENTER")} ${field.field_title}`,
2358
+ required: isRequired,
2359
+ minLength: minLength,
2360
+ maxLength: maxLength,
2361
+ readonly: isReadOnly,
2362
+ };
2409
2363
  }
2410
- return null;
2411
- }
2364
+ else if (field.field_type == TOPUP_BILL_PAYMENT_FIELD_TYPE.NUMERIC) {
2365
+ res["templateOptions"] = {
2366
+ label: `${field.field_title} `,
2367
+ placeholder: `${this.translationService.translate("COMMON_LABEL_PLEASE_ENTER")} ${field.field_title}`,
2368
+ required: isRequired,
2369
+ min: minValue,
2370
+ max: maxValue,
2371
+ minLength: minLength,
2372
+ maxLength: maxLength,
2373
+ };
2374
+ res["type"] = "number-field";
2375
+ }
2376
+ return res; // Always reached now
2377
+ }
2378
+ // getExtraFieldsToShow(field: any): FormlyFieldConfig | null {
2379
+ // if (field) {
2380
+ // let isReadOnly = false;
2381
+ // let fieldValue: any = null;
2382
+ // let customValidators: any = {};
2383
+ // if (field?.external_field_key === "dial_code") {
2384
+ // isReadOnly = true;
2385
+ // fieldValue = this.currentUserDetails?.dial_code;
2386
+ // this.fieldsModel = { "dial_code": fieldValue };
2387
+ // }
2388
+ // // Check if this is an amount field and we have a selected product
2389
+ // const isAmountField = field?.external_field_key?.toLowerCase().includes("amount") ||
2390
+ // field?.field_title?.toLowerCase().includes("amount");
2391
+ // if (isAmountField && this.selectedProduct) {
2392
+ // if (this.selectedProduct?.product_price_type === PRODUCT_PRICE_TYPE.FIXED) {
2393
+ // // Fixed price: make field readonly and set the fixed price
2394
+ // isReadOnly = true;
2395
+ // fieldValue = this.selectedProduct?.product_fixed_price || 0;
2396
+ // if (this.fieldsModel) {
2397
+ // this.fieldsModel[field.external_field_key] = fieldValue;
2398
+ // } else {
2399
+ // this.fieldsModel = { [field.external_field_key]: fieldValue };
2400
+ // }
2401
+ // } else if (this.selectedProduct?.product_price_type === PRODUCT_PRICE_TYPE.RANGE) {
2402
+ // const rangeMin = Number(this.selectedProduct?.product_range_price?.min) || 0;
2403
+ // const rangeMax = Number(this.selectedProduct?.product_range_price?.max) || 0;
2404
+ // customValidators = {
2405
+ // // Range validator - checks if value is within the allowed range
2406
+ // // Allows typing leading zeros (e.g., "01", "08") but validates the numeric value
2407
+ // range: {
2408
+ // expression: (control: any) => {
2409
+ // const value = control?.value;
2410
+ // if (value === null || value === undefined || value === '') {
2411
+ // return true; // No error if empty
2412
+ // }
2413
+ // const valueStr = String(value).trim();
2414
+ // // Convert string to number (handles leading zeros: "01" becomes 1, "08" becomes 8)
2415
+ // const numValue = Number(valueStr);
2416
+ // if (isNaN(numValue) || !isFinite(numValue)) {
2417
+ // return true; // Skip validation for invalid numbers
2418
+ // }
2419
+ // // Return true if value is IN range (no error), false if out of range (error)
2420
+ // return numValue >= rangeMin && numValue <= rangeMax;
2421
+ // },
2422
+ // message: () => `${this.translationService.translate("COMMON_LABEL_AMOUNT_MUST_BE_BETWEEN")} ${rangeMin} ${this.translationService.translate("COMMON_LABEL_AND")} ${rangeMax}`
2423
+ // }
2424
+ // };
2425
+ // }
2426
+ // }
2427
+ // const validations: Array<any> = field?.field_validation || [];
2428
+ // const normalizedFieldType = this.normalizeFieldType(field?.field_type);
2429
+ // const normalizedValidations = this.normalizeValidations(validations);
2430
+ // const isRequired: boolean = normalizedValidations.isRequired;
2431
+ // const minLength: number | undefined = normalizedValidations.minLength;
2432
+ // const maxLength: number | undefined = normalizedValidations.maxLength;
2433
+ // let minValue: number | undefined = normalizedValidations.minValue;
2434
+ // let maxValue: number | undefined = normalizedValidations.maxValue;
2435
+ // // For range products, don't set HTML5 min/max to allow typing any value
2436
+ // // We'll validate using custom validator only
2437
+ // // This prevents HTML5 from blocking input before validation
2438
+ // if (isAmountField && this.selectedProduct?.product_price_type === PRODUCT_PRICE_TYPE.RANGE) {
2439
+ // // Don't override min/max - let custom validator handle it
2440
+ // // This allows users to type any value, then validate on blur/submit
2441
+ // }
2442
+ // let res: FormlyFieldConfig = {
2443
+ // key: field.external_field_key,
2444
+ // templateOptions: {} as any,
2445
+ // className: "col-12",
2446
+ // wrappers: ["form-field-horizontal"],
2447
+ // type: "input",
2448
+ // // Enable real-time validation on change/input
2449
+ // modelOptions: {
2450
+ // updateOn: 'change'
2451
+ // },
2452
+ // // Show errors in real-time (even when not touched)
2453
+ // expressionProperties: {
2454
+ // 'templateOptions.disabled': 'formState.disabled',
2455
+ // },
2456
+ // // Mark field as touched on value change to show errors immediately
2457
+ // hooks: {
2458
+ // onInit: (field: FormlyFieldConfig) => {
2459
+ // const control = field.formControl;
2460
+ // if (control) {
2461
+ // // Subscribe to value changes and mark as touched to show errors immediately
2462
+ // control.valueChanges.subscribe(() => {
2463
+ // if (control.invalid && control.value !== null && control.value !== '') {
2464
+ // control.markAsTouched();
2465
+ // }
2466
+ // });
2467
+ // }
2468
+ // }
2469
+ // }
2470
+ // };
2471
+ // // Add custom validators if any
2472
+ // if (Object.keys(customValidators).length > 0) {
2473
+ // res["validators"] = customValidators;
2474
+ // }
2475
+ // if (normalizedFieldType == TOPUP_BILL_PAYMENT_FIELD_TYPE.TEXT_BOX) {
2476
+ // res["templateOptions"] = {
2477
+ // label: `${field.field_title} `,
2478
+ // placeholder: `${this.translationService.translate("COMMON_LABEL_PLEASE_ENTER")} ${field.field_title}`,
2479
+ // required: isRequired,
2480
+ // minLength: minLength,
2481
+ // maxLength: maxLength,
2482
+ // readonly: isReadOnly,
2483
+ // };
2484
+ // if (fieldValue !== null) {
2485
+ // res["defaultValue"] = fieldValue;
2486
+ // }
2487
+ // } else if (normalizedFieldType == TOPUP_BILL_PAYMENT_FIELD_TYPE.NUMERIC) {
2488
+ // // For range products, don't set min/max in templateOptions to allow typing
2489
+ // // Custom validator will handle validation
2490
+ // const templateOptions: any = {
2491
+ // label: `${field.field_title} `,
2492
+ // placeholder: `${this.translationService.translate("COMMON_LABEL_PLEASE_ENTER")} ${field.field_title}`,
2493
+ // required: isRequired,
2494
+ // minLength: minLength,
2495
+ // maxLength: maxLength,
2496
+ // readonly: isReadOnly,
2497
+ // };
2498
+ // // Only set min/max if NOT a range product (to allow typing any value for range products)
2499
+ // if (!(isAmountField && this.selectedProduct?.product_price_type === PRODUCT_PRICE_TYPE.RANGE)) {
2500
+ // templateOptions.min = minValue;
2501
+ // templateOptions.max = maxValue;
2502
+ // }
2503
+ // res["templateOptions"] = templateOptions;
2504
+ // res["type"] = "number-field";
2505
+ // if (fieldValue !== null) {
2506
+ // res["defaultValue"] = fieldValue;
2507
+ // }
2508
+ // }
2509
+ // return res;
2510
+ // }
2511
+ // return null;
2512
+ // }
2412
2513
  ngOnDestroy() {
2413
2514
  this.destroy$.next(true);
2414
2515
  this.destroy$.unsubscribe();
2415
2516
  }
2416
- getSelectedBill() {
2417
- return this.allWorkflowData?.selectedBill ?? this.selectedBill ?? null;
2418
- }
2419
- getBillAmount() {
2420
- const billAmount = Number(this.getSelectedBill()?.bill_amount);
2421
- if (isNaN(billAmount) || billAmount <= 0) {
2422
- return null;
2423
- }
2424
- return billAmount;
2425
- }
2426
- findAmountField() {
2427
- return this.fieldsArray.find((field) => {
2428
- const keyStr = String(field?.key || "").toLowerCase();
2429
- const labelStr = String(field?.templateOptions?.label || "").toLowerCase();
2430
- return keyStr.includes("amount") || labelStr.includes("amount");
2431
- });
2432
- }
2433
- parseFormAmount(value) {
2434
- if (value === null || value === undefined || value === "") {
2435
- return null;
2436
- }
2437
- const amount = typeof value === "number" ? value : parseFloat(String(value));
2438
- return isNaN(amount) ? null : amount;
2439
- }
2440
- validateEnteredAmountAgainstBill() {
2441
- const billAmount = this.getBillAmount();
2442
- if (billAmount === null) {
2443
- return true;
2444
- }
2445
- const amountField = this.findAmountField();
2446
- if (!amountField?.key) {
2447
- return true;
2448
- }
2449
- const fieldKey = String(amountField.key);
2450
- const enteredAmount = this.parseFormAmount(this.detailsForm?.value[fieldKey]);
2451
- if (enteredAmount === null || enteredAmount <= billAmount) {
2452
- return true;
2453
- }
2454
- this.toasterService.error(this.translationService.translate("COMMON_LABEL_AMOUNT_MUST_NOT_EXCEED_BILL_AMOUNT"));
2455
- const control = this.detailsForm.get(fieldKey);
2456
- control?.setErrors({ ...(control.errors ?? {}), billAmountMax: true });
2457
- control?.markAsTouched();
2458
- return false;
2459
- }
2460
2517
  normalizeWorkflowDetails(workflowDetails) {
2461
2518
  if (!Array.isArray(workflowDetails))
2462
2519
  return [];
@@ -2627,7 +2684,7 @@ class WorkFlowComponent {
2627
2684
  this.prepareFormFields(this.workFlowDetails?.screen_config);
2628
2685
  }
2629
2686
  else {
2630
- this.toasterService.error(res?.error[0]);
2687
+ this.toasterService.error(this.translationService.translate(res?.error[0]));
2631
2688
  }
2632
2689
  },
2633
2690
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "digipay-utility-payment",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.3.0",
6
6
  "@angular/core": "^20.3.0"