Skip to content

Commit

Permalink
Merge pull request #524 from vtex/update/geolocation-rules
Browse files Browse the repository at this point in the history
Fix postal code rules using geolocation
  • Loading branch information
sheilagomes authored Jun 27, 2023
2 parents 1ca5088 + 01ed1b9 commit c35e7e6
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Postal code rules when using geolocation mode

## [3.34.3] - 2023-06-19

### Fixed
Expand Down
1 change: 1 addition & 0 deletions react/country/AUT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/BGR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/CZE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/DEU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/ESP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/HRV.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/IRL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/MEX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/POL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/PRT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/PRY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

complement: {
Expand Down
1 change: 1 addition & 0 deletions react/country/ROU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14025,6 +14025,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},
number: {
valueIn: 'long_name',
Expand Down
1 change: 1 addition & 0 deletions react/country/RUS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
37 changes: 37 additions & 0 deletions react/country/SGP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,43 @@ const rules: PostalCodeRules = {
required: true,
},
],
geolocation: {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
valueIn: 'long_name',
types: ['street_number'],
required: false,
notApplicable: true,
},

street: { valueIn: 'long_name', types: ['route'] },

neighborhood: {
valueIn: 'long_name',
types: [
'neighborhood',
],
},

state: {
valueIn: 'long_name',
types: ['administrative_area_level_1'],
},

city: {
valueIn: 'long_name',
types: ['administrative_area_level_2', 'locality'],
},

receiverName: {
required: true,
},
},
summary: [
[{ name: 'street' }, { delimiter: ', ', name: 'complement' }],
[
Expand Down
1 change: 1 addition & 0 deletions react/country/SRB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/SVK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/UKR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

number: {
Expand Down
1 change: 1 addition & 0 deletions react/country/VEN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ const rules: PostalCodeRules = {
postalCode: {
valueIn: 'long_name',
types: ['postal_code'],
required: false,
},

complement: {
Expand Down

0 comments on commit c35e7e6

Please sign in to comment.