package company_report_permission

import "time"

// CompanyReportPermission 客户权限表
type CompanyReportPermission struct {
	CompanyReportPermissionID uint64    `gorm:"primaryKey;column:company_report_permission_id;type:bigint(20) unsigned;not null" json:"-"`         // 主键
	CompanyID                 int64     `gorm:"uniqueIndex:uni_key;column:company_id;type:bigint(20);default:0" json:"companyId"`                  // 客户id
	ReportPermissionID        int64     `gorm:"column:report_permission_id;type:bigint(20)" json:"reportPermissionId"`                             // 报告权限id
	CreatedTime               time.Time `gorm:"index:created_time;column:created_time;type:datetime;default:CURRENT_TIMESTAMP" json:"createdTime"` // 创建时间
	LastUpdatedTime           time.Time `gorm:"index:last_updated_time;column:last_updated_time;type:timestamp;not null;default:CURRENT_TIMESTAMP" json:"lastUpdatedTime"`
	ChartPermissionID         int       `gorm:"uniqueIndex:uni_key;column:chart_permission_id;type:int(11);default:0" json:"chartPermissionId"` // 大分类ID
	StartDate                 time.Time `gorm:"column:start_date;type:date" json:"startDate"`                                                   // 权限开始日期
	EndDate                   time.Time `gorm:"column:end_date;type:date" json:"endDate"`                                                       // 权限结束日期
	ProductID                 int       `gorm:"index:idx_product_id;column:product_id;type:int(11);default:0" json:"productId"`                 // 产品id
	ProductName               string    `gorm:"column:product_name;type:varchar(20);default:''" json:"productName"`                             // 产品名称
	ModifyTime                time.Time `gorm:"column:modify_time;type:datetime" json:"modifyTime"`                                             // 修改时间
	CompanyContractID         int       `gorm:"column:company_contract_id;type:int(11);default:0" json:"companyContractId"`                     // 合同id
	Status                    string    `gorm:"column:status;type:enum('正式','试用','关闭','永续','潜在')" json:"status"`
}

// TableName get sql table name.获取数据库表名
func (m *CompanyReportPermission) TableName() string {
	return "company_report_permission"
}

// CompanyReportPermissionColumns get sql column name.获取数据库列名
var CompanyReportPermissionColumns = struct {
	CompanyReportPermissionID string
	CompanyID                 string
	ReportPermissionID        string
	CreatedTime               string
	LastUpdatedTime           string
	ChartPermissionID         string
	StartDate                 string
	EndDate                   string
	ProductID                 string
	ProductName               string
	ModifyTime                string
	CompanyContractID         string
	Status                    string
}{
	CompanyReportPermissionID: "company_report_permission_id",
	CompanyID:                 "company_id",
	ReportPermissionID:        "report_permission_id",
	CreatedTime:               "created_time",
	LastUpdatedTime:           "last_updated_time",
	ChartPermissionID:         "chart_permission_id",
	StartDate:                 "start_date",
	EndDate:                   "end_date",
	ProductID:                 "product_id",
	ProductName:               "product_name",
	ModifyTime:                "modify_time",
	CompanyContractID:         "company_contract_id",
	Status:                    "status",
}
