Add delivery status and tracking details to user order

This commit is contained in:
masoodafar-web
2025-11-27 18:36:36 +03:30
parent 3e5f8348c2
commit ebd48c02a5
11 changed files with 139 additions and 42 deletions
@@ -59,12 +59,17 @@ message CreateNewUserOrderResponse
message UpdateUserOrderRequest
{
int64 id = 1;
// فیلدهای قدیمی (فعلاً برای سازگاری نگه داشته شده‌اند)
int64 price = 2;
int64 package_id = 3;
google.protobuf.Int64Value transaction_id = 4;
bool payment_status = 5;
google.protobuf.Timestamp payment_date = 6;
int64 user_id = 7;
// فیلدهای جدید مربوط به ارسال
int32 delivery_status = 8;
google.protobuf.StringValue tracking_code = 9;
google.protobuf.StringValue delivery_description = 10;
}
message DeleteUserOrderRequest
{
@@ -83,6 +88,22 @@ message GetUserOrderResponse
bool payment_status = 5;
google.protobuf.Timestamp payment_date = 6;
int64 user_id = 7;
// شناسه آدرس کاربر
google.protobuf.Int64Value user_address_id = 8;
// متن آدرس کاربر
google.protobuf.StringValue user_address_text = 9;
// جزئیات فاکتور
repeated FactorDetailModel factor_details = 10;
// وضعیت ارسال (مقدار عددی از DeliveryStatus در CMS)
int32 delivery_status = 11;
// کد رهگیری مرسوله
google.protobuf.StringValue tracking_code = 12;
// توضیحات وضعیت ارسال / نکات پستی
google.protobuf.StringValue delivery_description = 13;
// نام کامل کاربر
google.protobuf.StringValue user_full_name = 14;
// کدملی کاربر
google.protobuf.StringValue user_national_code = 15;
}
message GetAllUserOrderByFilterRequest
{
@@ -99,6 +120,7 @@ message GetAllUserOrderByFilterFilter
google.protobuf.BoolValue payment_status = 5;
google.protobuf.Timestamp payment_date = 6;
google.protobuf.Int64Value user_id = 7;
google.protobuf.Int64Value user_address_id = 8;
}
message GetAllUserOrderByFilterResponse
{
@@ -114,6 +136,31 @@ message GetAllUserOrderByFilterResponseModel
bool payment_status = 5;
google.protobuf.Timestamp payment_date = 6;
int64 user_id = 7;
// شناسه آدرس کاربر
google.protobuf.Int64Value user_address_id = 8;
// متن آدرس کاربر
google.protobuf.StringValue user_address_text = 9;
// وضعیت ارسال (مقدار عددی از DeliveryStatus در CMS)
int32 delivery_status = 10;
// کد رهگیری مرسوله
google.protobuf.StringValue tracking_code = 11;
// توضیحات وضعیت ارسال / نکات پستی
google.protobuf.StringValue delivery_description = 12;
// نام کامل کاربر
google.protobuf.StringValue user_full_name = 13;
// کدملی کاربر
google.protobuf.StringValue user_national_code = 14;
}
// جزئیات فاکتور سفارش
message FactorDetailModel
{
int64 product_id = 1;
string product_title = 2;
google.protobuf.StringValue product_thumbnail_path = 3;
google.protobuf.Int64Value unit_price = 4;
google.protobuf.Int32Value count = 5;
google.protobuf.Int64Value unit_discount_price = 6;
}
message PaginationState
@@ -8,14 +8,7 @@ public class UpdateUserOrderRequestValidator : AbstractValidator<UpdateUserOrder
{
RuleFor(model => model.Id)
.NotNull();
RuleFor(model => model.Price)
.NotNull();
RuleFor(model => model.PackageId)
.NotNull();
RuleFor(model => model.PaymentStatus)
.NotNull();
RuleFor(model => model.UserId)
.NotNull();
// بقیه فیلدها اختیاری هستند و فقط برای به‌روزرسانی وضعیت ارسال استفاده می‌شوند
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{