Documentation ¶
Index ¶
- func DestroyBranch(db *sqlx.DB, id int) (int64, error)
- func DestroyCategory(db *sqlx.DB, id int) (int64, error)
- func DestroyCustomer(db *sqlx.DB, id int) (int64, error)
- func DestroyInventory(db *sqlx.DB, id int) (int64, error)
- func DestroyItem(db *sqlx.DB, id int) (int64, error)
- func DestroyModifier(db *sqlx.DB, id int) (int64, error)
- func DestroySale(db *sqlx.DB, id int) (int64, error)
- func DestroySaleItem(db *sqlx.DB, id int) (int64, error)
- func DestroySupplier(db *sqlx.DB, id int) (int64, error)
- func DestroyTransfer(db *sqlx.DB, id int) (int64, error)
- func DestroyUser(db *sqlx.DB, id int) (int64, error)
- func StoreBranch(db *sqlx.DB, branch *Branch) (int64, error)
- func StoreCategory(db *sqlx.DB, category *Category) (int64, error)
- func StoreCustomer(db *sqlx.DB, customer *Customer) (int, error)
- func StoreInventories(db *sqlx.DB, binv *BatchInventory) (int64, error)
- func StoreInventory(db *sqlx.DB, inventory *Inventory) (int64, error)
- func StoreItem(db *sqlx.DB, item *Item) (int64, error)
- func StoreModifier(db *sqlx.DB, modifier *Modifier) (int64, error)
- func StoreSale(db *sqlx.DB, sale *Sale) (int, error)
- func StoreSaleItem(db *sqlx.DB, saleItem *SaleItem) (int64, error)
- func StoreSupplier(db *sqlx.DB, supplier *Supplier) (int64, error)
- func StoreTransfer(db *sqlx.DB, branchID int) (int64, error)
- func StoreUser(db *sqlx.DB, user *User) (int64, error)
- func UpdateSaleStatus(db *sqlx.DB, saleID int, status string) (int, error)
- type BatchInventory
- type BatchItem
- type Branch
- type Category
- type Customer
- type Inventory
- type InventoryDTO
- type Item
- type ItemDTO
- type Modifier
- type Sale
- type SaleItem
- type SaleWithItems
- type Supplier
- type Transfer
- type User
- type UserDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DestroyBranch ¶
DestroyBranch delete branch by id
func DestroyCategory ¶
DestroyCategory delete category by id
func DestroyCustomer ¶
DestroyCustomer delete customer by id
func DestroyInventory ¶
DestroyInventory delete inventory by id
func DestroyItem ¶
DestroyItem delete item by id
func DestroyModifier ¶
DestroyModifier delete modifier by id
func DestroySale ¶
DestroySale delete sale by id
func DestroySaleItem ¶
DestroySaleItem delete SaleItem by id
func DestroySupplier ¶
DestroySupplier delete supplier by id
func DestroyTransfer ¶
DestroyTransfer delete transfer by id
func DestroyUser ¶
DestroyUser delete user by id
func StoreBranch ¶
StoreBranch create new branch
func StoreCategory ¶
StoreCategory create new category
func StoreCustomer ¶
StoreCustomer create new customer
func StoreInventories ¶
func StoreInventories(db *sqlx.DB, binv *BatchInventory) (int64, error)
StoreInventories create new item
func StoreInventory ¶
StoreInventory create new inventory
func StoreModifier ¶
StoreModifier create new modifier
func StoreSaleItem ¶
StoreSaleItem create new SaleItem
func StoreSupplier ¶
StoreSupplier create new supplier
func StoreTransfer ¶
StoreTransfer create new transfer
Types ¶
type BatchInventory ¶
type Category ¶
type Category struct { ID int `json:"id" db:"id"` Code string `json:"code" db:"code"` CategoryDescription string `json:"category_description" db:"category_description"` }
func GetCategories ¶
GetCategories get all categories
type Customer ¶
type Customer struct { ID int `json:"id" db:"id"` CustomerName string `json:"customer_name" db:"customer_name"` CustomerNumber string `json:"customer_number" db:"customer_number"` CustomerEmail string `json:"customer_email" db:"customer_email"` CustomerAddress string `json:"customer_address" db:"customer_address"` }
func GetCustomer ¶
GetCustomer get one customer
type Inventory ¶
type Inventory struct { ID int `json:"id" db:"id"` InventoryType string `json:"inventory_type" db:"inventory_type"` QtyIN int64 `json:"qty_in" db:"qty_in"` QtyOUT int `json:"qty_out" db:"qty_out"` UnitCost float64 `json:"unit_cost" db:"unit_cost"` SRP float64 `json:"srp" db:"srp"` ItemID int64 `json:"item_id" db:"item_id"` BranchID int64 `json:"branch_id" db:"branch_id"` TransferID int64 `json:"transfer_id" db:"transfer_id"` }
type InventoryDTO ¶
func GetInventories ¶
func GetInventories(db *sqlx.DB) ([]InventoryDTO, error)
GetInventories get all inventories
type Item ¶
type Item struct { ID int `json:"id" db:"id"` Item string `json:"item" db:"item"` Description string `json:"description" db:"description"` CategoryDescription string `json:"category_description" db:"category_description"` Brand string `json:"brand" db:"brand"` Barcode string `json:"barcode" db:"barcode"` CategoryID int `json:"category_id" db:"category_id"` UOM string `json:"uom" db:"uom"` DefaultUnitCost string `json:"default_unit_cost" db:"default_unit_cost"` DefaultSRP string `json:"default_srp" db:"default_srp"` MarkupPercent float64 `json:"markup_percent" db:"markup_percent"` MarkupAmount float64 `json:"markup_amount" db:"markup_amount"` StockNotifyLimit int `json:"stock_notify_limit" db:"stock_notify_limit"` StockLimit int `json:"stock_limit" db:"stock_limit"` }
type Modifier ¶
type Modifier struct { ID int `json:"id"` ModifierTitle string `json:"modifier_title" db:"modifier_title"` ModifierItems string `json:"modifier_items" db:"modifier_items"` }
func GetModifier ¶
GetModifier get one modifier
type Sale ¶
type Sale struct { ID int `json:"id"` SaleDateTime string `json:"sale_datetime" db:"sale_datetime"` SaleDispenseLocation string `json:"sale_dispense_location" db:"sale_dispense_location"` SaleDispenseDateTime string `json:"sale_dispense_datetime" db:"sale_dispense_datetime"` SaleNo string `json:"sale_no" db:"sale_no"` SaleDetails string `json:"sale_details" db:"sale_details"` SaleStatus string `json:"sale_status" db:"sale_status"` CustomerID string `json:"customer_id" db:"customer_id"` }
type SaleItem ¶
type SaleItem struct { ID int `json:"id"` SRP float32 `json:"srp" db:"srp"` Qty int `json:"qty" db:"qty"` Status string `json:"status" db:"status"` Item string `json:"item" db:"item"` ItemID string `json:"item_id" db:"item_id"` SaleID string `json:"sale_id" db:"sale_id"` }
SaleItem - function SaleItem
func GetSaleItem ¶
GetSaleItem get one SaleItem
func GetSaleItems ¶
GetSaleItems get all SaleItems
type SaleWithItems ¶
type SaleWithItems struct { ID int `json:"id"` SaleDateTime string `json:"sale_datetime" db:"sale_datetime"` SaleDispenseLocation string `json:"sale_dispense_location" db:"sale_dispense_location"` SaleDispenseDateTime string `json:"sale_dispense_datetime" db:"sale_dispense_datetime"` SaleNo string `json:"sale_no" db:"sale_no"` SaleDetails string `json:"sale_details" db:"sale_details"` SaleStatus string `json:"sale_status" db:"sale_status"` Customer Customer SaleItems []SaleItem }
type Supplier ¶
type Supplier struct { ID int `json:"id" db:"id"` SupplierCode string `json:"supplier_code" db:"supplier_code"` SupplierDesc string `json:"supplier_description" db:"supplier_description"` SupplierPerson string `json:"supplier_contact_person" db:"supplier_contact_person"` SupplierContact string `json:"supplier_contact" db:"supplier_contact"` SupplierEmail string `json:"supplier_email" db:"supplier_email"` }
Supplier struct Supplier
func GetSupplier ¶
GetSupplier get one supplier
type Transfer ¶
type Transfer struct { ID int `json:"id"` TransferSTN string `json:"transfer_stn"` TransferDatetime string `json:"transfer_datetime"` BranchID int `json:"branch_id"` }
func GetTransfer ¶
GetTransfer get one transfer
type User ¶
type User struct { ID int `json:"id" db:"id"` Email string `json:"email" db:"email"` Username string `json:"username" db:"username"` Name string `json:"name" db:"name"` Password string `json:"password" db:"password"` Role string `json:"role" db:"role"` BranchID int `json:"branch_id" db:"branch_id"` }
func GetUsersByBranch ¶
GetUsersByBranch get all users by branch
type UserDTO ¶
type UserDTO struct { ID int `json:"id" db:"id"` Email string `json:"email" db:"email"` Username string `json:"username" db:"username"` Name string `json:"name" db:"name"` Role string `json:"role" db:"role"` BranchCode string `json:"branch_code" db:"branch_code"` BranchName string `json:"branch_name" db:"branch_name"` BranchID int `json:"branch_id" db:"branch_id"` }