1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package models
- import (
- "time"
- "github.com/qor5/admin/media/media_library"
- "github.com/qor5/admin/publish"
- )
- type Customer struct {
- ID uint `gorm:"primarykey"`
- Name string
- Addresses []*Address
- MembershipCard *MembershipCard
- }
- type Address struct {
- ID uint `gorm:"primarykey"`
- CustomerID uint
- Street string
- HomeImage media_library.MediaBox `sql:"type:text;"`
- UpdatedAt time.Time
- CreatedAt time.Time
- publish.Status
- Phones []*Phone
- }
- type Phone struct {
- ID uint `gorm:"primarykey"`
- AddressID uint
- Number int
- }
- type MembershipCard struct {
- ID uint `gorm:"primarykey"`
- CustomerID uint
- Number int
- ValidBefore *time.Time
- }
|