Documentation ¶
Index ¶
- type Customer
- type CustomerInfo
- type Database
- func (db *Database) CreateCustomer(c *Customer) (*Customer, error)
- func (db *Database) Customer(id int) (*Customer, error)
- func (db *Database) CustomerInfo(id int) (*CustomerInfo, error)
- func (db *Database) Customers() ([]*Customer, error)
- func (db *Database) DeleteCustomer(id int) error
- func (db *Database) Slips(customerId int) ([]*Slip, error)
- func (db *Database) UpdateCustomer(id int, c *Customer) (*Customer, error)
- type DbError
- type JsonNullInt64
- type Slip
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Customer ¶
type Customer struct { ID int `json:"id"` UserID int `json:"-"` Title *string `json:"title"` Name *string `json:"name"` Surname *string `json:"surname"` Address *string `json:"address"` ZipCode *string `json:"zip_code"` Town *string `json:"town"` Province *string `json:"province"` Country *string `json:"country"` TaxCode *string `json:"tax_code"` Vat *string `json:"vat"` Info *string `json:"info"` }
+------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+----------------+ | id | int | NO | PRI | NULL | auto_increment | | user_id | int | YES | MUL | NULL | | | title | varchar(255) | YES | MUL | NULL | | | name | varchar(255) | YES | MUL | NULL | | | surname | varchar(255) | YES | MUL | NULL | | | address | varchar(255) | YES | | NULL | | | zip_code | varchar(255) | YES | | NULL | | | town | varchar(255) | YES | | NULL | | | province | varchar(255) | YES | | NULL | | | country | varchar(255) | YES | | NULL | | | tax_code | varchar(255) | YES | | NULL | | | vat | varchar(255) | YES | | NULL | | | created_at | datetime | NO | | NULL | | | updated_at | datetime | NO | | NULL | | | info | text | YES | | NULL | | +------------+--------------+------+-----+---------+----------------+
type CustomerInfo ¶
type Database ¶
func (*Database) CreateCustomer ¶
func (*Database) CustomerInfo ¶
func (db *Database) CustomerInfo(id int) (*CustomerInfo, error)
func (*Database) DeleteCustomer ¶
type JsonNullInt64 ¶
func (JsonNullInt64) MarshalJSON ¶
func (v JsonNullInt64) MarshalJSON() ([]byte, error)
func (*JsonNullInt64) UnmarshalJSON ¶
func (v *JsonNullInt64) UnmarshalJSON(data []byte) error
type Slip ¶
type Slip struct { ID JsonNullInt64 `json:"id"` CustomerID JsonNullInt64 `json:"customer_id"` EstimateID JsonNullInt64 `json:"estimate_id"` InvoiceID JsonNullInt64 `json:"invoice_id"` InvoiceProjectID JsonNullInt64 `json:"invoice_project_id"` Name *string `json:"name"` Rate *float64 `json:"rate"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
+--------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------------+--------------+------+-----+---------+----------------+ | id | int | NO | PRI | NULL | auto_increment | | customer_id | int | NO | MUL | NULL | | | estimate_id | int | YES | MUL | NULL | | | invoice_id | int | YES | MUL | NULL | | | invoice_project_id | int | YES | MUL | NULL | | | name | varchar(255) | NO | MUL | NULL | | | rate | decimal(8,2) | NO | | NULL | | | timed | tinyint(1) | YES | | 0 | | | duration | int | YES | | NULL | | | created_at | datetime | NO | | NULL | | | updated_at | datetime | NO | | NULL | | +--------------------+--------------+------+-----+---------+----------------+
type User ¶
type User struct { ID int `json:"id"` Title *string `json:"title"` Name *string `json:"name"` Surname *string `json:"surname"` Address *string `json:"address"` ZipCode *string `json:"zip_code"` Town *string `json:"town"` Province *string `json:"province"` Country *string `json:"country"` TaxCode *string `json:"tax_code"` Vat *string `json:"vat"` Phone *string `json:"phone"` Email *string `json:"email"` }
+------------------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------------+--------------+------+-----+---------+----------------+ | id | int | NO | PRI | NULL | auto_increment | | title | varchar(255) | YES | | NULL | | | name | varchar(255) | NO | | NULL | | | surname | varchar(255) | NO | | NULL | | | address | varchar(255) | NO | | NULL | | | zip_code | varchar(255) | NO | | NULL | | | town | varchar(255) | NO | | NULL | | | province | varchar(255) | NO | | NULL | | | country | varchar(255) | YES | | NULL | | | tax_code | varchar(255) | NO | | NULL | | | vat | varchar(255) | NO | | NULL | | | phone | varchar(255) | NO | | NULL | | | created_at | datetime | NO | | NULL | | | updated_at | datetime | NO | | NULL | | | email | varchar(255) | NO | UNI | | | | encrypted_password | varchar(128) | NO | | | | | reset_password_token | varchar(255) | YES | UNI | NULL | | | reset_password_sent_at | datetime | YES | | NULL | | | remember_created_at | datetime | YES | | NULL | | | sign_in_count | int | YES | | 0 | | | current_sign_in_at | datetime | YES | | NULL | | | last_sign_in_at | datetime | YES | | NULL | | | current_sign_in_ip | varchar(255) | YES | | NULL | | | last_sign_in_ip | varchar(255) | YES | | NULL | | | bank_coordinates | text | YES | | NULL | | | language | varchar(255) | YES | | it | | | logo_file_name | varchar(255) | YES | | NULL | | | logo_content_type | varchar(255) | YES | | NULL | | | logo_file_size | int | YES | | NULL | | | logo_updated_at | datetime | YES | | NULL | | +------------------------+--------------+------+-----+---------+----------------+