Add migration for DiscountProductImages table
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m53s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m53s
- Created a new table `DiscountProductImages` in the CMS schema. - Added columns for image details including `Title`, `AltText`, `ImagePath`, `ThumbnailPath`, `SortOrder`, `IsActive`, `Created`, `CreatedBy`, `LastModified`, `LastModifiedBy`, and `IsDeleted`. - Established a foreign key relationship with the `DiscountProducts` table. - Created indexes on `DiscountProductId` and a composite index on `DiscountProductId` and `SortOrder`.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.0.162</Version>
|
||||
<Version>0.0.164</Version>
|
||||
<DebugType>None</DebugType>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
|
||||
@@ -40,6 +40,20 @@ service DiscountOrderContract
|
||||
get: "/GetUserOrders"
|
||||
};
|
||||
};
|
||||
|
||||
// Admin: Get All Discount Orders with filters
|
||||
rpc GetAllDiscountOrders(GetAllDiscountOrdersRequest) returns (GetAllDiscountOrdersResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllDiscountOrders"
|
||||
};
|
||||
};
|
||||
|
||||
// Admin: Get Sales Report
|
||||
rpc GetDiscountSalesReport(GetDiscountSalesReportRequest) returns (GetDiscountSalesReportResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetDiscountSalesReport"
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
// Place Order (Initial Step - Create Order)
|
||||
@@ -175,3 +189,118 @@ message OrderSummaryDto
|
||||
int32 items_count = 9;
|
||||
google.protobuf.Timestamp created = 10;
|
||||
}
|
||||
|
||||
// ===== Admin: Get All Discount Orders =====
|
||||
|
||||
message GetAllDiscountOrdersRequest
|
||||
{
|
||||
google.protobuf.Int64Value user_id = 1;
|
||||
google.protobuf.Int32Value payment_status = 2;
|
||||
google.protobuf.Int32Value delivery_status = 3;
|
||||
google.protobuf.StringValue user_mobile = 4;
|
||||
google.protobuf.StringValue tracking_code = 5;
|
||||
google.protobuf.Timestamp from_date = 6;
|
||||
google.protobuf.Timestamp to_date = 7;
|
||||
google.protobuf.Int64Value min_amount = 8;
|
||||
google.protobuf.Int64Value max_amount = 9;
|
||||
int32 page_number = 10;
|
||||
int32 page_size = 11;
|
||||
}
|
||||
|
||||
message GetAllDiscountOrdersResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated AdminOrderDto models = 2;
|
||||
}
|
||||
|
||||
message AdminOrderDto
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
string user_full_name = 3;
|
||||
string user_mobile = 4;
|
||||
int64 total_amount = 5;
|
||||
int64 discount_balance_used = 6;
|
||||
int64 gateway_amount_paid = 7;
|
||||
int64 vat_amount = 8;
|
||||
PaymentStatus payment_status = 9;
|
||||
google.protobuf.Timestamp payment_date = 10;
|
||||
DeliveryStatus delivery_status = 11;
|
||||
google.protobuf.Timestamp delivery_date = 12;
|
||||
google.protobuf.StringValue shipping_address = 13;
|
||||
google.protobuf.StringValue receiver_name = 14;
|
||||
google.protobuf.StringValue receiver_mobile = 15;
|
||||
google.protobuf.StringValue tracking_code = 16;
|
||||
google.protobuf.StringValue admin_note = 17;
|
||||
google.protobuf.Timestamp created = 18;
|
||||
google.protobuf.Timestamp last_modified = 19;
|
||||
int32 items_count = 20;
|
||||
}
|
||||
|
||||
enum PaymentStatus
|
||||
{
|
||||
PAYMENT_PENDING = 0;
|
||||
PAYMENT_COMPLETED = 1;
|
||||
PAYMENT_FAILED = 2;
|
||||
PAYMENT_REFUNDED = 3;
|
||||
}
|
||||
|
||||
// ===== Sales Report Messages =====
|
||||
|
||||
enum SalesReportType
|
||||
{
|
||||
REPORT_SUMMARY = 0;
|
||||
REPORT_DAILY = 1;
|
||||
REPORT_WEEKLY = 2;
|
||||
REPORT_MONTHLY = 3;
|
||||
}
|
||||
|
||||
message GetDiscountSalesReportRequest
|
||||
{
|
||||
google.protobuf.Timestamp from_date = 1;
|
||||
google.protobuf.Timestamp to_date = 2;
|
||||
SalesReportType report_type = 3;
|
||||
}
|
||||
|
||||
message GetDiscountSalesReportResponse
|
||||
{
|
||||
SalesSummary summary = 1;
|
||||
repeated SalesPeriodDto periods = 2;
|
||||
repeated TopSellingProductDto top_products = 3;
|
||||
}
|
||||
|
||||
message SalesSummary
|
||||
{
|
||||
int32 total_orders = 1;
|
||||
int32 completed_orders = 2;
|
||||
int32 pending_orders = 3;
|
||||
int32 cancelled_orders = 4;
|
||||
int64 total_sales_amount = 5;
|
||||
int64 total_discount_used = 6;
|
||||
int64 total_gateway_paid = 7;
|
||||
int64 total_vat_amount = 8;
|
||||
int64 average_order_value = 9;
|
||||
int32 unique_customers = 10;
|
||||
int32 total_products_sold = 11;
|
||||
}
|
||||
|
||||
message SalesPeriodDto
|
||||
{
|
||||
string period_label = 1;
|
||||
google.protobuf.Timestamp period_start = 2;
|
||||
google.protobuf.Timestamp period_end = 3;
|
||||
int32 orders_count = 4;
|
||||
int64 total_amount = 5;
|
||||
int64 discount_used = 6;
|
||||
int64 gateway_paid = 7;
|
||||
}
|
||||
|
||||
message TopSellingProductDto
|
||||
{
|
||||
int64 product_id = 1;
|
||||
string product_title = 2;
|
||||
google.protobuf.StringValue image_path = 3;
|
||||
int32 quantity_sold = 4;
|
||||
int64 total_revenue = 5;
|
||||
int32 orders_count = 6;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,37 @@ service DiscountProductContract
|
||||
get: "/GetDiscountProducts"
|
||||
};
|
||||
};
|
||||
|
||||
// Product Image Gallery Operations
|
||||
rpc AddDiscountProductImage(AddDiscountProductImageRequest) returns (AddDiscountProductImageResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/AddDiscountProductImage"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateDiscountProductImage(UpdateDiscountProductImageRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateDiscountProductImage"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteDiscountProductImage(DeleteDiscountProductImageRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteDiscountProductImage"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc ReorderDiscountProductImages(ReorderDiscountProductImagesRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/ReorderDiscountProductImages"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetDiscountProductImages(GetDiscountProductImagesRequest) returns (GetDiscountProductImagesResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetDiscountProductImages"
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
// Create Product
|
||||
@@ -150,3 +181,68 @@ message DiscountProductDto
|
||||
bool is_active = 10;
|
||||
google.protobuf.Timestamp created = 11;
|
||||
}
|
||||
|
||||
// ===== Product Image Gallery Messages =====
|
||||
|
||||
// Add Product Image
|
||||
message AddDiscountProductImageRequest
|
||||
{
|
||||
int64 discount_product_id = 1;
|
||||
string image_path = 2;
|
||||
string thumbnail_path = 3;
|
||||
google.protobuf.StringValue title = 4;
|
||||
google.protobuf.StringValue alt_text = 5;
|
||||
}
|
||||
|
||||
message AddDiscountProductImageResponse
|
||||
{
|
||||
int64 image_id = 1;
|
||||
}
|
||||
|
||||
// Update Product Image
|
||||
message UpdateDiscountProductImageRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
string image_path = 2;
|
||||
string thumbnail_path = 3;
|
||||
google.protobuf.StringValue title = 4;
|
||||
google.protobuf.StringValue alt_text = 5;
|
||||
bool is_active = 6;
|
||||
}
|
||||
|
||||
// Delete Product Image
|
||||
message DeleteDiscountProductImageRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
// Reorder Product Images
|
||||
message ReorderDiscountProductImagesRequest
|
||||
{
|
||||
int64 discount_product_id = 1;
|
||||
repeated int64 image_ids = 2;
|
||||
}
|
||||
|
||||
// Get Product Images
|
||||
message GetDiscountProductImagesRequest
|
||||
{
|
||||
int64 discount_product_id = 1;
|
||||
bool only_active = 2;
|
||||
}
|
||||
|
||||
message GetDiscountProductImagesResponse
|
||||
{
|
||||
repeated DiscountProductImageDto images = 1;
|
||||
}
|
||||
|
||||
message DiscountProductImageDto
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 discount_product_id = 2;
|
||||
string image_path = 3;
|
||||
string thumbnail_path = 4;
|
||||
google.protobuf.StringValue title = 5;
|
||||
google.protobuf.StringValue alt_text = 6;
|
||||
int32 sort_order = 7;
|
||||
bool is_active = 8;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user