add daily checklist module;adjust master data;adjust migration

This commit is contained in:
MacBook Air M1
2026-01-06 17:03:55 +07:00
parent b1996be24c
commit 3bd0602525
25 changed files with 1011 additions and 52 deletions
+16 -14
View File
@@ -7,25 +7,27 @@ import (
)
type Phases struct {
Id uint `gorm:"primaryKey"`
Name string `gorm:"not null"`
IsActive bool `gorm:"not null;default:true"`
Category string `gorm:"type:category_code;not null"`
CreatedAt time.Time `gorm:"autoCreateTime"`
Id uint `gorm:"primaryKey"`
Name string `gorm:"not null"`
IsActive bool `gorm:"not null;default:true"`
Category string `gorm:"type:category_code;not null"`
CreatedAt time.Time `gorm:"autoCreateTime"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
Activities []PhaseActivity `gorm:"foreignKey:PhaseId;references:Id"`
}
type PhaseActivity struct {
Id uint `gorm:"primaryKey"`
PhaseId uint `gorm:"not null"`
Name string `gorm:"not null"`
Description *string `gorm:"type:text"`
TimeType *string `gorm:"type:text"`
CreatedAt time.Time `gorm:"autoCreateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
Id uint `gorm:"primaryKey"`
PhaseId uint `gorm:"not null"`
Name string `gorm:"not null"`
Description *string `gorm:"type:text"`
TimeType *string `gorm:"type:text"`
CreatedAt time.Time `gorm:"autoCreateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
Phase Phase `gorm:"foreignKey:PhaseId;references:Id"`
Phase Phases `gorm:"foreignKey:PhaseId;references:Id"`
}
type Checklist struct {
@@ -37,5 +39,5 @@ type Checklist struct {
UpdatedAt time.Time `gorm:"autoUpdateTime"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
Phase *Phase `gorm:"foreignKey:PhaseId;references:Id"`
Phase *Phases `gorm:"foreignKey:PhaseId;references:Id"`
}