@prodoctors/contracts 1.1.4 → 1.1.5

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/gen/sales.ts CHANGED
@@ -221,6 +221,48 @@ export interface ListSaleOrdersResponse {
221
221
  meta: PaginationMeta | undefined;
222
222
  }
223
223
 
224
+ export interface CashierSalesSummaryRequest {
225
+ shiftId: string;
226
+ }
227
+
228
+ export interface CashierSalesPaymentSummary {
229
+ paymentMethod: PaymentMethod;
230
+ totalOrders: number;
231
+ totalAmount: string;
232
+ paidAmount: string;
233
+ changeAmount: string;
234
+ }
235
+
236
+ export interface CashierSalesProductSummary {
237
+ productId: string;
238
+ productName: string;
239
+ sku?: string | undefined;
240
+ totalQuantity: number;
241
+ totalBaseQuantity: number;
242
+ totalAmount: string;
243
+ }
244
+
245
+ export interface CashierSalesSummaryResponse {
246
+ shiftId: string;
247
+ branchId: string;
248
+ cashierId: string;
249
+ terminalId: string;
250
+ status: string;
251
+ openedAt: Timestamp | undefined;
252
+ closedAt?: Timestamp | undefined;
253
+ totalOrders: number;
254
+ totalQuantity: number;
255
+ totalBaseQuantity: number;
256
+ subtotal: string;
257
+ discountAmount: string;
258
+ taxAmount: string;
259
+ totalAmount: string;
260
+ paidAmount: string;
261
+ changeAmount: string;
262
+ paymentMethods: CashierSalesPaymentSummary[];
263
+ products: CashierSalesProductSummary[];
264
+ }
265
+
224
266
  export interface CreateSaleReturnItemInput {
225
267
  productId: string;
226
268
  productBatchId: string;
@@ -323,6 +365,8 @@ export interface SaleOrderServiceClient {
323
365
 
324
366
  listSaleOrders(request: ListSaleOrdersRequest): Observable<ListSaleOrdersResponse>;
325
367
 
368
+ getCashierSalesSummary(request: CashierSalesSummaryRequest): Observable<CashierSalesSummaryResponse>;
369
+
326
370
  deleteSaleOrder(request: IdRequest): Observable<BoolResponse>;
327
371
  }
328
372
 
@@ -337,6 +381,10 @@ export interface SaleOrderServiceController {
337
381
  request: ListSaleOrdersRequest,
338
382
  ): Promise<ListSaleOrdersResponse> | Observable<ListSaleOrdersResponse> | ListSaleOrdersResponse;
339
383
 
384
+ getCashierSalesSummary(
385
+ request: CashierSalesSummaryRequest,
386
+ ): Promise<CashierSalesSummaryResponse> | Observable<CashierSalesSummaryResponse> | CashierSalesSummaryResponse;
387
+
340
388
  deleteSaleOrder(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
341
389
  }
342
390
 
@@ -347,6 +395,7 @@ export function SaleOrderServiceControllerMethods() {
347
395
  "updateSaleOrder",
348
396
  "getSaleOrderById",
349
397
  "listSaleOrders",
398
+ "getCashierSalesSummary",
350
399
  "deleteSaleOrder",
351
400
  ];
352
401
  for (const method of grpcMethods) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prodoctors/contracts",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Protobuf definitions and generated Typescript types for ProDoctors",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/sales.proto CHANGED
@@ -210,6 +210,48 @@ message ListSaleOrdersResponse {
210
210
  common.v1.PaginationMeta meta = 2;
211
211
  }
212
212
 
213
+ message CashierSalesSummaryRequest {
214
+ string shift_id = 1;
215
+ }
216
+
217
+ message CashierSalesPaymentSummary {
218
+ PaymentMethod payment_method = 1;
219
+ int32 total_orders = 2;
220
+ string total_amount = 3;
221
+ string paid_amount = 4;
222
+ string change_amount = 5;
223
+ }
224
+
225
+ message CashierSalesProductSummary {
226
+ string product_id = 1;
227
+ string product_name = 2;
228
+ optional string sku = 3;
229
+ int32 total_quantity = 4;
230
+ int32 total_base_quantity = 5;
231
+ string total_amount = 6;
232
+ }
233
+
234
+ message CashierSalesSummaryResponse {
235
+ string shift_id = 1;
236
+ string branch_id = 2;
237
+ string cashier_id = 3;
238
+ string terminal_id = 4;
239
+ string status = 5;
240
+ google.protobuf.Timestamp opened_at = 6;
241
+ optional google.protobuf.Timestamp closed_at = 7;
242
+ int32 total_orders = 8;
243
+ int32 total_quantity = 9;
244
+ int32 total_base_quantity = 10;
245
+ string subtotal = 11;
246
+ string discount_amount = 12;
247
+ string tax_amount = 13;
248
+ string total_amount = 14;
249
+ string paid_amount = 15;
250
+ string change_amount = 16;
251
+ repeated CashierSalesPaymentSummary payment_methods = 17;
252
+ repeated CashierSalesProductSummary products = 18;
253
+ }
254
+
213
255
  message CreateSaleReturnItemInput {
214
256
  string product_id = 1;
215
257
  string product_batch_id = 2;
@@ -306,6 +348,7 @@ service SaleOrderService {
306
348
  rpc UpdateSaleOrder(UpdateSaleOrderRequest) returns (SaleOrder);
307
349
  rpc GetSaleOrderById(common.v1.IdRequest) returns (SaleOrder);
308
350
  rpc ListSaleOrders(ListSaleOrdersRequest) returns (ListSaleOrdersResponse);
351
+ rpc GetCashierSalesSummary(CashierSalesSummaryRequest) returns (CashierSalesSummaryResponse);
309
352
  rpc DeleteSaleOrder(common.v1.IdRequest) returns (common.v1.BoolResponse);
310
353
  }
311
354