- Regenerate proto stubs from correct cqrs_services.proto file - Update GrpcCqrsApiClient to use DynamicQueryService and CommandService - Fix type conversions for deliveries, routes, and commands - Convert proto Timestamp to ISO8601 strings for model compatibility - Convert string amounts to doubles for delivery orders - Use Int64 for delivery IDs in gRPC commands Work in progress: Timestamp conversion extension needs finalization. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1496 lines
41 KiB
Protocol Buffer
1496 lines
41 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
option csharp_namespace = "PlanB.Route.Api.Grpc";
|
|
|
|
package cqrs;
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
// Command service for CQRS operations
|
|
service CommandService {
|
|
// CompleteDeliveryCommand operation
|
|
rpc CompleteDelivery (CompleteDeliveryCommandRequest) returns (CompleteDeliveryCommandResponse);
|
|
|
|
// MarkDeliveryAsUncompletedCommand operation
|
|
rpc MarkDeliveryAsUncompleted (MarkDeliveryAsUncompletedCommandRequest) returns (MarkDeliveryAsUncompletedCommandResponse);
|
|
|
|
// CreateDeliveryTerritoryCommand operation
|
|
rpc CreateDeliveryTerritory (CreateDeliveryTerritoryCommandRequest) returns (CreateDeliveryTerritoryCommandResponse);
|
|
|
|
// DeleteDeliveryTerritoryCommand operation
|
|
rpc DeleteDeliveryTerritory (DeleteDeliveryTerritoryCommandRequest) returns (DeleteDeliveryTerritoryCommandResponse);
|
|
|
|
// ReactivateDeliveryTerritoryCommand operation
|
|
rpc ReactivateDeliveryTerritory (ReactivateDeliveryTerritoryCommandRequest) returns (ReactivateDeliveryTerritoryCommandResponse);
|
|
|
|
// UpdateDeliveryTerritoryCommand operation
|
|
rpc UpdateDeliveryTerritory (UpdateDeliveryTerritoryCommandRequest) returns (UpdateDeliveryTerritoryCommandResponse);
|
|
|
|
// AddDeliveryZoneCommand operation
|
|
rpc AddDeliveryZone (AddDeliveryZoneCommandRequest) returns (AddDeliveryZoneCommandResponse);
|
|
|
|
// AutoFillZoneWaypointsCommand operation
|
|
rpc AutoFillZoneWaypoints (AutoFillZoneWaypointsCommandRequest) returns (AutoFillZoneWaypointsCommandResponse);
|
|
|
|
// DeleteDeliveryZoneCommand operation
|
|
rpc DeleteDeliveryZone (DeleteDeliveryZoneCommandRequest) returns (DeleteDeliveryZoneCommandResponse);
|
|
|
|
// ImportDeliveryZonesCommand operation
|
|
rpc ImportDeliveryZones (ImportDeliveryZonesCommandRequest) returns (ImportDeliveryZonesCommandResponse);
|
|
|
|
// ReassignDeliveryZoneCommand operation
|
|
rpc ReassignDeliveryZone (ReassignDeliveryZoneCommandRequest) returns (ReassignDeliveryZoneCommandResponse);
|
|
|
|
// RemoveDeliveryZoneCommand operation
|
|
rpc RemoveDeliveryZone (RemoveDeliveryZoneCommandRequest) returns (RemoveDeliveryZoneCommandResponse);
|
|
|
|
// ReorderZonePrioritiesCommand operation
|
|
rpc ReorderZonePriorities (ReorderZonePrioritiesCommandRequest) returns (ReorderZonePrioritiesCommandResponse);
|
|
|
|
// SetDeliveryZoneExitWaypointCommand operation
|
|
rpc SetDeliveryZoneExitWaypoint (SetDeliveryZoneExitWaypointCommandRequest) returns (SetDeliveryZoneExitWaypointCommandResponse);
|
|
|
|
// SetDeliveryZoneStartWaypointCommand operation
|
|
rpc SetDeliveryZoneStartWaypoint (SetDeliveryZoneStartWaypointCommandRequest) returns (SetDeliveryZoneStartWaypointCommandResponse);
|
|
|
|
// UpdateDeliveryZoneCommand operation
|
|
rpc UpdateDeliveryZone (UpdateDeliveryZoneCommandRequest) returns (UpdateDeliveryZoneCommandResponse);
|
|
|
|
// GenerateInvoicesReportCommand operation
|
|
rpc GenerateInvoicesReport (GenerateInvoicesReportCommandRequest) returns (GenerateInvoicesReportCommandResponse);
|
|
|
|
// DefineRouteRoutingCommand operation
|
|
rpc DefineRouteRouting (DefineRouteRoutingCommandRequest) returns (DefineRouteRoutingCommandResponse);
|
|
|
|
// DeleteRouteCommand operation
|
|
rpc DeleteRoute (DeleteRouteCommandRequest) returns (DeleteRouteCommandResponse);
|
|
|
|
// GenerateRouteHeatMapCommand operation
|
|
rpc GenerateRouteHeatMap (GenerateRouteHeatMapCommandRequest) returns (GenerateRouteHeatMapCommandResponse);
|
|
|
|
// ImportAdditionalStopsCommand operation
|
|
rpc ImportAdditionalStops (ImportAdditionalStopsCommandRequest) returns (ImportAdditionalStopsCommandResponse);
|
|
|
|
// ImportRouteFromCsvCommand operation
|
|
rpc ImportRouteFromCsv (ImportRouteFromCsvCommandRequest) returns (ImportRouteFromCsvCommandResponse);
|
|
|
|
// OptimizeRouteByZonesCommand operation
|
|
rpc OptimizeRouteByZones (OptimizeRouteByZonesCommandRequest) returns (OptimizeRouteByZonesCommandResponse);
|
|
|
|
// RecalculateRouteStatsCommand operation
|
|
rpc RecalculateRouteStats (RecalculateRouteStatsCommandRequest) returns (RecalculateRouteStatsCommandResponse);
|
|
|
|
// AssignZonesToRouteCommand operation
|
|
rpc AssignZonesToRoute (AssignZonesToRouteCommandRequest) returns (AssignZonesToRouteCommandResponse);
|
|
|
|
// UpdateRouteTerritoryCommand operation
|
|
rpc UpdateRouteTerritory (UpdateRouteTerritoryCommandRequest) returns (UpdateRouteTerritoryCommandResponse);
|
|
|
|
// AssignDeliveryToRouteFragmentCommand operation
|
|
rpc AssignDeliveryToRouteFragment (AssignDeliveryToRouteFragmentCommandRequest) returns (AssignDeliveryToRouteFragmentCommandResponse);
|
|
|
|
// FetchRouteFragmentRoutesCommand operation
|
|
rpc FetchRouteFragmentRoutes (FetchRouteFragmentRoutesCommandRequest) returns (FetchRouteFragmentRoutesCommandResponse);
|
|
|
|
// ReorderRouteFragmentDeliveriesCommand operation
|
|
rpc ReorderRouteFragmentDeliveries (ReorderRouteFragmentDeliveriesCommandRequest) returns (ReorderRouteFragmentDeliveriesCommandResponse);
|
|
|
|
// SkipDeliveryCommand operation
|
|
rpc SkipDelivery (SkipDeliveryCommandRequest) returns (SkipDeliveryCommandResponse);
|
|
|
|
// UploadDeliveryPictureCommand operation
|
|
rpc UploadDeliveryPicture (UploadDeliveryPictureCommandRequest) returns (UploadDeliveryPictureCommandResponse);
|
|
|
|
// AddUserCommand operation
|
|
rpc AddUser (AddUserCommandRequest) returns (AddUserCommandResponse);
|
|
|
|
// ResetUserPasswordCommand operation
|
|
rpc ResetUserPassword (ResetUserPasswordCommandRequest) returns (ResetUserPasswordCommandResponse);
|
|
|
|
// UpdatePasswordCommand operation
|
|
rpc UpdatePassword (UpdatePasswordCommandRequest) returns (UpdatePasswordCommandResponse);
|
|
|
|
// UpdateUserCommand operation
|
|
rpc UpdateUser (UpdateUserCommandRequest) returns (UpdateUserCommandResponse);
|
|
|
|
// FetchWooCommerceOrdersCommand operation
|
|
rpc FetchWooCommerceOrders (FetchWooCommerceOrdersCommandRequest) returns (FetchWooCommerceOrdersCommandResponse);
|
|
|
|
// GenerateRouteFromWooCommerceCommand operation
|
|
rpc GenerateRouteFromWooCommerce (GenerateRouteFromWooCommerceCommandRequest) returns (GenerateRouteFromWooCommerceCommandResponse);
|
|
|
|
// SyncWooCommerceOrdersCommand operation
|
|
rpc SyncWooCommerceOrders (SyncWooCommerceOrdersCommandRequest) returns (SyncWooCommerceOrdersCommandResponse);
|
|
|
|
}
|
|
|
|
// Query service for CQRS operations
|
|
service QueryService {
|
|
// DeliveriesByFragmentQuery operation
|
|
rpc DeliveriesByFragment (DeliveriesByFragmentQueryRequest) returns (DeliveriesByFragmentQueryResponse);
|
|
|
|
// UnassignedDeliveriesQuery operation
|
|
rpc UnassignedDeliveries (UnassignedDeliveriesQueryRequest) returns (UnassignedDeliveriesQueryResponse);
|
|
|
|
// HealthQuery operation
|
|
rpc Health (HealthQueryRequest) returns (HealthQueryResponse);
|
|
|
|
// DeliveryRouteQuery operation
|
|
rpc DeliveryRoute (DeliveryRouteQueryRequest) returns (DeliveryRouteQueryResponse);
|
|
|
|
// DownloadRouteCsvQuery operation
|
|
rpc DownloadRouteCsv (DownloadRouteCsvQueryRequest) returns (DownloadRouteCsvQueryResponse);
|
|
|
|
// RouteHeatMapQuery operation
|
|
rpc RouteHeatMap (RouteHeatMapQueryRequest) returns (RouteHeatMapQueryResponse);
|
|
|
|
// RoutesByTerritoryQuery operation
|
|
rpc RoutesByTerritory (RoutesByTerritoryQueryRequest) returns (RoutesByTerritoryQueryResponse);
|
|
|
|
// TerritoryWithZonesQuery operation
|
|
rpc TerritoryWithZones (TerritoryWithZonesQueryRequest) returns (TerritoryWithZonesQueryResponse);
|
|
|
|
// ValidatePointInZoneQuery operation
|
|
rpc ValidatePointInZone (ValidatePointInZoneQueryRequest) returns (ValidatePointInZoneQueryResponse);
|
|
|
|
// ZoneGeometryQuery operation
|
|
rpc ZoneGeometry (ZoneGeometryQueryRequest) returns (ZoneGeometryQueryResponse);
|
|
|
|
// RouteFragmentDeliveriesMappingQuery operation
|
|
rpc RouteFragmentDeliveriesMapping (RouteFragmentDeliveriesMappingQueryRequest) returns (RouteFragmentDeliveriesMappingQueryResponse);
|
|
|
|
// WooCommerceSyncStatusQuery operation
|
|
rpc WooCommerceSyncStatus (WooCommerceSyncStatusQueryRequest) returns (WooCommerceSyncStatusQueryResponse);
|
|
|
|
}
|
|
|
|
// DynamicQuery service for CQRS operations
|
|
service DynamicQueryService {
|
|
// Dynamic query for SimpleDeliveriesQueryItem
|
|
rpc QuerySimpleDeliveriesQueryItems (DynamicQuerySimpleDeliveriesQueryItemsRequest) returns (DynamicQuerySimpleDeliveriesQueryItemsResponse);
|
|
|
|
// Dynamic query for SimpleDeliveryRouteQueryItem
|
|
rpc QuerySimpleDeliveryRouteQueryItems (DynamicQuerySimpleDeliveryRouteQueryItemsRequest) returns (DynamicQuerySimpleDeliveryRouteQueryItemsResponse);
|
|
|
|
// Dynamic query for DeliveryTerritoryItem
|
|
rpc QueryDeliveryTerritoryItems (DynamicQueryDeliveryTerritoryItemsRequest) returns (DynamicQueryDeliveryTerritoryItemsResponse);
|
|
|
|
// Dynamic query for DeliveryZoneItem
|
|
rpc QueryDeliveryZoneItems (DynamicQueryDeliveryZoneItemsRequest) returns (DynamicQueryDeliveryZoneItemsResponse);
|
|
|
|
// Dynamic query for RouteItem
|
|
rpc QueryRouteItems (DynamicQueryRouteItemsRequest) returns (DynamicQueryRouteItemsResponse);
|
|
|
|
// Dynamic query for UserQueryItem
|
|
rpc QueryUserQueryItems (DynamicQueryUserQueryItemsRequest) returns (DynamicQueryUserQueryItemsResponse);
|
|
|
|
// Dynamic query for WooCommerceOrderItem
|
|
rpc QueryWooCommerceOrderItems (DynamicQueryWooCommerceOrderItemsRequest) returns (DynamicQueryWooCommerceOrderItemsResponse);
|
|
|
|
}
|
|
|
|
// InvoiceReportFilter enum
|
|
enum InvoiceReportFilter {
|
|
INVOICE_REPORT_FILTER_DELIVERY = 0;
|
|
INVOICE_REPORT_FILTER_OTHERS = 1;
|
|
INVOICE_REPORT_FILTER_ALL = 2;
|
|
}
|
|
|
|
// UserRole enum
|
|
enum UserRole {
|
|
USER_ROLE_OWNER = 0;
|
|
USER_ROLE_ADMIN = 1;
|
|
USER_ROLE_DELIVERYMAN = 2;
|
|
}
|
|
|
|
// Request message for CompleteDeliveryCommand
|
|
message CompleteDeliveryCommandRequest {
|
|
int64 delivery_id = 1;
|
|
google.protobuf.Timestamp delivered_at = 2;
|
|
}
|
|
|
|
// Response message for CompleteDeliveryCommand
|
|
message CompleteDeliveryCommandResponse {
|
|
}
|
|
|
|
// Request message for MarkDeliveryAsUncompletedCommand
|
|
message MarkDeliveryAsUncompletedCommandRequest {
|
|
int64 delivery_id = 1;
|
|
}
|
|
|
|
// Response message for MarkDeliveryAsUncompletedCommand
|
|
message MarkDeliveryAsUncompletedCommandResponse {
|
|
}
|
|
|
|
// Request message for CreateDeliveryTerritoryCommand
|
|
message CreateDeliveryTerritoryCommandRequest {
|
|
string name = 1;
|
|
string color = 2;
|
|
int32 priority = 3;
|
|
}
|
|
|
|
// Response message for CreateDeliveryTerritoryCommand
|
|
message CreateDeliveryTerritoryCommandResponse {
|
|
CreateDeliveryTerritoryCommandResult result = 1;
|
|
}
|
|
|
|
// CreateDeliveryTerritoryCommandResult entity
|
|
message CreateDeliveryTerritoryCommandResult {
|
|
int64 id = 1;
|
|
}
|
|
|
|
// Request message for DeleteDeliveryTerritoryCommand
|
|
message DeleteDeliveryTerritoryCommandRequest {
|
|
int64 id = 1;
|
|
}
|
|
|
|
// Response message for DeleteDeliveryTerritoryCommand
|
|
message DeleteDeliveryTerritoryCommandResponse {
|
|
}
|
|
|
|
// Request message for ReactivateDeliveryTerritoryCommand
|
|
message ReactivateDeliveryTerritoryCommandRequest {
|
|
int64 id = 1;
|
|
}
|
|
|
|
// Response message for ReactivateDeliveryTerritoryCommand
|
|
message ReactivateDeliveryTerritoryCommandResponse {
|
|
}
|
|
|
|
// Request message for UpdateDeliveryTerritoryCommand
|
|
message UpdateDeliveryTerritoryCommandRequest {
|
|
int64 id = 1;
|
|
string name = 2;
|
|
string color = 3;
|
|
int32 priority = 4;
|
|
}
|
|
|
|
// Response message for UpdateDeliveryTerritoryCommand
|
|
message UpdateDeliveryTerritoryCommandResponse {
|
|
}
|
|
|
|
// Request message for AddDeliveryZoneCommand
|
|
message AddDeliveryZoneCommandRequest {
|
|
string name = 1;
|
|
string color = 2;
|
|
NpgsqlPolygon polygon = 3;
|
|
string shipping_fee = 4;
|
|
google.protobuf.Timestamp shipping_schedule_start = 5;
|
|
google.protobuf.Timestamp shipping_schedule_end = 6;
|
|
}
|
|
|
|
// NpgsqlPolygon entity
|
|
message NpgsqlPolygon {
|
|
repeated NpgsqlPoint items = 1;
|
|
}
|
|
|
|
// NpgsqlPoint entity
|
|
message NpgsqlPoint {
|
|
double x = 1;
|
|
double y = 2;
|
|
}
|
|
|
|
// Response message for AddDeliveryZoneCommand
|
|
message AddDeliveryZoneCommandResponse {
|
|
}
|
|
|
|
// Request message for AutoFillZoneWaypointsCommand
|
|
message AutoFillZoneWaypointsCommandRequest {
|
|
int64 territory_id = 1;
|
|
bool overwrite_existing = 2;
|
|
}
|
|
|
|
// Response message for AutoFillZoneWaypointsCommand
|
|
message AutoFillZoneWaypointsCommandResponse {
|
|
AutoFillZoneWaypointsCommandResult result = 1;
|
|
}
|
|
|
|
// AutoFillZoneWaypointsCommandResult entity
|
|
message AutoFillZoneWaypointsCommandResult {
|
|
int32 updated_count = 1;
|
|
repeated ZoneWaypointUpdate updates = 2;
|
|
}
|
|
|
|
// ZoneWaypointUpdate entity
|
|
message ZoneWaypointUpdate {
|
|
int64 zone_id = 1;
|
|
string zone_name = 2;
|
|
GeoPoint new_start_waypoint = 3;
|
|
}
|
|
|
|
// GeoPoint entity
|
|
message GeoPoint {
|
|
double latitude = 1;
|
|
double longitude = 2;
|
|
}
|
|
|
|
// Request message for DeleteDeliveryZoneCommand
|
|
message DeleteDeliveryZoneCommandRequest {
|
|
int64 id = 1;
|
|
}
|
|
|
|
// Response message for DeleteDeliveryZoneCommand
|
|
message DeleteDeliveryZoneCommandResponse {
|
|
}
|
|
|
|
// Request message for ImportDeliveryZonesCommand
|
|
message ImportDeliveryZonesCommandRequest {
|
|
bytes file_stream = 1;
|
|
int64 delivery_territory_id = 2;
|
|
}
|
|
|
|
// Response message for ImportDeliveryZonesCommand
|
|
message ImportDeliveryZonesCommandResponse {
|
|
}
|
|
|
|
// Request message for ReassignDeliveryZoneCommand
|
|
message ReassignDeliveryZoneCommandRequest {
|
|
int64 zone_id = 1;
|
|
int64 new_delivery_territory_id = 2;
|
|
int32 new_priority = 3;
|
|
}
|
|
|
|
// Response message for ReassignDeliveryZoneCommand
|
|
message ReassignDeliveryZoneCommandResponse {
|
|
}
|
|
|
|
// Request message for RemoveDeliveryZoneCommand
|
|
message RemoveDeliveryZoneCommandRequest {
|
|
int64 delivery_zone_id = 1;
|
|
}
|
|
|
|
// Response message for RemoveDeliveryZoneCommand
|
|
message RemoveDeliveryZoneCommandResponse {
|
|
}
|
|
|
|
// Request message for ReorderZonePrioritiesCommand
|
|
message ReorderZonePrioritiesCommandRequest {
|
|
int64 delivery_territory_id = 1;
|
|
repeated ZonePriorityItem priorities = 2;
|
|
}
|
|
|
|
// ZonePriorityItem entity
|
|
message ZonePriorityItem {
|
|
int64 zone_id = 1;
|
|
int32 priority = 2;
|
|
}
|
|
|
|
// Response message for ReorderZonePrioritiesCommand
|
|
message ReorderZonePrioritiesCommandResponse {
|
|
}
|
|
|
|
// Request message for SetDeliveryZoneExitWaypointCommand
|
|
message SetDeliveryZoneExitWaypointCommandRequest {
|
|
int64 delivery_zone_id = 1;
|
|
double latitude = 2;
|
|
double longitude = 3;
|
|
}
|
|
|
|
// Response message for SetDeliveryZoneExitWaypointCommand
|
|
message SetDeliveryZoneExitWaypointCommandResponse {
|
|
}
|
|
|
|
// Request message for SetDeliveryZoneStartWaypointCommand
|
|
message SetDeliveryZoneStartWaypointCommandRequest {
|
|
int64 delivery_zone_id = 1;
|
|
double latitude = 2;
|
|
double longitude = 3;
|
|
}
|
|
|
|
// Response message for SetDeliveryZoneStartWaypointCommand
|
|
message SetDeliveryZoneStartWaypointCommandResponse {
|
|
}
|
|
|
|
// Request message for UpdateDeliveryZoneCommand
|
|
message UpdateDeliveryZoneCommandRequest {
|
|
int64 territory_id = 1;
|
|
int64 delivery_zone_id = 2;
|
|
NpgsqlPolygon polygon = 3;
|
|
string name = 4;
|
|
string color = 5;
|
|
int32 priority = 6;
|
|
bool is_reverse = 7;
|
|
bool start_from_warehouse = 8;
|
|
string shipping_fee = 9;
|
|
google.protobuf.Timestamp shipping_schedule_start = 10;
|
|
google.protobuf.Timestamp shipping_schedule_end = 11;
|
|
}
|
|
|
|
// Response message for UpdateDeliveryZoneCommand
|
|
message UpdateDeliveryZoneCommandResponse {
|
|
}
|
|
|
|
// Request message for GenerateInvoicesReportCommand
|
|
message GenerateInvoicesReportCommandRequest {
|
|
int64 route_id = 1;
|
|
InvoiceReportFilter filter = 2;
|
|
}
|
|
|
|
// Response message for GenerateInvoicesReportCommand
|
|
message GenerateInvoicesReportCommandResponse {
|
|
GenerateReportResult result = 1;
|
|
}
|
|
|
|
// GenerateReportResult entity
|
|
message GenerateReportResult {
|
|
int64 report_id = 1;
|
|
}
|
|
|
|
// Request message for DefineRouteRoutingCommand
|
|
message DefineRouteRoutingCommandRequest {
|
|
int64 route_id = 1;
|
|
repeated DefineFragment fragments = 2;
|
|
}
|
|
|
|
// DefineFragment entity
|
|
message DefineFragment {
|
|
int32 index = 1;
|
|
repeated int64 deliveries = 2;
|
|
string name = 3;
|
|
}
|
|
|
|
// Response message for DefineRouteRoutingCommand
|
|
message DefineRouteRoutingCommandResponse {
|
|
}
|
|
|
|
// Request message for DeleteRouteCommand
|
|
message DeleteRouteCommandRequest {
|
|
int64 route_id = 1;
|
|
}
|
|
|
|
// Response message for DeleteRouteCommand
|
|
message DeleteRouteCommandResponse {
|
|
}
|
|
|
|
// Request message for GenerateRouteHeatMapCommand
|
|
message GenerateRouteHeatMapCommandRequest {
|
|
int64 route_id = 1;
|
|
double cluster_radius_meters = 2;
|
|
google.protobuf.Timestamp period_start = 3;
|
|
google.protobuf.Timestamp period_end = 4;
|
|
bool clear_existing = 5;
|
|
}
|
|
|
|
// Response message for GenerateRouteHeatMapCommand
|
|
message GenerateRouteHeatMapCommandResponse {
|
|
}
|
|
|
|
// Request message for ImportAdditionalStopsCommand
|
|
message ImportAdditionalStopsCommandRequest {
|
|
int64 route_id = 1;
|
|
string file_name = 2;
|
|
bytes file_stream = 3;
|
|
string file_delimiter = 4;
|
|
}
|
|
|
|
// Response message for ImportAdditionalStopsCommand
|
|
message ImportAdditionalStopsCommandResponse {
|
|
ImportAdditionalStopsResult result = 1;
|
|
}
|
|
|
|
// ImportAdditionalStopsResult entity
|
|
message ImportAdditionalStopsResult {
|
|
int32 total_rows = 1;
|
|
int32 success_count = 2;
|
|
int32 failed_count = 3;
|
|
repeated ImportError errors = 4;
|
|
repeated CreatedStopItem created_stops = 5;
|
|
}
|
|
|
|
// ImportError entity
|
|
message ImportError {
|
|
int32 row_number = 1;
|
|
string field = 2;
|
|
string message = 3;
|
|
}
|
|
|
|
// CreatedStopItem entity
|
|
message CreatedStopItem {
|
|
int64 delivery_id = 1;
|
|
string address_line1 = 2;
|
|
string city = 3;
|
|
double latitude = 4;
|
|
double longitude = 5;
|
|
int32 order_count = 6;
|
|
}
|
|
|
|
// Request message for ImportRouteFromCsvCommand
|
|
message ImportRouteFromCsvCommandRequest {
|
|
string name = 1;
|
|
string file_name = 2;
|
|
bytes file_stream = 3;
|
|
string file_delimiter = 4;
|
|
int64 delivery_territory_id = 5;
|
|
int32 total_portions = 6;
|
|
int32 total_orders = 7;
|
|
string total_amount = 8;
|
|
string average_order_amount = 9;
|
|
int32 delivery_orders = 10;
|
|
int32 pickup_orders = 11;
|
|
string average_plate_amount = 12;
|
|
}
|
|
|
|
// Response message for ImportRouteFromCsvCommand
|
|
message ImportRouteFromCsvCommandResponse {
|
|
}
|
|
|
|
// Request message for OptimizeRouteByZonesCommand
|
|
message OptimizeRouteByZonesCommandRequest {
|
|
int64 route_id = 1;
|
|
int64 delivery_territory_id = 2;
|
|
}
|
|
|
|
// Response message for OptimizeRouteByZonesCommand
|
|
message OptimizeRouteByZonesCommandResponse {
|
|
}
|
|
|
|
// Request message for RecalculateRouteStatsCommand
|
|
message RecalculateRouteStatsCommandRequest {
|
|
int64 route_id = 1;
|
|
}
|
|
|
|
// Response message for RecalculateRouteStatsCommand
|
|
message RecalculateRouteStatsCommandResponse {
|
|
RecalculateRouteStatsCommandResult result = 1;
|
|
}
|
|
|
|
// RecalculateRouteStatsCommandResult entity
|
|
message RecalculateRouteStatsCommandResult {
|
|
int32 total_orders = 1;
|
|
int32 delivery_orders = 2;
|
|
int32 pickup_orders = 3;
|
|
int32 total_portions = 4;
|
|
string total_amount = 5;
|
|
string average_order_amount = 6;
|
|
string average_plate_amount = 7;
|
|
}
|
|
|
|
// Request message for AssignZonesToRouteCommand
|
|
message AssignZonesToRouteCommandRequest {
|
|
int64 route_id = 1;
|
|
repeated ZoneAssignment zones = 2;
|
|
}
|
|
|
|
// ZoneAssignment entity
|
|
message ZoneAssignment {
|
|
int64 delivery_zone_id = 1;
|
|
int32 index = 2;
|
|
}
|
|
|
|
// Response message for AssignZonesToRouteCommand
|
|
message AssignZonesToRouteCommandResponse {
|
|
}
|
|
|
|
// Request message for UpdateRouteTerritoryCommand
|
|
message UpdateRouteTerritoryCommandRequest {
|
|
int64 route_id = 1;
|
|
int64 delivery_territory_id = 2;
|
|
}
|
|
|
|
// Response message for UpdateRouteTerritoryCommand
|
|
message UpdateRouteTerritoryCommandResponse {
|
|
}
|
|
|
|
// Request message for AssignDeliveryToRouteFragmentCommand
|
|
message AssignDeliveryToRouteFragmentCommandRequest {
|
|
int64 delivery_id = 1;
|
|
int64 fragment_id = 2;
|
|
int32 position = 3;
|
|
bool recalculate_route = 4;
|
|
}
|
|
|
|
// Response message for AssignDeliveryToRouteFragmentCommand
|
|
message AssignDeliveryToRouteFragmentCommandResponse {
|
|
AssignDeliveryToRouteFragmentCommandResult result = 1;
|
|
}
|
|
|
|
// AssignDeliveryToRouteFragmentCommandResult entity
|
|
message AssignDeliveryToRouteFragmentCommandResult {
|
|
int64 delivery_id = 1;
|
|
int64 fragment_id = 2;
|
|
int32 new_position = 3;
|
|
string updated_polyline = 4;
|
|
}
|
|
|
|
// Request message for FetchRouteFragmentRoutesCommand
|
|
message FetchRouteFragmentRoutesCommandRequest {
|
|
int64 route_id = 1;
|
|
repeated int64 fragment_ids = 2;
|
|
}
|
|
|
|
// Response message for FetchRouteFragmentRoutesCommand
|
|
message FetchRouteFragmentRoutesCommandResponse {
|
|
FetchRouteFragmentRoutesCommandResult result = 1;
|
|
}
|
|
|
|
// FetchRouteFragmentRoutesCommandResult entity
|
|
message FetchRouteFragmentRoutesCommandResult {
|
|
repeated RouteFragmentRouteResult routes = 1;
|
|
}
|
|
|
|
// RouteFragmentRouteResult entity
|
|
message RouteFragmentRouteResult {
|
|
int64 fragment_id = 1;
|
|
string encoded_polyline = 2;
|
|
double total_distance_km = 3;
|
|
int32 total_duration_minutes = 4;
|
|
bool success = 5;
|
|
string error = 6;
|
|
}
|
|
|
|
// Request message for ReorderRouteFragmentDeliveriesCommand
|
|
message ReorderRouteFragmentDeliveriesCommandRequest {
|
|
int64 fragment_id = 1;
|
|
repeated int64 delivery_ids = 2;
|
|
bool recalculate_route = 3;
|
|
}
|
|
|
|
// Response message for ReorderRouteFragmentDeliveriesCommand
|
|
message ReorderRouteFragmentDeliveriesCommandResponse {
|
|
ReorderRouteFragmentDeliveriesCommandResult result = 1;
|
|
}
|
|
|
|
// ReorderRouteFragmentDeliveriesCommandResult entity
|
|
message ReorderRouteFragmentDeliveriesCommandResult {
|
|
int64 fragment_id = 1;
|
|
int32 reordered_count = 2;
|
|
string updated_polyline = 3;
|
|
}
|
|
|
|
// Request message for SkipDeliveryCommand
|
|
message SkipDeliveryCommandRequest {
|
|
int64 delivery_id = 1;
|
|
string description = 2;
|
|
google.protobuf.Timestamp skipped_at = 3;
|
|
}
|
|
|
|
// Response message for SkipDeliveryCommand
|
|
message SkipDeliveryCommandResponse {
|
|
}
|
|
|
|
// Request message for UploadDeliveryPictureCommand
|
|
message UploadDeliveryPictureCommandRequest {
|
|
int64 delivery_id = 1;
|
|
string file_name = 2;
|
|
bytes file = 3;
|
|
}
|
|
|
|
// Response message for UploadDeliveryPictureCommand
|
|
message UploadDeliveryPictureCommandResponse {
|
|
}
|
|
|
|
// Request message for AddUserCommand
|
|
message AddUserCommandRequest {
|
|
string first_name = 1;
|
|
string last_name = 2;
|
|
string email = 3;
|
|
UserRole role = 4;
|
|
bool email_notifications = 5;
|
|
}
|
|
|
|
// Response message for AddUserCommand
|
|
message AddUserCommandResponse {
|
|
}
|
|
|
|
// Request message for ResetUserPasswordCommand
|
|
message ResetUserPasswordCommandRequest {
|
|
int64 user_id = 1;
|
|
}
|
|
|
|
// Response message for ResetUserPasswordCommand
|
|
message ResetUserPasswordCommandResponse {
|
|
}
|
|
|
|
// Request message for UpdatePasswordCommand
|
|
message UpdatePasswordCommandRequest {
|
|
int64 user_id = 1;
|
|
string password = 2;
|
|
}
|
|
|
|
// Response message for UpdatePasswordCommand
|
|
message UpdatePasswordCommandResponse {
|
|
}
|
|
|
|
// Request message for UpdateUserCommand
|
|
message UpdateUserCommandRequest {
|
|
int64 user_id = 1;
|
|
string first_name = 2;
|
|
string last_name = 3;
|
|
string email = 4;
|
|
UserRole role = 5;
|
|
bool email_notifications = 6;
|
|
}
|
|
|
|
// Response message for UpdateUserCommand
|
|
message UpdateUserCommandResponse {
|
|
}
|
|
|
|
// Request message for FetchWooCommerceOrdersCommand
|
|
message FetchWooCommerceOrdersCommandRequest {
|
|
}
|
|
|
|
// Response message for FetchWooCommerceOrdersCommand
|
|
message FetchWooCommerceOrdersCommandResponse {
|
|
FetchWooCommerceOrdersResult result = 1;
|
|
}
|
|
|
|
// FetchWooCommerceOrdersResult entity
|
|
message FetchWooCommerceOrdersResult {
|
|
repeated WooCommerceOrderDisplay orders = 1;
|
|
FetchWooCommerceOrdersSummary summary = 2;
|
|
}
|
|
|
|
// WooCommerceOrderDisplay entity
|
|
message WooCommerceOrderDisplay {
|
|
int64 id = 1;
|
|
int64 woo_order_id = 2;
|
|
string order_number = 3;
|
|
string status = 4;
|
|
google.protobuf.Timestamp date_created = 5;
|
|
string customer_name = 6;
|
|
string customer_email = 7;
|
|
string customer_phone = 8;
|
|
string shipping_address = 9;
|
|
string shipping_city = 10;
|
|
string shipping_postcode = 11;
|
|
string subtotal = 12;
|
|
string total_tax = 13;
|
|
string discount_total = 14;
|
|
string shipping_total = 15;
|
|
string order_total = 16;
|
|
string net_amount = 17;
|
|
bool is_delivery = 18;
|
|
int32 total_portions = 19;
|
|
repeated WooCommerceOrderItemDisplay items = 20;
|
|
bool is_imported = 21;
|
|
int64 imported_to_route_id = 22;
|
|
}
|
|
|
|
// WooCommerceOrderItemDisplay entity
|
|
message WooCommerceOrderItemDisplay {
|
|
string product_name = 1;
|
|
int32 quantity = 2;
|
|
string total = 3;
|
|
int32 portion_count = 4;
|
|
}
|
|
|
|
// FetchWooCommerceOrdersSummary entity
|
|
message FetchWooCommerceOrdersSummary {
|
|
int32 total_orders = 1;
|
|
int32 delivery_orders = 2;
|
|
int32 pickup_orders = 3;
|
|
int32 total_portions = 4;
|
|
string total_net_amount = 5;
|
|
string average_order_amount = 6;
|
|
}
|
|
|
|
// Request message for GenerateRouteFromWooCommerceCommand
|
|
message GenerateRouteFromWooCommerceCommandRequest {
|
|
string route_name = 1;
|
|
repeated int64 woo_commerce_order_ids = 2;
|
|
int64 delivery_territory_id = 3;
|
|
}
|
|
|
|
// Response message for GenerateRouteFromWooCommerceCommand
|
|
message GenerateRouteFromWooCommerceCommandResponse {
|
|
GenerateRouteFromWooCommerceCommandResult result = 1;
|
|
}
|
|
|
|
// GenerateRouteFromWooCommerceCommandResult entity
|
|
message GenerateRouteFromWooCommerceCommandResult {
|
|
int64 route_id = 1;
|
|
int32 orders_imported = 2;
|
|
int32 deliveries_created = 3;
|
|
}
|
|
|
|
// Request message for SyncWooCommerceOrdersCommand
|
|
message SyncWooCommerceOrdersCommandRequest {
|
|
google.protobuf.Timestamp date_from = 1;
|
|
google.protobuf.Timestamp date_to = 2;
|
|
}
|
|
|
|
// Response message for SyncWooCommerceOrdersCommand
|
|
message SyncWooCommerceOrdersCommandResponse {
|
|
SyncWooCommerceOrdersCommandResult result = 1;
|
|
}
|
|
|
|
// SyncWooCommerceOrdersCommandResult entity
|
|
message SyncWooCommerceOrdersCommandResult {
|
|
int64 sync_log_id = 1;
|
|
int32 orders_fetched = 2;
|
|
int32 orders_created = 3;
|
|
int32 orders_updated = 4;
|
|
}
|
|
|
|
// Request message for DeliveriesByFragmentQuery
|
|
message DeliveriesByFragmentQueryRequest {
|
|
int64 route_fragment_id = 1;
|
|
}
|
|
|
|
// Response message for DeliveriesByFragmentQuery
|
|
message DeliveriesByFragmentQueryResponse {
|
|
DeliveriesByFragmentQueryResult result = 1;
|
|
}
|
|
|
|
// DeliveriesByFragmentQueryResult entity
|
|
message DeliveriesByFragmentQueryResult {
|
|
int64 fragment_id = 1;
|
|
string fragment_name = 2;
|
|
repeated FragmentDeliveryItem deliveries = 3;
|
|
}
|
|
|
|
// FragmentDeliveryItem entity
|
|
message FragmentDeliveryItem {
|
|
int64 id = 1;
|
|
int32 route_order_index = 2;
|
|
string encoded_polylines = 3;
|
|
google.protobuf.Timestamp delivered_at = 4;
|
|
google.protobuf.Timestamp skipped_at = 5;
|
|
string skipped_description = 6;
|
|
int64 delivery_address_id = 7;
|
|
string address_line1 = 8;
|
|
string city = 9;
|
|
string postal_code = 10;
|
|
double latitude = 11;
|
|
double longitude = 12;
|
|
int32 order_count = 13;
|
|
string total_amount = 14;
|
|
}
|
|
|
|
// Request message for UnassignedDeliveriesQuery
|
|
message UnassignedDeliveriesQueryRequest {
|
|
int64 route_id = 1;
|
|
}
|
|
|
|
// Response message for UnassignedDeliveriesQuery
|
|
message UnassignedDeliveriesQueryResponse {
|
|
UnassignedDeliveriesQueryResult result = 1;
|
|
}
|
|
|
|
// UnassignedDeliveriesQueryResult entity
|
|
message UnassignedDeliveriesQueryResult {
|
|
int64 route_id = 1;
|
|
repeated FragmentDeliveryItem deliveries = 2;
|
|
}
|
|
|
|
// Request message for HealthQuery
|
|
message HealthQueryRequest {
|
|
}
|
|
|
|
// Response message for HealthQuery
|
|
message HealthQueryResponse {
|
|
HealthQueryResult result = 1;
|
|
}
|
|
|
|
// HealthQueryResult entity
|
|
message HealthQueryResult {
|
|
bool api_status = 1;
|
|
bool database_status = 2;
|
|
string database_latency = 3;
|
|
bool route_optimization_status = 4;
|
|
string route_optimization_latency = 5;
|
|
bool geo_decoding_status = 6;
|
|
string geo_decoding_latency = 7;
|
|
}
|
|
|
|
// Request message for DeliveryRouteQuery
|
|
message DeliveryRouteQueryRequest {
|
|
int64 route_id = 1;
|
|
}
|
|
|
|
// Response message for DeliveryRouteQuery
|
|
message DeliveryRouteQueryResponse {
|
|
DeliveryRouteItem result = 1;
|
|
}
|
|
|
|
// DeliveryRouteItem entity
|
|
message DeliveryRouteItem {
|
|
int64 id = 1;
|
|
string name = 2;
|
|
GeoPoint warehouse_location = 3;
|
|
repeated DeliveryItem deliveries = 4;
|
|
repeated RouteFragmentItem fragments = 5;
|
|
int32 total_portions = 6;
|
|
int32 total_orders = 7;
|
|
string total_amount = 8;
|
|
string average_order_amount = 9;
|
|
int32 delivery_orders = 10;
|
|
int32 pickup_orders = 11;
|
|
string average_plate_amount = 12;
|
|
}
|
|
|
|
// DeliveryItem entity
|
|
message DeliveryItem {
|
|
int64 id = 1;
|
|
repeated OrderItem orders = 2;
|
|
DeliveryAddressItem delivery_address = 3;
|
|
int64 fragment_id = 4;
|
|
int32 route_order_index = 5;
|
|
}
|
|
|
|
// OrderItem entity
|
|
message OrderItem {
|
|
int64 id = 1;
|
|
string customer_name = 2;
|
|
}
|
|
|
|
// DeliveryAddressItem entity
|
|
message DeliveryAddressItem {
|
|
double latitude = 1;
|
|
double longitude = 2;
|
|
string formatted_address = 3;
|
|
}
|
|
|
|
// RouteFragmentItem entity
|
|
message RouteFragmentItem {
|
|
int64 id = 1;
|
|
int32 index = 2;
|
|
string name = 3;
|
|
}
|
|
|
|
// Request message for DownloadRouteCsvQuery
|
|
message DownloadRouteCsvQueryRequest {
|
|
int64 route_id = 1;
|
|
}
|
|
|
|
// Response message for DownloadRouteCsvQuery
|
|
message DownloadRouteCsvQueryResponse {
|
|
DownloadRouteCsvResult result = 1;
|
|
}
|
|
|
|
// DownloadRouteCsvResult entity
|
|
message DownloadRouteCsvResult {
|
|
bytes file_stream = 1;
|
|
string file_name = 2;
|
|
string content_type = 3;
|
|
}
|
|
|
|
// Request message for RouteHeatMapQuery
|
|
message RouteHeatMapQueryRequest {
|
|
int64 route_id = 1;
|
|
google.protobuf.Timestamp generated_after = 2;
|
|
}
|
|
|
|
// Response message for RouteHeatMapQuery
|
|
message RouteHeatMapQueryResponse {
|
|
RouteHeatMapResult result = 1;
|
|
}
|
|
|
|
// RouteHeatMapResult entity
|
|
message RouteHeatMapResult {
|
|
int64 route_id = 1;
|
|
repeated HeatMapPoint points = 2;
|
|
int32 total_points = 3;
|
|
int32 max_intensity = 4;
|
|
}
|
|
|
|
// HeatMapPoint entity
|
|
message HeatMapPoint {
|
|
double latitude = 1;
|
|
double longitude = 2;
|
|
int32 intensity = 3;
|
|
double cluster_radius_meters = 4;
|
|
google.protobuf.Timestamp generated_at = 5;
|
|
}
|
|
|
|
// Request message for RoutesByTerritoryQuery
|
|
message RoutesByTerritoryQueryRequest {
|
|
int64 territory_id = 1;
|
|
}
|
|
|
|
// Response message for RoutesByTerritoryQuery
|
|
message RoutesByTerritoryQueryResponse {
|
|
RoutesByTerritoryResult result = 1;
|
|
}
|
|
|
|
// RoutesByTerritoryResult entity
|
|
message RoutesByTerritoryResult {
|
|
int64 territory_id = 1;
|
|
string territory_name = 2;
|
|
repeated RoutesByTerritoryItem routes = 3;
|
|
}
|
|
|
|
// RoutesByTerritoryItem entity
|
|
message RoutesByTerritoryItem {
|
|
int64 id = 1;
|
|
string name = 2;
|
|
google.protobuf.Timestamp created_at = 3;
|
|
google.protobuf.Timestamp updated_at = 4;
|
|
google.protobuf.Timestamp optimized_at = 5;
|
|
int32 deliveries_count = 6;
|
|
repeated RouteZoneItem zones = 7;
|
|
}
|
|
|
|
// RouteZoneItem entity
|
|
message RouteZoneItem {
|
|
int64 id = 1;
|
|
string name = 2;
|
|
int32 index = 3;
|
|
}
|
|
|
|
// Request message for TerritoryWithZonesQuery
|
|
message TerritoryWithZonesQueryRequest {
|
|
int64 territory_id = 1;
|
|
}
|
|
|
|
// Response message for TerritoryWithZonesQuery
|
|
message TerritoryWithZonesQueryResponse {
|
|
TerritoryWithZonesResult result = 1;
|
|
}
|
|
|
|
// TerritoryWithZonesResult entity
|
|
message TerritoryWithZonesResult {
|
|
int64 id = 1;
|
|
string name = 2;
|
|
string color = 3;
|
|
google.protobuf.Timestamp created_at = 4;
|
|
google.protobuf.Timestamp updated_at = 5;
|
|
repeated TerritoryZoneItem zones = 6;
|
|
}
|
|
|
|
// TerritoryZoneItem entity
|
|
message TerritoryZoneItem {
|
|
int64 id = 1;
|
|
string name = 2;
|
|
string color = 3;
|
|
int32 priority = 4;
|
|
bool is_reverse = 5;
|
|
bool start_from_warehouse = 6;
|
|
NpgsqlPolygon polygon = 7;
|
|
GeoPoint start_waypoint = 8;
|
|
GeoPoint exit_waypoint = 9;
|
|
}
|
|
|
|
// Request message for ValidatePointInZoneQuery
|
|
message ValidatePointInZoneQueryRequest {
|
|
double latitude = 1;
|
|
double longitude = 2;
|
|
int64 zone_id = 3;
|
|
int64 territory_id = 4;
|
|
}
|
|
|
|
// Response message for ValidatePointInZoneQuery
|
|
message ValidatePointInZoneQueryResponse {
|
|
ValidatePointInZoneQueryResult result = 1;
|
|
}
|
|
|
|
// ValidatePointInZoneQueryResult entity
|
|
message ValidatePointInZoneQueryResult {
|
|
bool is_inside_zone = 1;
|
|
int64 matched_zone_id = 2;
|
|
string matched_zone_name = 3;
|
|
int32 matched_zone_priority = 4;
|
|
}
|
|
|
|
// Request message for ZoneGeometryQuery
|
|
message ZoneGeometryQueryRequest {
|
|
int64 zone_id = 1;
|
|
}
|
|
|
|
// Response message for ZoneGeometryQuery
|
|
message ZoneGeometryQueryResponse {
|
|
ZoneGeometryQueryResult result = 1;
|
|
}
|
|
|
|
// ZoneGeometryQueryResult entity
|
|
message ZoneGeometryQueryResult {
|
|
int64 id = 1;
|
|
string name = 2;
|
|
string color = 3;
|
|
int32 priority = 4;
|
|
repeated GeoPoint polygon = 5;
|
|
GeoPoint centroid = 6;
|
|
GeoPoint start_waypoint = 7;
|
|
GeoPoint exit_waypoint = 8;
|
|
BoundingBox bounding_box = 9;
|
|
}
|
|
|
|
// BoundingBox entity
|
|
message BoundingBox {
|
|
double min_lat = 1;
|
|
double max_lat = 2;
|
|
double min_lon = 3;
|
|
double max_lon = 4;
|
|
}
|
|
|
|
// Request message for RouteFragmentDeliveriesMappingQuery
|
|
message RouteFragmentDeliveriesMappingQueryRequest {
|
|
int64 route_id = 1;
|
|
}
|
|
|
|
// Response message for RouteFragmentDeliveriesMappingQuery
|
|
message RouteFragmentDeliveriesMappingQueryResponse {
|
|
RouteFragmentDeliveriesMappingQueryResult result = 1;
|
|
}
|
|
|
|
// RouteFragmentDeliveriesMappingQueryResult entity
|
|
message RouteFragmentDeliveriesMappingQueryResult {
|
|
int64 route_id = 1;
|
|
repeated RouteFragmentMapping fragments = 2;
|
|
}
|
|
|
|
// RouteFragmentMapping entity
|
|
message RouteFragmentMapping {
|
|
int64 fragment_id = 1;
|
|
int32 fragment_index = 2;
|
|
string fragment_name = 3;
|
|
string encoded_polyline = 4;
|
|
repeated RouteFragmentDelivery deliveries = 5;
|
|
}
|
|
|
|
// RouteFragmentDelivery entity
|
|
message RouteFragmentDelivery {
|
|
int64 delivery_id = 1;
|
|
int32 order_index = 2;
|
|
double latitude = 3;
|
|
double longitude = 4;
|
|
string address_line1 = 5;
|
|
string city = 6;
|
|
google.protobuf.Timestamp delivered_at = 7;
|
|
google.protobuf.Timestamp skipped_at = 8;
|
|
}
|
|
|
|
// Request message for WooCommerceSyncStatusQuery
|
|
message WooCommerceSyncStatusQueryRequest {
|
|
google.protobuf.Timestamp date_from = 1;
|
|
google.protobuf.Timestamp date_to = 2;
|
|
}
|
|
|
|
// Response message for WooCommerceSyncStatusQuery
|
|
message WooCommerceSyncStatusQueryResponse {
|
|
WooCommerceSyncStatusQueryResult result = 1;
|
|
}
|
|
|
|
// WooCommerceSyncStatusQueryResult entity
|
|
message WooCommerceSyncStatusQueryResult {
|
|
int32 total_orders_synced = 1;
|
|
int32 delivery_orders = 2;
|
|
int32 pickup_orders = 3;
|
|
int32 total_portions = 4;
|
|
string total_net_amount = 5;
|
|
google.protobuf.Timestamp last_sync_at = 6;
|
|
repeated WooCommerceSyncLogItem recent_syncs = 7;
|
|
}
|
|
|
|
// WooCommerceSyncLogItem entity
|
|
message WooCommerceSyncLogItem {
|
|
int64 id = 1;
|
|
google.protobuf.Timestamp sync_started_at = 2;
|
|
google.protobuf.Timestamp sync_completed_at = 3;
|
|
string date_from = 4;
|
|
string date_to = 5;
|
|
int32 orders_fetched = 6;
|
|
int32 orders_created = 7;
|
|
int32 orders_updated = 8;
|
|
string status = 9;
|
|
string error_message = 10;
|
|
}
|
|
|
|
// Dynamic query filter with AND/OR support
|
|
message DynamicQueryFilter {
|
|
string path = 1;
|
|
int32 type = 2; // PoweredSoft.DynamicQuery.Core.FilterType
|
|
string value = 3;
|
|
repeated DynamicQueryFilter and = 4;
|
|
repeated DynamicQueryFilter or = 5;
|
|
}
|
|
|
|
// Dynamic query sort
|
|
message DynamicQuerySort {
|
|
string path = 1;
|
|
bool ascending = 2;
|
|
}
|
|
|
|
// Dynamic query group
|
|
message DynamicQueryGroup {
|
|
string path = 1;
|
|
}
|
|
|
|
// Dynamic query aggregate
|
|
message DynamicQueryAggregate {
|
|
string path = 1;
|
|
int32 type = 2; // PoweredSoft.DynamicQuery.Core.AggregateType
|
|
}
|
|
|
|
// Dynamic query request for SimpleDeliveriesQueryItem
|
|
message DynamicQuerySimpleDeliveriesQueryItemsRequest {
|
|
int32 page = 1;
|
|
int32 page_size = 2;
|
|
repeated DynamicQueryFilter filters = 3;
|
|
repeated DynamicQuerySort sorts = 4;
|
|
repeated DynamicQueryGroup groups = 5;
|
|
repeated DynamicQueryAggregate aggregates = 6;
|
|
}
|
|
|
|
// Dynamic query response for SimpleDeliveriesQueryItem
|
|
message DynamicQuerySimpleDeliveriesQueryItemsResponse {
|
|
repeated SimpleDeliveriesQueryItem data = 1;
|
|
int64 total_records = 2;
|
|
int32 number_of_pages = 3;
|
|
}
|
|
|
|
// SimpleDeliveriesQueryItem entity
|
|
message SimpleDeliveriesQueryItem {
|
|
int64 id = 1;
|
|
int64 route_fragment_id = 2;
|
|
int32 delivery_index = 3;
|
|
repeated SimpleDeliveryOrder orders = 4;
|
|
SimpleUserInfo delivered_by = 5;
|
|
SimpleDeliveryAddress delivery_address = 6;
|
|
google.protobuf.Timestamp delivered_at = 7;
|
|
google.protobuf.Timestamp skipped_at = 8;
|
|
google.protobuf.Timestamp created_at = 9;
|
|
google.protobuf.Timestamp updated_at = 10;
|
|
bool delivered = 11;
|
|
bool has_been_skipped = 12;
|
|
bool is_skipped = 13;
|
|
string name = 14;
|
|
}
|
|
|
|
// SimpleDeliveryOrder entity
|
|
message SimpleDeliveryOrder {
|
|
int64 id = 1;
|
|
bool is_new_customer = 2;
|
|
string note = 3;
|
|
string total_amount = 4;
|
|
string total_paid = 5;
|
|
int32 total_items = 6;
|
|
repeated SimpleDeliveryContact contacts = 7;
|
|
SimpleDeliveryContact contact = 8;
|
|
}
|
|
|
|
// SimpleDeliveryContact entity
|
|
message SimpleDeliveryContact {
|
|
string first_name = 1;
|
|
string last_name = 2;
|
|
string phone_number = 3;
|
|
string full_name = 4;
|
|
}
|
|
|
|
// SimpleUserInfo entity
|
|
message SimpleUserInfo {
|
|
int64 id = 1;
|
|
string first_name = 2;
|
|
string last_name = 3;
|
|
string full_name = 4;
|
|
}
|
|
|
|
// SimpleDeliveryAddress entity
|
|
message SimpleDeliveryAddress {
|
|
int64 id = 1;
|
|
string line1 = 2;
|
|
string line2 = 3;
|
|
string postal_code = 4;
|
|
string city = 5;
|
|
string subdivision = 6;
|
|
string country_code = 7;
|
|
double latitude = 8;
|
|
double longitude = 9;
|
|
string formatted_address = 10;
|
|
}
|
|
|
|
// Dynamic query request for SimpleDeliveryRouteQueryItem
|
|
message DynamicQuerySimpleDeliveryRouteQueryItemsRequest {
|
|
int32 page = 1;
|
|
int32 page_size = 2;
|
|
repeated DynamicQueryFilter filters = 3;
|
|
repeated DynamicQuerySort sorts = 4;
|
|
repeated DynamicQueryGroup groups = 5;
|
|
repeated DynamicQueryAggregate aggregates = 6;
|
|
}
|
|
|
|
// Dynamic query response for SimpleDeliveryRouteQueryItem
|
|
message DynamicQuerySimpleDeliveryRouteQueryItemsResponse {
|
|
repeated SimpleDeliveryRouteQueryItem data = 1;
|
|
int64 total_records = 2;
|
|
int32 number_of_pages = 3;
|
|
}
|
|
|
|
// SimpleDeliveryRouteQueryItem entity
|
|
message SimpleDeliveryRouteQueryItem {
|
|
int64 id = 1;
|
|
int64 route_id = 2;
|
|
string name = 3;
|
|
string route_name = 4;
|
|
int32 deliveries_count = 5;
|
|
int32 delivered_count = 6;
|
|
bool completed = 7;
|
|
google.protobuf.Timestamp created_at = 8;
|
|
}
|
|
|
|
// Dynamic query request for DeliveryTerritoryItem
|
|
message DynamicQueryDeliveryTerritoryItemsRequest {
|
|
int32 page = 1;
|
|
int32 page_size = 2;
|
|
repeated DynamicQueryFilter filters = 3;
|
|
repeated DynamicQuerySort sorts = 4;
|
|
repeated DynamicQueryGroup groups = 5;
|
|
repeated DynamicQueryAggregate aggregates = 6;
|
|
}
|
|
|
|
// Dynamic query response for DeliveryTerritoryItem
|
|
message DynamicQueryDeliveryTerritoryItemsResponse {
|
|
repeated DeliveryTerritoryItem data = 1;
|
|
int64 total_records = 2;
|
|
int32 number_of_pages = 3;
|
|
}
|
|
|
|
// DeliveryTerritoryItem entity
|
|
message DeliveryTerritoryItem {
|
|
int64 id = 1;
|
|
string name = 2;
|
|
string color = 3;
|
|
int32 priority = 4;
|
|
google.protobuf.Timestamp created_at = 5;
|
|
google.protobuf.Timestamp updated_at = 6;
|
|
int32 zone_count = 7;
|
|
bool is_active = 8;
|
|
google.protobuf.Timestamp deactivated_at = 9;
|
|
}
|
|
|
|
// Dynamic query request for DeliveryZoneItem
|
|
message DynamicQueryDeliveryZoneItemsRequest {
|
|
int32 page = 1;
|
|
int32 page_size = 2;
|
|
repeated DynamicQueryFilter filters = 3;
|
|
repeated DynamicQuerySort sorts = 4;
|
|
repeated DynamicQueryGroup groups = 5;
|
|
repeated DynamicQueryAggregate aggregates = 6;
|
|
}
|
|
|
|
// Dynamic query response for DeliveryZoneItem
|
|
message DynamicQueryDeliveryZoneItemsResponse {
|
|
repeated DeliveryZoneItem data = 1;
|
|
int64 total_records = 2;
|
|
int32 number_of_pages = 3;
|
|
}
|
|
|
|
// DeliveryZoneItem entity
|
|
message DeliveryZoneItem {
|
|
int64 id = 1;
|
|
string name = 2;
|
|
string color = 3;
|
|
int32 priority = 4;
|
|
bool is_reverse = 5;
|
|
bool start_from_warehouse = 6;
|
|
NpgsqlPolygon polygon = 7;
|
|
string shipping_fee = 8;
|
|
google.protobuf.Timestamp shipping_schedule_start = 9;
|
|
google.protobuf.Timestamp shipping_schedule_end = 10;
|
|
GeoPoint start_waypoint = 11;
|
|
GeoPoint exit_waypoint = 12;
|
|
google.protobuf.Timestamp created_at = 13;
|
|
google.protobuf.Timestamp updated_at = 14;
|
|
int64 delivery_territory_id = 15;
|
|
string delivery_territory_name = 16;
|
|
}
|
|
|
|
// Dynamic query request for RouteItem
|
|
message DynamicQueryRouteItemsRequest {
|
|
int32 page = 1;
|
|
int32 page_size = 2;
|
|
repeated DynamicQueryFilter filters = 3;
|
|
repeated DynamicQuerySort sorts = 4;
|
|
repeated DynamicQueryGroup groups = 5;
|
|
repeated DynamicQueryAggregate aggregates = 6;
|
|
}
|
|
|
|
// Dynamic query response for RouteItem
|
|
message DynamicQueryRouteItemsResponse {
|
|
repeated RouteItem data = 1;
|
|
int64 total_records = 2;
|
|
int32 number_of_pages = 3;
|
|
}
|
|
|
|
// RouteItem entity
|
|
message RouteItem {
|
|
int64 id = 1;
|
|
string name = 2;
|
|
int32 deliveries_count = 3;
|
|
google.protobuf.Timestamp optimized_at = 4;
|
|
google.protobuf.Timestamp created_at = 5;
|
|
google.protobuf.Timestamp updated_at = 6;
|
|
int32 fragments_count = 7;
|
|
repeated int64 fragment_ids = 8;
|
|
int64 delivery_territory_id = 9;
|
|
string delivery_territory_name = 10;
|
|
repeated RouteZoneItem zones = 11;
|
|
int32 total_portions = 12;
|
|
int32 total_orders = 13;
|
|
string total_amount = 14;
|
|
string average_order_amount = 15;
|
|
int32 delivery_orders = 16;
|
|
int32 pickup_orders = 17;
|
|
string average_plate_amount = 18;
|
|
}
|
|
|
|
// Dynamic query request for UserQueryItem
|
|
message DynamicQueryUserQueryItemsRequest {
|
|
int32 page = 1;
|
|
int32 page_size = 2;
|
|
repeated DynamicQueryFilter filters = 3;
|
|
repeated DynamicQuerySort sorts = 4;
|
|
repeated DynamicQueryGroup groups = 5;
|
|
repeated DynamicQueryAggregate aggregates = 6;
|
|
}
|
|
|
|
// Dynamic query response for UserQueryItem
|
|
message DynamicQueryUserQueryItemsResponse {
|
|
repeated UserQueryItem data = 1;
|
|
int64 total_records = 2;
|
|
int32 number_of_pages = 3;
|
|
}
|
|
|
|
// UserQueryItem entity
|
|
message UserQueryItem {
|
|
int64 id = 1;
|
|
string first_name = 2;
|
|
string last_name = 3;
|
|
string email = 4;
|
|
string subject_id = 5;
|
|
UserRole role = 6;
|
|
bool email_notifications = 7;
|
|
google.protobuf.Timestamp created_at = 8;
|
|
}
|
|
|
|
// Dynamic query request for WooCommerceOrderItem
|
|
message DynamicQueryWooCommerceOrderItemsRequest {
|
|
int32 page = 1;
|
|
int32 page_size = 2;
|
|
repeated DynamicQueryFilter filters = 3;
|
|
repeated DynamicQuerySort sorts = 4;
|
|
repeated DynamicQueryGroup groups = 5;
|
|
repeated DynamicQueryAggregate aggregates = 6;
|
|
}
|
|
|
|
// Dynamic query response for WooCommerceOrderItem
|
|
message DynamicQueryWooCommerceOrderItemsResponse {
|
|
repeated WooCommerceOrderItem data = 1;
|
|
int64 total_records = 2;
|
|
int32 number_of_pages = 3;
|
|
}
|
|
|
|
// WooCommerceOrderItem entity
|
|
message WooCommerceOrderItem {
|
|
int64 id = 1;
|
|
int64 woo_order_id = 2;
|
|
string order_number = 3;
|
|
string status = 4;
|
|
google.protobuf.Timestamp date_created = 5;
|
|
string customer_name = 6;
|
|
string customer_email = 7;
|
|
string shipping_city = 8;
|
|
string shipping_postcode = 9;
|
|
string subtotal = 10;
|
|
string total_tax = 11;
|
|
string discount_total = 12;
|
|
string order_total = 13;
|
|
string net_amount = 14;
|
|
int32 total_portions = 15;
|
|
bool is_delivery = 16;
|
|
bool is_imported = 17;
|
|
int64 imported_to_route_id = 18;
|
|
google.protobuf.Timestamp synced_at = 19;
|
|
}
|
|
|