Complete FrontOffice BFF to CMS Migration
- Migrated all 9 services from FrontOffice.BFF to CMS architecture - Enhanced user.proto with 7 additional Customer API endpoints: * UpdateCustomerProfile, GetCustomerProfile * ChangeCustomerPassword with validation * GetCustomerReferrals with commission stats * UploadCustomerAvatar with file validation * GetCustomerSettings, UpdateCustomerSettings - All services now support Customer endpoints with /Customer/ prefix - Mock implementations with realistic Persian data - Fixed namespace conflicts and compilation issues - Comprehensive testing completed for all endpoints - Services migrated: Categories, City, UserCarts, Products, UserWallet, Transaction, UserOrder, Package, User (enhanced)
This commit is contained in:
@@ -79,6 +79,55 @@ service UserOrderContract
|
||||
get: "/CalculateOrderPV"
|
||||
};
|
||||
};
|
||||
|
||||
// ============= Customer-specific Methods =============
|
||||
|
||||
rpc CreateNewOrderForCustomer(CreateNewUserOrderRequest) returns (CreateNewUserOrderResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/CreateOrder"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc SubmitOrderForCustomer(SubmitShopBuyOrderRequest) returns (SubmitShopBuyOrderResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/SubmitOrder"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerOrders(GetAllUserOrderByFilterRequest) returns (GetAllUserOrderByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetOrders"
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetCustomerOrder(GetUserOrderRequest) returns (GetUserOrderResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetOrder"
|
||||
|
||||
};
|
||||
};
|
||||
rpc CustomerCancelOrder(CustomerCancelOrderRequest) returns (CustomerCancelOrderResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/CancelOrder"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerOrderHistory(GetCustomerOrderHistoryRequest) returns (GetCustomerOrderHistoryResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetOrderHistory"
|
||||
};
|
||||
};
|
||||
rpc CustomerTrackOrder(CustomerTrackOrderRequest) returns (CustomerTrackOrderResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/TrackOrder"
|
||||
};
|
||||
};
|
||||
rpc CustomerReorderPreviousOrder(CustomerReorderRequest) returns (CustomerReorderResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/Reorder"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewUserOrderRequest
|
||||
{
|
||||
@@ -348,6 +397,115 @@ message ApplyDiscountToOrderResponse
|
||||
int64 final_amount = 5;
|
||||
}
|
||||
|
||||
// ============= Customer Message Types =============
|
||||
|
||||
message CustomerCancelOrderRequest
|
||||
{
|
||||
int64 order_id = 1;
|
||||
string cancellation_reason = 2;
|
||||
}
|
||||
|
||||
message CustomerCancelOrderResponse
|
||||
{
|
||||
bool success = 1;
|
||||
string message = 2;
|
||||
int64 refund_amount = 3;
|
||||
string refund_transaction_id = 4;
|
||||
}
|
||||
|
||||
message GetCustomerOrderHistoryRequest
|
||||
{
|
||||
int64 user_id = 1;
|
||||
messages.PaginationState pagination_state = 2;
|
||||
OrderStatusEnum status_filter = 3;
|
||||
google.protobuf.Timestamp from_date = 4;
|
||||
google.protobuf.Timestamp to_date = 5;
|
||||
}
|
||||
|
||||
message GetCustomerOrderHistoryResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated CustomerOrderModel orders = 2;
|
||||
}
|
||||
|
||||
message CustomerTrackOrderRequest
|
||||
{
|
||||
int64 order_id = 1;
|
||||
}
|
||||
|
||||
message CustomerTrackOrderResponse
|
||||
{
|
||||
CustomerOrderModel order = 1;
|
||||
repeated OrderStatusHistory status_history = 2;
|
||||
DeliveryTrackingInfo delivery_info = 3;
|
||||
}
|
||||
|
||||
message CustomerReorderRequest
|
||||
{
|
||||
int64 original_order_id = 1;
|
||||
bool use_current_prices = 2;
|
||||
}
|
||||
|
||||
message CustomerReorderResponse
|
||||
{
|
||||
bool success = 1;
|
||||
string message = 2;
|
||||
int64 new_order_id = 3;
|
||||
int64 total_amount = 4;
|
||||
}
|
||||
|
||||
message CustomerOrderModel
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 amount = 2;
|
||||
int64 package_id = 3;
|
||||
string package_name = 4;
|
||||
OrderStatusEnum status = 5;
|
||||
string status_message = 6;
|
||||
google.protobuf.Timestamp order_date = 7;
|
||||
google.protobuf.Timestamp delivery_date = 8;
|
||||
string tracking_code = 9;
|
||||
int32 items_count = 10;
|
||||
bool can_cancel = 11;
|
||||
bool can_reorder = 12;
|
||||
}
|
||||
|
||||
message OrderStatusHistory
|
||||
{
|
||||
OrderStatusEnum status = 1;
|
||||
string status_message = 2;
|
||||
google.protobuf.Timestamp changed_at = 3;
|
||||
string changed_by = 4;
|
||||
}
|
||||
|
||||
message DeliveryTrackingInfo
|
||||
{
|
||||
string tracking_code = 1;
|
||||
string courier_name = 2;
|
||||
string estimated_delivery = 3;
|
||||
string current_location = 4;
|
||||
repeated DeliveryStep delivery_steps = 5;
|
||||
}
|
||||
|
||||
message DeliveryStep
|
||||
{
|
||||
string step_name = 1;
|
||||
string step_description = 2;
|
||||
google.protobuf.Timestamp step_time = 3;
|
||||
bool is_completed = 4;
|
||||
}
|
||||
|
||||
enum OrderStatusEnum
|
||||
{
|
||||
ORDER_STATUS_PENDING = 0;
|
||||
ORDER_STATUS_CONFIRMED = 1;
|
||||
ORDER_STATUS_PROCESSING = 2;
|
||||
ORDER_STATUS_SHIPPED = 3;
|
||||
ORDER_STATUS_DELIVERED = 4;
|
||||
ORDER_STATUS_CANCELLED = 5;
|
||||
ORDER_STATUS_REFUNDED = 6;
|
||||
}
|
||||
|
||||
message CalculateOrderPVRequest
|
||||
{
|
||||
int64 order_id = 1;
|
||||
|
||||
Reference in New Issue
Block a user