Documentation ¶
Index ¶
- type Customer
- type Database
- func (d *Database) CloseDatabase()
- func (d *Database) GetAllCustomers() ([]Customer, error)
- func (d *Database) GetAllInvoices() ([]Invoice, error)
- func (d *Database) GetAllProducts() ([]Product, error)
- func (d *Database) GetCustomerByNumber(number string) (*Customer, error)
- func (d *Database) GetDatabaseName() string
- func (d *Database) GetInvoiceByNumber(number string) (*Invoice, error)
- func (d *Database) GetInvoiceRowsByInvoiceId(id int) ([]InvoiceRow, error)
- func (d *Database) GetNextInvoiceNumber() (int, error)
- func (d *Database) GetProductByNumber(number string) (*Product, error)
- func (d *Database) InsertInvoice(invoice *Invoice) error
- func (d *Database) UpdateProduct(product *Product) error
- type Invoice
- type InvoiceRow
- type Product
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Customer ¶
type Customer struct { Id int `gorm:"column:id;primary_key"` FancyName string `gorm:"column:fancyname;size:100;default:null"` Name string `gorm:"column:name;size:100"` Number string `gorm:"column:number;size:100"` Reference string `gorm:"column:reference;size:100:default:null"` PayDay int `gorm:"column:payday;default:30"` Address string `gorm:"column:address;size:100"` PostalAddress string `gorm:"column:postaladdress;size:100"` }
type Database ¶
type Database struct { UseTestDatabase bool // contains filtered or unexported fields }
func NewDatabase ¶
func (*Database) CloseDatabase ¶
func (d *Database) CloseDatabase()
func (*Database) GetAllCustomers ¶
func (*Database) GetAllInvoices ¶
func (*Database) GetAllProducts ¶
func (*Database) GetCustomerByNumber ¶
func (*Database) GetDatabaseName ¶
func (*Database) GetInvoiceByNumber ¶
func (*Database) GetInvoiceRowsByInvoiceId ¶
func (d *Database) GetInvoiceRowsByInvoiceId(id int) ([]InvoiceRow, error)
func (*Database) GetNextInvoiceNumber ¶
func (*Database) GetProductByNumber ¶
func (*Database) InsertInvoice ¶
func (*Database) UpdateProduct ¶
type Invoice ¶
type Invoice struct { Id int `gorm:"column:id;primary_key"` Number int `gorm:"column:number"` Date time.Time `gorm:"column:date"` DueDate time.Time `gorm:"column:duedate"` Amount float32 `gorm:"column:amount"` CustomerNumber string `gorm:"column:customernumber;size:100"` CustomerName string `gorm:"column:customername;size:100"` CustomerAddress string `gorm:"column:customeraddress;size:100"` CustomerPostalAddress string `gorm:"column:customerpostaladdress;size:100"` CustomerReference string `gorm:"column:customerreference;size:100"` PayDay int `gorm:"column:payday"` Credit bool `gorm:"column:credit;default:0"` CreditInvoiceNumber sql.NullInt32 `gorm:"column:creditinvoicenumber;default:null"` ReadOnly bool `gorm:"column:readonly;default:false"` Rows []InvoiceRow }
type InvoiceRow ¶
type InvoiceRow struct { Id int `gorm:"column:id;primary_key"` InvoiceId int `gorm:"column:invoiceid;"` Text string `gorm:"column:producttext;size:100"` Name string `gorm:"column:productname;size:100"` Price float32 `gorm:"column:productprice"` Amount float32 `gorm:"column:amount"` Total float32 `gorm:"column:rowtotal"` }
func (*InvoiceRow) TableName ¶
func (p *InvoiceRow) TableName() string
Click to show internal directories.
Click to hide internal directories.