2025-07-18 20:10:29 +07:00
|
|
|
package entities
|
|
|
|
|
|
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
|
|
|
|
|
|
func GetAllEntities() []interface{} {
|
|
|
|
|
return []interface{}{
|
|
|
|
|
&Organization{},
|
|
|
|
|
&Outlet{},
|
|
|
|
|
&OutletSetting{},
|
|
|
|
|
&User{},
|
|
|
|
|
&Category{},
|
|
|
|
|
&Product{},
|
|
|
|
|
&ProductVariant{},
|
|
|
|
|
&Inventory{},
|
|
|
|
|
&Order{},
|
|
|
|
|
&OrderItem{},
|
|
|
|
|
&PaymentMethod{},
|
|
|
|
|
&Payment{},
|
|
|
|
|
&Customer{},
|
2025-07-30 23:18:20 +07:00
|
|
|
&Table{},
|
2025-09-12 01:12:11 +07:00
|
|
|
&Vendor{},
|
|
|
|
|
&PurchaseOrder{},
|
|
|
|
|
&PurchaseOrderItem{},
|
|
|
|
|
&PurchaseOrderAttachment{},
|
|
|
|
|
&IngredientUnitConverter{},
|
2025-09-17 19:30:17 +07:00
|
|
|
// Gamification entities
|
|
|
|
|
&CustomerPoints{},
|
|
|
|
|
&CustomerTokens{},
|
|
|
|
|
&Tier{},
|
|
|
|
|
&Game{},
|
|
|
|
|
&GamePrize{},
|
|
|
|
|
&GamePlay{},
|
|
|
|
|
&OmsetTracker{},
|
2025-09-17 23:55:11 +07:00
|
|
|
&Reward{},
|
|
|
|
|
&Campaign{},
|
|
|
|
|
&CampaignRule{},
|
2025-09-18 01:32:01 +07:00
|
|
|
&OtpSession{},
|
2025-07-18 20:10:29 +07:00
|
|
|
// Analytics entities are not database tables, they are query results
|
2026-05-10 10:42:09 +07:00
|
|
|
&UserDevice{},
|
2026-05-10 12:35:44 +07:00
|
|
|
// Notification entities
|
|
|
|
|
&Notification{},
|
|
|
|
|
&NotificationReceiver{},
|
|
|
|
|
&NotificationDelivery{},
|
2026-05-13 21:58:54 +07:00
|
|
|
&ProductOutletPrice{},
|
2026-05-25 14:59:40 +07:00
|
|
|
&Expense{},
|
2026-08-13 14:38:28 +07:00
|
|
|
&CashAdvance{},
|
2026-09-30 15:31:44 +07:00
|
|
|
// Wallet entities
|
|
|
|
|
&CustomerWallet{},
|
|
|
|
|
&WalletTransaction{},
|
|
|
|
|
&WalletLot{},
|
|
|
|
|
&WalletLotAllocation{},
|
|
|
|
|
&LoyaltySettingChange{},
|
2025-07-18 20:10:29 +07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func AutoMigrate(db *gorm.DB) error {
|
|
|
|
|
return db.AutoMigrate(GetAllEntities()...)
|
|
|
|
|
}
|