We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6697bdc commit 294214bCopy full SHA for 294214b
1 file changed
v1/prices.go
@@ -242,6 +242,8 @@ func (upf *UpfrontFare) NoCarsAvailable() bool {
242
243
var errInvalidSeatCount = errors.New("invalid seatcount, default and maximum value is 2")
244
245
+const defaultSeatCount = 2
246
+
247
func (esReq *EstimateRequest) validateForUpfrontFare() error {
248
if esReq == nil {
249
return errNilEstimateRequest
@@ -253,6 +255,10 @@ func (esReq *EstimateRequest) validateForUpfrontFare() error {
253
255
return errInvalidSeatCount
254
256
}
257
258
+ if esReq.SeatCount == 0 {
259
+ esReq.SeatCount = defaultSeatCount
260
+ }
261
262
// UpfrontFares require:
263
// * StartPlace or (StartLatitude, StartLongitude)
264
// * EndPlace or (EndLatitude, EndLongitude)
0 commit comments