Documentation
¶
Index ¶
- Variables
- type Error
- type Invoice
- type InvoiceDetail
- type InvoiceDetails
- type InvoiceDetailsReport
- type InvoiceDetailsReports
- type InvoiceReport
- type Invoices
- type InvoicesReport
- type JWTCustomClaims
- type Login
- type MessageResponse
- type PayPalRequestData
- type PayPalRequestValidator
- type Product
- type ProductToPurchase
- type ProductToPurchases
- type Products
- type PurchaseOrder
- type PurchaseOrders
- type Response
- type Responses
- type User
- type Users
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidID = errors.New("the ID is not valid")
)
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct { Code string Err error Who string StatusHTTP int Data interface{} APIMessage string UserID string }
func (*Error) HasStatusHTTP ¶
type Invoice ¶
type Invoice struct { ID uuid.UUID `json:"id"` UserID uuid.UUID `json:"user_id"` PurchaseOrderID uuid.UUID `json:"purchase_order_id"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
Invoice model of table invoices
type InvoiceDetail ¶
type InvoiceDetail struct { ID uuid.UUID `json:"id"` InvoiceID uuid.UUID `json:"invoice_id"` ProductID uuid.UUID `json:"product_id"` Amount uint `json:"amount"` UnitPrice float64 `json:"unit_price"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
InvoiceDetail model of table invoice_details
func (InvoiceDetail) HasID ¶
func (i InvoiceDetail) HasID() bool
type InvoiceDetails ¶
type InvoiceDetails []InvoiceDetail
InvoiceDetails slice of InvoiceDetail
func (InvoiceDetails) IsEmpty ¶
func (i InvoiceDetails) IsEmpty() bool
type InvoiceDetailsReport ¶
type InvoiceDetailsReport struct { InvoiceDetail InvoiceDetail `json:"invoice_detail"` Product Product `json:"product"` }
type InvoiceDetailsReports ¶
type InvoiceDetailsReports []InvoiceDetailsReport
type InvoiceReport ¶
type InvoiceReport struct { Invoice Invoice `json:"invoice"` User User `json:"user"` InvoiceDetailsReport InvoiceDetailsReports `json:"invoice_details_report"` }
type InvoicesReport ¶
type InvoicesReport []InvoiceReport
type JWTCustomClaims ¶
type MessageResponse ¶
type PayPalRequestData ¶
type PayPalRequestValidator ¶
type PayPalRequestValidator struct { // Headers AuthAlgo string `json:"auth_algo"` CertURL string `json:"cert_url"` TransmissionID string `json:"transmission_id"` TransmissionSig string `json:"transmission_sig"` TransmissionTime string `json:"transmission_time"` // Body WebhookID string `json:"webhook_id"` WebhookEvent json.RawMessage `json:"webhook_event"` }
type Product ¶
type Product struct { ID uuid.UUID `json:"id"` ProductName string `json:"product_name"` Price float64 `json:"price"` Images json.RawMessage `json:"images"` Description string `json:"description"` Features json.RawMessage `json:"features"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
Product model of table prodcuts
type ProductToPurchase ¶
type ProductToPurchases ¶
type ProductToPurchases []ProductToPurchase
type PurchaseOrder ¶
type PurchaseOrder struct { ID uuid.UUID `json:"id"` UserID uuid.UUID `json:"user_id"` Products json.RawMessage `json:"products"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
PurchaseOrder model of table purchase_orders
func (PurchaseOrder) HasID ¶
func (p PurchaseOrder) HasID() bool
func (PurchaseOrder) TotalAmount ¶
func (p PurchaseOrder) TotalAmount() float64
func (PurchaseOrder) Validate ¶
func (p PurchaseOrder) Validate() error
type PurchaseOrders ¶
type PurchaseOrders []PurchaseOrder
PurchaseOrders slice of PurchaseOrder
func (PurchaseOrders) IsEmpty ¶
func (p PurchaseOrders) IsEmpty() bool
Click to show internal directories.
Click to hide internal directories.