79 lines
3.3 KiB
Go
79 lines
3.3 KiB
Go
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type MeterDetail struct {
|
|
Code string `json:"code" db:"code"`
|
|
Park string `json:"parkId" db:"park_id"`
|
|
Address *string `json:"address" db:"address"`
|
|
MeterType int16 `json:"meterType" db:"meter_type"`
|
|
Building *string `json:"building" db:"building"`
|
|
BuildingName *string `json:"buildingName" db:"building_name"`
|
|
OnFloor *string `json:"onFloor" db:"on_floor"`
|
|
Area decimal.NullDecimal `json:"area" db:"area"`
|
|
Ratio decimal.Decimal `json:"ratio" db:"ratio"`
|
|
Seq int64 `json:"seq" db:"seq"`
|
|
Enabled bool `json:"enabled" db:"enabled"`
|
|
AttachedAt *time.Time `json:"attachedAt" db:"attached_at"`
|
|
DetachedAt *time.Time `json:"detachedAt" db:"detached_at"`
|
|
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
|
LastModifiedAt time.Time `json:"lastModifiedAt" db:"last_modified_at"`
|
|
}
|
|
|
|
type MeterRelation struct {
|
|
Id string `json:"id"`
|
|
Park string `json:"parkId" db:"park_id"`
|
|
MasterMeter string `json:"masterMeterId" db:"master_meter_id"`
|
|
SlaveMeter string `json:"slaveMeterId" db:"slave_meter_id"`
|
|
EstablishedAt time.Time `json:"establishedAt"`
|
|
SuspendedAt *time.Time `json:"suspendedAt"`
|
|
RevokeAt *time.Time `json:"revokeAt"`
|
|
}
|
|
|
|
type MeterSynchronization struct {
|
|
Park string `json:"parkId" db:"park_id"`
|
|
Meter string `json:"meterId" db:"meter_id"`
|
|
ForeignMeter string `json:"foreignMeter"`
|
|
SystemType string `json:"systemType"`
|
|
SystemIdentity string `json:"systemIdentity"`
|
|
Enabled bool `json:"enabled"`
|
|
LastSynchronizedAt time.Time `json:"lastSynchronizedAt" db:"last_synchronized_at"`
|
|
RevokeAt *time.Time `json:"revokeAt" db:"revoke_at"`
|
|
}
|
|
|
|
type SimpleMeterDocument struct {
|
|
Code string `json:"code"`
|
|
Seq int64 `json:"seq"`
|
|
Address *string `json:"address"`
|
|
Ratio decimal.Decimal `json:"ratio"`
|
|
TenementName *string `json:"tenementName"`
|
|
}
|
|
|
|
type NestedMeter struct {
|
|
MeterId string `json:"meterId"`
|
|
MeterDetail MeterDetail `json:"meterDetail"`
|
|
LastTermReadings Reading `json:"lastTermReadings"`
|
|
CurrentTermReadings Reading `json:"currentTermReadings"`
|
|
Overall ConsumptionUnit `json:"overall"`
|
|
Critical ConsumptionUnit `json:"critical"`
|
|
Peak ConsumptionUnit `json:"peak"`
|
|
Flat ConsumptionUnit `json:"flat"`
|
|
Valley ConsumptionUnit `json:"valley"`
|
|
BasicPooled decimal.Decimal `json:"basicPooled"`
|
|
AdjustPooled decimal.Decimal `json:"adjustPooled"`
|
|
LossPooled decimal.Decimal `json:"lossPooled"`
|
|
PublicPooled decimal.Decimal `json:"publicPooled"`
|
|
FinalTotal decimal.Decimal `json:"finalTotal"`
|
|
Area decimal.Decimal `json:"area"`
|
|
Proportion decimal.Decimal `json:"proportion"`
|
|
}
|
|
|
|
type PooledMeterDetailCompound struct {
|
|
MeterDetail
|
|
BindMeters []MeterDetail `json:"bindMeters"`
|
|
}
|