2023-03-05 23:35:41 +07:00
|
|
|
// Code generated by sqlc. DO NOT EDIT.
|
|
|
|
// versions:
|
|
|
|
// sqlc v1.17.2
|
|
|
|
|
|
|
|
package db
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
2023-03-07 18:52:37 +07:00
|
|
|
"encoding/json"
|
2023-03-05 23:35:41 +07:00
|
|
|
|
|
|
|
"github.com/google/uuid"
|
|
|
|
"github.com/tabbed/pqtype"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Customer struct {
|
2023-03-07 18:52:37 +07:00
|
|
|
ID uuid.UUID `json:"id"`
|
|
|
|
IndexID int64 `json:"index_id"`
|
|
|
|
MerchantID uuid.UUID `json:"merchant_id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Detail []json.RawMessage `json:"detail"`
|
|
|
|
CreatedAt sql.NullTime `json:"created_at"`
|
|
|
|
UpdatedAt sql.NullTime `json:"updated_at"`
|
2023-03-05 23:35:41 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
type Merchant struct {
|
|
|
|
ID uuid.UUID `json:"id"`
|
|
|
|
IndexID int64 `json:"index_id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
OwnerID uuid.UUID `json:"owner_id"`
|
|
|
|
CreatedAt sql.NullTime `json:"created_at"`
|
|
|
|
UpdatedAt sql.NullTime `json:"updated_at"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Product struct {
|
|
|
|
ID uuid.UUID `json:"id"`
|
|
|
|
MerchantID uuid.UUID `json:"merchant_id"`
|
|
|
|
IndexID int64 `json:"index_id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
SellingPrice float64 `json:"selling_price"`
|
|
|
|
PurchasePrice float64 `json:"purchase_price"`
|
|
|
|
Stock float64 `json:"stock"`
|
|
|
|
CreatedAt sql.NullTime `json:"created_at"`
|
|
|
|
UpdatedAt sql.NullTime `json:"updated_at"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type PurchaseOrder struct {
|
|
|
|
ID uuid.UUID `json:"id"`
|
|
|
|
SupplierID uuid.UUID `json:"supplier_id"`
|
|
|
|
MerchantID uuid.UUID `json:"merchant_id"`
|
|
|
|
IndexID int64 `json:"index_id"`
|
|
|
|
Code sql.NullString `json:"code"`
|
|
|
|
IsPaid bool `json:"is_paid"`
|
|
|
|
Total float64 `json:"total"`
|
|
|
|
PaidNominal float64 `json:"paid_nominal"`
|
|
|
|
Note sql.NullString `json:"note"`
|
|
|
|
CreatedAt sql.NullTime `json:"created_at"`
|
|
|
|
UpdatedAt sql.NullTime `json:"updated_at"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type PurchaseOrderDetail struct {
|
|
|
|
ID uuid.UUID `json:"id"`
|
|
|
|
IndexID int64 `json:"index_id"`
|
|
|
|
Code sql.NullString `json:"code"`
|
|
|
|
MerchantID uuid.UUID `json:"merchant_id"`
|
|
|
|
PurchaseOrderID uuid.UUID `json:"purchase_order_id"`
|
|
|
|
ProductID uuid.UUID `json:"product_id"`
|
|
|
|
Quantity float64 `json:"quantity"`
|
|
|
|
SubTotal float64 `json:"sub_total"`
|
|
|
|
ProductPrice float64 `json:"product_price"`
|
|
|
|
CreatedAt sql.NullTime `json:"created_at"`
|
|
|
|
UpdatedAt sql.NullTime `json:"updated_at"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SaleOrder struct {
|
|
|
|
ID uuid.UUID `json:"id"`
|
|
|
|
IndexID int64 `json:"index_id"`
|
|
|
|
Code sql.NullString `json:"code"`
|
|
|
|
MerchantID uuid.UUID `json:"merchant_id"`
|
|
|
|
CustomerID uuid.NullUUID `json:"customer_id"`
|
|
|
|
IsPaid sql.NullBool `json:"is_paid"`
|
|
|
|
Total float64 `json:"total"`
|
|
|
|
PaidNominal float64 `json:"paid_nominal"`
|
|
|
|
Note sql.NullString `json:"note"`
|
|
|
|
CreatedAt sql.NullTime `json:"created_at"`
|
|
|
|
UpdatedAt sql.NullTime `json:"updated_at"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SaleOrderDetail struct {
|
|
|
|
ID uuid.UUID `json:"id"`
|
|
|
|
IndexID int64 `json:"index_id"`
|
|
|
|
SaleOrderID uuid.UUID `json:"sale_order_id"`
|
|
|
|
ProductID uuid.UUID `json:"product_id"`
|
|
|
|
ProductName string `json:"product_name"`
|
|
|
|
Quantity float64 `json:"quantity"`
|
|
|
|
SubTotal float64 `json:"sub_total"`
|
|
|
|
ProductPrice float64 `json:"product_price"`
|
|
|
|
Profit float64 `json:"profit"`
|
|
|
|
CreatedAt sql.NullTime `json:"created_at"`
|
|
|
|
UpdatedAt sql.NullTime `json:"updated_at"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Supplier struct {
|
|
|
|
ID uuid.UUID `json:"id"`
|
|
|
|
IndexID int64 `json:"index_id"`
|
|
|
|
MerchantID uuid.UUID `json:"merchant_id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Detail pqtype.NullRawMessage `json:"detail"`
|
|
|
|
CreatedAt sql.NullTime `json:"created_at"`
|
|
|
|
UpdatedAt sql.NullTime `json:"updated_at"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type User struct {
|
|
|
|
ID uuid.UUID `json:"id"`
|
|
|
|
IndexID int64 `json:"index_id"`
|
|
|
|
Email string `json:"email"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
Fullname sql.NullString `json:"fullname"`
|
|
|
|
CreatedAt sql.NullTime `json:"created_at"`
|
|
|
|
UpdatedAt sql.NullTime `json:"updated_at"`
|
|
|
|
}
|