Add PostgreSQL database option and more booking flow functionalities
This commit is contained in:
@@ -2,7 +2,6 @@ package ocssapi
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss"
|
||||
"github.com/rs/zerolog/log"
|
||||
@@ -15,10 +14,14 @@ func (s *OCSSApiService) PostBookings(ctx context.Context, booking ocss.Booking)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &result.BookingDefinition, nil
|
||||
return &result.Booking, nil
|
||||
}
|
||||
func (s *OCSSApiService) PatchBookings(ctx context.Context, bookingId string, status ocss.BookingStatus, message *string) error {
|
||||
return errors.New("booking not found")
|
||||
err := s.Handler.UpdateBookingStatus(bookingId, status)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (s *OCSSApiService) GetBookings(ctx context.Context, bookingId string) (*ocss.Booking, error) {
|
||||
result, err := s.Handler.GetBooking(bookingId)
|
||||
@@ -27,5 +30,5 @@ func (s *OCSSApiService) GetBookings(ctx context.Context, bookingId string) (*oc
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &result.BookingDefinition, nil
|
||||
return &result.Booking, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user