package model

import (
	"gorm.io/gorm"
	"time"
)

type InvoiceRewrite struct {
	ID                    int       `json:"id" csv:"id"`
	CollectionID          string    `json:"collection_id,omitempty" csv:"collection_id"`
	NsOrderNumber         string    `json:"ns_order_number,omitempty" csv:"ns_order_number"`
	NsCollectionNumber    string    `json:"ns_collection_number,omitempty" csv:"ns_collection_number"`
	SalesforceOrderNumber string    `json:"salesforce_order_number,omitempty" csv:"salesforce_order_number"`
	PdfName               string    `json:"pdf_name,omitempty" csv:"pdf_name"`
	PdfContent            string    `json:"pdf_content,omitempty" csv:"pdf_content"`
	PdfContentByte        string    `json:"pdf_content_byte,omitempty" csv:"pdf_content_byte"`
	InvoiceNumberToUse    string    `json:"invoice_number_to_use,omitempty" csv:"invoice_number_to_use"`
	Source                string    `json:"source,omitempty" csv:"source"`
	Sync                  int       `json:"sync,omitempty" csv:"sync"`
	SyncTime              time.Time `json:"sync_time" csv:"sync_time"`
	CreatedAt             time.Time `json:"created_at,omitempty" csv:"created_at"`     // 使用 time.Time 处理 datetime 类型
	UpdatedTime           time.Time `json:"updated_time,omitempty" csv:"updated_time"` // 使用 time.Time 处理 datetime 类型
}

func (InvoiceRewrite) TableName() string {
	return "invoice_rewrite"
}

type InvoiceRewriteContentByte struct {
	ID             int            `json:"id"`
	CreatedAt      time.Time      `json:"created_at,omitempty"` // 使用 time.Time 处理 datetime 类型
	UpdatedAt      time.Time      `json:"updated_at,omitempty"` // 使用 time.Time 处理 datetime 类型
	DeletedAt      gorm.DeletedAt `json:"deleted_at,omitempty"`
	InvoiceID      int            `json:"invoice_id,omitempty"`
	PdfContentByte []byte         `json:"pdf_content_byte,omitempty"`
}

func (InvoiceRewriteContentByte) TableName() string {
	return "invoice_rewrite_content_byte"
}
