Mhamdans17 commited on
Commit ·
e79019b
1
Parent(s): 0c807ba
fix: remove default:true GORM tags from IsActive fields to allow explicitly setting them to false during registration
Browse files- models/models.go +3 -3
models/models.go
CHANGED
|
@@ -13,7 +13,7 @@ type Company struct {
|
|
| 13 |
Email string `gorm:"type:varchar(100)" json:"email"`
|
| 14 |
Phone string `gorm:"type:varchar(20)" json:"phone"`
|
| 15 |
LogoURL string `gorm:"type:varchar(255)" json:"logo_url"`
|
| 16 |
-
IsActive bool `
|
| 17 |
FeePercentage float64 `gorm:"type:float;default:0.0;not null" json:"fee_percentage"`
|
| 18 |
ApprovedAt *time.Time `json:"approved_at"`
|
| 19 |
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
|
@@ -30,7 +30,7 @@ type Branch struct {
|
|
| 30 |
Name string `gorm:"type:varchar(100);not null" json:"name"`
|
| 31 |
Address string `gorm:"type:varchar(255)" json:"address"`
|
| 32 |
Phone string `gorm:"type:varchar(20)" json:"phone"`
|
| 33 |
-
IsActive bool `
|
| 34 |
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
| 35 |
Company *Company `gorm:"foreignKey:CompanyID" json:"company,omitempty"`
|
| 36 |
Users []User `gorm:"foreignKey:BranchID;constraint:OnDelete:SET NULL" json:"-"`
|
|
@@ -47,7 +47,7 @@ type User struct {
|
|
| 47 |
Role string `gorm:"type:varchar(20);default:'kasir'" json:"role"` // "super_admin", "owner", "kasir"
|
| 48 |
CompanyID *uint `json:"company_id"`
|
| 49 |
BranchID *uint `json:"branch_id"`
|
| 50 |
-
IsActive bool `
|
| 51 |
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
| 52 |
Company *Company `gorm:"foreignKey:CompanyID" json:"company,omitempty"`
|
| 53 |
Branch *Branch `gorm:"foreignKey:BranchID" json:"branch,omitempty"`
|
|
|
|
| 13 |
Email string `gorm:"type:varchar(100)" json:"email"`
|
| 14 |
Phone string `gorm:"type:varchar(20)" json:"phone"`
|
| 15 |
LogoURL string `gorm:"type:varchar(255)" json:"logo_url"`
|
| 16 |
+
IsActive bool `json:"is_active"`
|
| 17 |
FeePercentage float64 `gorm:"type:float;default:0.0;not null" json:"fee_percentage"`
|
| 18 |
ApprovedAt *time.Time `json:"approved_at"`
|
| 19 |
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
|
|
|
| 30 |
Name string `gorm:"type:varchar(100);not null" json:"name"`
|
| 31 |
Address string `gorm:"type:varchar(255)" json:"address"`
|
| 32 |
Phone string `gorm:"type:varchar(20)" json:"phone"`
|
| 33 |
+
IsActive bool `json:"is_active"`
|
| 34 |
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
| 35 |
Company *Company `gorm:"foreignKey:CompanyID" json:"company,omitempty"`
|
| 36 |
Users []User `gorm:"foreignKey:BranchID;constraint:OnDelete:SET NULL" json:"-"`
|
|
|
|
| 47 |
Role string `gorm:"type:varchar(20);default:'kasir'" json:"role"` // "super_admin", "owner", "kasir"
|
| 48 |
CompanyID *uint `json:"company_id"`
|
| 49 |
BranchID *uint `json:"branch_id"`
|
| 50 |
+
IsActive bool `json:"is_active"`
|
| 51 |
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
| 52 |
Company *Company `gorm:"foreignKey:CompanyID" json:"company,omitempty"`
|
| 53 |
Branch *Branch `gorm:"foreignKey:BranchID" json:"branch,omitempty"`
|