diff --git a/packages/core/types/src/http/region/common.ts b/packages/core/types/src/http/region/common.ts index 34d8b06729..5a2d26508a 100644 --- a/packages/core/types/src/http/region/common.ts +++ b/packages/core/types/src/http/region/common.ts @@ -17,7 +17,7 @@ export interface BaseRegionCountry { id: string iso_2?: string iso_3?: string - num_code?: number + num_code?: string name?: string display_name?: string } @@ -37,7 +37,7 @@ export interface BaseRegionCountryFilters id?: string[] | string iso_2?: string[] | string iso_3?: string[] | string - num_code?: number[] | string + num_code?: string | string[] name?: string[] | string display_name?: string[] | string } diff --git a/packages/core/types/src/region/common.ts b/packages/core/types/src/region/common.ts index ee815c36c4..9800a3e384 100644 --- a/packages/core/types/src/region/common.ts +++ b/packages/core/types/src/region/common.ts @@ -72,7 +72,7 @@ export interface RegionCountryDTO { /** * The country's code number. */ - num_code: number + num_code: string /** * The name of the country. @@ -147,7 +147,7 @@ export interface FilterableRegionCountryProps /** * Filter countries by their code number. */ - num_code?: number[] | string + num_code?: string[] | string /** * Filter countries by their name. diff --git a/packages/modules/region/src/migrations/.snapshot-medusa-region.json b/packages/modules/region/src/migrations/.snapshot-medusa-region.json index b48a175d6c..09bac771ad 100644 --- a/packages/modules/region/src/migrations/.snapshot-medusa-region.json +++ b/packages/modules/region/src/migrations/.snapshot-medusa-region.json @@ -131,12 +131,12 @@ }, "num_code": { "name": "num_code", - "type": "int", + "type": "text", "unsigned": false, "autoincrement": false, "primary": false, "nullable": false, - "mappedType": "integer" + "mappedType": "text" }, "name": { "name": "name", diff --git a/packages/modules/region/src/migrations/RegionModuleSetup20240205173216.ts b/packages/modules/region/src/migrations/RegionModuleSetup20240205173216.ts index 81390f93ac..4b447ecf15 100644 --- a/packages/modules/region/src/migrations/RegionModuleSetup20240205173216.ts +++ b/packages/modules/region/src/migrations/RegionModuleSetup20240205173216.ts @@ -29,7 +29,7 @@ CREATE INDEX IF NOT EXISTS "IDX_region_deleted_at" ON "region" ("deleted_at") WH CREATE TABLE IF NOT EXISTS "region_country" ( "iso_2" text NOT NULL, "iso_3" text NOT NULL, - "num_code" int NOT NULL, + "num_code" text NOT NULL, "name" text NOT NULL, "display_name" text NOT NULL, "region_id" text NULL, diff --git a/packages/modules/region/src/models/country.ts b/packages/modules/region/src/models/country.ts index 85b640f44a..4150ee0ec9 100644 --- a/packages/modules/region/src/models/country.ts +++ b/packages/modules/region/src/models/country.ts @@ -22,8 +22,8 @@ export default class Country { @Property({ columnType: "text" }) iso_3: string - @Property({ columnType: "int" }) - num_code: number + @Property({ columnType: "text" }) + num_code: string @Property({ columnType: "text" }) name: string