93 lines
2.8 KiB
Go
93 lines
2.8 KiB
Go
package calculate
|
|
|
|
import (
|
|
"electricity_bill_calc/model"
|
|
"electricity_bill_calc/types"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type Reading struct {
|
|
ReadAt types.DateTime
|
|
Ratio decimal.Decimal
|
|
Overall decimal.Decimal
|
|
Critical decimal.Decimal
|
|
Peak decimal.Decimal
|
|
Flat decimal.Decimal
|
|
Valley decimal.Decimal
|
|
}
|
|
|
|
type Pooling struct {
|
|
Code string
|
|
Detail model.ConsumptionUnit
|
|
}
|
|
|
|
type Meter struct {
|
|
Code string
|
|
Detail model.MeterDetail
|
|
CoveredArea decimal.Decimal
|
|
LastTermReading *Reading
|
|
CurrentTermReading *Reading
|
|
Overall model.ConsumptionUnit
|
|
Critical model.ConsumptionUnit
|
|
Peak model.ConsumptionUnit
|
|
Flat model.ConsumptionUnit
|
|
Valley model.ConsumptionUnit
|
|
AdjustLoss model.ConsumptionUnit
|
|
PooledBasic model.ConsumptionUnit
|
|
PooledAdjust model.ConsumptionUnit
|
|
PooledLoss model.ConsumptionUnit
|
|
PooledPublic model.ConsumptionUnit
|
|
SharedPoolingProportion decimal.Decimal
|
|
Poolings []*Pooling
|
|
}
|
|
|
|
type TenementCharge struct {
|
|
Tenement string
|
|
Overall model.ConsumptionUnit
|
|
Critical model.ConsumptionUnit
|
|
Peak model.ConsumptionUnit
|
|
Flat model.ConsumptionUnit
|
|
Valley model.ConsumptionUnit
|
|
BasicFee decimal.Decimal
|
|
AdjustFee decimal.Decimal
|
|
LossPooled decimal.Decimal
|
|
PublicPooled decimal.Decimal
|
|
FinalCharges decimal.Decimal
|
|
Submeters []*Meter
|
|
Poolings []*Meter
|
|
}
|
|
|
|
type Summary struct {
|
|
ReportId string
|
|
OverallArea decimal.Decimal
|
|
Overall model.ConsumptionUnit
|
|
ConsumptionFee decimal.Decimal
|
|
Critical model.ConsumptionUnit
|
|
Peak model.ConsumptionUnit
|
|
Flat model.ConsumptionUnit
|
|
Valley model.ConsumptionUnit
|
|
Loss decimal.Decimal
|
|
LossFee decimal.Decimal
|
|
LossProportion decimal.Decimal
|
|
AuthoizeLoss model.ConsumptionUnit
|
|
BasicFee decimal.Decimal
|
|
BasicPooledPriceConsumption decimal.Decimal
|
|
BasicPooledPriceArea decimal.Decimal
|
|
AdjustFee decimal.Decimal
|
|
AdjustPooledPriceConsumption decimal.Decimal
|
|
AdjustPooledPriceArea decimal.Decimal
|
|
LossDilutedPrice decimal.Decimal
|
|
TotalConsumption decimal.Decimal
|
|
FinalDilutedOverall decimal.Decimal
|
|
}
|
|
|
|
type PoolingSummary struct {
|
|
Tenement string
|
|
Meter string
|
|
TargetMeter string
|
|
Area decimal.NullDecimal
|
|
OverallAmount decimal.Decimal
|
|
PoolingProportion decimal.Decimal
|
|
}
|