Skip to content

Commit

Permalink
feat(types): extend country and country state types (#174)
Browse files Browse the repository at this point in the history
* feat(types): extend country and country state types

* chore: changeset
  • Loading branch information
mkucmus authored Apr 27, 2023
1 parent 4c01ff5 commit a1edcd1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/heavy-bats-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shopware-pwa/types": patch
---

Extend types for Country and CountryState entities
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import { CustomerAddress } from "../../checkout/customer/CustomerAddress";
import { SalesChannel } from "../sales-channel/SalesChannel";
import { CustomFields } from "../../common/CustomField";

type CountryTaxSetting = {
enabled: boolean;
currencyId: string;
amount: number;
apiAlias: string;
};

/**
* @public
*/
Expand All @@ -30,4 +37,25 @@ export type Country = {
customerAddress: CustomerAddress[] | null;
salesChannelDefaultAssignments: SalesChannel[] | null;
salesChannels: SalesChannel[] | null;
extensions: unknown;
_uniqueIdentifier: string;
translated: {
name: string;
customFields: unknown;
addressFormat: string[][];
};
companyTaxFree: boolean;
checkVatIdPattern: boolean;
vatIdPattern: string;
vatIdRequired: boolean;
customerTax: CountryTaxSetting;
companyTax: CountryTaxSetting;
states: CountryState[];
postalCodeRequired: boolean;
checkPostalCodePattern: boolean;
checkAdvancedPostalCodePattern: boolean;
advancedPostalCodePattern: null | string;
defaultPostalCodePattern: string;
addressFormat: string[][];
apiAlias: "country";
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,20 @@ export type CountryState = {
customerAddresses: CustomerAddress[] | null;
orderAddresses: OrderAddress[] | null;
customFields: CustomFields;
extensions: unknown;
_uniqueIdentifier: string;
versionId: string | null;
translated: {
name: string;
customFields: unknown;
};
createdAt: string;
updatedAt: string | null;
countryId: string;
shortCode: string;
name: string | null;
position: number;
active: boolean;
id: string;
apiAlias: "country_state";
};

2 comments on commit a1edcd1

@vercel
Copy link

@vercel vercel bot commented on a1edcd1 Apr 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

frontends-demo – ./templates/vue-demo-store

frontends-demo.vercel.app
frontends-demo-shopware-frontends.vercel.app
frontends-demo-git-main-shopware-frontends.vercel.app

@vercel
Copy link

@vercel vercel bot commented on a1edcd1 Apr 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.