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
require (
github.com/golang/protobuf v1.5.2
github.com/google/uuid v1.3.0
github.com/spf13/viper v1.12.0
go.mongodb.org/mongo-driver v1.10.1
@ -12,7 +13,6 @@ require (
require (
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/hashicorp/hcl v1.0.0 // 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(),
Unavailableto: v.Unavailableto.AsTime(),
Data: map[string]any{},
Deleted: v.Deleted,
}
for k, d := range v.Data.GetFields() {
@ -62,6 +63,7 @@ func BookingFromStorageType(booking *storage.Booking) (*Booking, error) {
Unavailablefrom: timestamppb.New(booking.Unavailablefrom),
Unavailableto: timestamppb.New(booking.Unavailableto),
Data: data,
Deleted: booking.Deleted,
}
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.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.19.4
// - protoc v3.21.12
// source: fleets.proto
package grpcapi
@ -27,14 +27,14 @@ type FleetsClient interface {
GetVehicle(ctx context.Context, in *GetVehicleRequest, opts ...grpc.CallOption) (*GetVehicleResponse, error)
GetVehicles(ctx context.Context, in *GetVehiclesRequest, opts ...grpc.CallOption) (*GetVehiclesResponse, 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)
GetBooking(ctx context.Context, in *GetBookingRequest, opts ...grpc.CallOption) (*GetBookingResponse, error)
GetBookings(ctx context.Context, in *GetBookingsRequest, opts ...grpc.CallOption) (*GetBookingsResponse, error)
GetDriverBookings(ctx context.Context, in *GetDriverBookingsRequest, opts ...grpc.CallOption) (*GetDriverBookingsResponse, error)
UpdateBooking(ctx context.Context, in *UpdateBookingRequest, opts ...grpc.CallOption) (*UpdateBookingResponse, 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)
}
@ -154,14 +154,14 @@ type FleetsServer interface {
GetVehicle(context.Context, *GetVehicleRequest) (*GetVehicleResponse, error)
GetVehicles(context.Context, *GetVehiclesRequest) (*GetVehiclesResponse, error)
UpdateVehicle(context.Context, *UpdateVehicleRequest) (*UpdateVehicleResponse, error)
//Bookings
// Bookings
CreateBooking(context.Context, *CreateBookingRequest) (*CreateBookingResponse, error)
GetBooking(context.Context, *GetBookingRequest) (*GetBookingResponse, error)
GetBookings(context.Context, *GetBookingsRequest) (*GetBookingsResponse, error)
GetDriverBookings(context.Context, *GetDriverBookingsRequest) (*GetDriverBookingsResponse, error)
UpdateBooking(context.Context, *UpdateBookingRequest) (*UpdateBookingResponse, error)
DeleteBooking(context.Context, *DeleteBookingRequest) (*DeleteBookingResponse, error)
//Search / Availabilities
// Search / Availabilities
FindVehicle(context.Context, *FindVehicleRequest) (*FindVehicleResponse, error)
mustEmbedUnimplementedFleetsServer()
}

View File

@ -1,359 +1,250 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.19.4
// source: vehicles.proto
package grpcapi
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
structpb "google.golang.org/protobuf/types/known/structpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
math "math"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// 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 {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
Administrators []string `protobuf:"bytes,4,rep,name=administrators,proto3" json:"administrators,omitempty"`
Data *structpb.Struct `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
Bookings []*Booking `protobuf:"bytes,6,rep,name=bookings,proto3" json:"bookings,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
Administrators []string `protobuf:"bytes,4,rep,name=administrators,proto3" json:"administrators,omitempty"`
Data *structpb.Struct `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
Bookings []*Booking `protobuf:"bytes,6,rep,name=bookings,proto3" json:"bookings,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (x *Vehicle) Reset() {
*x = Vehicle{}
if protoimpl.UnsafeEnabled {
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 (m *Vehicle) Reset() { *m = Vehicle{} }
func (m *Vehicle) String() string { return proto.CompactTextString(m) }
func (*Vehicle) ProtoMessage() {}
func (*Vehicle) Descriptor() ([]byte, []int) {
return file_vehicles_proto_rawDescGZIP(), []int{0}
return fileDescriptor_b84b5fa4f4d86273, []int{0}
}
func (x *Vehicle) GetId() string {
if x != nil {
return x.Id
func (m *Vehicle) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Vehicle.Unmarshal(m, b)
}
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 ""
}
func (x *Vehicle) GetNamespace() string {
if x != nil {
return x.Namespace
func (m *Vehicle) GetNamespace() string {
if m != nil {
return m.Namespace
}
return ""
}
func (x *Vehicle) GetType() string {
if x != nil {
return x.Type
func (m *Vehicle) GetType() string {
if m != nil {
return m.Type
}
return ""
}
func (x *Vehicle) GetAdministrators() []string {
if x != nil {
return x.Administrators
func (m *Vehicle) GetAdministrators() []string {
if m != nil {
return m.Administrators
}
return nil
}
func (x *Vehicle) GetData() *structpb.Struct {
if x != nil {
return x.Data
func (m *Vehicle) GetData() *structpb.Struct {
if m != nil {
return m.Data
}
return nil
}
func (x *Vehicle) GetBookings() []*Booking {
if x != nil {
return x.Bookings
func (m *Vehicle) GetBookings() []*Booking {
if m != nil {
return m.Bookings
}
return nil
}
type Booking struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Vehicleid string `protobuf:"bytes,2,opt,name=vehicleid,proto3" json:"vehicleid,omitempty"`
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"`
Enddate *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=enddate,proto3" json:"enddate,omitempty"`
Unavailablefrom *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=unavailablefrom,proto3" json:"unavailablefrom,omitempty"`
Unavailableto *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=unavailableto,proto3" json:"unavailableto,omitempty"`
Data *structpb.Struct `protobuf:"bytes,8,opt,name=data,proto3" json:"data,omitempty"`
Vehicle *Vehicle `protobuf:"bytes,9,opt,name=vehicle,proto3" json:"vehicle,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Vehicleid string `protobuf:"bytes,2,opt,name=vehicleid,proto3" json:"vehicleid,omitempty"`
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"`
Enddate *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=enddate,proto3" json:"enddate,omitempty"`
Unavailablefrom *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=unavailablefrom,proto3" json:"unavailablefrom,omitempty"`
Unavailableto *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=unavailableto,proto3" json:"unavailableto,omitempty"`
Data *structpb.Struct `protobuf:"bytes,8,opt,name=data,proto3" json:"data,omitempty"`
Deleted bool `protobuf:"varint,10,opt,name=deleted,proto3" json:"deleted,omitempty"`
Vehicle *Vehicle `protobuf:"bytes,9,opt,name=vehicle,proto3" json:"vehicle,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (x *Booking) Reset() {
*x = Booking{}
if protoimpl.UnsafeEnabled {
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 (m *Booking) Reset() { *m = Booking{} }
func (m *Booking) String() string { return proto.CompactTextString(m) }
func (*Booking) ProtoMessage() {}
func (*Booking) Descriptor() ([]byte, []int) {
return file_vehicles_proto_rawDescGZIP(), []int{1}
return fileDescriptor_b84b5fa4f4d86273, []int{1}
}
func (x *Booking) GetId() string {
if x != nil {
return x.Id
func (m *Booking) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Booking.Unmarshal(m, b)
}
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 ""
}
func (x *Booking) GetVehicleid() string {
if x != nil {
return x.Vehicleid
func (m *Booking) GetVehicleid() string {
if m != nil {
return m.Vehicleid
}
return ""
}
func (x *Booking) GetDriver() string {
if x != nil {
return x.Driver
func (m *Booking) GetDriver() string {
if m != nil {
return m.Driver
}
return ""
}
func (x *Booking) GetStartdate() *timestamppb.Timestamp {
if x != nil {
return x.Startdate
func (m *Booking) GetStartdate() *timestamppb.Timestamp {
if m != nil {
return m.Startdate
}
return nil
}
func (x *Booking) GetEnddate() *timestamppb.Timestamp {
if x != nil {
return x.Enddate
func (m *Booking) GetEnddate() *timestamppb.Timestamp {
if m != nil {
return m.Enddate
}
return nil
}
func (x *Booking) GetUnavailablefrom() *timestamppb.Timestamp {
if x != nil {
return x.Unavailablefrom
func (m *Booking) GetUnavailablefrom() *timestamppb.Timestamp {
if m != nil {
return m.Unavailablefrom
}
return nil
}
func (x *Booking) GetUnavailableto() *timestamppb.Timestamp {
if x != nil {
return x.Unavailableto
func (m *Booking) GetUnavailableto() *timestamppb.Timestamp {
if m != nil {
return m.Unavailableto
}
return nil
}
func (x *Booking) GetData() *structpb.Struct {
if x != nil {
return x.Data
func (m *Booking) GetData() *structpb.Struct {
if m != nil {
return m.Data
}
return nil
}
func (x *Booking) GetVehicle() *Vehicle {
if x != nil {
return x.Vehicle
func (m *Booking) GetDeleted() bool {
if m != nil {
return m.Deleted
}
return false
}
func (m *Booking) GetVehicle() *Vehicle {
if m != nil {
return m.Vehicle
}
return nil
}
var File_vehicles_proto protoreflect.FileDescriptor
var file_vehicles_proto_rawDesc = []byte{
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,
func init() {
proto.RegisterType((*Vehicle)(nil), "Vehicle")
proto.RegisterType((*Booking)(nil), "Booking")
}
var (
file_vehicles_proto_rawDescOnce sync.Once
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
func init() {
proto.RegisterFile("vehicles.proto", fileDescriptor_b84b5fa4f4d86273)
}
var file_vehicles_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_vehicles_proto_goTypes = []interface{}{
(*Vehicle)(nil), // 0: Vehicle
(*Booking)(nil), // 1: Booking
(*structpb.Struct)(nil), // 2: google.protobuf.Struct
(*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp
}
var file_vehicles_proto_depIdxs = []int32{
2, // 0: Vehicle.data:type_name -> google.protobuf.Struct
1, // 1: Vehicle.bookings:type_name -> Booking
3, // 2: Booking.startdate:type_name -> google.protobuf.Timestamp
3, // 3: Booking.enddate:type_name -> google.protobuf.Timestamp
3, // 4: Booking.unavailablefrom:type_name -> google.protobuf.Timestamp
3, // 5: Booking.unavailableto:type_name -> google.protobuf.Timestamp
2, // 6: Booking.data:type_name -> google.protobuf.Struct
0, // 7: Booking.vehicle:type_name -> Vehicle
8, // [8:8] is the sub-list for method output_type
8, // [8:8] is the sub-list for method input_type
8, // [8:8] is the sub-list for extension type_name
8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
}
func init() { file_vehicles_proto_init() }
func file_vehicles_proto_init() {
if File_vehicles_proto != nil {
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
var fileDescriptor_b84b5fa4f4d86273 = []byte{
// 384 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x5d, 0xab, 0xd4, 0x30,
0x10, 0xa5, 0xbb, 0xbd, 0xfd, 0x98, 0x8b, 0x2b, 0xe4, 0x41, 0xc3, 0xe5, 0x82, 0x65, 0x11, 0x29,
0xa8, 0x29, 0x5c, 0x7d, 0xf0, 0x51, 0x2e, 0xfe, 0x82, 0x2a, 0x3e, 0xf8, 0x96, 0x36, 0xd3, 0x1a,
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,
0xb0, 0xce, 0x90, 0xb9, 0xb9, 0xed, 0x8d, 0xe9, 0x07, 0xac, 0x42, 0xd5, 0x1c, 0xba, 0xca, 0x93,
0x3b, 0xb4, 0xb4, 0xb0, 0xcf, 0xce, 0x59, 0xd2, 0x23, 0x7a, 0x92, 0xa3, 0x9d, 0x1b, 0xf6, 0x3f,
0x23, 0x48, 0x3f, 0xcf, 0x13, 0xd9, 0x0e, 0x36, 0x5a, 0xf1, 0xa8, 0x88, 0xca, 0xbc, 0xde, 0x68,
0xc5, 0x6e, 0x21, 0x9f, 0xe4, 0x88, 0xde, 0xca, 0x16, 0xf9, 0x26, 0xc0, 0x0f, 0x00, 0x63, 0x10,
0xd3, 0x77, 0x8b, 0x7c, 0x1b, 0x88, 0xf0, 0x66, 0x2f, 0x60, 0x27, 0xd5, 0xa8, 0x27, 0xed, 0xc9,
0x49, 0x32, 0xce, 0xf3, 0xb8, 0xd8, 0x96, 0x79, 0x7d, 0x86, 0xb2, 0x97, 0x10, 0x2b, 0x49, 0x92,
0x5f, 0x15, 0x51, 0x79, 0x7d, 0xf7, 0x54, 0xcc, 0x2e, 0xc5, 0xea, 0x52, 0x7c, 0x0c, 0x19, 0xea,
0xd0, 0xc4, 0x9e, 0x43, 0xd6, 0x18, 0xf3, 0x4d, 0x4f, 0xbd, 0xe7, 0x49, 0xb1, 0x2d, 0xaf, 0xef,
0x32, 0x71, 0x3f, 0x03, 0xf5, 0x89, 0xd9, 0xff, 0xd8, 0x42, 0xba, 0xa0, 0xff, 0x0a, 0xb2, 0x6c,
0x4d, 0xab, 0x35, 0xc8, 0x09, 0x60, 0x4f, 0x20, 0x51, 0x4e, 0x1f, 0xd1, 0x2d, 0x51, 0x96, 0x8a,
0xbd, 0x83, 0xdc, 0x93, 0x74, 0xa4, 0x24, 0x21, 0x8f, 0x83, 0xd3, 0x9b, 0xbf, 0x9c, 0x7e, 0x5a,
0xf7, 0x59, 0x3f, 0x34, 0xb3, 0xb7, 0x90, 0xe2, 0xa4, 0x82, 0xee, 0xea, 0xa2, 0x6e, 0x6d, 0x65,
0x1f, 0xe0, 0xf1, 0x61, 0x92, 0x47, 0xa9, 0x07, 0xd9, 0x0c, 0xd8, 0x39, 0x33, 0xf2, 0xe4, 0xa2,
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,
0xf1, 0xe5, 0x55, 0xaf, 0x49, 0xb4, 0xc6, 0xd8, 0xde, 0x08, 0x6d, 0xaa, 0xf9, 0xf5, 0xda, 0x0e,
0x92, 0x3a, 0xe3, 0xc6, 0xaa, 0x1b, 0x10, 0xc9, 0x57, 0xbd, 0xb3, 0xad, 0xb4, 0xba, 0x49, 0x82,
0x89, 0x37, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xd8, 0xa7, 0x63, 0x05, 0x03, 0x00, 0x00,
}

View File

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

View File

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