chores: refactor struct and structure project

This commit is contained in:
ericprd
2025-03-05 21:21:44 +08:00
parent 13a8481f22
commit 567e0e32ca
103 changed files with 1125 additions and 731 deletions
+23 -1
View File
@@ -1,6 +1,28 @@
package subscribedomain
type Subscribe struct {
import (
subscribeplandm "legalgo-BE-go/internal/domain/subscribe_plan_model"
"time"
)
type SubscribeDepecrate struct {
ID string `json:"id"`
SubscribePlanID string `json:"subscribe_plan_id"`
}
type SubscribeUpdateReqDepecrate struct {
ID string `json:"id"`
Status string `json:"status"`
}
// refactored
type Subscribe struct {
ID string `gorm:"primaryKey" json:"id"`
SubscribePlanID string `gorm:"not null" json:"subscribe_plan_id"`
StartDate time.Time `gorm:"default:CURRENT_TIMESTAMP"`
EndDate time.Time `gorm:"default:null"`
Status string `gorm:"default:'inactive'"`
AutoRenew bool `gorm:"default:true"`
SubscribePlan subscribeplandm.SubscribePlan `gorm:"foreignKey:SubscribePlanID;constraint:OnDelete:CASCADE" json:"subscribe_plan"`
}