From 9a33de96a07eec8c7a337e1bdb8ac2cd0ffffa5a Mon Sep 17 00:00:00 2001 From: SoXX Date: Mon, 14 Oct 2024 12:30:27 +0200 Subject: [PATCH] feat(database): Refactor Pool model to use PoolCategory type for category field --- pkg/models/pools.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/models/pools.go b/pkg/models/pools.go index e1a6683..0b4dad6 100644 --- a/pkg/models/pools.go +++ b/pkg/models/pools.go @@ -1,9 +1,16 @@ package models +type PoolCategory string + +const ( + Series PoolCategory = "series" + Collection PoolCategory = "collection" +) + type Pool struct { BaseModel[PoolID] - Name string `json:"name" gorm:"type:varchar(25)"` - Category string `json:"category" gorm:"type:pool_category;type:enum('series', 'collection')"` + Name string `json:"name" gorm:"type:varchar(25)"` + Category PoolCategory `json:"category" gorm:"type:pool_category;type:enum('series', 'collection')"` } func (Pool) TableName() string {