feat: integrate PYMS payment gateway, add blog/sitepage/image services, local file manager
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m44s

Payment Gateway:
- Add PYMSPaymentService: IPaymentGatewayService via gRPC to PYMS microservice
- Add ZarinPalPaymentService: direct ZarinPal integration (backup)
- Register 'pyms' payment provider in DI ConfigureServices
- Add PYMS proto files (pyms_transaction.proto, pyms_public_messages.proto)
- Fix VerifyDiscountWalletCharge: pass 'OK' as status instead of Authority
- Update appsettings: PaymentProvider=pyms, sandbox mode, merchant ID

Blog System:
- Add BlogCategory, BlogPost, BlogPostImage entities and CQRS
- Add proto files and gRPC services for blog management
- Add Mapster profiles for blog responses

Content Management:
- Add SitePage entity and CQRS for static pages
- Add proto and gRPC service for site pages

Image/File Management:
- Add LocalFileManager with disk storage + base64 serving + FMS fallback
- Add ImagePathResolverInterceptor for gRPC responses
- Add ImageResolverService for explicit image resolution
- Add UploadsController for public file serving with FMS fallback
- Add PaymentCallbackController for discount order payment callbacks

Database:
- Add blog and content entity migrations
- Remove ImagePath MaxLength constraints
- Remove old FileManagementService (replaced by LocalFileManager)
This commit is contained in:
masoodafar-web
2026-02-15 23:01:16 +03:30
parent 5a4e4a960d
commit 2502cbbda2
177 changed files with 16632 additions and 487 deletions
@@ -0,0 +1,115 @@
syntax = "proto3";
package blogcategory;
import "public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.BlogCategory";
service BlogCategoryContract
{
rpc CreateBlogCategory(CreateBlogCategoryRequest) returns (CreateBlogCategoryResponse){
option (google.api.http) = { post: "/CreateBlogCategory" body: "*" };
};
rpc UpdateBlogCategory(UpdateBlogCategoryRequest) returns (google.protobuf.Empty){
option (google.api.http) = { put: "/UpdateBlogCategory" body: "*" };
};
rpc DeleteBlogCategory(DeleteBlogCategoryRequest) returns (google.protobuf.Empty){
option (google.api.http) = { delete: "/DeleteBlogCategory" body: "*" };
};
rpc GetBlogCategory(GetBlogCategoryRequest) returns (GetBlogCategoryResponse){
option (google.api.http) = { get: "/GetBlogCategory" };
};
rpc GetAllBlogCategories(GetAllBlogCategoriesRequest) returns (GetAllBlogCategoriesResponse){
option (google.api.http) = { get: "/GetAllBlogCategories" };
};
rpc GetActiveBlogCategories(GetActiveBlogCategoriesRequest) returns (GetActiveBlogCategoriesResponse){
option (google.api.http) = { get: "/GetActiveBlogCategories" };
};
}
// ── Create ──
message CreateBlogCategoryRequest
{
string title = 1;
string slug = 2;
google.protobuf.StringValue description = 3;
google.protobuf.StringValue icon_name = 4;
int32 sort_order = 5;
bool is_active = 6;
}
message CreateBlogCategoryResponse
{
int64 id = 1;
}
// ── Update ──
message UpdateBlogCategoryRequest
{
int64 id = 1;
string title = 2;
string slug = 3;
google.protobuf.StringValue description = 4;
google.protobuf.StringValue icon_name = 5;
int32 sort_order = 6;
bool is_active = 7;
}
// ── Delete ──
message DeleteBlogCategoryRequest
{
int64 id = 1;
}
// ── Get ──
message GetBlogCategoryRequest
{
int64 id = 1;
}
message GetBlogCategoryResponse
{
int64 id = 1;
string title = 2;
string slug = 3;
google.protobuf.StringValue description = 4;
google.protobuf.StringValue icon_name = 5;
int32 sort_order = 6;
bool is_active = 7;
int32 post_count = 8;
google.protobuf.Timestamp created = 9;
}
// ── Get All (Admin) ──
message GetAllBlogCategoriesRequest
{
messages.PaginationState pagination_state = 1;
google.protobuf.StringValue sort_by = 2;
}
message GetAllBlogCategoriesResponse
{
messages.MetaData meta_data = 1;
repeated BlogCategoryListItem models = 2;
}
message BlogCategoryListItem
{
int64 id = 1;
string title = 2;
string slug = 3;
google.protobuf.StringValue description = 4;
google.protobuf.StringValue icon_name = 5;
int32 sort_order = 6;
bool is_active = 7;
int32 post_count = 8;
}
// ── Get Active (Customer) ──
message GetActiveBlogCategoriesRequest {}
message GetActiveBlogCategoriesResponse
{
repeated BlogCategoryListItem categories = 1;
}
@@ -0,0 +1,221 @@
syntax = "proto3";
package blogpost;
import "public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.BlogPost";
service BlogPostContract
{
rpc CreateBlogPost(CreateBlogPostRequest) returns (CreateBlogPostResponse){
option (google.api.http) = { post: "/CreateBlogPost" body: "*" };
};
rpc UpdateBlogPost(UpdateBlogPostRequest) returns (google.protobuf.Empty){
option (google.api.http) = { put: "/UpdateBlogPost" body: "*" };
};
rpc DeleteBlogPost(DeleteBlogPostRequest) returns (google.protobuf.Empty){
option (google.api.http) = { delete: "/DeleteBlogPost" body: "*" };
};
rpc GetBlogPost(GetBlogPostRequest) returns (GetBlogPostResponse){
option (google.api.http) = { get: "/GetBlogPost" };
};
rpc GetBlogPostBySlug(GetBlogPostBySlugRequest) returns (GetBlogPostResponse){
option (google.api.http) = { get: "/GetBlogPostBySlug" };
};
rpc GetAllBlogPosts(GetAllBlogPostsRequest) returns (GetAllBlogPostsResponse){
option (google.api.http) = { get: "/GetAllBlogPosts" };
};
rpc GetPublishedBlogPosts(GetPublishedBlogPostsRequest) returns (GetAllBlogPostsResponse){
option (google.api.http) = { get: "/GetPublishedBlogPosts" };
};
rpc GetFeaturedBlogPosts(GetFeaturedBlogPostsRequest) returns (GetAllBlogPostsResponse){
option (google.api.http) = { get: "/GetFeaturedBlogPosts" };
};
rpc PublishBlogPost(PublishBlogPostRequest) returns (PublishBlogPostResponse){
option (google.api.http) = { post: "/PublishBlogPost" body: "*" };
};
rpc ArchiveBlogPost(ArchiveBlogPostRequest) returns (ArchiveBlogPostResponse){
option (google.api.http) = { post: "/ArchiveBlogPost" body: "*" };
};
rpc IncrementViewCount(IncrementViewCountRequest) returns (google.protobuf.Empty){
option (google.api.http) = { post: "/IncrementViewCount" body: "*" };
};
}
// ── Create ──
message CreateBlogPostRequest
{
string title = 1;
string slug = 2;
google.protobuf.StringValue summary = 3;
string html_content = 4;
google.protobuf.StringValue featured_image_path = 5;
google.protobuf.StringValue featured_image_thumbnail_path = 6;
repeated int64 category_ids = 7;
repeated int64 tag_ids = 8;
bool is_featured = 9;
int32 sort_order = 10;
BlogImageFileModel image_file = 11;
}
message CreateBlogPostResponse
{
int64 id = 1;
}
// ── Update ──
message UpdateBlogPostRequest
{
int64 id = 1;
string title = 2;
string slug = 3;
google.protobuf.StringValue summary = 4;
string html_content = 5;
google.protobuf.StringValue featured_image_path = 6;
google.protobuf.StringValue featured_image_thumbnail_path = 7;
repeated int64 category_ids = 8;
repeated int64 tag_ids = 9;
bool is_featured = 10;
int32 sort_order = 11;
BlogImageFileModel image_file = 12;
}
// ── Delete ──
message DeleteBlogPostRequest
{
int64 id = 1;
}
// ── Get Single ──
message GetBlogPostRequest
{
int64 id = 1;
}
message GetBlogPostBySlugRequest
{
string slug = 1;
}
message GetBlogPostResponse
{
int64 id = 1;
string title = 2;
string slug = 3;
google.protobuf.StringValue summary = 4;
string html_content = 5;
google.protobuf.StringValue featured_image_path = 6;
google.protobuf.StringValue featured_image_thumbnail_path = 7;
int32 status = 8;
string status_name = 9;
google.protobuf.Timestamp published_at = 10;
int32 view_count = 11;
int64 author_user_id = 12;
bool is_featured = 13;
int32 sort_order = 14;
google.protobuf.Timestamp created = 15;
google.protobuf.Timestamp last_modified = 16;
repeated BlogPostCategoryInfo categories = 17;
repeated BlogPostTagInfo tags = 18;
}
message BlogPostCategoryInfo
{
int64 id = 1;
string title = 2;
string slug = 3;
}
message BlogPostTagInfo
{
int64 id = 1;
string title = 2;
string name = 3;
}
// ── Get All (Admin) ──
message GetAllBlogPostsRequest
{
messages.PaginationState pagination_state = 1;
google.protobuf.StringValue sort_by = 2;
GetAllBlogPostsFilter filter = 3;
}
message GetAllBlogPostsFilter
{
google.protobuf.StringValue search_term = 1;
google.protobuf.Int32Value status = 2;
google.protobuf.Int64Value category_id = 3;
google.protobuf.BoolValue is_featured = 4;
}
message GetAllBlogPostsResponse
{
messages.MetaData meta_data = 1;
repeated BlogPostListItem models = 2;
}
message BlogPostListItem
{
int64 id = 1;
string title = 2;
string slug = 3;
google.protobuf.StringValue summary = 4;
google.protobuf.StringValue featured_image_thumbnail_path = 5;
int32 status = 6;
string status_name = 7;
google.protobuf.Timestamp published_at = 8;
int32 view_count = 9;
bool is_featured = 10;
google.protobuf.Timestamp created = 11;
repeated BlogPostCategoryInfo categories = 12;
}
// ── Get Published (Customer) ──
message GetPublishedBlogPostsRequest
{
messages.PaginationState pagination_state = 1;
google.protobuf.StringValue search_term = 2;
google.protobuf.Int64Value category_id = 3;
}
// ── Get Featured ──
message GetFeaturedBlogPostsRequest
{
int32 count = 1;
}
// ── Publish ──
message PublishBlogPostRequest
{
int64 id = 1;
}
message PublishBlogPostResponse
{
bool success = 1;
string message = 2;
google.protobuf.Timestamp published_at = 3;
}
// ── Archive ──
message ArchiveBlogPostRequest
{
int64 id = 1;
}
message ArchiveBlogPostResponse
{
bool success = 1;
string message = 2;
}
// ── View Count ──
message IncrementViewCountRequest
{
int64 id = 1;
}
// ── File upload model for binary image uploads from BackOffice ──
message BlogImageFileModel
{
bytes file = 1;
string mime = 2;
string file_name = 3;
}
@@ -0,0 +1,80 @@
syntax = "proto3";
package blogpostimage;
import "public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.BlogPostImage";
service BlogPostImageContract
{
rpc AddBlogPostImage(AddBlogPostImageRequest) returns (AddBlogPostImageResponse){
option (google.api.http) = { post: "/AddBlogPostImage" body: "*" };
};
rpc DeleteBlogPostImage(DeleteBlogPostImageRequest) returns (google.protobuf.Empty){
option (google.api.http) = { delete: "/DeleteBlogPostImage" body: "*" };
};
rpc GetBlogPostImages(GetBlogPostImagesRequest) returns (GetBlogPostImagesResponse){
option (google.api.http) = { get: "/GetBlogPostImages" };
};
rpc ReorderBlogPostImages(ReorderBlogPostImagesRequest) returns (google.protobuf.Empty){
option (google.api.http) = { put: "/ReorderBlogPostImages" body: "*" };
};
}
// ── Add ──
message AddBlogPostImageRequest
{
int64 blog_post_id = 1;
string image_path = 2;
string thumbnail_path = 3;
google.protobuf.StringValue alt_text = 4;
google.protobuf.StringValue caption = 5;
int32 sort_order = 6;
}
message AddBlogPostImageResponse
{
int64 id = 1;
}
// ── Delete ──
message DeleteBlogPostImageRequest
{
int64 id = 1;
}
// ── Get All for Post ──
message GetBlogPostImagesRequest
{
int64 blog_post_id = 1;
}
message GetBlogPostImagesResponse
{
repeated BlogPostImageItem images = 1;
}
message BlogPostImageItem
{
int64 id = 1;
int64 blog_post_id = 2;
string image_path = 3;
string thumbnail_path = 4;
google.protobuf.StringValue alt_text = 5;
google.protobuf.StringValue caption = 6;
int32 sort_order = 7;
}
// ── Reorder ──
message ReorderBlogPostImagesRequest
{
repeated ImageSortItem items = 1;
}
message ImageSortItem
{
int64 id = 1;
int32 sort_order = 2;
}
@@ -136,6 +136,8 @@ message GetAllCategoryByFilterResponseModel
google.protobuf.Int64Value parent_id = 6;
bool is_active = 7;
int32 sort_order = 8;
// تعداد محصولات این دسته‌بندی
int32 product_count = 9;
}
message GetAllCategoriesRequest {
messages.PaginationState pagination_state = 1;
@@ -348,8 +348,8 @@ message UserWeeklyBalanceModel
// GetAllWeeklyPools Query
message GetAllWeeklyPoolsRequest
{
google.protobuf.StringValue from_week = 1; // Format: "YYYY-Www" (optional)
google.protobuf.StringValue to_week = 2; // Format: "YYYY-Www" (optional)
google.protobuf.Int64Value from_week_definition_id = 1; // WeekDefinitionId filter (optional)
google.protobuf.Int64Value to_week_definition_id = 2; // WeekDefinitionId filter (optional)
google.protobuf.BoolValue only_calculated = 3; // Only show calculated pools
int32 page_index = 4;
int32 page_size = 5;
@@ -158,6 +158,9 @@ message OrderItemDto
int64 total_price = 6;
int64 discount_amount = 7;
int64 final_price = 8;
// آدرس تصویر محصول
string image_path = 9;
string thumbnail_path = 10;
}
// Get User Orders
@@ -0,0 +1,31 @@
syntax = "proto3";
package imageresolver;
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.ImageResolver";
service ImageResolverContract
{
// تبدیل لیست مسیرهای تصویر به base64 data-URI
rpc ResolveImages(ResolveImagesRequest) returns (ResolveImagesResponse){
option (google.api.http) = { post: "/ResolveImages" body: "*" };
};
}
message ResolveImagesRequest
{
repeated string paths = 1;
}
message ResolveImagesResponse
{
repeated ResolvedImage images = 1;
}
message ResolvedImage
{
string original_path = 1;
string data_uri = 2;
}
@@ -36,6 +36,7 @@ message CreateNewOtpTokenRequest
{
string mobile = 1;
string purpose = 2;
google.protobuf.StringValue sign_guid = 3;
}
message CreateNewOtpTokenResponse
{
@@ -228,6 +228,7 @@ message GetAllProductsByFilterFilter
google.protobuf.Int32Value view_count = 12;
google.protobuf.Int32Value remaining_count = 13;
google.protobuf.Int64Value category_id = 14;
google.protobuf.BoolValue is_active = 15;
}
message GetAllProductsByFilterResponse
{
@@ -251,6 +252,8 @@ message GetAllProductsByFilterResponseModel
int32 remaining_count = 13;
// لیست شناسه دسته‌بندی‌های محصول
repeated int64 category_ids = 14;
// وضعیت فعال/غیرفعال (معکوس IsDeleted)
bool is_active = 15;
}
message GetCustomerProductsByFilterResponse
@@ -0,0 +1,41 @@
syntax = "proto3";
package pyms_messages;
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.PYMS";
service PYMSPublicMessageContract{}
message PaginationState
{
int32 page_number = 1;
int32 page_size = 2;
}
message MetaData
{
int64 current_page = 1;
int64 total_page = 2;
int64 page_size = 3;
int64 total_count = 4;
bool has_previous = 5;
bool has_next = 6;
}
message DecimalValue
{
int64 units = 1;
sfixed32 nanos = 2;
}
enum TransactionTypeEnum
{
Real = 0;
Sandbox = 1;
}
enum CurrencyEnum
{
IRR = 0;
IRT = 1;
}
@@ -0,0 +1,279 @@
syntax = "proto3";
package pyms_transaction;
import "pyms/pyms_public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.PYMS.Transaction";
service TransactionContract
{
rpc CreateNewTransaction(CreateNewTransactionRequest) returns (CreateNewTransactionResponse){
option (google.api.http) = {
post: "/CreateNewTransaction"
body: "*"
};
};
rpc UpdateTransaction(UpdateTransactionRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
put: "/UpdateTransaction"
body: "*"
};
};
rpc DeleteTransaction(DeleteTransactionRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
delete: "/DeleteTransaction"
body: "*"
};
};
rpc GetTransaction(GetTransactionRequest) returns (GetTransactionResponse){
option (google.api.http) = {
get: "/GetTransaction"
};
};
rpc GetAllTransactionByFilter(GetAllTransactionByFilterRequest) returns (GetAllTransactionByFilterResponse){
option (google.api.http) = {
get: "/GetAllTransactionByFilter"
};
};
rpc PaymentRequest(PaymentRequestRequest) returns (PaymentRequestResponse){
option (google.api.http) = {
post: "/PaymentRequest"
body: "*"
};
};
rpc PaymentVerification(PaymentVerificationRequest) returns (PaymentVerificationResponse){
option (google.api.http) = {
post: "/PaymentVerification"
body: "*"
};
};
}
message CreateNewTransactionRequest
{
string merchant_id = 1;
int64 amount = 2;
string callback_url = 3;
string description = 4;
google.protobuf.StringValue mobile = 5;
google.protobuf.StringValue email = 6;
google.protobuf.Int32Value request_status_code = 7;
google.protobuf.StringValue request_status_message = 8;
google.protobuf.StringValue authority = 9;
google.protobuf.StringValue fee_type = 10;
google.protobuf.Int64Value fee = 11;
oneof Currency_item
{
pyms_messages.CurrencyEnum currency = 12;
}
bool payment_status = 13;
google.protobuf.Int32Value verification_status_code = 14;
google.protobuf.StringValue verification_status_message = 15;
google.protobuf.StringValue card_hash = 16;
google.protobuf.StringValue card_pan = 17;
google.protobuf.StringValue ref_id = 18;
google.protobuf.StringValue order_id = 19;
oneof Type_item
{
pyms_messages.TransactionTypeEnum type = 20;
}
}
message CreateNewTransactionResponse
{
int64 id = 1;
}
message UpdateTransactionRequest
{
int64 id = 1;
string merchant_id = 2;
int64 amount = 3;
string callback_url = 4;
string description = 5;
google.protobuf.StringValue mobile = 6;
google.protobuf.StringValue email = 7;
google.protobuf.Int32Value request_status_code = 8;
google.protobuf.StringValue request_status_message = 9;
google.protobuf.StringValue authority = 10;
google.protobuf.StringValue fee_type = 11;
google.protobuf.Int64Value fee = 12;
oneof Currency_item
{
pyms_messages.CurrencyEnum currency = 13;
}
bool payment_status = 14;
google.protobuf.Int32Value verification_status_code = 15;
google.protobuf.StringValue verification_status_message = 16;
google.protobuf.StringValue card_hash = 17;
google.protobuf.StringValue card_pan = 18;
google.protobuf.StringValue ref_id = 19;
google.protobuf.StringValue order_id = 20;
oneof Type_item
{
pyms_messages.TransactionTypeEnum type = 21;
}
}
message DeleteTransactionRequest
{
int64 id = 1;
}
message GetTransactionRequest
{
google.protobuf.Int64Value id = 1;
google.protobuf.StringValue authority = 2;
}
message GetTransactionResponse
{
int64 id = 1;
string merchant_id = 2;
int64 amount = 3;
string callback_url = 4;
string description = 5;
google.protobuf.StringValue mobile = 6;
google.protobuf.StringValue email = 7;
google.protobuf.Int32Value request_status_code = 8;
google.protobuf.StringValue request_status_message = 9;
google.protobuf.StringValue authority = 10;
google.protobuf.StringValue fee_type = 11;
google.protobuf.Int64Value fee = 12;
oneof Currency_item
{
pyms_messages.CurrencyEnum currency = 13;
}
bool payment_status = 14;
google.protobuf.Int32Value verification_status_code = 15;
google.protobuf.StringValue verification_status_message = 16;
google.protobuf.StringValue card_hash = 17;
google.protobuf.StringValue card_pan = 18;
google.protobuf.StringValue ref_id = 19;
google.protobuf.StringValue order_id = 20;
oneof Type_item
{
pyms_messages.TransactionTypeEnum type = 21;
}
}
message GetAllTransactionByFilterRequest
{
pyms_messages.PaginationState pagination_state = 1;
google.protobuf.StringValue sort_by = 2;
GetAllTransactionByFilterFilter filter = 3;
}
message GetAllTransactionByFilterFilter
{
google.protobuf.Int64Value id = 1;
google.protobuf.StringValue merchant_id = 2;
google.protobuf.Int64Value amount = 3;
google.protobuf.StringValue callback_url = 4;
google.protobuf.StringValue description = 5;
google.protobuf.StringValue mobile = 6;
google.protobuf.StringValue email = 7;
google.protobuf.Int32Value request_status_code = 8;
google.protobuf.StringValue request_status_message = 9;
google.protobuf.StringValue authority = 10;
google.protobuf.StringValue fee_type = 11;
google.protobuf.Int64Value fee = 12;
oneof Currency_item
{
pyms_messages.CurrencyEnum currency = 13;
}
google.protobuf.BoolValue payment_status = 14;
google.protobuf.Int32Value verification_status_code = 15;
google.protobuf.StringValue verification_status_message = 16;
google.protobuf.StringValue card_hash = 17;
google.protobuf.StringValue card_pan = 18;
google.protobuf.StringValue ref_id = 19;
google.protobuf.StringValue order_id = 20;
oneof Type_item
{
pyms_messages.TransactionTypeEnum type = 21;
}
}
message GetAllTransactionByFilterResponse
{
pyms_messages.MetaData meta_data = 1;
repeated GetAllTransactionByFilterResponseModel models = 2;
}
message GetAllTransactionByFilterResponseModel
{
int64 id = 1;
string merchant_id = 2;
int64 amount = 3;
string callback_url = 4;
string description = 5;
google.protobuf.StringValue mobile = 6;
google.protobuf.StringValue email = 7;
google.protobuf.Int32Value request_status_code = 8;
google.protobuf.StringValue request_status_message = 9;
google.protobuf.StringValue authority = 10;
google.protobuf.StringValue fee_type = 11;
google.protobuf.Int64Value fee = 12;
oneof Currency_item
{
pyms_messages.CurrencyEnum currency = 13;
}
bool payment_status = 14;
google.protobuf.Int32Value verification_status_code = 15;
google.protobuf.StringValue verification_status_message = 16;
google.protobuf.StringValue card_hash = 17;
google.protobuf.StringValue card_pan = 18;
google.protobuf.StringValue ref_id = 19;
google.protobuf.StringValue order_id = 20;
oneof Type_item
{
pyms_messages.TransactionTypeEnum type = 21;
}
}
message PaymentRequestRequest
{
google.protobuf.StringValue merchant_id = 1;
int64 amount = 2;
string callback_url = 3;
google.protobuf.StringValue description = 4;
google.protobuf.StringValue mobile = 5;
google.protobuf.StringValue email = 6;
oneof Currency_item
{
pyms_messages.CurrencyEnum currency = 7;
}
oneof Type_item
{
pyms_messages.TransactionTypeEnum type = 8;
}
google.protobuf.StringValue order_id = 9;
}
message PaymentRequestResponse
{
string payment_g_w_url = 1;
}
message PaymentVerificationRequest
{
string authority = 1;
string status = 2;
}
message PaymentVerificationResponse
{
int64 id = 1;
bool payment_status = 2;
string message = 3;
google.protobuf.StringValue ref_id = 4;
google.protobuf.StringValue order_id = 5;
google.protobuf.Int32Value verification_status_code = 6;
}
@@ -0,0 +1,195 @@
syntax = "proto3";
package sitepage;
import "public_messages.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.SitePage";
service SitePageContract
{
rpc GetSitePage(GetSitePageRequest) returns (GetSitePageResponse){
option (google.api.http) = { get: "/GetSitePage" };
};
rpc GetSitePageByKey(GetSitePageByKeyRequest) returns (GetSitePageResponse){
option (google.api.http) = { get: "/GetSitePageByKey" };
};
rpc CreateSitePage(CreateSitePageRequest) returns (CreateSitePageResponse){
option (google.api.http) = { post: "/CreateSitePage" body: "*" };
};
rpc UpdateSitePage(UpdateSitePageRequest) returns (google.protobuf.Empty){
option (google.api.http) = { put: "/UpdateSitePage" body: "*" };
};
rpc DeleteSitePage(DeleteSitePageRequest) returns (google.protobuf.Empty){
option (google.api.http) = { delete: "/DeleteSitePage" body: "*" };
};
rpc GetAllSitePages(GetAllSitePagesRequest) returns (GetAllSitePagesResponse){
option (google.api.http) = { get: "/GetAllSitePages" };
};
rpc CreateSitePageSection(CreateSitePageSectionRequest) returns (CreateSitePageSectionResponse){
option (google.api.http) = { post: "/CreateSitePageSection" body: "*" };
};
rpc UpdateSitePageSection(UpdateSitePageSectionRequest) returns (google.protobuf.Empty){
option (google.api.http) = { put: "/UpdateSitePageSection" body: "*" };
};
rpc DeleteSitePageSection(DeleteSitePageSectionRequest) returns (google.protobuf.Empty){
option (google.api.http) = { delete: "/DeleteSitePageSection" body: "*" };
};
rpc ReorderSitePageSections(ReorderSitePageSectionsRequest) returns (google.protobuf.Empty){
option (google.api.http) = { put: "/ReorderSitePageSections" body: "*" };
};
}
// ── Get Site Page ──
message GetSitePageRequest
{
int64 id = 1;
}
message GetSitePageByKeyRequest
{
string page_key = 1;
}
message GetSitePageResponse
{
int64 id = 1;
string page_key = 2;
string title = 3;
google.protobuf.StringValue meta_description = 4;
google.protobuf.StringValue hero_title = 5;
google.protobuf.StringValue hero_subtitle = 6;
google.protobuf.StringValue hero_image_path = 7;
bool is_active = 8;
repeated SitePageSectionItem sections = 9;
}
message SitePageSectionItem
{
int64 id = 1;
string section_key = 2;
string title = 3;
google.protobuf.StringValue subtitle = 4;
google.protobuf.StringValue html_content = 5;
google.protobuf.StringValue icon_name = 6;
google.protobuf.StringValue image_path = 7;
google.protobuf.StringValue image_thumbnail_path = 8;
int32 sort_order = 9;
bool is_active = 10;
google.protobuf.StringValue extra_data = 11;
}
// ── Update Site Page ──
message UpdateSitePageRequest
{
int64 id = 1;
string title = 2;
google.protobuf.StringValue meta_description = 3;
google.protobuf.StringValue hero_title = 4;
google.protobuf.StringValue hero_subtitle = 5;
google.protobuf.StringValue hero_image_path = 6;
bool is_active = 7;
SitePageImageFileModel image_file = 8;
}
// ── Get All ──
message GetAllSitePagesRequest {}
message GetAllSitePagesResponse
{
repeated SitePageSummary pages = 1;
}
message SitePageSummary
{
int64 id = 1;
string page_key = 2;
string title = 3;
bool is_active = 4;
int32 section_count = 5;
google.protobuf.Timestamp last_modified = 6;
}
// ── Create Section ──
message CreateSitePageSectionRequest
{
int64 site_page_id = 1;
string section_key = 2;
string title = 3;
google.protobuf.StringValue subtitle = 4;
google.protobuf.StringValue html_content = 5;
google.protobuf.StringValue icon_name = 6;
google.protobuf.StringValue image_path = 7;
google.protobuf.StringValue image_thumbnail_path = 8;
int32 sort_order = 9;
google.protobuf.StringValue extra_data = 10;
SitePageImageFileModel image_file = 11;
}
message CreateSitePageSectionResponse
{
int64 id = 1;
}
// ── Update Section ──
message UpdateSitePageSectionRequest
{
int64 id = 1;
string section_key = 2;
string title = 3;
google.protobuf.StringValue subtitle = 4;
google.protobuf.StringValue html_content = 5;
google.protobuf.StringValue icon_name = 6;
google.protobuf.StringValue image_path = 7;
google.protobuf.StringValue image_thumbnail_path = 8;
int32 sort_order = 9;
bool is_active = 10;
google.protobuf.StringValue extra_data = 11;
SitePageImageFileModel image_file = 12;
}
// ── Delete Section ──
message DeleteSitePageSectionRequest
{
int64 id = 1;
}
// ── Reorder Sections ──
message ReorderSitePageSectionsRequest
{
repeated SectionSortItem items = 1;
}
message SectionSortItem
{
int64 id = 1;
int32 sort_order = 2;
}
// ── Create Site Page ──
message CreateSitePageRequest
{
string page_key = 1;
string title = 2;
google.protobuf.StringValue meta_description = 3;
google.protobuf.StringValue hero_title = 4;
google.protobuf.StringValue hero_subtitle = 5;
bool is_active = 6;
SitePageImageFileModel image_file = 7;
}
message CreateSitePageResponse
{
int64 id = 1;
}
// ── Delete Site Page ──
message DeleteSitePageRequest
{
int64 id = 1;
}
// ── File upload model for binary image uploads from BackOffice ──
message SitePageImageFileModel
{
bytes file = 1;
string mime = 2;
string file_name = 3;
}
@@ -269,6 +269,9 @@ message GetAllUserOrderByFilterFilter
{
messages.DeliveryStatus delivery_status = 10;
}
// فیلتر بازه تاریخ
google.protobuf.Timestamp from_date = 11;
google.protobuf.Timestamp to_date = 12;
}
message GetAllUserOrderByFilterResponse
{