Added invoices endpoint
This commit is contained in:
@@ -5,6 +5,9 @@ import "github.com/jinzhu/gorm"
|
||||
type Company struct {
|
||||
gorm.Model
|
||||
Name string
|
||||
Address string
|
||||
Email string
|
||||
Phone string
|
||||
Users []User
|
||||
Devices []Device
|
||||
}
|
||||
|
||||
42
models/invoice.go
Normal file
42
models/invoice.go
Normal file
@@ -0,0 +1,42 @@
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
||||
func (Invoice) Update() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
func (Invoice) Create() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
func (Invoice) Delete() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
27
models/invoice_item.go
Normal file
27
models/invoice_item.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
type InvoiceItem struct {
|
||||
gorm.Model
|
||||
Description string
|
||||
Quantity int64
|
||||
Unit string
|
||||
PriceCents int64 `gorm:"column:price_cents"`
|
||||
InvoiceID uint
|
||||
}
|
||||
|
||||
|
||||
|
||||
func (InvoiceItem) Update() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
func (InvoiceItem) Create() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
func (InvoiceItem) Delete() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user