Skip to content

feature: allow to blacklist or whitelist country codes in the IsIBAN decorator #2048

Closed as not planned
@spotlesscoder

Description

@spotlesscoder

Description

I want to build an API that only accepts german IBANs for payments.

Proposed solution

Add options to the decorators that allow to either

  • whitelist country codes
  • blacklist country codes

Each of the two params should allow an array of ISO3166-2 country codes as strings (or maybe use an enum for TS?).

Should look something like this for the API

class MyClass {
  @IsIBAN({whitelistCountries: ["DE"]})
  germanIBAN: string;

  @IsIBAN({blacklistCountries: ["US"]})
  nonUSIBAN: string;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: needs discussionIssues which needs discussion before implementation.type: featureIssues related to new features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions