mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 05:21:57 +00:00
28 lines
1.0 KiB
Go
28 lines
1.0 KiB
Go
package entities
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Customer struct {
|
|
Id uint `gorm:"primaryKey"`
|
|
Name string `gorm:"type:varchar(50);not null;uniqueIndex:customers_name_unique,where:deleted_at IS NULL"`
|
|
PicId uint `gorm:"not null"`
|
|
Type string `gorm:"not null;size:50"`
|
|
Address string `gorm:"not null"`
|
|
Phone string `gorm:"not null;size:20"`
|
|
Email string `gorm:"type:varchar(50);not null"`
|
|
AccountNumber string `gorm:"not null;size:50"`
|
|
BankName string `gorm:"not null;size:100;default:''"`
|
|
Balance float64 `gorm:"default:0"`
|
|
CreatedBy uint `gorm:"not null"`
|
|
CreatedAt time.Time `gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
|
|
CreatedUser User `gorm:"foreignKey:CreatedBy;references:Id"`
|
|
Pic User `gorm:"foreignKey:PicId;references:Id"`
|
|
}
|