package model

import "time"

type SaleOrderResponse struct {
	Code     int
	Response *CallistoApiResponse
}

type CallistoApiResponse struct {
	Success bool                   `json:"success"`
	Result  interface{}            `json:"result"`
	SOData  map[string]interface{} `json:"_bff"`
	Error   map[string]interface{} `json:"error,omitempty"`
}

type UpdateNoteData struct {
	OrderReference string
	UserID         int64
	Note           string
	CreatedAt      time.Time
}

type AddShipmentData struct {
	OrderReference string
	UserID         int64
	DispatchedAt   *time.Time
	IsCollection   bool
	TrackingCode   string
	Priority       uint32
	TrackingUrl    string
	NoAirbill      bool
	CourierRef     int64
	CreatedAt      time.Time
}

type AddDocumentData struct {
	OrderReference string
	CreatedBy      int64
	DocumentType   int32
	Url            string
	Hash           string
	InvoiceId      int64
	ShipmentId     int64
}

type File struct {
	Content  []byte
	Name     string
	MIMEType string
}

func (f *File) GetFileExtension() string {
	switch f.MIMEType {
	case "text/csv":
		return "csv"
	default:
		return ""
	}
}

type SaleOrderExportASNResponse struct {
	Code    int
	Success bool
	Error   map[string]interface{}
	File    *File
}

type SaleOrderASNData struct {
	SKU         string
	ProductName string
	Serial      string
	IMEI        string
}

type SaleOrderShipmentData struct {
	ID uint64
}
