Skip to content

feat(account-creation): collect the turkish identifiers - #23344

Open
jmalnuit wants to merge 1 commit into
masterfrom
feat/MANAGER-22518
Open

jmalnuit wants to merge 1 commit into
masterfrom
feat/MANAGER-22518

Conversation

@jmalnuit

@jmalnuit jmalnuit commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

For a TR address and the Company, Non-profit or Public administration category, the legal block starts with, in this order: the VKN (10 digits, required), a KDV choice ("has a KDV number, equal to the VKN" / "no KDV number", none preselected, required), the read-only KDV when the organisation has one, then the MERSİS No (16 digits) or, for a public administration, the DETSİS No (8 digits), both optional.

The KDV is never typed: vat is the VKN, or empty for "no KDV number"; the choice itself is never sent. The front refuses a wrong length, a single repeated digit and a straight run of digits (wrapping from 9 to 0), with the reason under the field, on top of the API pattern. An individual sees none of these fields and the phone is mandatory.

The account type step no longer offers "Autre", nor "Entreprise individuelle" in Turkey.

Description

Ticket Reference: #...

Additional Information

@jmalnuit
jmalnuit requested a review from a team as a code owner November 4, 2026 14:43
@jmalnuit
jmalnuit requested review from AlexisAfonso, aottr and sachinrameshn and a balanced review from Copilot November 4, 2026 14:43

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.

🟡 Changes recommended

Country-specific validation still permits a hidden account category and produces untranslated or misleading tax-identifier error messages.

3 open issues
What changed in this PR

Adds Turkish legal identifiers to the account-creation flow, using the address country and account category to control fields and validation.

Changes:

  • Adds VKN, a required KDV choice with derived VAT, and optional MERSİS or DETSİS identifiers.
  • Adds Turkish identifier validation, mandatory phone rules, and account-type filtering.
  • Adds French labels and error messages, plus helper and account-type tests.
File Description
packages/​manager/​apps/​account-creation/​src/​pages/​accountType/​AccountType.spec.tsx Tests exclusion of unavailable account types.
packages/​manager/​apps/​account-creation/​src/​pages/​accountType/​AccountType.page.tsx Filters account-type options and tooltip content.
packages/​manager/​apps/​account-creation/​src/​pages/​accountDetails/​turkeyIdentifiers/​TurkeyIdentifierFields.component.tsx Renders Turkish identifiers and the KDV choice.
packages/​manager/​apps/​account-creation/​src/​pages/​accountDetails/​accountDetails.page.tsx Integrates Turkish rules, fields, and derived VAT into the form.
packages/​manager/​apps/​account-creation/​src/​helpers/​turkeyHelper.ts Defines Turkish eligibility, validation, and schema helpers.
packages/​manager/​apps/​account-creation/​src/​helpers/​turkeyHelper.spec.ts Tests Turkish rules, identifiers, and schema behavior.
packages/​manager/​apps/​account-creation/​public/​translations/​account-details/​Messages_fr_FR.json Adds French labels, hints, and validation messages.

Review effort: Balanced

mandatory: boolean,
) => {
const checked = z
.string()
Comment on lines +262 to +263
case TURKEY_ERRORS.pattern:
return `account_details_error_${identifier}`;
Comment on lines +53 to +55
const legalForms = useMemo(
() => selectableLegalForms(rule?.in as LegalForm[] | undefined, country),
[rule?.in, country],
Copilot AI balanced review requested due to automatic review settings November 6, 2026 15:15
For a TR address and the Company, Non-profit or Public administration
category, the legal block starts with, in this order: the VKN, a KDV
choice ("has a KDV number, equal to the VKN" / "no KDV number", none
preselected, required), the read-only KDV when the organisation has
one, then the MERSİS No or, for a public administration, the DETSİS No.

The rules API drives these fields: each one is shown only when its rule
is returned, mandatory and formatted as the rule says, and the account
types offered are the ones the API returns. The front only adds what a
pattern cannot express: a single repeated digit or a straight run of
digits (wrapping from 9 to 0) is refused, with the reason under the
field.

The KDV is never typed: vat is the VKN, or empty for "no KDV number";
the choice itself is never sent.

Signed-off-by: jmalnuit <jonathan.malnuit@ovhcloud.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.

🟡 Changes recommended

The shared identifier matcher omits API length constraints, allowing an invalid VKN to pass validation and be copied into vat.

4 open issues

Review effort: Balanced


/** The API pattern accepts the cleaned value (no pattern, or a broken one: yes). */
const matchesRule = (digits: string, rule: Rule | undefined) => {
if (!rule?.regularExpression) return true;
Copilot AI balanced review requested due to automatic review settings November 6, 2026 15:20

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.

🟡 Changes recommended

Turkish identifier validation drops API length constraints, allowing invalid VKN values into VAT, while missing required-error localization and KDV blur handling leave validation feedback incomplete.

5 open issues

Review effort: Balanced

{' *'}
</OdsText>
</div>
<div className="w-full flex flex-col gap-2 mb-4">

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants