Compare commits

...

1 Commits

Author SHA1 Message Date
Nicolas CARON 896c1f2f1b edit proto files to add Deleted option 2023-05-05 15:16:00 +02:00
7 changed files with 993 additions and 1780 deletions

2
go.mod
View File

@ -3,6 +3,7 @@ module git.coopgo.io/coopgo-platform/fleets
go 1.18 go 1.18
require ( require (
github.com/golang/protobuf v1.5.2
github.com/google/uuid v1.3.0 github.com/google/uuid v1.3.0
github.com/spf13/viper v1.12.0 github.com/spf13/viper v1.12.0
go.mongodb.org/mongo-driver v1.10.1 go.mongodb.org/mongo-driver v1.10.1
@ -12,7 +13,6 @@ require (
require ( require (
github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.1 // indirect github.com/golang/snappy v0.0.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect
github.com/klauspost/compress v1.13.6 // indirect github.com/klauspost/compress v1.13.6 // indirect

View File

@ -20,6 +20,7 @@ func (v Booking) ToStorageType() storage.Booking {
Unavailablefrom: v.Unavailablefrom.AsTime(), Unavailablefrom: v.Unavailablefrom.AsTime(),
Unavailableto: v.Unavailableto.AsTime(), Unavailableto: v.Unavailableto.AsTime(),
Data: map[string]any{}, Data: map[string]any{},
Deleted: v.Deleted,
} }
for k, d := range v.Data.GetFields() { for k, d := range v.Data.GetFields() {
@ -62,6 +63,7 @@ func BookingFromStorageType(booking *storage.Booking) (*Booking, error) {
Unavailablefrom: timestamppb.New(booking.Unavailablefrom), Unavailablefrom: timestamppb.New(booking.Unavailablefrom),
Unavailableto: timestamppb.New(booking.Unavailableto), Unavailableto: timestamppb.New(booking.Unavailableto),
Data: data, Data: data,
Deleted: booking.Deleted,
} }
result.Vehicle, err = VehicleFromStorageType(&booking.Vehicle) result.Vehicle, err = VehicleFromStorageType(&booking.Vehicle)

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.2.0 // - protoc-gen-go-grpc v1.2.0
// - protoc v3.19.4 // - protoc v3.21.12
// source: fleets.proto // source: fleets.proto
package grpcapi package grpcapi
@ -27,14 +27,14 @@ type FleetsClient interface {
GetVehicle(ctx context.Context, in *GetVehicleRequest, opts ...grpc.CallOption) (*GetVehicleResponse, error) GetVehicle(ctx context.Context, in *GetVehicleRequest, opts ...grpc.CallOption) (*GetVehicleResponse, error)
GetVehicles(ctx context.Context, in *GetVehiclesRequest, opts ...grpc.CallOption) (*GetVehiclesResponse, error) GetVehicles(ctx context.Context, in *GetVehiclesRequest, opts ...grpc.CallOption) (*GetVehiclesResponse, error)
UpdateVehicle(ctx context.Context, in *UpdateVehicleRequest, opts ...grpc.CallOption) (*UpdateVehicleResponse, error) UpdateVehicle(ctx context.Context, in *UpdateVehicleRequest, opts ...grpc.CallOption) (*UpdateVehicleResponse, error)
//Bookings // Bookings
CreateBooking(ctx context.Context, in *CreateBookingRequest, opts ...grpc.CallOption) (*CreateBookingResponse, error) CreateBooking(ctx context.Context, in *CreateBookingRequest, opts ...grpc.CallOption) (*CreateBookingResponse, error)
GetBooking(ctx context.Context, in *GetBookingRequest, opts ...grpc.CallOption) (*GetBookingResponse, error) GetBooking(ctx context.Context, in *GetBookingRequest, opts ...grpc.CallOption) (*GetBookingResponse, error)
GetBookings(ctx context.Context, in *GetBookingsRequest, opts ...grpc.CallOption) (*GetBookingsResponse, error) GetBookings(ctx context.Context, in *GetBookingsRequest, opts ...grpc.CallOption) (*GetBookingsResponse, error)
GetDriverBookings(ctx context.Context, in *GetDriverBookingsRequest, opts ...grpc.CallOption) (*GetDriverBookingsResponse, error) GetDriverBookings(ctx context.Context, in *GetDriverBookingsRequest, opts ...grpc.CallOption) (*GetDriverBookingsResponse, error)
UpdateBooking(ctx context.Context, in *UpdateBookingRequest, opts ...grpc.CallOption) (*UpdateBookingResponse, error) UpdateBooking(ctx context.Context, in *UpdateBookingRequest, opts ...grpc.CallOption) (*UpdateBookingResponse, error)
DeleteBooking(ctx context.Context, in *DeleteBookingRequest, opts ...grpc.CallOption) (*DeleteBookingResponse, error) DeleteBooking(ctx context.Context, in *DeleteBookingRequest, opts ...grpc.CallOption) (*DeleteBookingResponse, error)
//Search / Availabilities // Search / Availabilities
FindVehicle(ctx context.Context, in *FindVehicleRequest, opts ...grpc.CallOption) (*FindVehicleResponse, error) FindVehicle(ctx context.Context, in *FindVehicleRequest, opts ...grpc.CallOption) (*FindVehicleResponse, error)
} }
@ -154,14 +154,14 @@ type FleetsServer interface {
GetVehicle(context.Context, *GetVehicleRequest) (*GetVehicleResponse, error) GetVehicle(context.Context, *GetVehicleRequest) (*GetVehicleResponse, error)
GetVehicles(context.Context, *GetVehiclesRequest) (*GetVehiclesResponse, error) GetVehicles(context.Context, *GetVehiclesRequest) (*GetVehiclesResponse, error)
UpdateVehicle(context.Context, *UpdateVehicleRequest) (*UpdateVehicleResponse, error) UpdateVehicle(context.Context, *UpdateVehicleRequest) (*UpdateVehicleResponse, error)
//Bookings // Bookings
CreateBooking(context.Context, *CreateBookingRequest) (*CreateBookingResponse, error) CreateBooking(context.Context, *CreateBookingRequest) (*CreateBookingResponse, error)
GetBooking(context.Context, *GetBookingRequest) (*GetBookingResponse, error) GetBooking(context.Context, *GetBookingRequest) (*GetBookingResponse, error)
GetBookings(context.Context, *GetBookingsRequest) (*GetBookingsResponse, error) GetBookings(context.Context, *GetBookingsRequest) (*GetBookingsResponse, error)
GetDriverBookings(context.Context, *GetDriverBookingsRequest) (*GetDriverBookingsResponse, error) GetDriverBookings(context.Context, *GetDriverBookingsRequest) (*GetDriverBookingsResponse, error)
UpdateBooking(context.Context, *UpdateBookingRequest) (*UpdateBookingResponse, error) UpdateBooking(context.Context, *UpdateBookingRequest) (*UpdateBookingResponse, error)
DeleteBooking(context.Context, *DeleteBookingRequest) (*DeleteBookingResponse, error) DeleteBooking(context.Context, *DeleteBookingRequest) (*DeleteBookingResponse, error)
//Search / Availabilities // Search / Availabilities
FindVehicle(context.Context, *FindVehicleRequest) (*FindVehicleResponse, error) FindVehicle(context.Context, *FindVehicleRequest) (*FindVehicleResponse, error)
mustEmbedUnimplementedFleetsServer() mustEmbedUnimplementedFleetsServer()
} }

View File

@ -1,359 +1,250 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.19.4
// source: vehicles.proto // source: vehicles.proto
package grpcapi package grpcapi
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" fmt "fmt"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" proto "github.com/golang/protobuf/proto"
structpb "google.golang.org/protobuf/types/known/structpb" structpb "google.golang.org/protobuf/types/known/structpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb" timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect" math "math"
sync "sync"
) )
const ( // Reference imports to suppress errors if they are not otherwise used.
// Verify that this generated code is sufficiently up-to-date. var _ = proto.Marshal
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) var _ = fmt.Errorf
// Verify that runtime/protoimpl is sufficiently up-to-date. var _ = math.Inf
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) // This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Vehicle struct { type Vehicle struct {
state protoimpl.MessageState Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
sizeCache protoimpl.SizeCache Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
unknownFields protoimpl.UnknownFields Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
Administrators []string `protobuf:"bytes,4,rep,name=administrators,proto3" json:"administrators,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Data *structpb.Struct `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` Bookings []*Booking `protobuf:"bytes,6,rep,name=bookings,proto3" json:"bookings,omitempty"`
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
Administrators []string `protobuf:"bytes,4,rep,name=administrators,proto3" json:"administrators,omitempty"` XXX_unrecognized []byte `json:"-"`
Data *structpb.Struct `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` XXX_sizecache int32 `json:"-"`
Bookings []*Booking `protobuf:"bytes,6,rep,name=bookings,proto3" json:"bookings,omitempty"`
} }
func (x *Vehicle) Reset() { func (m *Vehicle) Reset() { *m = Vehicle{} }
*x = Vehicle{} func (m *Vehicle) String() string { return proto.CompactTextString(m) }
if protoimpl.UnsafeEnabled { func (*Vehicle) ProtoMessage() {}
mi := &file_vehicles_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Vehicle) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Vehicle) ProtoMessage() {}
func (x *Vehicle) ProtoReflect() protoreflect.Message {
mi := &file_vehicles_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Vehicle.ProtoReflect.Descriptor instead.
func (*Vehicle) Descriptor() ([]byte, []int) { func (*Vehicle) Descriptor() ([]byte, []int) {
return file_vehicles_proto_rawDescGZIP(), []int{0} return fileDescriptor_b84b5fa4f4d86273, []int{0}
} }
func (x *Vehicle) GetId() string { func (m *Vehicle) XXX_Unmarshal(b []byte) error {
if x != nil { return xxx_messageInfo_Vehicle.Unmarshal(m, b)
return x.Id }
func (m *Vehicle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Vehicle.Marshal(b, m, deterministic)
}
func (m *Vehicle) XXX_Merge(src proto.Message) {
xxx_messageInfo_Vehicle.Merge(m, src)
}
func (m *Vehicle) XXX_Size() int {
return xxx_messageInfo_Vehicle.Size(m)
}
func (m *Vehicle) XXX_DiscardUnknown() {
xxx_messageInfo_Vehicle.DiscardUnknown(m)
}
var xxx_messageInfo_Vehicle proto.InternalMessageInfo
func (m *Vehicle) GetId() string {
if m != nil {
return m.Id
} }
return "" return ""
} }
func (x *Vehicle) GetNamespace() string { func (m *Vehicle) GetNamespace() string {
if x != nil { if m != nil {
return x.Namespace return m.Namespace
} }
return "" return ""
} }
func (x *Vehicle) GetType() string { func (m *Vehicle) GetType() string {
if x != nil { if m != nil {
return x.Type return m.Type
} }
return "" return ""
} }
func (x *Vehicle) GetAdministrators() []string { func (m *Vehicle) GetAdministrators() []string {
if x != nil { if m != nil {
return x.Administrators return m.Administrators
} }
return nil return nil
} }
func (x *Vehicle) GetData() *structpb.Struct { func (m *Vehicle) GetData() *structpb.Struct {
if x != nil { if m != nil {
return x.Data return m.Data
} }
return nil return nil
} }
func (x *Vehicle) GetBookings() []*Booking { func (m *Vehicle) GetBookings() []*Booking {
if x != nil { if m != nil {
return x.Bookings return m.Bookings
} }
return nil return nil
} }
type Booking struct { type Booking struct {
state protoimpl.MessageState Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
sizeCache protoimpl.SizeCache Vehicleid string `protobuf:"bytes,2,opt,name=vehicleid,proto3" json:"vehicleid,omitempty"`
unknownFields protoimpl.UnknownFields Driver string `protobuf:"bytes,3,opt,name=driver,proto3" json:"driver,omitempty"`
Startdate *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=startdate,proto3" json:"startdate,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Enddate *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=enddate,proto3" json:"enddate,omitempty"`
Vehicleid string `protobuf:"bytes,2,opt,name=vehicleid,proto3" json:"vehicleid,omitempty"` Unavailablefrom *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=unavailablefrom,proto3" json:"unavailablefrom,omitempty"`
Driver string `protobuf:"bytes,3,opt,name=driver,proto3" json:"driver,omitempty"` Unavailableto *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=unavailableto,proto3" json:"unavailableto,omitempty"`
Startdate *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=startdate,proto3" json:"startdate,omitempty"` Data *structpb.Struct `protobuf:"bytes,8,opt,name=data,proto3" json:"data,omitempty"`
Enddate *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=enddate,proto3" json:"enddate,omitempty"` Deleted bool `protobuf:"varint,10,opt,name=deleted,proto3" json:"deleted,omitempty"`
Unavailablefrom *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=unavailablefrom,proto3" json:"unavailablefrom,omitempty"` Vehicle *Vehicle `protobuf:"bytes,9,opt,name=vehicle,proto3" json:"vehicle,omitempty"`
Unavailableto *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=unavailableto,proto3" json:"unavailableto,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
Data *structpb.Struct `protobuf:"bytes,8,opt,name=data,proto3" json:"data,omitempty"` XXX_unrecognized []byte `json:"-"`
Vehicle *Vehicle `protobuf:"bytes,9,opt,name=vehicle,proto3" json:"vehicle,omitempty"` XXX_sizecache int32 `json:"-"`
} }
func (x *Booking) Reset() { func (m *Booking) Reset() { *m = Booking{} }
*x = Booking{} func (m *Booking) String() string { return proto.CompactTextString(m) }
if protoimpl.UnsafeEnabled { func (*Booking) ProtoMessage() {}
mi := &file_vehicles_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Booking) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Booking) ProtoMessage() {}
func (x *Booking) ProtoReflect() protoreflect.Message {
mi := &file_vehicles_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Booking.ProtoReflect.Descriptor instead.
func (*Booking) Descriptor() ([]byte, []int) { func (*Booking) Descriptor() ([]byte, []int) {
return file_vehicles_proto_rawDescGZIP(), []int{1} return fileDescriptor_b84b5fa4f4d86273, []int{1}
} }
func (x *Booking) GetId() string { func (m *Booking) XXX_Unmarshal(b []byte) error {
if x != nil { return xxx_messageInfo_Booking.Unmarshal(m, b)
return x.Id }
func (m *Booking) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Booking.Marshal(b, m, deterministic)
}
func (m *Booking) XXX_Merge(src proto.Message) {
xxx_messageInfo_Booking.Merge(m, src)
}
func (m *Booking) XXX_Size() int {
return xxx_messageInfo_Booking.Size(m)
}
func (m *Booking) XXX_DiscardUnknown() {
xxx_messageInfo_Booking.DiscardUnknown(m)
}
var xxx_messageInfo_Booking proto.InternalMessageInfo
func (m *Booking) GetId() string {
if m != nil {
return m.Id
} }
return "" return ""
} }
func (x *Booking) GetVehicleid() string { func (m *Booking) GetVehicleid() string {
if x != nil { if m != nil {
return x.Vehicleid return m.Vehicleid
} }
return "" return ""
} }
func (x *Booking) GetDriver() string { func (m *Booking) GetDriver() string {
if x != nil { if m != nil {
return x.Driver return m.Driver
} }
return "" return ""
} }
func (x *Booking) GetStartdate() *timestamppb.Timestamp { func (m *Booking) GetStartdate() *timestamppb.Timestamp {
if x != nil { if m != nil {
return x.Startdate return m.Startdate
} }
return nil return nil
} }
func (x *Booking) GetEnddate() *timestamppb.Timestamp { func (m *Booking) GetEnddate() *timestamppb.Timestamp {
if x != nil { if m != nil {
return x.Enddate return m.Enddate
} }
return nil return nil
} }
func (x *Booking) GetUnavailablefrom() *timestamppb.Timestamp { func (m *Booking) GetUnavailablefrom() *timestamppb.Timestamp {
if x != nil { if m != nil {
return x.Unavailablefrom return m.Unavailablefrom
} }
return nil return nil
} }
func (x *Booking) GetUnavailableto() *timestamppb.Timestamp { func (m *Booking) GetUnavailableto() *timestamppb.Timestamp {
if x != nil { if m != nil {
return x.Unavailableto return m.Unavailableto
} }
return nil return nil
} }
func (x *Booking) GetData() *structpb.Struct { func (m *Booking) GetData() *structpb.Struct {
if x != nil { if m != nil {
return x.Data return m.Data
} }
return nil return nil
} }
func (x *Booking) GetVehicle() *Vehicle { func (m *Booking) GetDeleted() bool {
if x != nil { if m != nil {
return x.Vehicle return m.Deleted
}
return false
}
func (m *Booking) GetVehicle() *Vehicle {
if m != nil {
return m.Vehicle
} }
return nil return nil
} }
var File_vehicles_proto protoreflect.FileDescriptor func init() {
proto.RegisterType((*Vehicle)(nil), "Vehicle")
var file_vehicles_proto_rawDesc = []byte{ proto.RegisterType((*Booking)(nil), "Booking")
0x0a, 0x0e, 0x76, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0xc6, 0x01, 0x0a, 0x07, 0x56, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e,
0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a,
0x0e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18,
0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x69, 0x73, 0x74, 0x72,
0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61,
0x74, 0x61, 0x12, 0x24, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x06,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x08,
0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x98, 0x03, 0x0a, 0x07, 0x42, 0x6f, 0x6f,
0x6b, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x69,
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65,
0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x74,
0x61, 0x72, 0x74, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74,
0x64, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x64, 0x61, 0x74, 0x65, 0x18,
0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
0x70, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x64, 0x61, 0x74, 0x65, 0x12, 0x44, 0x0a, 0x0f, 0x75, 0x6e,
0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x06, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52,
0x0f, 0x75, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x66, 0x72, 0x6f, 0x6d,
0x12, 0x40, 0x0a, 0x0d, 0x75, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x74,
0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
0x61, 0x6d, 0x70, 0x52, 0x0d, 0x75, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65,
0x74, 0x6f, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12,
0x22, 0x0a, 0x07, 0x76, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x08, 0x2e, 0x56, 0x65, 0x68, 0x69, 0x63, 0x6c, 0x65, 0x52, 0x07, 0x76, 0x65, 0x68, 0x69,
0x63, 0x6c, 0x65, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67,
0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61, 0x74,
0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x66, 0x6c, 0x65, 0x65, 0x74, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63,
0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( func init() {
file_vehicles_proto_rawDescOnce sync.Once proto.RegisterFile("vehicles.proto", fileDescriptor_b84b5fa4f4d86273)
file_vehicles_proto_rawDescData = file_vehicles_proto_rawDesc
)
func file_vehicles_proto_rawDescGZIP() []byte {
file_vehicles_proto_rawDescOnce.Do(func() {
file_vehicles_proto_rawDescData = protoimpl.X.CompressGZIP(file_vehicles_proto_rawDescData)
})
return file_vehicles_proto_rawDescData
} }
var file_vehicles_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var fileDescriptor_b84b5fa4f4d86273 = []byte{
var file_vehicles_proto_goTypes = []interface{}{ // 384 bytes of a gzipped FileDescriptorProto
(*Vehicle)(nil), // 0: Vehicle 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x5d, 0xab, 0xd4, 0x30,
(*Booking)(nil), // 1: Booking 0x10, 0xa5, 0xbb, 0xbd, 0xfd, 0x98, 0x8b, 0x2b, 0xe4, 0x41, 0xc3, 0xe5, 0x82, 0x65, 0x11, 0x29,
(*structpb.Struct)(nil), // 2: google.protobuf.Struct 0xa8, 0x29, 0x5c, 0x7d, 0xf0, 0x51, 0x2e, 0xfe, 0x82, 0x2a, 0x3e, 0xf8, 0x96, 0x36, 0xd3, 0x1a,
(*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp 0x6c, 0x9b, 0x90, 0xcc, 0x2e, 0xf8, 0xb7, 0xfc, 0x11, 0xfe, 0x2e, 0x21, 0x6d, 0xf7, 0xea, 0x2a,
} 0xac, 0x6f, 0x99, 0x73, 0xe6, 0x0c, 0xe7, 0xcc, 0x04, 0x76, 0x47, 0xfc, 0xaa, 0xdb, 0x01, 0xbd,
var file_vehicles_proto_depIdxs = []int32{ 0xb0, 0xce, 0x90, 0xb9, 0xb9, 0xed, 0x8d, 0xe9, 0x07, 0xac, 0x42, 0xd5, 0x1c, 0xba, 0xca, 0x93,
2, // 0: Vehicle.data:type_name -> google.protobuf.Struct 0x3b, 0xb4, 0xb4, 0xb0, 0xcf, 0xce, 0x59, 0xd2, 0x23, 0x7a, 0x92, 0xa3, 0x9d, 0x1b, 0xf6, 0x3f,
1, // 1: Vehicle.bookings:type_name -> Booking 0x23, 0x48, 0x3f, 0xcf, 0x13, 0xd9, 0x0e, 0x36, 0x5a, 0xf1, 0xa8, 0x88, 0xca, 0xbc, 0xde, 0x68,
3, // 2: Booking.startdate:type_name -> google.protobuf.Timestamp 0xc5, 0x6e, 0x21, 0x9f, 0xe4, 0x88, 0xde, 0xca, 0x16, 0xf9, 0x26, 0xc0, 0x0f, 0x00, 0x63, 0x10,
3, // 3: Booking.enddate:type_name -> google.protobuf.Timestamp 0xd3, 0x77, 0x8b, 0x7c, 0x1b, 0x88, 0xf0, 0x66, 0x2f, 0x60, 0x27, 0xd5, 0xa8, 0x27, 0xed, 0xc9,
3, // 4: Booking.unavailablefrom:type_name -> google.protobuf.Timestamp 0x49, 0x32, 0xce, 0xf3, 0xb8, 0xd8, 0x96, 0x79, 0x7d, 0x86, 0xb2, 0x97, 0x10, 0x2b, 0x49, 0x92,
3, // 5: Booking.unavailableto:type_name -> google.protobuf.Timestamp 0x5f, 0x15, 0x51, 0x79, 0x7d, 0xf7, 0x54, 0xcc, 0x2e, 0xc5, 0xea, 0x52, 0x7c, 0x0c, 0x19, 0xea,
2, // 6: Booking.data:type_name -> google.protobuf.Struct 0xd0, 0xc4, 0x9e, 0x43, 0xd6, 0x18, 0xf3, 0x4d, 0x4f, 0xbd, 0xe7, 0x49, 0xb1, 0x2d, 0xaf, 0xef,
0, // 7: Booking.vehicle:type_name -> Vehicle 0x32, 0x71, 0x3f, 0x03, 0xf5, 0x89, 0xd9, 0xff, 0xd8, 0x42, 0xba, 0xa0, 0xff, 0x0a, 0xb2, 0x6c,
8, // [8:8] is the sub-list for method output_type 0x4d, 0xab, 0x35, 0xc8, 0x09, 0x60, 0x4f, 0x20, 0x51, 0x4e, 0x1f, 0xd1, 0x2d, 0x51, 0x96, 0x8a,
8, // [8:8] is the sub-list for method input_type 0xbd, 0x83, 0xdc, 0x93, 0x74, 0xa4, 0x24, 0x21, 0x8f, 0x83, 0xd3, 0x9b, 0xbf, 0x9c, 0x7e, 0x5a,
8, // [8:8] is the sub-list for extension type_name 0xf7, 0x59, 0x3f, 0x34, 0xb3, 0xb7, 0x90, 0xe2, 0xa4, 0x82, 0xee, 0xea, 0xa2, 0x6e, 0x6d, 0x65,
8, // [8:8] is the sub-list for extension extendee 0x1f, 0xe0, 0xf1, 0x61, 0x92, 0x47, 0xa9, 0x07, 0xd9, 0x0c, 0xd8, 0x39, 0x33, 0xf2, 0xe4, 0xa2,
0, // [0:8] is the sub-list for field type_name 0xfa, 0x5c, 0xc2, 0xde, 0xc3, 0xa3, 0xdf, 0x20, 0x32, 0x3c, 0xbd, 0x38, 0xe3, 0x4f, 0xc1, 0xe9,
} 0x38, 0xd9, 0xff, 0x1c, 0x87, 0x43, 0xaa, 0x70, 0x40, 0x42, 0xc5, 0xa1, 0x88, 0xca, 0xac, 0x5e,
0x4b, 0xb6, 0x87, 0x74, 0xd9, 0x31, 0xcf, 0xc3, 0xa4, 0x4c, 0x2c, 0x1f, 0xad, 0x5e, 0x89, 0x7b,
func init() { file_vehicles_proto_init() } 0xf1, 0xe5, 0x55, 0xaf, 0x49, 0xb4, 0xc6, 0xd8, 0xde, 0x08, 0x6d, 0xaa, 0xf9, 0xf5, 0xda, 0x0e,
func file_vehicles_proto_init() { 0x92, 0x3a, 0xe3, 0xc6, 0xaa, 0x1b, 0x10, 0xc9, 0x57, 0xbd, 0xb3, 0xad, 0xb4, 0xba, 0x49, 0x82,
if File_vehicles_proto != nil { 0x89, 0x37, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xd8, 0xa7, 0x63, 0x05, 0x03, 0x00, 0x00,
return
}
if !protoimpl.UnsafeEnabled {
file_vehicles_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Vehicle); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_vehicles_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Booking); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_vehicles_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_vehicles_proto_goTypes,
DependencyIndexes: file_vehicles_proto_depIdxs,
MessageInfos: file_vehicles_proto_msgTypes,
}.Build()
File_vehicles_proto = out.File
file_vehicles_proto_rawDesc = nil
file_vehicles_proto_goTypes = nil
file_vehicles_proto_depIdxs = nil
} }

View File

@ -23,6 +23,6 @@ message Booking {
google.protobuf.Timestamp unavailablefrom = 6; google.protobuf.Timestamp unavailablefrom = 6;
google.protobuf.Timestamp unavailableto = 7; google.protobuf.Timestamp unavailableto = 7;
google.protobuf.Struct data = 8; google.protobuf.Struct data = 8;
bool deleted = 10;
Vehicle vehicle = 9; Vehicle vehicle = 9;
} }

View File

@ -17,8 +17,7 @@ type Booking struct {
Unavailablefrom time.Time `json:"unavailablefrom"` Unavailablefrom time.Time `json:"unavailablefrom"`
Unavailableto time.Time `json:"unavailableto"` Unavailableto time.Time `json:"unavailableto"`
Data map[string]any `json:"data"` Data map[string]any `json:"data"`
Deleted bool `json:"deleted"`
Deleted bool
Vehicle Vehicle `json:"vehicle" bson:"-"` Vehicle Vehicle `json:"vehicle" bson:"-"`
} }