naise_pos/db/sqlc/models.go

214 lines
6.9 KiB
Go
Raw Permalink Normal View History

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-19 18:17:17 +07:00
"database/sql/driver"
2023-03-07 18:52:37 +07:00
"encoding/json"
2023-03-19 18:17:17 +07:00
"fmt"
2023-03-16 12:21:41 +07:00
"time"
2023-03-05 23:35:41 +07:00
"github.com/google/uuid"
"github.com/tabbed/pqtype"
)
2023-03-19 18:17:17 +07:00
type StockLogsType string
const (
StockLogsTypeIn StockLogsType = "in"
StockLogsTypeOut StockLogsType = "out"
)
func (e *StockLogsType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = StockLogsType(s)
case string:
*e = StockLogsType(s)
default:
return fmt.Errorf("unsupported scan type for StockLogsType: %T", src)
}
return nil
}
type NullStockLogsType struct {
StockLogsType StockLogsType
Valid bool // Valid is true if StockLogsType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullStockLogsType) Scan(value interface{}) error {
if value == nil {
ns.StockLogsType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.StockLogsType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullStockLogsType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.StockLogsType), nil
}
2023-03-05 23:35:41 +07:00
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 {
2023-04-05 14:04:49 +07:00
ID uuid.UUID `json:"id"`
MerchantID uuid.UUID `json:"merchant_id"`
ProductTypeID int16 `json:"product_type_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"`
ProductCategoryID uuid.UUID `json:"product_category_id"`
Image sql.NullString `json:"image"`
2023-03-16 16:55:45 +07:00
}
type ProductCategory struct {
ID uuid.UUID `json:"id"`
MerchantID uuid.UUID `json:"merchant_id"`
IndexID int64 `json:"index_id"`
Name string `json:"name"`
2023-03-05 23:35:41 +07:00
}
2023-03-22 13:40:18 +07:00
type ProductType struct {
ID int16 `json:"id"`
Name string `json:"name"`
}
2023-03-05 23:35:41 +07:00
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"`
CreatedBy uuid.UUID `json:"created_by"`
2023-03-05 23:35:41 +07:00
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"`
2023-03-22 12:06:09 +07:00
Code string `json:"code"`
CreatedBy uuid.UUID `json:"created_by"`
2023-03-05 23:35:41 +07:00
MerchantID uuid.UUID `json:"merchant_id"`
CustomerID uuid.NullUUID `json:"customer_id"`
2023-03-22 12:06:09 +07:00
IsPaid bool `json:"is_paid"`
2023-03-05 23:35:41 +07:00
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"`
2023-03-22 12:06:09 +07:00
IsKeep bool `json:"is_keep"`
Change float64 `json:"change"`
2023-03-05 23:35:41 +07:00
}
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"`
}
2023-03-19 18:17:17 +07:00
type StockLog struct {
ID uuid.UUID `json:"id"`
IndexID int64 `json:"index_id"`
MerchantID uuid.UUID `json:"merchant_id"`
ProductID uuid.UUID `json:"product_id"`
CreatedBy uuid.UUID `json:"created_by"`
TransactionID uuid.NullUUID `json:"transaction_id"`
TransactionActionType string `json:"transaction_action_type"`
TransactionDescription string `json:"transaction_description"`
Type StockLogsType `json:"type"`
SellingPrice float64 `json:"selling_price"`
PurchasePrice float64 `json:"purchase_price"`
Quantity float64 `json:"quantity"`
CreatedAt sql.NullTime `json:"created_at"`
UpdatedAt sql.NullTime `json:"updated_at"`
}
2023-03-05 23:35:41 +07:00
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 {
2023-03-13 09:24:59 +07:00
ID uuid.UUID `json:"id"`
IndexID int64 `json:"index_id"`
Email string `json:"email"`
Password string `json:"password"`
Fullname string `json:"fullname"`
CreatedAt sql.NullTime `json:"created_at"`
UpdatedAt sql.NullTime `json:"updated_at"`
2023-03-05 23:35:41 +07:00
}
2023-03-16 12:21:41 +07:00
type UserSession struct {
ID uuid.UUID `json:"id"`
IndexID int64 `json:"index_id"`
Email string `json:"email"`
RefreshToken string `json:"refresh_token"`
UserAgent string `json:"user_agent"`
ClientIp string `json:"client_ip"`
IsBlocked bool `json:"is_blocked"`
ExpiresAt time.Time `json:"expires_at"`
CreatedAt sql.NullTime `json:"created_at"`
}