package model import "time" // WithdrawalQualification 是代理提现资料资格的不可变版本。 // 历史版本、附件引用与审批结果不被覆盖:替换合同或法人身份证即新增版本并使旧有效版本失效。 type WithdrawalQualification struct { ID uint `gorm:"column:id;primaryKey;autoIncrement" json:"id"` ShopID uint `gorm:"column:shop_id;not null;comment:所属代理店铺ID" json:"shop_id"` SubjectType string `gorm:"column:subject_type;type:varchar(20);not null;comment:签约主体类型 enterprise/personal" json:"subject_type"` SubjectCode string `gorm:"column:subject_code;type:varchar(64);not null;comment:签约主体代码" json:"subject_code"` LegalPersonIDCard string `gorm:"column:legal_person_id_card;type:varchar(64);not null;comment:法人身份证号" json:"legal_person_id_card"` ContractFileKey string `gorm:"column:contract_file_key;type:varchar(255);not null;comment:合同附件对象存储Key" json:"contract_file_key"` IDCardFrontFileKey string `gorm:"column:id_card_front_file_key;type:varchar(255);not null;comment:法人身份证正面附件对象存储Key" json:"id_card_front_file_key"` IDCardBackFileKey string `gorm:"column:id_card_back_file_key;type:varchar(255);not null;comment:法人身份证反面附件对象存储Key" json:"id_card_back_file_key"` BusinessLicenseFileKey string `gorm:"column:business_license_file_key;type:varchar(255);not null;default:'';comment:营业执照附件对象存储Key" json:"business_license_file_key"` ShopFrontFileKey string `gorm:"column:shop_front_file_key;type:varchar(255);not null;default:'';comment:门头照附件对象存储Key" json:"shop_front_file_key"` InvoiceFileKey string `gorm:"column:invoice_file_key;type:varchar(255);not null;default:'';comment:发票附件对象存储Key" json:"invoice_file_key"` InvoiceTitle string `gorm:"column:invoice_title;type:varchar(200);not null;default:'';comment:发票抬头" json:"invoice_title"` InvoiceSubjectCode string `gorm:"column:invoice_subject_code;type:varchar(64);not null;default:'';comment:发票统一社会信用代码" json:"invoice_subject_code"` Status int `gorm:"column:status;type:smallint;not null;default:0;comment:状态 0-待审批 1-已通过有效 2-已驳回 3-已失效或已作废" json:"status"` InvalidReason string `gorm:"column:invalid_reason;type:varchar(500);not null;default:'';comment:失效原因" json:"invalid_reason"` InvalidatedAt *time.Time `gorm:"column:invalidated_at;type:timestamptz;comment:失效时间" json:"invalidated_at,omitempty"` InvalidatedBy uint `gorm:"column:invalidated_by;not null;default:0;comment:使资格失效的操作账号ID,0 表示店铺停用联动" json:"invalidated_by"` ApprovalInstanceID *uint `gorm:"column:approval_instance_id;comment:关联的通用审批实例ID" json:"approval_instance_id,omitempty"` DecidedAt *time.Time `gorm:"column:decided_at;type:timestamptz;comment:审批终态到达时间" json:"decided_at,omitempty"` Creator uint `gorm:"column:creator;not null;default:0;comment:创建人用户ID" json:"creator"` Updater uint `gorm:"column:updater;not null;default:0;comment:最近更新人用户ID" json:"updater"` CreatedAt time.Time `gorm:"column:created_at;type:timestamptz;not null;autoCreateTime" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;type:timestamptz;not null;autoUpdateTime" json:"updated_at"` } // TableName 指定提现资料资格版本表名。 func (WithdrawalQualification) TableName() string { return "tb_withdrawal_qualification" }