diff --git a/cmd/migration/migrations/20250828070941.sql b/cmd/migration/migrations/20250828070941.sql new file mode 100644 index 00000000..2f68a1b8 --- /dev/null +++ b/cmd/migration/migrations/20250828070941.sql @@ -0,0 +1,2 @@ +-- Modify "Item" table +ALTER TABLE "public"."Item" ALTER COLUMN "Infra_Id" TYPE integer; diff --git a/cmd/migration/migrations/atlas.sum b/cmd/migration/migrations/atlas.sum index b8ef29bb..7bb9cb01 100644 --- a/cmd/migration/migrations/atlas.sum +++ b/cmd/migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:m00Lt6P6Ck2i7UG8WlVBOWl5vmvSQZltNb1O7Z7zM+I= +h1:MjDAKEJK5Xf8q46mZR+EV6dJDBnGujQZyg98WDs/oJM= 20250825054027.sql h1:zRUeuuP4bDLf96Cb38D/l9ivBAQC745XRao0rxbzdVI= 20250825060522.sql h1:NiE1fVzydcg8Y8ytSHgt0DkkauQFveNXv42BoG5m+bI= 20250825102900.sql h1:OAUnj87Wz7mrHykX14idePckUmRYa5UH0LylYDL76RI= @@ -8,4 +8,5 @@ h1:m00Lt6P6Ck2i7UG8WlVBOWl5vmvSQZltNb1O7Z7zM+I= 20250827024311.sql h1:eTlrQYcHa/jmb3qSZxgTB+7S4IXJ8B4yklUB36iZaDw= 20250827072230.sql h1:BfdTcToEYC8d30BS+1Su5Pz5Ecz8bh74F2j+Bh/r2BM= 20250827083322.sql h1:2MErE7W1JTjcxtgKJs/1iEF8kgV6vrcGrDVx/m6LwHQ= -20250828061151.sql h1:cZkYO1VHCc2RtOwP1yesHNG/p+o/zeOAGvqJRU4Q4Xc= +20250828061151.sql h1:CxTT3e9ZJ+Rp4UXE40SuFswVedlagKqDneFkg4BZkRs= +20250828070941.sql h1:IFzr/lvd99yOUdNXuW8wJNjBkXPhrHfMR2Ilx9+2MqE= diff --git a/internal/domain/main-entities/item/dto.go b/internal/domain/main-entities/item/dto.go index 78f5fa4b..c157b541 100644 --- a/internal/domain/main-entities/item/dto.go +++ b/internal/domain/main-entities/item/dto.go @@ -11,7 +11,7 @@ type CreateDto struct { Name string `json:"name"` ItemGroup_Code *string `json:"itemGroup_code"` Uom_Code *string `json:"uom_code"` - Infra_Id *int16 `json:"infra_id"` + Infra_Id *uint16 `json:"infra_id"` Stock *int `json:"stock"` } @@ -20,7 +20,7 @@ type ReadListDto struct { Name string `json:"name"` ItemGroup_Code *string `json:"itemGroup_code"` Uom_Code *string `json:"uom_code"` - Infra_Id *int16 `json:"infra_id"` + Infra_Id *uint16 `json:"infra_id"` Stock *int `json:"stock"` Page int `json:"page"` @@ -61,7 +61,7 @@ type ResponseDto struct { ItemGroup *eig.ItemGroup `json:"itemGroup,omitempty"` Uom_Code *string `json:"uom_code"` Uom *eu.Uom `json:"uom,omitempty"` - Infra_Id *int16 `json:"infra_id"` + Infra_Id *uint16 `json:"infra_id"` Stock *int `json:"stock"` } diff --git a/internal/domain/main-entities/item/entity.go b/internal/domain/main-entities/item/entity.go index 9eeb9425..c6cb0b8f 100644 --- a/internal/domain/main-entities/item/entity.go +++ b/internal/domain/main-entities/item/entity.go @@ -14,6 +14,6 @@ type Item struct { ItemGroup *eig.ItemGroup `json:"itemGroup,omitempty" gorm:"foreignKey:ItemGroup_Code;references:Code"` Uom_Code *string `json:"uom_code" gorm:"size:10"` Uom *eu.Uom `json:"uom,omitempty" gorm:"foreignKey:Uom_Code;references:Code"` - Infra_Id *int16 `json:"infra_id"` + Infra_Id *uint16 `json:"infra_id"` Stock *int `json:"stock"` }