integrate-onpoint #5

Merged
sinhluu merged 15 commits from integrate-onpoint into master 2022-10-31 09:36:25 +00:00
1 changed files with 1 additions and 15 deletions
Showing only changes of commit e9f66f611e - Show all commits

View File

@ -1,7 +1,6 @@
package globalcare
import (
"encoding/json"
"time"
)
@ -41,20 +40,7 @@ type VehicleInfo struct {
// CarOccupantAccidentInsuranceObj ...
type CarOccupantAccidentInsuranceObj struct {
NumberOfSeats int `json:"numberOfSeats"`
}
func (c *CarOccupantAccidentInsuranceObj) MarshalJSON() ([]byte, error) {
buy := 1
if c.NumberOfSeats <= 0 {
buy = 2
}
return json.Marshal(&struct {
Buy int `json:"buy"`
NumberOfSeats int `json:"numberOfSeats"`
}{
Buy: buy,
NumberOfSeats: c.NumberOfSeats,
})
}
// InsuredInfo ...