@prodoctors/contracts 1.12.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/proto/shift.proto CHANGED
@@ -1,144 +1,144 @@
1
- syntax = "proto3";
2
-
3
- package shift.v1;
4
-
5
- import "google/protobuf/timestamp.proto";
6
- import "common.proto";
7
-
8
- enum ShiftStatus {
9
- SHIFT_STATUS_UNSPECIFIED = 0;
10
- SHIFT_STATUS_OPEN = 1;
11
- SHIFT_STATUS_CLOSED = 2;
12
- SHIFT_STATUS_FAILED = 3;
13
- }
14
-
15
- enum ExternalTerminalStatus {
16
- EXTERNAL_TERMINAL_STATUS_UNSPECIFIED = 0;
17
- EXTERNAL_TERMINAL_STATUS_UNKNOWN = 1;
18
- EXTERNAL_TERMINAL_STATUS_OPEN = 2;
19
- EXTERNAL_TERMINAL_STATUS_CLOSED = 3;
20
- EXTERNAL_TERMINAL_STATUS_ERROR = 4;
21
- }
22
-
23
- message PosTerminal {
24
- string id = 1;
25
- string branch_id = 2;
26
- string name = 3;
27
- string base_url = 4;
28
- string token = 5;
29
- string port = 6;
30
- bool is_active = 7;
31
- ExternalTerminalStatus last_known_status = 8;
32
- optional google.protobuf.Timestamp last_status_checked_at = 9;
33
- optional string last_status_message = 10;
34
- google.protobuf.Timestamp created_at = 11;
35
- google.protobuf.Timestamp updated_at = 12;
36
- }
37
-
38
- message CashierShift {
39
- string id = 1;
40
- string branch_id = 2;
41
- string cashier_id = 3;
42
- string terminal_id = 4;
43
- ShiftStatus status = 5;
44
- google.protobuf.Timestamp opened_at = 6;
45
- optional google.protobuf.Timestamp closed_at = 7;
46
- optional string open_message = 8;
47
- optional string close_message = 9;
48
- optional int32 left_zreport_count_at_open = 10;
49
- optional int32 left_zreport_count_at_close = 11;
50
- optional string external_error_message = 12;
51
- google.protobuf.Timestamp created_at = 13;
52
- google.protobuf.Timestamp updated_at = 14;
53
- optional PosTerminal terminal = 15;
54
- }
55
-
56
- message CreateTerminalRequest {
57
- string branch_id = 1;
58
- string name = 2;
59
- string base_url = 3;
60
- string token = 4;
61
- string port = 5;
62
- optional bool is_active = 6;
63
- }
64
-
65
- message UpdateTerminalRequest {
66
- string id = 1;
67
- optional string name = 2;
68
- optional string base_url = 3;
69
- optional string token = 4;
70
- optional string port = 5;
71
- optional bool is_active = 6;
72
- }
73
-
74
- message ListTerminalsRequest {
75
- common.v1.PaginationRequest pagination = 1;
76
- optional string branch_id = 2;
77
- optional bool is_active = 3;
78
- optional string search = 4;
79
- }
80
-
81
- message ListTerminalsResponse {
82
- repeated PosTerminal items = 1;
83
- common.v1.PaginationMeta meta = 2;
84
- }
85
-
86
- message TerminalStatusResponse {
87
- string terminal_id = 1;
88
- bool is_open = 2;
89
- ExternalTerminalStatus status = 3;
90
- optional string message = 4;
91
- optional int32 left_zreport_count = 5;
92
- optional google.protobuf.Timestamp checked_at = 6;
93
- }
94
-
95
- message OpenShiftRequest {
96
- string cashier_id = 1;
97
- string terminal_id = 2;
98
- }
99
-
100
- message CloseShiftRequest {
101
- string shift_id = 1;
102
- string cashier_id = 2;
103
- optional string note = 3;
104
- }
105
-
106
- message GetCurrentShiftRequest {
107
- string cashier_id = 1;
108
- }
109
-
110
- message GetShiftByIdRequest {
111
- string shift_id = 1;
112
- }
113
-
114
- message ListShiftsRequest {
115
- common.v1.PaginationRequest pagination = 1;
116
- optional string branch_id = 2;
117
- optional string cashier_id = 3;
118
- optional string terminal_id = 4;
119
- optional ShiftStatus status = 5;
120
- optional string date_from = 6;
121
- optional string date_to = 7;
122
- }
123
-
124
- message ListShiftsResponse {
125
- repeated CashierShift items = 1;
126
- common.v1.PaginationMeta meta = 2;
127
- }
128
-
129
- service TerminalService {
130
- rpc CreateTerminal(CreateTerminalRequest) returns (PosTerminal);
131
- rpc UpdateTerminal(UpdateTerminalRequest) returns (PosTerminal);
132
- rpc GetTerminalById(common.v1.IdRequest) returns (PosTerminal);
133
- rpc ListTerminals(ListTerminalsRequest) returns (ListTerminalsResponse);
134
- rpc DeleteTerminal(common.v1.IdRequest) returns (common.v1.BoolResponse);
135
- rpc GetTerminalStatus(common.v1.IdRequest) returns (TerminalStatusResponse);
136
- }
137
-
138
- service ShiftService {
139
- rpc OpenShift(OpenShiftRequest) returns (CashierShift);
140
- rpc CloseShift(CloseShiftRequest) returns (CashierShift);
141
- rpc GetCurrentShift(GetCurrentShiftRequest) returns (CashierShift);
142
- rpc GetShiftById(GetShiftByIdRequest) returns (CashierShift);
143
- rpc ListShifts(ListShiftsRequest) returns (ListShiftsResponse);
1
+ syntax = "proto3";
2
+
3
+ package shift.v1;
4
+
5
+ import "google/protobuf/timestamp.proto";
6
+ import "common.proto";
7
+
8
+ enum ShiftStatus {
9
+ SHIFT_STATUS_UNSPECIFIED = 0;
10
+ SHIFT_STATUS_OPEN = 1;
11
+ SHIFT_STATUS_CLOSED = 2;
12
+ SHIFT_STATUS_FAILED = 3;
13
+ }
14
+
15
+ enum ExternalTerminalStatus {
16
+ EXTERNAL_TERMINAL_STATUS_UNSPECIFIED = 0;
17
+ EXTERNAL_TERMINAL_STATUS_UNKNOWN = 1;
18
+ EXTERNAL_TERMINAL_STATUS_OPEN = 2;
19
+ EXTERNAL_TERMINAL_STATUS_CLOSED = 3;
20
+ EXTERNAL_TERMINAL_STATUS_ERROR = 4;
21
+ }
22
+
23
+ message PosTerminal {
24
+ string id = 1;
25
+ string branch_id = 2;
26
+ string name = 3;
27
+ string base_url = 4;
28
+ string token = 5;
29
+ string port = 6;
30
+ bool is_active = 7;
31
+ ExternalTerminalStatus last_known_status = 8;
32
+ optional google.protobuf.Timestamp last_status_checked_at = 9;
33
+ optional string last_status_message = 10;
34
+ google.protobuf.Timestamp created_at = 11;
35
+ google.protobuf.Timestamp updated_at = 12;
36
+ }
37
+
38
+ message CashierShift {
39
+ string id = 1;
40
+ string branch_id = 2;
41
+ string cashier_id = 3;
42
+ string terminal_id = 4;
43
+ ShiftStatus status = 5;
44
+ google.protobuf.Timestamp opened_at = 6;
45
+ optional google.protobuf.Timestamp closed_at = 7;
46
+ optional string open_message = 8;
47
+ optional string close_message = 9;
48
+ optional int32 left_zreport_count_at_open = 10;
49
+ optional int32 left_zreport_count_at_close = 11;
50
+ optional string external_error_message = 12;
51
+ google.protobuf.Timestamp created_at = 13;
52
+ google.protobuf.Timestamp updated_at = 14;
53
+ optional PosTerminal terminal = 15;
54
+ }
55
+
56
+ message CreateTerminalRequest {
57
+ string branch_id = 1;
58
+ string name = 2;
59
+ string base_url = 3;
60
+ string token = 4;
61
+ string port = 5;
62
+ optional bool is_active = 6;
63
+ }
64
+
65
+ message UpdateTerminalRequest {
66
+ string id = 1;
67
+ optional string name = 2;
68
+ optional string base_url = 3;
69
+ optional string token = 4;
70
+ optional string port = 5;
71
+ optional bool is_active = 6;
72
+ }
73
+
74
+ message ListTerminalsRequest {
75
+ common.v1.PaginationRequest pagination = 1;
76
+ optional string branch_id = 2;
77
+ optional bool is_active = 3;
78
+ optional string search = 4;
79
+ }
80
+
81
+ message ListTerminalsResponse {
82
+ repeated PosTerminal items = 1;
83
+ common.v1.PaginationMeta meta = 2;
84
+ }
85
+
86
+ message TerminalStatusResponse {
87
+ string terminal_id = 1;
88
+ bool is_open = 2;
89
+ ExternalTerminalStatus status = 3;
90
+ optional string message = 4;
91
+ optional int32 left_zreport_count = 5;
92
+ optional google.protobuf.Timestamp checked_at = 6;
93
+ }
94
+
95
+ message OpenShiftRequest {
96
+ string cashier_id = 1;
97
+ string terminal_id = 2;
98
+ }
99
+
100
+ message CloseShiftRequest {
101
+ string shift_id = 1;
102
+ string cashier_id = 2;
103
+ optional string note = 3;
104
+ }
105
+
106
+ message GetCurrentShiftRequest {
107
+ string cashier_id = 1;
108
+ }
109
+
110
+ message GetShiftByIdRequest {
111
+ string shift_id = 1;
112
+ }
113
+
114
+ message ListShiftsRequest {
115
+ common.v1.PaginationRequest pagination = 1;
116
+ optional string branch_id = 2;
117
+ optional string cashier_id = 3;
118
+ optional string terminal_id = 4;
119
+ optional ShiftStatus status = 5;
120
+ optional string date_from = 6;
121
+ optional string date_to = 7;
122
+ }
123
+
124
+ message ListShiftsResponse {
125
+ repeated CashierShift items = 1;
126
+ common.v1.PaginationMeta meta = 2;
127
+ }
128
+
129
+ service TerminalService {
130
+ rpc CreateTerminal(CreateTerminalRequest) returns (PosTerminal);
131
+ rpc UpdateTerminal(UpdateTerminalRequest) returns (PosTerminal);
132
+ rpc GetTerminalById(common.v1.IdRequest) returns (PosTerminal);
133
+ rpc ListTerminals(ListTerminalsRequest) returns (ListTerminalsResponse);
134
+ rpc DeleteTerminal(common.v1.IdRequest) returns (common.v1.BoolResponse);
135
+ rpc GetTerminalStatus(common.v1.IdRequest) returns (TerminalStatusResponse);
136
+ }
137
+
138
+ service ShiftService {
139
+ rpc OpenShift(OpenShiftRequest) returns (CashierShift);
140
+ rpc CloseShift(CloseShiftRequest) returns (CashierShift);
141
+ rpc GetCurrentShift(GetCurrentShiftRequest) returns (CashierShift);
142
+ rpc GetShiftById(GetShiftByIdRequest) returns (CashierShift);
143
+ rpc ListShifts(ListShiftsRequest) returns (ListShiftsResponse);
144
144
  }