adjust softdelete daily checklist; add empty kandang

This commit is contained in:
giovanni
2026-04-22 16:24:31 +07:00
parent 2a141a96d1
commit 91d51bf1b8
8 changed files with 287 additions and 63 deletions
+10 -3
View File
@@ -1,6 +1,10 @@
package entities
import "time"
import (
"time"
"gorm.io/gorm"
)
type DailyChecklist struct {
Id uint `gorm:"primaryKey"`
@@ -14,12 +18,15 @@ type DailyChecklist struct {
DocumentPath *string
RejectReason *string
CreatedBy *uint
CreatedAt time.Time `gorm:"autoCreateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
DeletedBy *uint
CreatedAt time.Time `gorm:"autoCreateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
Kandang KandangGroup `gorm:"foreignKey:KandangId;references:Id"`
Checklist *Checklist `gorm:"foreignKey:ChecklistId;references:Id"`
Creator *User `gorm:"foreignKey:CreatedBy;references:Id"`
Deleter *User `gorm:"foreignKey:DeletedBy;references:Id"`
Tasks []DailyChecklistTask `gorm:"foreignKey:DailyChecklistId;references:Id"`
}