Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveEbarimt ¶
func SaveEbarimt(db *gorm.DB, res *structs.ReceiptResponse)
func SendMail ¶
func SendMail(input EmailInput) error
Types ¶
type Base ¶
type Base struct {
ID int64 `gorm:"primary_key;autoIncrement:true" json:"id"`
CreatedAt time.Time `gorm:"autoCreateTime;index" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
}
* NOTE * : Database Models -
type Ebarimt ¶
type Ebarimt struct {
Base
TotalAmount float64 `gorm:"total_amount" json:"total_amount"`
TotalVat float64 `gorm:"total_vat" json:"total_vat"`
TotalCityTax float64 `gorm:"total_city_tax" json:"total_city_tax"`
BranchNo string `gorm:"branch_no" json:"branch_no"`
DistrictCode string `gorm:"district_code" json:"district_code"`
MerchantTin string `gorm:"merchant_tin" json:"merchant_tin"`
PosNo string `gorm:"pos_no" json:"pos_no"`
CustomerTin string `gorm:"customer_tin" json:"customer_tin"`
ConsumerNo string `gorm:"consumer_no" json:"consumer_no"`
Type string `gorm:"type:varchar(20);column:receipt_type" json:"type"`
BillID string `gorm:"bill_id" json:"bill_id"`
InvoiceID string `gorm:"invoice_id" json:"invoice_id"`
PosID float64 `gorm:"pos_id" json:"pos_id"`
Message string `gorm:"message" json:"message"`
Date string `gorm:"date" json:"date"`
IsRefund bool `gorm:"is_refund" json:"is_refund"`
Receipts []EbarimtReceipt `gorm:"foreignKey:EbarimtID" json:"receipts"`
}
* NOTE * : Database Models -
type EbarimtReceipt ¶
type EbarimtReceipt struct {
Base
EbarimtID int64 `gorm:"ebarimt_id" json:"ebarimt_id"`
BillID string `gorm:"bill_id" json:"bill_id"`
TotalAmount float64 `gorm:"total_amount" json:"total_amount"`
TotalVat float64 `gorm:"total_vat" json:"total_vat"`
TotalCityTax float64 `gorm:"total_city_tax" json:"total_city_tax"`
TaxType string `gorm:"tax_type" json:"tax_type"`
MerchantTin string `gorm:"merchant_tin" json:"merchant_tin"`
BankAccountNo string `gorm:"bank_account_no" json:"bank_account_no"`
Items []EbarimtReceiptItem `gorm:"foreignKey:ReceiptID" json:"items"`
IsRefund bool `gorm:"is_refund" json:"is_refund"`
}
* NOTE * : Database Models -
type EbarimtReceiptItem ¶
type EbarimtReceiptItem struct {
Base
Name string `gorm:"name" json:"name"`
BarCode string `gorm:"bar_code" json:"bar_code"`
BarCodeType string `gorm:"bar_code_type" json:"bar_code_type"`
ClassificationCode string `gorm:"classification_code" json:"classification_code"`
MeasureUnit string `gorm:"measure_unit" json:"measure_unit"`
TaxProductCode string `gorm:"tax_product_code" json:"tax_product_code"`
Qty float64 `gorm:"qty" json:"qty"`
UnitPrice float64 `gorm:"unit_price" json:"unit_price"`
TotalAmount float64 `gorm:"total_amount" json:"total_amount"`
TotalVat float64 `gorm:"total_vat" json:"total_vat"`
TotalCityTax float64 `gorm:"total_city_tax" json:"total_city_tax"`
TotalBonus float64 `gorm:"total_bonus" json:"total_bonus"`
ReceiptID int64 `gorm:"receipt_id" json:"receipt_id"`
Receipt *EbarimtReceipt `gorm:"foreignKey:ReceiptID" json:"receipt"`
}
* NOTE * : Database Models -
type EmailInput ¶
type EmailInput struct {
Email string `json:"email"`
Subject string `json:"subject"`
From string `json:"from"`
User string `json:"user"`
Password string `json:"password"`
SmtpHost string `json:"smtp_host"`
SmtpPort string `json:"smtp_port"`
TemplatePath string `json:"template_path"`
Response models.ReceiptResponse `json:"response"`
}
type SendEmailBody ¶
type SendEmailBody struct {
Date string `json:"date"`
TotalAmount string `json:"total_amount"`
TotalVat string `json:"total_vat"`
BillType string `json:"bill_type"`
BillID string `json:"bill_id"`
Lottery string `json:"lottery"`
Type string `json:"type"`
TotalCityTax string `json:"total_city_tax"`
Image string `json:"image"`
OrgName string `json:"org_name"`
OrgTin string `json:"org_tin"`
BranchNo string `json:"branch_no"`
Items []struct {
Name string `json:"name"`
Qty string `json:"qty"`
TotalAmount string `json:"total_amount"`
TotalVat string `json:"total_vat"`
TotalCityTax string `json:"total_city_tax"`
} `json:"items"`
}
type StorageService ¶
type StorageService struct {
// contains filtered or unexported fields
}
func NewStorageService ¶
func NewStorageService(endpoint, accessKey, secretKey string) *StorageService
func (*StorageService) AttachImage ¶
func (s *StorageService) AttachImage(res *structs.ReceiptResponse) (string, error)
Click to show internal directories.
Click to hide internal directories.