|
@@ -39,27 +39,20 @@ type SyncLog struct {
|
|
// Client data
|
|
// Client data
|
|
type ClientPriceUpdate struct {
|
|
type ClientPriceUpdate struct {
|
|
Model
|
|
Model
|
|
- CompanyId uint64 `json:"company_id"` // only used by FOS
|
|
|
|
- StationId uint64 `json:"station_id"` // only used by FOS
|
|
|
|
- PriceUpdateId uint64 `json:"price_update_id"`
|
|
|
|
- GradeId uint64 `json:"grade_id"`
|
|
|
|
- GradeText string `json:"grade_text"`
|
|
|
|
- GradePrice uint64 `json:"grade_price"`
|
|
|
|
- NewGradePrice uint64 `json:"new_grade_price"`
|
|
|
|
- RecCreatedAt time.Time `json:"rec_create_at"`
|
|
|
|
- RecUpdatedAt time.Time `json:"rec_update_at"`
|
|
|
|
|
|
+ CompanyId uint64 `json:"company_id"` // only used by FOS
|
|
|
|
+ StationId uint64 `json:"station_id"` // only used by FOS
|
|
|
|
+ PriceUpdateId uint64 `json:"price_update_id"`
|
|
|
|
+ GradeId uint64 `json:"grade_id"`
|
|
|
|
+ GradeText string `json:"grade_text"`
|
|
|
|
+ GradePrice uint64 `json:"grade_price"`
|
|
|
|
+ NewGradePrice uint64 `json:"new_grade_price"`
|
|
|
|
+ RecCreatedAt string `json:"rec_create_at"`
|
|
|
|
+ RecUpdatedAt string `json:"rec_update_at"`
|
|
}
|
|
}
|
|
|
|
|
|
// Custom unmarshal for date time of the record
|
|
// Custom unmarshal for date time of the record
|
|
func (s *ClientPriceUpdate) UnmarshalJSON(data []byte) error {
|
|
func (s *ClientPriceUpdate) UnmarshalJSON(data []byte) error {
|
|
- type Alias ClientPriceUpdate
|
|
|
|
- aux := &struct {
|
|
|
|
- RecCreatedAt string `json:"rec_create_at"`
|
|
|
|
- RecUpdatedAt string `json:"rec_update_at"`
|
|
|
|
- *Alias
|
|
|
|
- }{
|
|
|
|
- Alias: (*Alias)(s),
|
|
|
|
- }
|
|
|
|
|
|
+ var aux ClientPriceUpdate
|
|
if err := json.Unmarshal(data, &aux); err != nil {
|
|
if err := json.Unmarshal(data, &aux); err != nil {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
@@ -72,7 +65,7 @@ func (s *ClientPriceUpdate) UnmarshalJSON(data []byte) error {
|
|
return e
|
|
return e
|
|
}
|
|
}
|
|
|
|
|
|
- s.RecCreatedAt = createdAt
|
|
|
|
- s.RecUpdatedAt = updatedAt
|
|
|
|
|
|
+ s.CreatedAt = createdAt
|
|
|
|
+ s.UpdatedAt = updatedAt
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|