73 lines
2.6 KiB
Go

package vo
import (
"electricity_bill_calc/types"
"github.com/shopspring/decimal"
)
type ReportCreationForm struct {
Park string `json:"parkId"`
PeriodBegin types.Date `json:"periodBegin"`
PeriodEnd types.Date `json:"periodEnd"`
Overall decimal.Decimal `json:"overall"`
OverallFee decimal.Decimal `json:"overallFee"`
Critical decimal.Decimal `json:"critical"`
CriticalFee decimal.Decimal `json:"criticalFee"`
Peak decimal.Decimal `json:"peak"`
PeakFee decimal.Decimal `json:"peakFee"`
Flat decimal.Decimal `json:"flat,omitempty"`
FlatFee decimal.Decimal `json:"flatFee,omitempty"`
Valley decimal.Decimal `json:"valley"`
ValleyFee decimal.Decimal `json:"valleyFee"`
BasicFee decimal.Decimal `json:"basicFee"`
AdjustFee decimal.Decimal `json:"adjustFee"`
}
type ReportModifyForm struct {
PeriodBegin types.Date `json:"periodBegin"`
PeriodEnd types.Date `json:"periodEnd"`
Overall decimal.Decimal `json:"overall"`
OverallFee decimal.Decimal `json:"overallFee"`
Critical decimal.Decimal `json:"critical"`
CriticalFee decimal.Decimal `json:"criticalFee"`
Peak decimal.Decimal `json:"peak"`
PeakFee decimal.Decimal `json:"peakFee"`
Flat decimal.Decimal `json:"flat,omitempty"`
FlatFee decimal.Decimal `json:"flatFee,omitempty"`
Valley decimal.Decimal `json:"valley"`
ValleyFee decimal.Decimal `json:"valleyFee"`
BasicFee decimal.Decimal `json:"basicFee"`
AdjustFee decimal.Decimal `json:"adjustFee"`
}
type SimplifiedReportIndex struct {
Id string `json:"id"`
Park string `json:"parkId"`
PeriodBegin types.Date `json:"periodBegin"`
PeriodEnd types.Date `json:"periodEnd"`
Published bool `json:"published"`
PublishedAt *types.DateTime `json:"publishedAt"`
Withdraw int16 `json:"withdraw"`
LastWithdrawAppliedAt *types.DateTime `json:"lastWithdrawAppliedAt"`
LastWithdrawAuditAt *types.DateTime `json:"lastWithdrawAuditAt"`
Status int16 `json:"status"`
Message *string `json:"message"`
}
func (sri *SimplifiedReportIndex) Period(p types.DateRange) {
sri.PeriodBegin = p.SafeLower()
sri.PeriodEnd = p.SafeUpper()
}
type ReportIndexQueryResponse struct {
Park SimplifiedParkDetail `json:"park"`
Report *SimplifiedReportIndex `json:"report"`
}
type ComprehensiveReportQueryResponse struct {
Report SimplifiedReportIndex `json:"report"`
Park SimplifiedParkDetail `json:"park"`
User SimplifiedUserDetail `json:"user"`
}