Skip to content

Cash reward redemption#490

Open
Sam Beveridge (00salmon) wants to merge 103 commits into
masterfrom
cash-reward-redemption
Open

Cash reward redemption#490
Sam Beveridge (00salmon) wants to merge 103 commits into
masterfrom
cash-reward-redemption

Conversation

@00salmon

@00salmon Sam Beveridge (00salmon) commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Description of the change

JIRA Task Link: https://impact.atlassian.net/browse/SQDEV-3910

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation or Development tools (readme, specs, tests, code formatting)

Links

  • Jira issue number: (PUT IT HERE)
  • Process.st launch checklist: (PUT IT HERE)

Checklists

Development

  • Prettier was run (if applicable)
  • The behaviour changes in the pull request are covered by specs
  • All tests related to the changed code pass in development

Paperwork

  • This pull request has a descriptive title and information useful to a reviewer
  • This pull request has a Jira number
  • This pull request has a Process.st launch checklist

Code review

  • Changes have been reviewed by at least one other engineer
  • Security impacts of this change have been considered

Copilot AI review requested due to automatic review settings April 6, 2026 21:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the Tax & Cash banking info form by introducing structured, per-field validation error handling based on Impact API validation metadata, and adds a new “Partner Info Modal” component to the Mint component library/stencilbook.

Changes:

  • Map backend validation errors (field + errorPath) to form field names and frontend-friendly error codes.
  • Add configurable per-field ICU error-message templates and wire them into form validation rendering.
  • Introduce a new sqm-partner-info-modal component (view + stories) and register it in the stencilbook; bump package version.

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.tsx Adds API→form field/error-code mapping and includes errorPath in GraphQL validationErrors.
packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.tsx Adds per-field error message props + ICU templates and renders richer invalid messages when an API errorCode is present.
packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.tsx Extends form error shape to include errorCode and adds text.errorMessages.
packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/formDefinitions.tsx Passes errorCode + fieldName into validation message builder for each form input.
packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/readme.md Documents the newly added per-field error-message props.
packages/mint-components/src/components/sqm-stencilbook/sqm-stencilbook.tsx Registers Partner Info Modal stories in the stencilbook.
packages/mint-components/src/components/sqm-partner-info-modal/sqm-partner-info-modal.tsx Adds new Partner Info Modal component (currently demo-hook driven).
packages/mint-components/src/components/sqm-partner-info-modal/sqm-partner-info-modal-view.tsx Implements the modal UI (dialog + selects + submit button).
packages/mint-components/src/components/sqm-partner-info-modal/PartnerInfoModal.stories.tsx Adds Storybook stories for the Partner Info Modal.
packages/mint-components/src/components.d.ts Updates generated component typings for new/updated props and new component.
packages/mint-components/package.json Bumps package version to 2.1.8-0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

