-
Notifications
You must be signed in to change notification settings - Fork 7
/
booking.proto
60 lines (49 loc) · 1.45 KB
/
booking.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* Booking related messages.
*
* This file is really just an example. The data model is completely
* fictional.
*/
syntax = "proto3";
option go_package = "example.com/booking";
package com.example.booking;
/**
* Represents the booking status ID.
*/
message BookingStatusID {
int32 id = 1; /// Unique booking status ID.
}
/**
* Represents the status of a vehicle booking.
*/
message BookingStatus {
int32 id = 1; /// Unique booking status ID.
string description = 2; /// Booking status description. E.g. "Active".
}
/**
* Represents the booking of a vehicle.
*
* Vehicles are quite fun. But drive carefully!
*/
message Booking {
int32 vehicle_id = 1; /// ID of booked vehicle.
int32 customer_id = 2; /// Customer that booked the vehicle.
BookingStatus status = 3; /// Status of the booking.
/** Has booking confirmation been sent? */
bool confirmation_sent = 4;
/** Has payment been received? */
bool payment_received = 5;
string color_preference = 6 [deprecated=true]; // Color preference of the customer.
}
// An empty message for testing
message EmptyBookingMessage {
}
/**
* Service for handling vehicle bookings.
*/
service BookingService {
/// Used to book a vehicle. Pass in a Booking and a BookingStatus will be returned.
rpc BookVehicle (Booking) returns (BookingStatus) {}
/// Used to subscribe to updates of the BookingStatus.
rpc BookingUpdates (BookingStatusID) returns (stream BookingStatus);
}