complete structure revamp
This commit is contained in:
124
api/responses.go
Normal file
124
api/responses.go
Normal file
@@ -0,0 +1,124 @@
|
||||
package api
|
||||
|
||||
type BaseResponse struct {
|
||||
Task int `json:"task"`
|
||||
Type int `json:"type"`
|
||||
Ver int `json:"ver"`
|
||||
Source string `json:"source"`
|
||||
Device string `json:"device"`
|
||||
Tag string `json:"tag"`
|
||||
Dt string `json:"dt"`
|
||||
Res int `json:"res"`
|
||||
ResAction int `json:"res_action"`
|
||||
Errortxt string `json:"errortxt"`
|
||||
Warnings []string `json:"warnings"`
|
||||
ErrorExtra interface{} `json:"error_extra"`
|
||||
}
|
||||
|
||||
type SellResponse struct {
|
||||
BaseResponse
|
||||
Info SellInfo `json:"info"`
|
||||
}
|
||||
|
||||
type SellInfo struct {
|
||||
Task int `json:"task"`
|
||||
Fisid string `json:"fisid"`
|
||||
Dataid int `json:"dataid"`
|
||||
Doccode string `json:"doccode"`
|
||||
Dt string `json:"dt"`
|
||||
Cashier string `json:"cashier"`
|
||||
Dtype int `json:"dtype"`
|
||||
Isprint int `json:"isprint"`
|
||||
Isoffline bool `json:"isoffline"`
|
||||
Safe float64 `json:"safe"`
|
||||
ShiftLink int `json:"shift_link"`
|
||||
Docno int `json:"docno"`
|
||||
Cancelid string `json:"cancelid,omitempty"`
|
||||
}
|
||||
|
||||
type ZReportResponse struct {
|
||||
BaseResponse
|
||||
Info ZReportInfo `json:"info"`
|
||||
}
|
||||
|
||||
type ZReportInfo struct {
|
||||
Task int `json:"task"`
|
||||
Fisid string `json:"fisid"`
|
||||
Dataid int `json:"dataid"`
|
||||
Doccode string `json:"doccode"`
|
||||
Dt string `json:"dt"`
|
||||
Cashier string `json:"cashier"`
|
||||
Dtype int `json:"dtype"`
|
||||
Isprint int `json:"isprint"`
|
||||
Isoffline bool `json:"isoffline"`
|
||||
Safe float64 `json:"safe"`
|
||||
ShiftLink int `json:"shift_link"`
|
||||
Docno int `json:"docno"`
|
||||
Receipt ZReportReceipt `json:"receipt"`
|
||||
Summary ZReportSummary `json:"summary"`
|
||||
Taxes []ZReportTax `json:"taxes"`
|
||||
Pays []ZReportPay `json:"pays"`
|
||||
Money []ZReportMoney `json:"money"`
|
||||
Cash []ZReportMoney `json:"cash"`
|
||||
MoneyTransfer []interface{} `json:"money_transfer"`
|
||||
}
|
||||
|
||||
type ZReportReceipt struct {
|
||||
CountP int `json:"count_p"`
|
||||
CountM int `json:"count_m"`
|
||||
Count14 int `json:"count_14"`
|
||||
CountTransfer int `json:"count_transfer"`
|
||||
LastDocnoP int `json:"last_docno_p"`
|
||||
LastDocnoM int `json:"last_docno_m"`
|
||||
}
|
||||
|
||||
type ZReportSummary struct {
|
||||
BaseP float64 `json:"base_p"`
|
||||
BaseM float64 `json:"base_m"`
|
||||
TaxexP float64 `json:"taxex_p"`
|
||||
TaxexM float64 `json:"taxex_m"`
|
||||
DiscP float64 `json:"disc_p"`
|
||||
DiscM float64 `json:"disc_m"`
|
||||
}
|
||||
|
||||
type ZReportTax struct {
|
||||
GrCode int `json:"gr_code"`
|
||||
BaseSumP float64 `json:"base_sum_p"`
|
||||
BaseSumM float64 `json:"base_sum_m"`
|
||||
BaseTaxSumP float64 `json:"base_tax_sum_p"`
|
||||
BaseTaxSumM float64 `json:"base_tax_sum_m"`
|
||||
BaseExSumP float64 `json:"base_ex_sum_p"`
|
||||
BaseExSumM float64 `json:"base_ex_sum_m"`
|
||||
TaxName string `json:"tax_name"`
|
||||
TaxFname string `json:"tax_fname"`
|
||||
TaxLit string `json:"tax_lit"`
|
||||
TaxPercent float64 `json:"tax_percent"`
|
||||
TaxSumP float64 `json:"tax_sum_p"`
|
||||
TaxSumM float64 `json:"tax_sum_m"`
|
||||
ExName string `json:"ex_name"`
|
||||
ExPercent float64 `json:"ex_percent"`
|
||||
ExSumP float64 `json:"ex_sum_p"`
|
||||
ExSumM float64 `json:"ex_sum_m"`
|
||||
}
|
||||
|
||||
type ZReportPay struct {
|
||||
Type int `json:"type"`
|
||||
Name string `json:"name"`
|
||||
SumP float64 `json:"sum_p"`
|
||||
SumM float64 `json:"sum_m"`
|
||||
RoundPu float64 `json:"round_pu"`
|
||||
RoundPd float64 `json:"round_pd"`
|
||||
RoundMu float64 `json:"round_mu"`
|
||||
RoundMd float64 `json:"round_md"`
|
||||
}
|
||||
|
||||
type ZReportMoney struct {
|
||||
Type int `json:"type"`
|
||||
Name string `json:"name"`
|
||||
SumP float64 `json:"sum_p"`
|
||||
SumM float64 `json:"sum_m"`
|
||||
RoundPu float64 `json:"round_pu"`
|
||||
RoundPd float64 `json:"round_pd"`
|
||||
RoundMu float64 `json:"round_mu"`
|
||||
RoundMd float64 `json:"round_md"`
|
||||
}
|
||||
Reference in New Issue
Block a user