You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.4 KiB

8 months ago
package model
import (
"database/sql"
"github.com/shopspring/decimal"
"gorm.io/gorm"
"time"
)
const (
SplitAccountStatusInProgress = 1 // 进行中
SplitAccountStatusFinish = 2 // 已完成
)
type SplitAccount struct {
Id uint `gorm:"primaryKey"`
Name string // 分账名称
SponsorId uint // 发起人
Broker Broker `gorm:"foreignKey:SponsorId"`
LastBill string // 最近一次账单
Status uint // 分账状态 1=进行中 2=已完成
TotalAmount decimal.Decimal // 分账总额
BillAmount decimal.Decimal // 账目总额
SaleAmount decimal.Decimal // 出售总额
ModelId uint // 车型id
Model CarModel `gorm:"foreignKey:ModelId;references:ModelId"`
LocationId uint // 车辆所在地
Location Area `gorm:"foreignKey:LocationId"`
LicensingDate sql.NullTime // 上牌日期
Color string // 车身颜色
Mileage decimal.Decimal // 里程
Brokers []SplitAccountBroker `gorm:"foreignKey:AccountId"`
Bills []SplitAccountBill `gorm:"foreignKey:AccountId"`
SaleAt sql.NullTime // 出售时间
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt
}