Files
FamilyHUB/backend/src/domain/receipt.go
T

85 lines
2.6 KiB
Go

package domain
import "time"
type Position struct {
ID int64 `json:"id"`
ReceiptID int64 `json:"receipt_id"`
SectionNumber string `json:"section_number"`
GTINCode string `json:"gtin_code"`
Tag string `json:"tag"`
MarkingCode string `json:"marking_code"`
UKZCode string `json:"ukz_code"`
ProductName string `json:"product_name"`
ProductCountRaw string `json:"product_count"`
ProductCount float64 `json:"-"`
AmountRaw string `json:"amount"`
Amount float64 `json:"-"`
DiscountRaw string `json:"discount"`
Discount float64 `json:"-"`
SurchargeRaw string `json:"surcharge"`
Surcharge float64 `json:"-"`
}
type Receipt struct {
ID int `json:"id"`
TransactionID *int64 `json:"transaction_id"`
Status int `json:"STATUS"`
AnotherAmount float64 `json:"another_amount"`
CashAmount float64 `json:"cash_amount"`
CashboxNumber int64 `json:"cashbox_number"`
Cashier string `json:"cashier"`
ClearingAmount float64 `json:"clearing_amount"`
Currency string `json:"currency"`
DocNum string `json:"doc_num"`
HouseTo string `json:"house_to"`
KodSoato string `json:"kod_soato"`
Margin float64 `json:"margin"`
NameNP string `json:"name_np"`
NameSPD string `json:"name_spd"`
NameTO string `json:"name_to"`
OblastSoato *string `json:"oblast_soato"`
RayonSoato *string `json:"rayon_soato"`
SelsovetSoato *string `json:"selsovet_soato"`
PaymentAmount float64 `json:"payment_amount"`
PaymentType int `json:"payment_type"`
ReceiptNumber string `json:"receipt_number"`
SknoNumber string `json:"skno_number"`
StreetTo string `json:"street_to"`
Success string `json:"success"`
TotalAmount float64 `json:"total_amount"`
TypeNP string `json:"type_np"`
UI string `json:"ui"`
UNP string `json:"unp"`
IssuedAtRaw string `json:"issued_at"`
IssuedAt time.Time `json:"-"`
PositionsRaw string `json:"positions"`
Positions []Position `json:"-"`
}
type AddReceiptRequest struct {
Number string `json:"number" binding:"required,min=24,max=24"`
Date string `json:"date" binding:"required"`
FamilyID *int64 `json:"family_id"`
CreatedBy *int64 `json:"created_by"`
Type *string `json:"type"`
Category *string `json:"category"`
Description *string `json:"description"`
}
type AddReceiptResponse struct {
ID int32 `json:"id"`
Number string `json:"number"`
Date time.Time `json:"date"`
TransactionID *int64 `json:"transaction_id,omitempty"`
}