Skip to content

Conversation

@ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Oct 29, 2024

Third and final part of #2390

Related to #3235

Blocked by #3223 and #3233


Fixes the pattern for en_GB using the patterns from the second page of this document (linked in the original issue)

Valid Formats

The following is a list of the valid formats of postcode.
An ‘A’ indicates an alphabetic character, an ‘N’ indicates a numeric character.

Format Example

Outcode Incode Postcode
AN NAA M1_1AA__
ANN NAA M60_1NW_
AAN NAA CR2_6XH_
AANN NAA DN55_1PT
ANA NAA W1P_1HQ_
AANA NAA EC1A_1BB

(Where _ represents a space)

The following characters are never used in the inward part of the postcode:
C I K M O V

Workaround until this is merged:

const zipCode = faker.helpers.fake([
  '{{helpers.fromRegExp("[A-Z]{1,2}[0-9]{1,2} [0-9][ABDEFGHJLNPQRSTUWXYZ]{2}")}}',
  '{{helpers.fromRegExp("[A-Z]{1,2}[0-9][A-Z] [0-9][ABDEFGHJLNPQRSTUWXYZ]{2}")}}',
]);

(can also be used in browser console on our website)

@ST-DDT ST-DDT added s: on hold Blocked by something or frozen to avoid conflicts p: 1-normal Nothing urgent c: locale Permutes locale definitions m: location Something is referring to the location module labels Oct 29, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Oct 29, 2024
@ST-DDT ST-DDT self-assigned this Oct 29, 2024
@ST-DDT ST-DDT requested a review from a team as a code owner October 29, 2024 21:26
@ST-DDT ST-DDT linked an issue Oct 29, 2024 that may be closed by this pull request
10 tasks
@ST-DDT ST-DDT marked this pull request as draft October 29, 2024 21:26
@codecov
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.96%. Comparing base (b9930dc) to head (c0affe5).

Additional details and impacted files
@@                       Coverage Diff                       @@
##           refactor/location/zipCode/fake    #3234   +/-   ##
===============================================================
  Coverage                           99.96%   99.96%           
===============================================================
  Files                                2805     2805           
  Lines                              217143   217143           
  Branches                              969      969           
===============================================================
+ Hits                               217066   217068    +2     
+ Misses                                 77       75    -2     
Files with missing lines Coverage Δ
src/locales/en_GB/location/postcode_pattern.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@ST-DDT ST-DDT force-pushed the refactor/locale/en_GB/location/zipcode branch from 6600184 to e276128 Compare October 29, 2024 21:30
@ST-DDT ST-DDT force-pushed the refactor/locale/en_GB/location/zipcode branch from e276128 to 35398f2 Compare October 29, 2024 21:32
@ST-DDT ST-DDT changed the title refactor(location): deprecate zipCode format parameter refactor(locale): fix en_GB postcode patterns Oct 29, 2024
@ST-DDT ST-DDT added the c: bug Something isn't working label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: bug Something isn't working c: locale Permutes locale definitions m: location Something is referring to the location module p: 1-normal Nothing urgent s: on hold Blocked by something or frozen to avoid conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid zip/postal codes when using locale en_GB

1 participant