Files
old-backend/models/invoice.go

67 lines
1.1 KiB
Go
Raw Normal View History

2023-09-27 19:20:44 +02:00
package models
import (
"time"
"github.com/jinzhu/gorm"
)
type Invoice struct {
gorm.Model
BuyerID uint
BuyerName string
BuyerAddress string
BuyerEmail string
BuyerPhone string
SellerID uint
SellerName string
SellerAddress string
SellerEmail string
SellerPhone string
PriceCents int64 `gorm:"column:price_cents"`
Discount int64
Tax int64
TermsAndConditions string
InvoiceName string
InvoiceDate time.Time
InvoiceDueDate time.Time
ContractID uint
InvoiceItem [] InvoiceItem
2023-10-03 18:26:57 +02:00
Status string
2023-09-27 19:20:44 +02:00
}
2023-10-03 18:26:57 +02:00
type ListInvoiceResponse struct {
Status KeyValue `json:"Status"`
Buyer CompanyShortResponse `json:"Buyer"`
ContractID int
DateCreated time.Time
DueDate time.Time
Amount string
}
type KeyValue struct {
Key string
Value string
}
func GetInvoiceStatuses() []Status {
return []Status{
{Key: "Insurance claimed", Value: "insurance_claimed"},
{Key: "Invoice issued", Value: "invoice_issued"},
}
}
2023-09-27 19:20:44 +02:00
func (Invoice) Update() (bool, error) {
return false, nil
}
func (Invoice) Create() (bool, error) {
return false, nil
}
func (Invoice) Delete() (bool, error) {
return false, nil
}