forked from coopnorge/interview-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logistics.proto
69 lines (57 loc) · 1.82 KB
/
logistics.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
61
62
63
64
65
66
67
68
69
syntax = "proto3";
package coopnorge.logistics.api.v1;
import "google/api/annotations.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
// ---------------------------------------
// Service
// ---------------------------------------
// CoopLogisticsEngineAPI
service CoopLogisticsEngineAPI {
// MoveUnit request will be send when unit moves in dimensions to new location.
rpc MoveUnit(MoveUnitRequest) returns (DefaultResponse) {
option (google.api.http) = {
post: "/v1/cargo_unit/move"
};
}
// UnitReachedWarehouse reports when unit reached warehouse to do something there.
rpc UnitReachedWarehouse(UnitReachedWarehouseRequest) returns (DefaultResponse) {
option (google.api.http) = {
post: "/v1/warehouse/cargo_unit/reached"
};
}
}
// ---------------------------------------
// Requests
// ---------------------------------------
// MoveUnitRequest
message MoveUnitRequest {
int64 cargo_unit_id = 1;
Location location = 2;
}
// UnitReachedWarehouseRequest contains WarehouseAnnouncement with Location
message UnitReachedWarehouseRequest {
Location location = 1;
WarehouseAnnouncement announcement = 2;
}
// ---------------------------------------
// Responses
// ---------------------------------------
// DefaultResponse
message DefaultResponse {}
// ---------------------------------------
// Models
// ---------------------------------------
// WarehouseAnnouncement
message WarehouseAnnouncement {
// cargo_unit_id is unique id
int64 cargo_unit_id = 1;
// warehouse_id is unique id
int64 warehouse_id = 2;
// the message contains information about the announcement
string message = 3;
}
// Location where entity now located in X,Y Axis
message Location {
uint32 Latitude = 1;
uint32 Longitude = 2;
}