add customers
This commit is contained in:
@ -40,6 +40,7 @@ type Order struct {
|
||||
ID int `json:"id"`
|
||||
WidgetID int `json:"widget_id"`
|
||||
TransactionID int `json:"transaction_id"`
|
||||
CustomerID int `json:"customer_id"`
|
||||
StatusID int `json:"status_id"`
|
||||
Quantity int `json:"quantity"`
|
||||
Amount int `json:"amount"`
|
||||
@ -86,6 +87,16 @@ type User struct {
|
||||
UpdatedAt time.Time `json:"-"`
|
||||
}
|
||||
|
||||
// Customer is the type for customers
|
||||
type Customer struct {
|
||||
ID int `json:"id"`
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
Email string `json:"email"`
|
||||
CreatedAt time.Time `json:"-"`
|
||||
UpdatedAt time.Time `json:"-"`
|
||||
}
|
||||
|
||||
func (m *DBModel) GetWidget(id int) (Widget, error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
|
||||
defer cancel()
|
||||
|
Reference in New Issue
Block a user