helpText: getValidationErrorMessage({
type: errors?.inputErrors?.beneficiaryTaxPayerId?.type,
label: props.text.taxPayerIdLabel,
errorCode: errors?.inputErrors?.taxPayerId?.errorCode,

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Tax Payer ID field’s error helper reads errors?.inputErrors?.taxPayerId?.errorCode, but the error being checked is errors?.inputErrors?.beneficiaryTaxPayerId. This prevents the specific API errorCode from being shown for this field. Use the same key (beneficiaryTaxPayerId) when reading errorCode (while still using fieldName: "taxPayerId" if you intend to select the taxPayerId template).

Suggested change
errorCode: errors?.inputErrors?.taxPayerId?.errorCode,
errorCode: errors?.inputErrors?.beneficiaryTaxPayerId?.errorCode,

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 7, 2026 17:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sam Beveridge (00salmon) and others added 3 commits April 7, 2026 13:53
…eUserInfoForm and useTaxAndCash step logic. Handle Impact API sending back DZ and 000000 for phone number data
Copilot AI review requested due to automatic review settings April 9, 2026 00:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

AndiLuo added 2 commits April 9, 2026 16:33
… partner creation in to widget verificaiton flow. Some view refactors for all 3 components
Copilot AI review requested due to automatic review settings April 10, 2026 23:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 66 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • packages/mint-components/package-lock.json: Generated file
Comments suppressed due to low confidence (6)

packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.tsx:1

  • routeAfterMaybeCompleting() refetches, but then computes currentStep using the stale user object captured before refetch(), so routing can be wrong (e.g., still routes as STARTED/invalid even after completing). Use the refetch result (or recompute from data after refetch) when calling getCurrentStep, and consider handling/void-ing the async call to avoid unhandled promise rejections.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.tsx:1
  • The fallback errorCode uses the raw API error.code when there’s no mapping. Downstream ICU templates treat other as a human-readable fallback, but error.code is typically not user-facing. Consider storing both a short mapped code and the original error.message (or using error.message as the fallback when no mapping exists) so the “other” branch can display a readable message.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.tsx:1
  • classificationCodeError is keyed as beneficiaryClassification, but the new field introduced in formDefinitions.tsx uses errors.inputErrors.classificationCode / name="/classificationCode". This mismatch prevents the per-field ICU template from being found. Rename the key to classificationCode (or align the input error key to beneficiaryClassification) so getValidationErrorMessage can pick up the right template.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/formDefinitions.tsx:1
  • The errorCode lookup uses errors?.inputErrors?.taxPayerId?.errorCode, but the field key for this input is beneficiaryTaxPayerId (as used for type on line 242). This makes errorCode undefined even when the API returned one. Use errors?.inputErrors?.beneficiaryTaxPayerId?.errorCode instead.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/formDefinitions.tsx:1
  • These new fields don’t pass errorCode and fieldName into getValidationErrorMessage, so the new per-field ICU error templates (and mapped API error codes) won’t be used for branchName / classificationCode. Pass errorCode: errors?.inputErrors?.branchName?.errorCode with fieldName: "branchName", and similarly for classificationCode.
    packages/mint-components/src/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.tsx:379
  • This appears intended to render the “Not available”/fallback status when there is no matching state, but it only triggers for an empty-string state. If state is undefined/null (a more common “no state” sentinel), this block won’t render—so users may see no status text at all. Prefer a falsy check (e.g., !state) or ensure state is normalized to "" in one place.
            {state === "" && (
              <div>
                <TextSpanView type="p">{statusText}</TextSpanView>
              </div>
            )}

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 66 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • packages/mint-components/package-lock.json: Generated file
Comments suppressed due to low confidence (8)

packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.tsx:1

  • currentStep is computed using the pre-refetch user object, so routing can ignore the newly completed connection status / updated publisher fields. Compute currentStep from the refetched data (e.g., use the returned refetch result or derive from the latest query state) before calling setStep.
    packages/mint-components/src/components/tax-and-cash/data.ts:1
  • connectionStatus is typed as always-present, but the updated UI logic treats it as possibly missing for legacy connections (and saasquatch.d.ts makes it optional). If the API can return null/undefined for legacy users, this type should allow that (e.g., connectionStatus?: ... or connectionStatus: ... | null) to avoid incorrect assumptions and potential runtime/type mismatches.
    packages/mint-components/src/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.tsx:1
  • Two concrete runtime hazards here: (1) value only coerces null to "" but not undefined, so value={undefined} can leak to the input; consider using a nullish coalesce (formState.phoneNumber ?? "") to normalize both. (2) formData is typed optional (formData?: FormState) but is dereferenced unguarded (formData.phoneNumberCountryCode); use formData?.phoneNumberCountryCode (and handle the undefined case) to prevent crashes if the validator is invoked without formData.
    packages/mint-components/src/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.tsx:1
  • Two concrete runtime hazards here: (1) value only coerces null to "" but not undefined, so value={undefined} can leak to the input; consider using a nullish coalesce (formState.phoneNumber ?? "") to normalize both. (2) formData is typed optional (formData?: FormState) but is dereferenced unguarded (formData.phoneNumberCountryCode); use formData?.phoneNumberCountryCode (and handle the undefined case) to prevent crashes if the validator is invoked without formData.
    packages/mint-components/src/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.tsx:1
  • onSl-input from Shoelace is dispatched by the <sl-input> custom element, so e.target is not an HTMLInputElement. Casting to HTMLInputElement is misleading and can break if consumers expect DOM input semantics; use the Shoelace element type (or a safe any/property access) and update its .value property directly.
    packages/mint-components/src/components/tax-and-cash/utils.ts:1
  • Returning "" for missing input can unintentionally overwrite a previously stored phone number (or trigger backend validation) when the caller always includes phoneNumber in the mutation payload. Consider returning undefined (and omitting the field) or otherwise letting callers decide whether to send the field when input is empty.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/formDefinitions.tsx:1
  • These new inputs don’t pass errorCode and fieldName into getValidationErrorMessage, so the richer ICU templates added in sqm-banking-info-form.tsx won’t be used for API-derived validation errors on branchName / classificationCode. For consistency with the other fields, pass errorCode: errors?.inputErrors?.<field>?.errorCode and fieldName: "<field>" so per-field messaging works.
    packages/mint-components/src/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.feature:1
  • Corrected spelling of 'recieved' to 'received'.

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 66 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • packages/mint-components/package-lock.json: Generated file
Comments suppressed due to low confidence (6)

packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.tsx:1

  • getCurrentStep(user) is computed using the stale user value from before refetch(), so routing can be wrong (e.g., still seeing STARTED / missing fields). Capture the result of refetch() (or call getCurrentStep with the refreshed user object) and handle errors from the async call (e.g., void routeAfterMaybeCompleting().catch(...)) to avoid unhandled promise rejections in the effect.
    packages/mint-components/src/components/tax-and-cash/utils.ts:1
  • parsePhoneNumberFromString can throw if the provided country code is not recognized at runtime (you’re casting an arbitrary string to CountryCode). Wrap parsing in a try/catch and fall back to the digits-only sanitizer (or return false in validators) to prevent the form from crashing on unexpected backend values.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.tsx:1
  • classificationCodeError is being stored under beneficiaryClassification, but the new input is named classificationCode (and backend mapping also appears to use classificationCode). This mismatch will prevent the per-field ICU template lookup from working for classification-code errors; align the key (classificationCode) with the form field/errors shape.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/formDefinitions.tsx:1
  • These new fields don’t pass errorCode and fieldName into getValidationErrorMessage, so API-derived error-code mapping won’t surface the intended rich ICU messages (it will fall back to the generic invalid text). Pass errorCode: errors?.inputErrors?.branchName?.errorCode + fieldName: "branchName" and similarly for classificationCode.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/formDefinitions.tsx:1
  • These new fields don’t pass errorCode and fieldName into getValidationErrorMessage, so API-derived error-code mapping won’t surface the intended rich ICU messages (it will fall back to the generic invalid text). Pass errorCode: errors?.inputErrors?.branchName?.errorCode + fieldName: "branchName" and similarly for classificationCode.
    packages/mint-components/src/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.tsx:379
  • Rendering a dedicated branch for state === "" is fragile and likely unintended (most “no match” cases are undefined/null, and an empty string will also force the ICU select into the other branch). Prefer returning an explicit, meaningful status from the resolver (or render based on !state) to avoid inconsistent display between “no rule” vs “unknown rule”.
            {state === "" && (
              <div>
                <TextSpanView type="p">{statusText}</TextSpanView>
              </div>
            )}

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 61 out of 66 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • packages/mint-components/package-lock.json: Generated file
Comments suppressed due to low confidence (6)

packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.tsx:1

  • routeAfterMaybeCompleting() computes currentStep using the pre-refetch user object even after calling refetch(), so routing can be wrong (e.g., still seeing STARTED / incomplete status). Also, completeConnection() builds vars using outer data?.user rather than the user argument, which can cause inconsistent IDs/names if the closure is stale. Recommended fix: (1) make routeAfterMaybeCompleting() use the refetch result (e.g., const refreshed = await refetch(); const refreshedUser = refreshed?.data?.user ?? user; then call getCurrentStep(refreshedUser)), (2) build vars consistently from the user parameter and its publisher, and (3) explicitly handle the async call with void routeAfterMaybeCompleting() and internal try/catch to avoid unhandled promise rejections inside useEffect.
    packages/mint-components/src/components/tax-and-cash/data.ts:1
  • connectionStatus is typed as always present and non-null, but multiple callsites and specs in this PR treat legacy users as having connectionStatus null/undefined. To align the type with expected backend behavior (and avoid runtime/type drift), make connectionStatus optional/nullable (e.g., connectionStatus?: "NOT_STARTED" | "STARTED" | "COMPLETED" | null;) and update any dependent logic that assumes it’s always set.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/formDefinitions.tsx:1
  • The new branchName and classificationCode inputs don’t pass errorCode and fieldName into getValidationErrorMessage, so they can’t use the new per-field ICU error templates even though the rest of the form is wired for that. Suggested fix: pass errorCode: errors?.inputErrors?.branchName?.errorCode + fieldName: "branchName" (and similarly for classificationCode) to keep behavior consistent and enable the richer messages.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.tsx:1
  • The per-field error template map keys should match the fieldName passed to getValidationErrorMessage() and the keys used in errors.inputErrors. For the newly added classificationCode field, the map currently uses beneficiaryClassification, which means classificationCode will fall back to the generic invalid message even when an API errorCode is present. Suggested fix: add a classificationCode: props.classificationCodeError entry (and keep beneficiaryClassification only if it’s still a real input key elsewhere), then ensure the classification-code input passes fieldName: "classificationCode".
    packages/mint-components/src/components/tax-and-cash/utils.ts:1
  • parsePhoneNumberFromString() can throw for invalid/unsupported CountryCode values (e.g., unexpected strings coming from data or the select). Since this helper is used in submit paths, an exception here would break saving rather than cleanly falling back to digits-only. Suggested fix: wrap the parse call in a try/catch and return the digits-only fallback (or empty string) when parsing fails; apply the same defensive pattern in isValidI18nPhoneNumber() so it returns false instead of throwing.
    packages/mint-components/src/components/sqm-widget-verification/sqm-widget-verification.tsx:1
  • Correct grammar in this comment to make the intent clear (e.g., “Any updates must be reflected in …”).

@Locrian24 Coleton (Locrian24) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will approve once hygiene and stencil-docs-target is bumped

Comment thread packages/mint-components/package.json Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 62 out of 67 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • packages/mint-components/package-lock.json: Generated file
Comments suppressed due to low confidence (7)

packages/mint-components/src/components/tax-and-cash/data.ts:1

  • connectionStatus is modeled here as always present when impactConnection is non-null, but other changes in this PR (and saasquatch.d.ts) treat it as optional and sometimes null/undefined (legacy). This mismatch can lead to unsafe assumptions and incorrect narrowing in the UI logic. Update the UserQuery type to reflect observed API behavior (e.g., connectionStatus?: ... | null).
    packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.tsx:1
  • After calling refetch(), routing still uses the pre-refetch user object, so getCurrentStep(user) can compute the wrong step (especially if connectionStatus changes to COMPLETED). Also, the async call isn't awaited/handled, so errors become unhandled promise rejections. Use the refetch result (or updated data.user) to compute the step, and invoke the async function with explicit error handling (e.g., void routeAfterMaybeCompleting().catch(...)).
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.tsx:1
  • classificationCodeError is wired under beneficiaryClassification, which appears to be a different field (and will overwrite the classification template). As a result, classification code (KBE) errors likely won't map to the correct per-field ICU template. Rename/add the correct key for the field that receives classificationCode validation errors (e.g., classificationCode) and keep beneficiaryClassification mapped to the classification select error template.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/formDefinitions.tsx:1
  • These new inputs don't pass errorCode and fieldName into getValidationErrorMessage, so they can't take advantage of the new API error-code mapping + per-field ICU templates introduced in this PR. Pass through errors?.inputErrors?.<field>?.errorCode and the corresponding fieldName keys so branch name / classification code get the richer messages.
    packages/mint-components/src/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.tsx:1
  • The comment indicates the placeholder is the pair phoneNumber === \"0000000\" and phoneNumberCountryCode === \"DZ\", but the unlock logic checks only phoneNumber. This can incorrectly unlock fields if a real value ever matches the placeholder number (or if the backend changes one side only). Match on both fields (phone number + country code) to align with the documented invariant.
    packages/mint-components/src/components/sqm-referral-table/cells/sqm-referral-table-rewards-cell.tsx:379
  • This adds a new render branch for state === \"\" that duplicates the PAYOUT_APPROVED block and changes the previous behavior. If \"\" represents an unknown/unmatched state, it should likely be handled explicitly (e.g., a dedicated fallback UI or no status section), not by reusing the payout-approved layout. Consider reverting the original PAYOUT_APPROVED condition and adding a deliberate, separate fallback for empty/unknown state.
            {state === "" && (
              <div>
                <TextSpanView type="p">{statusText}</TextSpanView>
              </div>
            )}

packages/mint-components/src/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.feature:1

  • Correct spelling of 'recieved' to 'received'.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 62 out of 67 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • packages/mint-components/package-lock.json: Generated file
Comments suppressed due to low confidence (4)

packages/mint-components/src/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.tsx:1

  • getCurrentStep(user) uses the pre-refetch user object even after await refetch(). If completeImpactConnection updates connectionStatus and/or publisher billing fields, routing can still compute the wrong step (e.g., staying on "/1" because it’s evaluating stale data). Use the refetch result (or re-read data.user after refetch) to compute currentStep from the refreshed user instead of the stale closure value.
    packages/mint-components/src/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.tsx:1
  • formData is typed as optional in ValidationErrorFunction (formData?: FormState), but this handler dereferences formData.phoneNumberCountryCode without a guard. This can fail TypeScript compilation (or throw at runtime if formData is ever omitted). Use optional chaining or a default (e.g., formData?.phoneNumberCountryCode) and decide how validation should behave when it’s missing.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/formDefinitions.tsx:1
  • The new fields branchName (and similarly classificationCode below) don’t pass errorCode and fieldName into getValidationErrorMessage, while other inputs do. This prevents the new API error-code mapping from producing the richer per-field ICU messages you introduced. Update these new inputs to pass errorCode: errors?.inputErrors?.branchName?.errorCode and fieldName: "branchName" (and the equivalent for classificationCode) to keep behavior consistent.
    packages/mint-components/src/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.tsx:1
  • classificationCodeError is wired under the beneficiaryClassification key, but the new KBE field introduced in useBankingInfoForm/formDefinitions.tsx is named classificationCode. As written, API validation errors for classificationCode won’t be able to find the per-field template, and may fall back to generic messaging. Wire props.classificationCodeError under the matching classificationCode key (and keep beneficiaryClassification separate if it represents the “Classification” select field).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

9 participants