@prodoctors/contracts 1.13.0 → 1.15.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/dist/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +1 -0
- package/gen/branch.ts +3 -0
- package/gen/inventory.ts +13 -1
- package/gen/payment.ts +208 -0
- package/gen/prescription.ts +84 -2
- package/gen/reservation.ts +23 -1
- package/package.json +28 -28
- package/proto/branch.proto +84 -81
- package/proto/inventory.proto +355 -344
- package/proto/payment.proto +145 -0
- package/proto/prescription.proto +40 -0
- package/proto/reservation.proto +224 -207
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package payment.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
import "common.proto";
|
|
7
|
+
|
|
8
|
+
// Onlayn to'lov provayderi.
|
|
9
|
+
enum PaymentProvider {
|
|
10
|
+
PAYMENT_PROVIDER_UNSPECIFIED = 0;
|
|
11
|
+
PAYMENT_PROVIDER_VIA = 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// To'lov oqimi.
|
|
15
|
+
enum PaymentFlow {
|
|
16
|
+
PAYMENT_FLOW_UNSPECIFIED = 0;
|
|
17
|
+
// Hisob-faktura: mijoz provayder tomonida to'laydi (karta bizdan o'tmaydi).
|
|
18
|
+
PAYMENT_FLOW_INVOICE = 1;
|
|
19
|
+
// Karta tokeni bilan ushlab turish, olib ketishda yechish.
|
|
20
|
+
PAYMENT_FLOW_HOLD = 2;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// To'lov holati.
|
|
24
|
+
enum PaymentStatus {
|
|
25
|
+
PAYMENT_STATUS_UNSPECIFIED = 0;
|
|
26
|
+
PAYMENT_STATUS_PENDING = 1;
|
|
27
|
+
PAYMENT_STATUS_HELD = 2;
|
|
28
|
+
PAYMENT_STATUS_PAID = 3;
|
|
29
|
+
PAYMENT_STATUS_CANCELLED = 4;
|
|
30
|
+
PAYMENT_STATUS_FAILED = 5;
|
|
31
|
+
PAYMENT_STATUS_REFUNDED = 6;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message Payment {
|
|
35
|
+
string id = 1;
|
|
36
|
+
string web_order_id = 2;
|
|
37
|
+
|
|
38
|
+
PaymentProvider provider = 3;
|
|
39
|
+
PaymentFlow flow = 4;
|
|
40
|
+
PaymentStatus status = 5;
|
|
41
|
+
|
|
42
|
+
string amount = 6;
|
|
43
|
+
string currency = 7;
|
|
44
|
+
|
|
45
|
+
// Bizning idempotentlik kalitimiz.
|
|
46
|
+
string external_id = 8;
|
|
47
|
+
// Provayder hisob-fakturasi (`inv_...`).
|
|
48
|
+
optional string invoice_id = 9;
|
|
49
|
+
// Provayder tranzaksiyasi (`trx_...`).
|
|
50
|
+
optional string transaction_id = 10;
|
|
51
|
+
// Mijozni yo'naltirish uchun to'lov sahifasi (bo'lsa).
|
|
52
|
+
optional string payment_url = 11;
|
|
53
|
+
// Karta niqobi (oxirgi raqamlar). To'liq PAN saqlanmaydi.
|
|
54
|
+
optional string card_mask = 12;
|
|
55
|
+
|
|
56
|
+
optional google.protobuf.Timestamp paid_at = 13;
|
|
57
|
+
optional string failure_reason = 14;
|
|
58
|
+
|
|
59
|
+
google.protobuf.Timestamp created_at = 15;
|
|
60
|
+
google.protobuf.Timestamp updated_at = 16;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
message StartPaymentRequest {
|
|
64
|
+
string web_order_id = 1;
|
|
65
|
+
// Ko'rsatilmasa INVOICE ishlatiladi.
|
|
66
|
+
PaymentFlow flow = 2;
|
|
67
|
+
|
|
68
|
+
// HOLD oqimi uchun majburiy.
|
|
69
|
+
optional string card_token = 3;
|
|
70
|
+
|
|
71
|
+
optional string receiver_phone = 4;
|
|
72
|
+
optional string receiver_email = 5;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
message GetPaymentByOrderRequest {
|
|
76
|
+
string web_order_id = 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Provayder callback'i yoki UI polling — holatni provayderdan tortadi.
|
|
80
|
+
message SyncPaymentRequest {
|
|
81
|
+
// Ikkalasidan biri: bizning to'lov id yoki provayder tranzaksiya/invoice id.
|
|
82
|
+
optional string payment_id = 1;
|
|
83
|
+
optional string external_id = 2;
|
|
84
|
+
optional string provider_reference = 3;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// HOLD → yechish (dori berilganda).
|
|
88
|
+
message ConfirmPaymentRequest {
|
|
89
|
+
string payment_id = 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// HOLD → qaytarish (bron bekor/muddati o'tganda).
|
|
93
|
+
message CancelPaymentRequest {
|
|
94
|
+
string payment_id = 1;
|
|
95
|
+
optional string reason = 2;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// --- Karta kiritish (karta SAQLANMAYDI) ---
|
|
99
|
+
//
|
|
100
|
+
// Oqim: RegisterCard (karta ma'lumoti) -> mijozga SMS -> ConfirmCard (kod)
|
|
101
|
+
// -> olingan token DARHOL hold yaratishga ishlatiladi va tashlab yuboriladi.
|
|
102
|
+
// PAN hech qayerda saqlanmaydi va loglanmaydi.
|
|
103
|
+
|
|
104
|
+
message RegisterCardRequest {
|
|
105
|
+
string web_order_id = 1;
|
|
106
|
+
// Karta raqami — faqat provayderga uzatiladi, saqlanmaydi.
|
|
107
|
+
string pan = 2;
|
|
108
|
+
string exp_month = 3;
|
|
109
|
+
string exp_year = 4;
|
|
110
|
+
string phone = 5;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
message RegisterCardResponse {
|
|
114
|
+
string payment_id = 1;
|
|
115
|
+
string verify_id = 2;
|
|
116
|
+
// SMS yuborilgan raqam niqobi (mijozga ko'rsatish uchun).
|
|
117
|
+
string phone_mask = 3;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
message ConfirmCardRequest {
|
|
121
|
+
string payment_id = 1;
|
|
122
|
+
string verify_code = 2;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
message ResendCardCodeRequest {
|
|
126
|
+
string payment_id = 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
message ResendCardCodeResponse {
|
|
130
|
+
string verify_id = 1;
|
|
131
|
+
string phone_mask = 2;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
service PaymentService {
|
|
135
|
+
rpc StartPayment(StartPaymentRequest) returns (Payment);
|
|
136
|
+
rpc GetPayment(common.v1.IdRequest) returns (Payment);
|
|
137
|
+
rpc GetPaymentByOrder(GetPaymentByOrderRequest) returns (Payment);
|
|
138
|
+
rpc SyncPayment(SyncPaymentRequest) returns (Payment);
|
|
139
|
+
rpc ConfirmPayment(ConfirmPaymentRequest) returns (Payment);
|
|
140
|
+
rpc CancelPayment(CancelPaymentRequest) returns (Payment);
|
|
141
|
+
|
|
142
|
+
rpc RegisterCard(RegisterCardRequest) returns (RegisterCardResponse);
|
|
143
|
+
rpc ConfirmCard(ConfirmCardRequest) returns (Payment);
|
|
144
|
+
rpc ResendCardCode(ResendCardCodeRequest) returns (ResendCardCodeResponse);
|
|
145
|
+
}
|
package/proto/prescription.proto
CHANGED
|
@@ -17,6 +17,9 @@ message SearchPrescriptionRequest {
|
|
|
17
17
|
optional string birth_date = 6; // YYYY-MM-DD
|
|
18
18
|
optional bool is_confidant = 7;
|
|
19
19
|
optional string qr = 8; // "prescription-{patient_id}-{safe_code}" — parse qilinadi
|
|
20
|
+
// Retseptni ochayotgan farmatsevt. DMED tokeni har bir shaxsga alohida
|
|
21
|
+
// bog'langani uchun (retsept berish DMED'da shaxsga yoziladi) majburiy.
|
|
22
|
+
string account_id = 9;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
// Bizning katalogdagi mos mahsulot (filialda mavjud stock bilan).
|
|
@@ -73,6 +76,8 @@ message DispenseRequest {
|
|
|
73
76
|
optional string marking_code = 5;
|
|
74
77
|
int32 drug_amount = 6;
|
|
75
78
|
int64 price = 7;
|
|
79
|
+
// Dorini beruvchi farmatsevt — DMED tokeni shu shaxsniki.
|
|
80
|
+
string account_id = 8;
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
message CheckIssueResponse {
|
|
@@ -86,7 +91,42 @@ message IssueResponse {
|
|
|
86
91
|
string message = 3;
|
|
87
92
|
}
|
|
88
93
|
|
|
94
|
+
// --- DMED hisobini ulash (OAuth2 Authorization Code) ---
|
|
95
|
+
// Token har bir farmatsevtga alohida saqlanadi.
|
|
96
|
+
|
|
97
|
+
message DmedAccountRequest {
|
|
98
|
+
string account_id = 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message DmedAuthorizeUrlResponse {
|
|
102
|
+
// Farmatsevt shu manzilga yo'naltiriladi (DMED login sahifasi).
|
|
103
|
+
string authorize_url = 1;
|
|
104
|
+
// CSRF himoyasi uchun; callback'da qaytib keladi.
|
|
105
|
+
string state = 2;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
message CompleteDmedConnectionRequest {
|
|
109
|
+
string account_id = 1;
|
|
110
|
+
string code = 2;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
message DmedConnectionStatus {
|
|
114
|
+
bool connected = 1;
|
|
115
|
+
optional string dmed_email = 2;
|
|
116
|
+
// Access token qachon tugashi (ISO 8601).
|
|
117
|
+
optional string expires_at = 3;
|
|
118
|
+
}
|
|
119
|
+
|
|
89
120
|
service PrescriptionService {
|
|
121
|
+
// DMED hisobini ulash: login manzilini beradi.
|
|
122
|
+
rpc ConnectDmed(DmedAccountRequest) returns (DmedAuthorizeUrlResponse);
|
|
123
|
+
// Callback'dan kelgan `code` ni tokenga almashtirib saqlaydi.
|
|
124
|
+
rpc CompleteDmedConnection(CompleteDmedConnectionRequest) returns (DmedConnectionStatus);
|
|
125
|
+
// Ulanish holati (POS "ulangan/ulanmagan" ko'rsatishi uchun).
|
|
126
|
+
rpc GetDmedStatus(DmedAccountRequest) returns (DmedConnectionStatus);
|
|
127
|
+
// Ulanishni uzish.
|
|
128
|
+
rpc DisconnectDmed(DmedAccountRequest) returns (DmedConnectionStatus);
|
|
129
|
+
|
|
90
130
|
// Retsept qidirish + bizdagi mos stockni topish.
|
|
91
131
|
rpc SearchPrescription(SearchPrescriptionRequest) returns (SearchPrescriptionResponse);
|
|
92
132
|
// Berishdan oldin DMED'da tekshirish.
|
package/proto/reservation.proto
CHANGED
|
@@ -1,207 +1,224 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package reservation.v1;
|
|
4
|
-
|
|
5
|
-
import "google/protobuf/timestamp.proto";
|
|
6
|
-
import "common.proto";
|
|
7
|
-
|
|
8
|
-
enum WebReservationStatus {
|
|
9
|
-
WEB_RESERVATION_STATUS_UNSPECIFIED = 0;
|
|
10
|
-
WEB_RESERVATION_STATUS_CREATED = 1;
|
|
11
|
-
WEB_RESERVATION_STATUS_CONFIRMED = 2;
|
|
12
|
-
WEB_RESERVATION_STATUS_READY = 3;
|
|
13
|
-
WEB_RESERVATION_STATUS_COMPLETED = 4;
|
|
14
|
-
WEB_RESERVATION_STATUS_CANCELLED = 5;
|
|
15
|
-
WEB_RESERVATION_STATUS_EXPIRED = 6;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
enum WebOrderStatus {
|
|
19
|
-
WEB_ORDER_STATUS_UNSPECIFIED = 0;
|
|
20
|
-
WEB_ORDER_STATUS_CREATED = 1;
|
|
21
|
-
WEB_ORDER_STATUS_CONFIRMED = 2;
|
|
22
|
-
WEB_ORDER_STATUS_READY = 3;
|
|
23
|
-
WEB_ORDER_STATUS_COMPLETED = 4;
|
|
24
|
-
WEB_ORDER_STATUS_CANCELLED = 5;
|
|
25
|
-
WEB_ORDER_STATUS_EXPIRED = 6;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
message WebReservation {
|
|
29
|
-
string id = 1;
|
|
30
|
-
string reservation_number = 2;
|
|
31
|
-
WebReservationStatus status = 3;
|
|
32
|
-
|
|
33
|
-
string product_id = 4;
|
|
34
|
-
string product_batch_id = 5;
|
|
35
|
-
string branch_id = 6;
|
|
36
|
-
optional string customer_id = 7;
|
|
37
|
-
|
|
38
|
-
optional string order_id = 8;
|
|
39
|
-
|
|
40
|
-
string product_name = 9;
|
|
41
|
-
string pharmacy_name = 10;
|
|
42
|
-
|
|
43
|
-
string customer_name = 11;
|
|
44
|
-
string phone = 12;
|
|
45
|
-
optional string comment = 13;
|
|
46
|
-
optional string city = 14;
|
|
47
|
-
|
|
48
|
-
int32 quantity = 15;
|
|
49
|
-
string unit_price = 16;
|
|
50
|
-
string total_price = 17;
|
|
51
|
-
string source = 18;
|
|
52
|
-
|
|
53
|
-
google.protobuf.Timestamp created_at = 19;
|
|
54
|
-
google.protobuf.Timestamp expires_at = 20;
|
|
55
|
-
google.protobuf.Timestamp updated_at = 21;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
message CreateWebReservationRequest {
|
|
59
|
-
string product_id = 1;
|
|
60
|
-
string product_batch_id = 2;
|
|
61
|
-
string branch_id = 3;
|
|
62
|
-
|
|
63
|
-
optional string order_id = 4;
|
|
64
|
-
|
|
65
|
-
string product_name = 5;
|
|
66
|
-
string pharmacy_name = 6;
|
|
67
|
-
|
|
68
|
-
string customer_name = 7;
|
|
69
|
-
string phone = 8;
|
|
70
|
-
optional string comment = 9;
|
|
71
|
-
optional string city = 10;
|
|
72
|
-
|
|
73
|
-
int32 quantity = 11;
|
|
74
|
-
string unit_price = 12;
|
|
75
|
-
string total_price = 13;
|
|
76
|
-
optional string source = 14;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
message ListWebReservationsRequest {
|
|
80
|
-
common.v1.PaginationRequest pagination = 1;
|
|
81
|
-
optional WebReservationStatus status = 2;
|
|
82
|
-
optional string branch_id = 3;
|
|
83
|
-
optional string phone = 4;
|
|
84
|
-
optional string reservation_number = 5;
|
|
85
|
-
optional string order_id = 6;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
message ListWebReservationsResponse {
|
|
89
|
-
repeated WebReservation items = 1;
|
|
90
|
-
common.v1.PaginationMeta meta = 2;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
message UpdateWebReservationStatusRequest {
|
|
94
|
-
string id = 1;
|
|
95
|
-
WebReservationStatus status = 2;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
message WebOrderItem {
|
|
99
|
-
string id = 1;
|
|
100
|
-
string reservation_id = 2;
|
|
101
|
-
|
|
102
|
-
string product_id = 3;
|
|
103
|
-
string product_batch_id = 4;
|
|
104
|
-
string branch_id = 5;
|
|
105
|
-
|
|
106
|
-
string product_name = 6;
|
|
107
|
-
string pharmacy_name = 7;
|
|
108
|
-
|
|
109
|
-
int32 quantity = 8;
|
|
110
|
-
string unit_price = 9;
|
|
111
|
-
string total_price = 10;
|
|
112
|
-
|
|
113
|
-
WebReservationStatus status = 11;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
message WebOrder {
|
|
117
|
-
string id = 1;
|
|
118
|
-
string order_number = 2;
|
|
119
|
-
WebOrderStatus status = 3;
|
|
120
|
-
|
|
121
|
-
string customer_name = 4;
|
|
122
|
-
string phone = 5;
|
|
123
|
-
optional string comment = 6;
|
|
124
|
-
optional string city = 7;
|
|
125
|
-
|
|
126
|
-
string source = 8;
|
|
127
|
-
int32 total_items = 9;
|
|
128
|
-
string total_price = 10;
|
|
129
|
-
|
|
130
|
-
google.protobuf.Timestamp created_at = 11;
|
|
131
|
-
google.protobuf.Timestamp expires_at = 12;
|
|
132
|
-
google.protobuf.Timestamp updated_at = 13;
|
|
133
|
-
|
|
134
|
-
repeated WebOrderItem items = 14;
|
|
135
|
-
|
|
136
|
-
// Buyurtma bajariladigan dorixona (bitta order = bitta filial).
|
|
137
|
-
optional string branch_id = 15;
|
|
138
|
-
optional string pharmacy_name = 16;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
string
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
string
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package reservation.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
import "common.proto";
|
|
7
|
+
|
|
8
|
+
enum WebReservationStatus {
|
|
9
|
+
WEB_RESERVATION_STATUS_UNSPECIFIED = 0;
|
|
10
|
+
WEB_RESERVATION_STATUS_CREATED = 1;
|
|
11
|
+
WEB_RESERVATION_STATUS_CONFIRMED = 2;
|
|
12
|
+
WEB_RESERVATION_STATUS_READY = 3;
|
|
13
|
+
WEB_RESERVATION_STATUS_COMPLETED = 4;
|
|
14
|
+
WEB_RESERVATION_STATUS_CANCELLED = 5;
|
|
15
|
+
WEB_RESERVATION_STATUS_EXPIRED = 6;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
enum WebOrderStatus {
|
|
19
|
+
WEB_ORDER_STATUS_UNSPECIFIED = 0;
|
|
20
|
+
WEB_ORDER_STATUS_CREATED = 1;
|
|
21
|
+
WEB_ORDER_STATUS_CONFIRMED = 2;
|
|
22
|
+
WEB_ORDER_STATUS_READY = 3;
|
|
23
|
+
WEB_ORDER_STATUS_COMPLETED = 4;
|
|
24
|
+
WEB_ORDER_STATUS_CANCELLED = 5;
|
|
25
|
+
WEB_ORDER_STATUS_EXPIRED = 6;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message WebReservation {
|
|
29
|
+
string id = 1;
|
|
30
|
+
string reservation_number = 2;
|
|
31
|
+
WebReservationStatus status = 3;
|
|
32
|
+
|
|
33
|
+
string product_id = 4;
|
|
34
|
+
string product_batch_id = 5;
|
|
35
|
+
string branch_id = 6;
|
|
36
|
+
optional string customer_id = 7;
|
|
37
|
+
|
|
38
|
+
optional string order_id = 8;
|
|
39
|
+
|
|
40
|
+
string product_name = 9;
|
|
41
|
+
string pharmacy_name = 10;
|
|
42
|
+
|
|
43
|
+
string customer_name = 11;
|
|
44
|
+
string phone = 12;
|
|
45
|
+
optional string comment = 13;
|
|
46
|
+
optional string city = 14;
|
|
47
|
+
|
|
48
|
+
int32 quantity = 15;
|
|
49
|
+
string unit_price = 16;
|
|
50
|
+
string total_price = 17;
|
|
51
|
+
string source = 18;
|
|
52
|
+
|
|
53
|
+
google.protobuf.Timestamp created_at = 19;
|
|
54
|
+
google.protobuf.Timestamp expires_at = 20;
|
|
55
|
+
google.protobuf.Timestamp updated_at = 21;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message CreateWebReservationRequest {
|
|
59
|
+
string product_id = 1;
|
|
60
|
+
string product_batch_id = 2;
|
|
61
|
+
string branch_id = 3;
|
|
62
|
+
|
|
63
|
+
optional string order_id = 4;
|
|
64
|
+
|
|
65
|
+
string product_name = 5;
|
|
66
|
+
string pharmacy_name = 6;
|
|
67
|
+
|
|
68
|
+
string customer_name = 7;
|
|
69
|
+
string phone = 8;
|
|
70
|
+
optional string comment = 9;
|
|
71
|
+
optional string city = 10;
|
|
72
|
+
|
|
73
|
+
int32 quantity = 11;
|
|
74
|
+
string unit_price = 12;
|
|
75
|
+
string total_price = 13;
|
|
76
|
+
optional string source = 14;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message ListWebReservationsRequest {
|
|
80
|
+
common.v1.PaginationRequest pagination = 1;
|
|
81
|
+
optional WebReservationStatus status = 2;
|
|
82
|
+
optional string branch_id = 3;
|
|
83
|
+
optional string phone = 4;
|
|
84
|
+
optional string reservation_number = 5;
|
|
85
|
+
optional string order_id = 6;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
message ListWebReservationsResponse {
|
|
89
|
+
repeated WebReservation items = 1;
|
|
90
|
+
common.v1.PaginationMeta meta = 2;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
message UpdateWebReservationStatusRequest {
|
|
94
|
+
string id = 1;
|
|
95
|
+
WebReservationStatus status = 2;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
message WebOrderItem {
|
|
99
|
+
string id = 1;
|
|
100
|
+
string reservation_id = 2;
|
|
101
|
+
|
|
102
|
+
string product_id = 3;
|
|
103
|
+
string product_batch_id = 4;
|
|
104
|
+
string branch_id = 5;
|
|
105
|
+
|
|
106
|
+
string product_name = 6;
|
|
107
|
+
string pharmacy_name = 7;
|
|
108
|
+
|
|
109
|
+
int32 quantity = 8;
|
|
110
|
+
string unit_price = 9;
|
|
111
|
+
string total_price = 10;
|
|
112
|
+
|
|
113
|
+
WebReservationStatus status = 11;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
message WebOrder {
|
|
117
|
+
string id = 1;
|
|
118
|
+
string order_number = 2;
|
|
119
|
+
WebOrderStatus status = 3;
|
|
120
|
+
|
|
121
|
+
string customer_name = 4;
|
|
122
|
+
string phone = 5;
|
|
123
|
+
optional string comment = 6;
|
|
124
|
+
optional string city = 7;
|
|
125
|
+
|
|
126
|
+
string source = 8;
|
|
127
|
+
int32 total_items = 9;
|
|
128
|
+
string total_price = 10;
|
|
129
|
+
|
|
130
|
+
google.protobuf.Timestamp created_at = 11;
|
|
131
|
+
google.protobuf.Timestamp expires_at = 12;
|
|
132
|
+
google.protobuf.Timestamp updated_at = 13;
|
|
133
|
+
|
|
134
|
+
repeated WebOrderItem items = 14;
|
|
135
|
+
|
|
136
|
+
// Buyurtma bajariladigan dorixona (bitta order = bitta filial).
|
|
137
|
+
optional string branch_id = 15;
|
|
138
|
+
optional string pharmacy_name = 16;
|
|
139
|
+
|
|
140
|
+
// Onlayn to'lov. Bo'lmasa — dorixonada naqd/karta bilan to'lanadi.
|
|
141
|
+
optional WebOrderPayment payment = 17;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Buyurtmaning onlayn to'lovi (bo'lsa). To'liq tafsilot payment.v1 da —
|
|
145
|
+
// bu yerda ro'yxat/kartochkada ko'rsatish uchun zarur minimum.
|
|
146
|
+
message WebOrderPayment {
|
|
147
|
+
string id = 1;
|
|
148
|
+
// PENDING | HELD | PAID | CANCELLED | FAILED | REFUNDED
|
|
149
|
+
string status = 2;
|
|
150
|
+
string amount = 3;
|
|
151
|
+
optional string card_mask = 4;
|
|
152
|
+
optional google.protobuf.Timestamp paid_at = 5;
|
|
153
|
+
// Fiskal chek yuborilganmi (yuborilmagan bo'lsa — sabab `receipt_error`).
|
|
154
|
+
optional google.protobuf.Timestamp receipt_sent_at = 6;
|
|
155
|
+
optional string receipt_error = 7;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
message GetWebOrderByNumberRequest {
|
|
159
|
+
string order_number = 1;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
message FulfillWebOrderRequest {
|
|
163
|
+
string order_id = 1;
|
|
164
|
+
optional string cashier_id = 2;
|
|
165
|
+
string payment_method = 3; // PaymentMethod (CASH/CARD/...)
|
|
166
|
+
optional string paid_amount = 4;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
message CreateWebOrderItem {
|
|
170
|
+
string product_id = 1;
|
|
171
|
+
string product_batch_id = 2;
|
|
172
|
+
string branch_id = 3;
|
|
173
|
+
|
|
174
|
+
string product_name = 4;
|
|
175
|
+
string pharmacy_name = 5;
|
|
176
|
+
|
|
177
|
+
int32 quantity = 6;
|
|
178
|
+
string unit_price = 7;
|
|
179
|
+
string total_price = 8;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
message CreateWebOrderRequest {
|
|
183
|
+
string customer_name = 1;
|
|
184
|
+
string phone = 2;
|
|
185
|
+
optional string comment = 3;
|
|
186
|
+
optional string city = 4;
|
|
187
|
+
optional string source = 5;
|
|
188
|
+
|
|
189
|
+
repeated CreateWebOrderItem items = 6;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
message ListWebOrdersRequest {
|
|
193
|
+
common.v1.PaginationRequest pagination = 1;
|
|
194
|
+
optional WebOrderStatus status = 2;
|
|
195
|
+
optional string phone = 3;
|
|
196
|
+
optional string order_number = 4;
|
|
197
|
+
optional string branch_id = 5;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
message ListWebOrdersResponse {
|
|
201
|
+
repeated WebOrder items = 1;
|
|
202
|
+
common.v1.PaginationMeta meta = 2;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
message UpdateWebOrderStatusRequest {
|
|
206
|
+
string id = 1;
|
|
207
|
+
WebOrderStatus status = 2;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
service WebReservationService {
|
|
211
|
+
rpc CreateWebReservation(CreateWebReservationRequest) returns (WebReservation);
|
|
212
|
+
rpc GetWebReservation(common.v1.IdRequest) returns (WebReservation);
|
|
213
|
+
rpc ListWebReservations(ListWebReservationsRequest) returns (ListWebReservationsResponse);
|
|
214
|
+
rpc UpdateWebReservationStatus(UpdateWebReservationStatusRequest) returns (WebReservation);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
service WebOrderService {
|
|
218
|
+
rpc CreateWebOrder(CreateWebOrderRequest) returns (WebOrder);
|
|
219
|
+
rpc GetWebOrder(common.v1.IdRequest) returns (WebOrder);
|
|
220
|
+
rpc GetWebOrderByNumber(GetWebOrderByNumberRequest) returns (WebOrder);
|
|
221
|
+
rpc ListWebOrders(ListWebOrdersRequest) returns (ListWebOrdersResponse);
|
|
222
|
+
rpc UpdateWebOrderStatus(UpdateWebOrderStatusRequest) returns (WebOrder);
|
|
223
|
+
rpc FulfillWebOrder(FulfillWebOrderRequest) returns (WebOrder);
|
|
224
|
+
}
|