Skip to content

Commit

Permalink
fix(address draft presets): remove invalid states from address preset…
Browse files Browse the repository at this point in the history
…s for european b2b companies (#501)
  • Loading branch information
ByronDWall authored Feb 28, 2024
1 parent 0d3dbc0 commit 7a5d138
Show file tree
Hide file tree
Showing 31 changed files with 79 additions and 99 deletions.
6 changes: 6 additions & 0 deletions .changeset/five-coats-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@commercetools-test-data/commons': patch
'@commercetools-test-data/cart': patch
---

Remove invalid states from address presets for european b2b companies
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe(`with eagleHeavyLiftTechnologiesIncUs preset`, () => {
"key": "eagle-heavy-lift-technologies-inc-us",
"name": "Eagle Heavy Lift Technologies Inc.",
"shippingAddresses": undefined,
"status": "Active",
"status": undefined,
"storeMode": "Explicit",
"stores": [
{
Expand Down Expand Up @@ -197,7 +197,6 @@ describe(`with eagleHeavyLiftTechnologiesIncUs preset`, () => {
"key": "eagle-heavy-lift-technologies-inc-us",
"name": "Eagle Heavy Lift Technologies Inc.",
"shippingAddresses": undefined,
"status": "Active",
"storeMode": "Explicit",
"stores": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const eagleHeavyLiftTechnologiesIncUs = (): TCompanyDraftBuilder =>
.unitType(unitType.Company)
.storeMode(storeMode.Explicit)
.associateMode(associateMode.Explicit)
.status(status.Active)
.stores([KeyReferenceDraft.presets.store().key(usLargeCustomersStore.key!)])
.associates([
AssociateDraft.presets.sampleDataB2B.jamesSmith(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe(`with libertyCraneSolutionsLlcUs preset`, () => {
"key": "liberty-crane-solutions-llc-us",
"name": "Liberty Crane Solutions LLC",
"shippingAddresses": undefined,
"status": "Active",
"status": undefined,
"storeMode": "Explicit",
"stores": [
{
Expand Down Expand Up @@ -197,7 +197,6 @@ describe(`with libertyCraneSolutionsLlcUs preset`, () => {
"key": "liberty-crane-solutions-llc-us",
"name": "Liberty Crane Solutions LLC",
"shippingAddresses": undefined,
"status": "Active",
"storeMode": "Explicit",
"stores": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const libertyCraneSolutionsLlcUs = (): TCompanyDraftBuilder =>
.unitType(unitType.Company)
.storeMode(storeMode.Explicit)
.associateMode(associateMode.Explicit)
.status(status.Active)
.stores([
KeyReferenceDraft.presets.store().key(usMediumCustomersStore.key!),
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe(`with lifttechSolutionsLtd preset`, () => {
"postalCode": "SW1A 1AA",
"region": "England",
"salutation": undefined,
"state": "London",
"state": undefined,
"streetName": "Baker Street",
"streetNumber": "221B",
"title": undefined,
Expand Down Expand Up @@ -93,7 +93,7 @@ describe(`with lifttechSolutionsLtd preset`, () => {
"key": "lifttech-solutions-ltd",
"name": "LiftTech Solutions Ltd",
"shippingAddresses": undefined,
"status": "Active",
"status": undefined,
"storeMode": "Explicit",
"stores": [
{
Expand Down Expand Up @@ -135,7 +135,7 @@ describe(`with lifttechSolutionsLtd preset`, () => {
"postalCode": "SW1A 1AA",
"region": "England",
"salutation": undefined,
"state": "London",
"state": undefined,
"streetName": "Baker Street",
"streetNumber": "221B",
"title": undefined,
Expand Down Expand Up @@ -197,7 +197,6 @@ describe(`with lifttechSolutionsLtd preset`, () => {
"key": "lifttech-solutions-ltd",
"name": "LiftTech Solutions Ltd",
"shippingAddresses": undefined,
"status": "Active",
"storeMode": "Explicit",
"stores": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const lifttechSolutionsLtd = (): TCompanyDraftBuilder =>
.unitType(unitType.Company)
.storeMode(storeMode.Explicit)
.associateMode(associateMode.Explicit)
.status(status.Active)
.stores([KeyReferenceDraft.presets.store().key(deFrUkStore.key!)])
.associates([
AssociateDraft.presets.sampleDataB2B.oliverSmith(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const transformers = {
}),
graphql: Transformer<TCompanyDraft, TCompanyDraftGraphql>('graphql', {
buildFields: ['addresses', 'associates', 'stores'],
removeFields: ['status'],
}),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe(`with lifttechSolutionsLtdDe preset`, () => {
"postalCode": "12345",
"region": "Brandenburg",
"salutation": undefined,
"state": "Berlin",
"state": undefined,
"streetName": "Hauptstraße",
"streetNumber": "456",
"title": undefined,
Expand Down Expand Up @@ -77,14 +77,12 @@ describe(`with lifttechSolutionsLtdDe preset`, () => {
"defaultShippingAddress": 0,
"key": "lifttech-solutions-ltd-de",
"name": "LiftTech Lösungen GmbH",
"parentUnit": [
{
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
],
"parentUnit": {
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
"shippingAddresses": undefined,
"status": "Active",
"status": undefined,
"storeMode": "FromParent",
"stores": undefined,
"unitType": "Division",
Expand Down Expand Up @@ -121,7 +119,7 @@ describe(`with lifttechSolutionsLtdDe preset`, () => {
"postalCode": "12345",
"region": "Brandenburg",
"salutation": undefined,
"state": "Berlin",
"state": undefined,
"streetName": "Hauptstraße",
"streetNumber": "456",
"title": undefined,
Expand Down Expand Up @@ -167,14 +165,11 @@ describe(`with lifttechSolutionsLtdDe preset`, () => {
"defaultShippingAddress": 0,
"key": "lifttech-solutions-ltd-de",
"name": "LiftTech Lösungen GmbH",
"parentUnit": [
{
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
],
"parentUnit": {
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
"shippingAddresses": undefined,
"status": "Active",
"storeMode": "FromParent",
"stores": undefined,
"unitType": "Division",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const lifttechSolutionsLtdDe = (): TDivisionDraftBuilder =>
.key('lifttech-solutions-ltd-de')
.name('LiftTech Lösungen GmbH')
.unitType(unitType.Division)
.status(status.Active)
.storeMode(storeMode.FromParent)
.associateMode(associateMode.ExplicitAndFromParent)
.associates([
Expand All @@ -28,11 +27,11 @@ const lifttechSolutionsLtdDe = (): TDivisionDraftBuilder =>
.addresses([
AddressDraft.presets.sampleDataB2B.lifttechSolutionsLtdDeAddress(),
])
.parentUnit([
.parentUnit(
KeyReferenceDraft.presets
.businessUnit()
.key(lifttechSolutionsLtdCompany.key!),
])
.key(lifttechSolutionsLtdCompany.key!)
)
.defaultShippingAddress(0)
.defaultBillingAddress(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe(`with lifttechSolutionsLtdEs preset`, () => {
"postalCode": "28013",
"region": "Community of Madrid",
"salutation": undefined,
"state": "Community of Madrid",
"state": undefined,
"streetName": "Calle Mayor",
"streetNumber": "101",
"title": undefined,
Expand Down Expand Up @@ -77,14 +77,12 @@ describe(`with lifttechSolutionsLtdEs preset`, () => {
"defaultShippingAddress": 0,
"key": "lifttech-solutions-ltd-es",
"name": "LiftTech Soluciones S.L.",
"parentUnit": [
{
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
],
"parentUnit": {
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
"shippingAddresses": undefined,
"status": "Active",
"status": undefined,
"storeMode": "Explicit",
"stores": [
{
Expand Down Expand Up @@ -126,7 +124,7 @@ describe(`with lifttechSolutionsLtdEs preset`, () => {
"postalCode": "28013",
"region": "Community of Madrid",
"salutation": undefined,
"state": "Community of Madrid",
"state": undefined,
"streetName": "Calle Mayor",
"streetNumber": "101",
"title": undefined,
Expand Down Expand Up @@ -172,14 +170,11 @@ describe(`with lifttechSolutionsLtdEs preset`, () => {
"defaultShippingAddress": 0,
"key": "lifttech-solutions-ltd-es",
"name": "LiftTech Soluciones S.L.",
"parentUnit": [
{
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
],
"parentUnit": {
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
"shippingAddresses": undefined,
"status": "Active",
"storeMode": "Explicit",
"stores": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const lifttechSolutionsLtdEs = (): TDivisionDraftBuilder =>
.key('lifttech-solutions-ltd-es')
.name('LiftTech Soluciones S.L.')
.unitType(unitType.Division)
.status(status.Active)
.storeMode(storeMode.Explicit)
.associateMode(associateMode.ExplicitAndFromParent)
.stores([KeyReferenceDraft.presets.store().key(spainStore.key!)])
Expand All @@ -34,11 +33,11 @@ const lifttechSolutionsLtdEs = (): TDivisionDraftBuilder =>
.addresses([
AddressDraft.presets.sampleDataB2B.lifttechSolutionsLtdEsAddress(),
])
.parentUnit([
.parentUnit(
KeyReferenceDraft.presets
.businessUnit()
.key(lifttechSolutionsLtdCompany.key!),
])
.key(lifttechSolutionsLtdCompany.key!)
)
.defaultShippingAddress(0)
.defaultBillingAddress(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe(`with lifttechSolutionsLtdFr preset`, () => {
"postalCode": "75002",
"region": "Île-de-France",
"salutation": undefined,
"state": "Île-de-France",
"state": undefined,
"streetName": "Rue de la Paix",
"streetNumber": "789",
"title": undefined,
Expand Down Expand Up @@ -77,14 +77,12 @@ describe(`with lifttechSolutionsLtdFr preset`, () => {
"defaultShippingAddress": 0,
"key": "lifttech-solutions-ltd-fr",
"name": "LiftTech Solutions SARL",
"parentUnit": [
{
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
],
"parentUnit": {
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
"shippingAddresses": undefined,
"status": "Active",
"status": undefined,
"storeMode": "FromParent",
"stores": undefined,
"unitType": "Division",
Expand Down Expand Up @@ -121,7 +119,7 @@ describe(`with lifttechSolutionsLtdFr preset`, () => {
"postalCode": "75002",
"region": "Île-de-France",
"salutation": undefined,
"state": "Île-de-France",
"state": undefined,
"streetName": "Rue de la Paix",
"streetNumber": "789",
"title": undefined,
Expand Down Expand Up @@ -167,14 +165,11 @@ describe(`with lifttechSolutionsLtdFr preset`, () => {
"defaultShippingAddress": 0,
"key": "lifttech-solutions-ltd-fr",
"name": "LiftTech Solutions SARL",
"parentUnit": [
{
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
],
"parentUnit": {
"key": "lifttech-solutions-ltd",
"typeId": "business-unit",
},
"shippingAddresses": undefined,
"status": "Active",
"storeMode": "FromParent",
"stores": undefined,
"unitType": "Division",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const lifttechSolutionsLtdFr = (): TDivisionDraftBuilder =>
.key('lifttech-solutions-ltd-fr')
.name('LiftTech Solutions SARL')
.unitType(unitType.Division)
.status(status.Active)
.storeMode(storeMode.FromParent)
.associateMode(associateMode.ExplicitAndFromParent)
.associates([
Expand All @@ -28,11 +27,11 @@ const lifttechSolutionsLtdFr = (): TDivisionDraftBuilder =>
.addresses([
AddressDraft.presets.sampleDataB2B.lifttechSolutionsLtdFrAddress(),
])
.parentUnit([
.parentUnit(
KeyReferenceDraft.presets
.businessUnit()
.key(lifttechSolutionsLtdCompany.key!),
])
.key(lifttechSolutionsLtdCompany.key!)
)
.defaultShippingAddress(0)
.defaultBillingAddress(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const transformers = {
}),
graphql: Transformer<TDivisionDraft, TDivisionDraftGraphql>('graphql', {
buildFields: ['addresses', 'associates', 'parentUnit', 'stores'],
removeFields: ['status'],
}),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe(`with lifttechSolutionsLtdCart1 preset`, () => {
"postalCode": "SW1A 1AA",
"region": "England",
"salutation": undefined,
"state": "London",
"state": undefined,
"streetName": "Baker Street",
"streetNumber": "221B",
"title": undefined,
Expand Down Expand Up @@ -214,7 +214,7 @@ describe(`with lifttechSolutionsLtdCart1 preset`, () => {
"postalCode": "SW1A 1AA",
"region": "England",
"salutation": undefined,
"state": "London",
"state": undefined,
"streetName": "Baker Street",
"streetNumber": "221B",
"title": undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe(`with lifttechSolutionsLtdCart2 preset`, () => {
"postalCode": "SW1A 1AA",
"region": "England",
"salutation": undefined,
"state": "London",
"state": undefined,
"streetName": "Baker Street",
"streetNumber": "221B",
"title": undefined,
Expand Down Expand Up @@ -214,7 +214,7 @@ describe(`with lifttechSolutionsLtdCart2 preset`, () => {
"postalCode": "SW1A 1AA",
"region": "England",
"salutation": undefined,
"state": "London",
"state": undefined,
"streetName": "Baker Street",
"streetNumber": "221B",
"title": undefined,
Expand Down
Loading

0 comments on commit 7a5d138

Please sign in to comment.