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:
@@ -0,0 +1,167 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package city;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.City";
|
||||
|
||||
service CityContract {
|
||||
// Customer Methods - برای مشتریان
|
||||
rpc GetCitiesForCustomer(GetCitiesForCustomerRequest) returns (GetCitiesForCustomerResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/Cities/GetCities"
|
||||
};
|
||||
};
|
||||
|
||||
rpc GetCityByIdForCustomer(GetCityByIdForCustomerRequest) returns (GetCityByIdForCustomerResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/Cities/GetCity/{id}"
|
||||
};
|
||||
};
|
||||
|
||||
rpc GetCitiesByStateForCustomer(GetCitiesByStateForCustomerRequest) returns (GetCitiesByStateForCustomerResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/Cities/GetCitiesByState/{state_id}"
|
||||
};
|
||||
};
|
||||
|
||||
// Admin Methods
|
||||
rpc GetAllCitiesByFilter(GetAllCitiesByFilterRequest) returns (GetAllCitiesByFilterResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/Cities/GetAllCitiesByFilter"
|
||||
};
|
||||
};
|
||||
|
||||
rpc CreateCity(CreateCityRequest) returns (CreateCityResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/Cities/CreateCity"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
|
||||
rpc UpdateCity(UpdateCityRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
put: "/Cities/UpdateCity"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
|
||||
rpc DeleteCity(DeleteCityRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
delete: "/Cities/DeleteCity/{id}"
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
// Customer Messages
|
||||
message GetCitiesForCustomerRequest {
|
||||
google.protobuf.Int64Value state_id = 1;
|
||||
google.protobuf.StringValue search_term = 2;
|
||||
int32 page_number = 3;
|
||||
int32 page_size = 4;
|
||||
}
|
||||
|
||||
message GetCitiesForCustomerResponse {
|
||||
repeated CityDto cities = 1;
|
||||
MetaData meta_data = 2;
|
||||
}
|
||||
|
||||
message GetCityByIdForCustomerRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message GetCityByIdForCustomerResponse {
|
||||
CityDto city = 1;
|
||||
}
|
||||
|
||||
message GetCitiesByStateForCustomerRequest {
|
||||
int64 state_id = 1;
|
||||
int32 page_number = 2;
|
||||
int32 page_size = 3;
|
||||
}
|
||||
|
||||
message GetCitiesByStateForCustomerResponse {
|
||||
repeated CityDto cities = 1;
|
||||
MetaData meta_data = 2;
|
||||
}
|
||||
|
||||
// Admin Messages
|
||||
message GetAllCitiesByFilterRequest {
|
||||
PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllCitiesByFilterFilter filter = 3;
|
||||
}
|
||||
|
||||
message GetAllCitiesByFilterFilter {
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.StringValue name = 2;
|
||||
google.protobuf.StringValue native = 3;
|
||||
google.protobuf.Int64Value state_id = 4;
|
||||
}
|
||||
|
||||
message GetAllCitiesByFilterResponse {
|
||||
MetaData meta_data = 1;
|
||||
repeated CityDto cities = 2;
|
||||
}
|
||||
|
||||
message CreateCityRequest {
|
||||
int64 external_id = 1;
|
||||
string name = 2;
|
||||
string native = 3;
|
||||
google.protobuf.StringValue latitude = 4;
|
||||
google.protobuf.StringValue longitude = 5;
|
||||
int64 state_id = 6;
|
||||
}
|
||||
|
||||
message CreateCityResponse {
|
||||
int64 id = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message UpdateCityRequest {
|
||||
int64 id = 1;
|
||||
int64 external_id = 2;
|
||||
string name = 3;
|
||||
string native = 4;
|
||||
google.protobuf.StringValue latitude = 5;
|
||||
google.protobuf.StringValue longitude = 6;
|
||||
int64 state_id = 7;
|
||||
}
|
||||
|
||||
message DeleteCityRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
// Common DTOs
|
||||
message CityDto {
|
||||
int64 id = 1;
|
||||
int64 external_id = 2;
|
||||
string name = 3;
|
||||
string native = 4;
|
||||
google.protobuf.StringValue latitude = 5;
|
||||
google.protobuf.StringValue longitude = 6;
|
||||
int64 state_id = 7;
|
||||
string state_name = 8;
|
||||
string state_native = 9;
|
||||
google.protobuf.Timestamp created = 10;
|
||||
google.protobuf.Timestamp last_modified = 11;
|
||||
}
|
||||
|
||||
// Common Messages
|
||||
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;
|
||||
}
|
||||
@@ -43,6 +43,22 @@ service CategoryContract
|
||||
|
||||
};
|
||||
};
|
||||
rpc GetAllCategoriesForCustomer(GetAllCategoriesForCustomerRequest) returns (GetAllCategoriesForCustomerResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/Categories/GetAllCategories"
|
||||
};
|
||||
};
|
||||
rpc GetCategoryByIdForCustomer(GetCategoryByIdForCustomerRequest) returns (GetCategoryByIdForCustomerResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/Categories/GetCategory/{id}"
|
||||
};
|
||||
};
|
||||
rpc GetAllCategories(GetAllCategoriesRequest) returns (GetAllCategoriesResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetAllCategories"
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewCategoryRequest
|
||||
{
|
||||
@@ -121,3 +137,42 @@ message GetAllCategoryByFilterResponseModel
|
||||
bool is_active = 7;
|
||||
int32 sort_order = 8;
|
||||
}
|
||||
message GetAllCategoriesRequest {
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllCategoryByFilterFilter filter = 3;
|
||||
}
|
||||
message GetAllCategoriesResponse {
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllCategoryFilterResponseModel models = 2;
|
||||
}
|
||||
message GetAllCategoryFilterResponseModel {
|
||||
int64 id = 1;
|
||||
string name = 2;
|
||||
string title = 3;
|
||||
string description = 4;
|
||||
google.protobuf.StringValue image_path = 5;
|
||||
google.protobuf.Int64Value parent_id = 6;
|
||||
bool is_active = 7;
|
||||
int32 sort_order = 8;
|
||||
}
|
||||
|
||||
// Customer Messages
|
||||
message GetAllCategoriesForCustomerRequest {
|
||||
google.protobuf.Int64Value parent_id = 1;
|
||||
int32 page_number = 2;
|
||||
int32 page_size = 3;
|
||||
}
|
||||
|
||||
message GetAllCategoriesForCustomerResponse {
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetAllCategoryFilterResponseModel categories = 2;
|
||||
}
|
||||
|
||||
message GetCategoryByIdForCustomerRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message GetCategoryByIdForCustomerResponse {
|
||||
GetAllCategoryFilterResponseModel category = 1;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package health;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option csharp_namespace = "CMSMicroservice.Protobuf.Protos.Health";
|
||||
|
||||
service HealthContract
|
||||
{
|
||||
rpc GetSystemHealth(google.protobuf.Empty) returns (GetSystemHealthResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Health/System"
|
||||
};
|
||||
};
|
||||
|
||||
rpc GetServiceHealth(GetServiceHealthRequest) returns (GetServiceHealthResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Health/Service/{service_name}"
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
message GetServiceHealthRequest
|
||||
{
|
||||
string service_name = 1;
|
||||
}
|
||||
|
||||
message GetSystemHealthResponse
|
||||
{
|
||||
bool overall_healthy = 1;
|
||||
repeated ServiceHealthModel services = 2;
|
||||
google.protobuf.Timestamp checked_at = 3;
|
||||
string version = 4;
|
||||
string environment = 5;
|
||||
}
|
||||
|
||||
message GetServiceHealthResponse
|
||||
{
|
||||
ServiceHealthModel service = 1;
|
||||
google.protobuf.Timestamp checked_at = 2;
|
||||
}
|
||||
|
||||
message ServiceHealthModel
|
||||
{
|
||||
string service_name = 1;
|
||||
HealthStatus status = 2;
|
||||
string description = 3;
|
||||
int64 response_time_ms = 4;
|
||||
google.protobuf.Timestamp last_check = 5;
|
||||
repeated HealthDetail details = 6;
|
||||
}
|
||||
|
||||
message HealthDetail
|
||||
{
|
||||
string key = 1;
|
||||
string value = 2;
|
||||
HealthStatus status = 3;
|
||||
}
|
||||
|
||||
enum HealthStatus
|
||||
{
|
||||
UNKNOWN = 0;
|
||||
HEALTHY = 1;
|
||||
DEGRADED = 2;
|
||||
UNHEALTHY = 3;
|
||||
}
|
||||
@@ -76,6 +76,36 @@ service PackageContract
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
|
||||
// ============= Customer-specific Methods =============
|
||||
|
||||
rpc GetCustomerPackages(GetCustomerPackagesRequest) returns (GetCustomerPackagesResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetPackages"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerPackageDetails(GetCustomerPackageDetailsRequest) returns (GetCustomerPackageDetailsResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetPackageDetails"
|
||||
};
|
||||
};
|
||||
rpc CustomerPurchasePackage(CustomerPurchasePackageRequest) returns (CustomerPurchasePackageResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/PurchasePackage"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc CustomerVerifyPackagePurchase(CustomerVerifyPackagePurchaseRequest) returns (CustomerVerifyPackagePurchaseResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/VerifyPackagePurchase"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerPurchaseHistory(GetCustomerPurchaseHistoryRequest) returns (GetCustomerPurchaseHistoryResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetPurchaseHistory"
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewPackageRequest
|
||||
{
|
||||
@@ -226,3 +256,151 @@ message VerifyBasePackagePaymentResponse
|
||||
int64 wallet_balance = 6;
|
||||
int64 discount_balance = 7;
|
||||
}
|
||||
|
||||
// ============= Customer Message Types =============
|
||||
|
||||
message GetCustomerPackagesRequest
|
||||
{
|
||||
bool include_inactive = 1;
|
||||
PackageTypeEnum package_type_filter = 2;
|
||||
}
|
||||
|
||||
message GetCustomerPackagesResponse
|
||||
{
|
||||
repeated CustomerPackageModel packages = 1;
|
||||
}
|
||||
|
||||
message GetCustomerPackageDetailsRequest
|
||||
{
|
||||
int64 package_id = 1;
|
||||
}
|
||||
|
||||
message GetCustomerPackageDetailsResponse
|
||||
{
|
||||
CustomerPackageModel package = 1;
|
||||
repeated PackageFeature features = 2;
|
||||
PurchaseRequirements requirements = 3;
|
||||
}
|
||||
|
||||
message CustomerPurchasePackageRequest
|
||||
{
|
||||
int64 package_id = 1;
|
||||
PurchaseMethodEnum purchase_method = 2;
|
||||
string callback_url = 3;
|
||||
}
|
||||
|
||||
message CustomerPurchasePackageResponse
|
||||
{
|
||||
bool success = 1;
|
||||
string message = 2;
|
||||
int64 order_id = 3;
|
||||
string payment_gateway_url = 4;
|
||||
string authority = 5;
|
||||
}
|
||||
|
||||
message CustomerVerifyPackagePurchaseRequest
|
||||
{
|
||||
int64 order_id = 1;
|
||||
string authority = 2;
|
||||
string status = 3;
|
||||
}
|
||||
|
||||
message CustomerVerifyPackagePurchaseResponse
|
||||
{
|
||||
bool success = 1;
|
||||
string message = 2;
|
||||
int64 transaction_id = 3;
|
||||
string reference_code = 4;
|
||||
PackagePurchaseInfo purchase_info = 5;
|
||||
}
|
||||
|
||||
message GetCustomerPurchaseHistoryRequest
|
||||
{
|
||||
int64 user_id = 1;
|
||||
messages.PaginationState pagination_state = 2;
|
||||
PackageTypeEnum package_type_filter = 3;
|
||||
google.protobuf.Timestamp from_date = 4;
|
||||
google.protobuf.Timestamp to_date = 5;
|
||||
}
|
||||
|
||||
message GetCustomerPurchaseHistoryResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated PackagePurchaseHistory purchases = 2;
|
||||
}
|
||||
|
||||
message CustomerPackageModel
|
||||
{
|
||||
int64 id = 1;
|
||||
string name = 2;
|
||||
string description = 3;
|
||||
int64 price = 4;
|
||||
string currency = 5;
|
||||
PackageTypeEnum package_type = 6;
|
||||
bool is_available = 7;
|
||||
string image_url = 8;
|
||||
int32 validity_days = 9;
|
||||
bool is_popular = 10;
|
||||
string short_description = 11;
|
||||
}
|
||||
|
||||
message PackageFeature
|
||||
{
|
||||
string title = 1;
|
||||
string description = 2;
|
||||
string icon = 3;
|
||||
bool is_highlighted = 4;
|
||||
}
|
||||
|
||||
message PurchaseRequirements
|
||||
{
|
||||
bool requires_membership = 1;
|
||||
int64 minimum_wallet_balance = 2;
|
||||
repeated string restrictions = 3;
|
||||
}
|
||||
|
||||
message PackagePurchaseInfo
|
||||
{
|
||||
int64 package_id = 1;
|
||||
string package_name = 2;
|
||||
int64 amount_paid = 3;
|
||||
google.protobuf.Timestamp purchase_date = 4;
|
||||
google.protobuf.Timestamp expiry_date = 5;
|
||||
}
|
||||
|
||||
message PackagePurchaseHistory
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 package_id = 2;
|
||||
string package_name = 3;
|
||||
int64 amount = 4;
|
||||
PackageTypeEnum package_type = 5;
|
||||
google.protobuf.Timestamp purchase_date = 6;
|
||||
google.protobuf.Timestamp expiry_date = 7;
|
||||
PaymentStatusEnum status = 8;
|
||||
string status_message = 9;
|
||||
string reference_code = 10;
|
||||
}
|
||||
|
||||
enum PackageTypeEnum
|
||||
{
|
||||
PACKAGE_TYPE_BASIC = 0;
|
||||
PACKAGE_TYPE_GOLDEN = 1;
|
||||
PACKAGE_TYPE_PREMIUM = 2;
|
||||
PACKAGE_TYPE_SPECIAL = 3;
|
||||
}
|
||||
|
||||
enum PurchaseMethodEnum
|
||||
{
|
||||
PURCHASE_METHOD_WALLET = 0;
|
||||
PURCHASE_METHOD_GATEWAY = 1;
|
||||
PURCHASE_METHOD_MIXED = 2;
|
||||
}
|
||||
|
||||
enum PaymentStatusEnum
|
||||
{
|
||||
PAYMENT_STATUS_PENDING = 0;
|
||||
PAYMENT_STATUS_SUCCESS = 1;
|
||||
PAYMENT_STATUS_FAILED = 2;
|
||||
PAYMENT_STATUS_REFUNDED = 3;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,19 @@ service ProductsContract
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
|
||||
// ============= Customer-specific Methods =============
|
||||
|
||||
rpc GetCustomerProducts(GetProductsRequest) returns (GetProductsResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetProduct"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerProductsByFilter(GetAllProductsByFilterRequest) returns (GetCustomerProductsByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetProducts"
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewProductsRequest
|
||||
{
|
||||
@@ -129,8 +142,17 @@ message GetProductsResponse
|
||||
int32 sale_count = 11;
|
||||
int32 view_count = 12;
|
||||
int32 remaining_count = 13;
|
||||
// لیست شناسه دستهبندیهای محصول
|
||||
repeated int64 category_ids = 14;
|
||||
repeated ProductGalleryItem gallery = 14;
|
||||
repeated ProductCategoryPath categories = 15;
|
||||
}
|
||||
|
||||
message ProductGalleryItem
|
||||
{
|
||||
int64 product_gallery_id = 1;
|
||||
int64 product_image_id = 2;
|
||||
string title = 3;
|
||||
string image_path = 4;
|
||||
string image_thumbnail_path = 5;
|
||||
}
|
||||
message GetAllProductsByFilterRequest
|
||||
{
|
||||
@@ -179,6 +201,44 @@ message GetAllProductsByFilterResponseModel
|
||||
repeated int64 category_ids = 14;
|
||||
}
|
||||
|
||||
message GetCustomerProductsByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetCustomerProductsByFilterResponseModel models = 2;
|
||||
}
|
||||
|
||||
message GetCustomerProductsByFilterResponseModel
|
||||
{
|
||||
int64 id = 1;
|
||||
string title = 2;
|
||||
string description = 3;
|
||||
string short_infomation = 4;
|
||||
string full_information = 5;
|
||||
int64 price = 6;
|
||||
int32 discount = 7;
|
||||
int32 rate = 8;
|
||||
string image_path = 9;
|
||||
string thumbnail_path = 10;
|
||||
int32 sale_count = 11;
|
||||
int32 view_count = 12;
|
||||
int32 remaining_count = 13;
|
||||
repeated ProductCategoryPath categories = 14;
|
||||
}
|
||||
|
||||
message ProductCategoryPath
|
||||
{
|
||||
int64 category_id = 1;
|
||||
string title = 2;
|
||||
repeated CategoryNode path = 3;
|
||||
}
|
||||
|
||||
message CategoryNode
|
||||
{
|
||||
int64 id = 1;
|
||||
string title = 2;
|
||||
google.protobuf.Int64Value parent_id = 3;
|
||||
}
|
||||
|
||||
// Bulk Update Product Prices
|
||||
message BulkUpdateProductPricesRequest
|
||||
{
|
||||
|
||||
@@ -55,6 +55,31 @@ service TransactionsContract
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
|
||||
// ============= Customer-specific Methods =============
|
||||
|
||||
rpc GetCustomerTransaction(GetCustomerTransactionRequest) returns (GetCustomerTransactionResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetTransaction"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerTransactionsByFilter(GetCustomerTransactionsByFilterRequest) returns (GetCustomerTransactionsByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetTransactions"
|
||||
};
|
||||
};
|
||||
rpc CustomerPaymentRequest(CustomerPaymentRequestRequest) returns (CustomerPaymentRequestResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/PaymentRequest"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc CustomerPaymentVerification(CustomerPaymentVerificationRequest) returns (CustomerPaymentVerificationResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/PaymentVerification"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewTransactionsRequest
|
||||
{
|
||||
@@ -191,3 +216,131 @@ message RefundTransactionResponse
|
||||
int64 refund_amount = 3;
|
||||
string message = 4;
|
||||
}
|
||||
|
||||
// ============= Customer-specific Messages =============
|
||||
|
||||
// Customer Transaction Models
|
||||
message GetCustomerTransactionRequest
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.StringValue authority = 2;
|
||||
}
|
||||
|
||||
message GetCustomerTransactionResponse
|
||||
{
|
||||
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;
|
||||
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;
|
||||
TransactionTypeEnum type = 21;
|
||||
}
|
||||
|
||||
// Customer Filter Messages
|
||||
message GetCustomerTransactionsByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetCustomerTransactionsByFilterFilter filter = 3;
|
||||
}
|
||||
|
||||
message GetCustomerTransactionsByFilterFilter
|
||||
{
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.Int64Value amount = 2;
|
||||
google.protobuf.StringValue description = 3;
|
||||
google.protobuf.StringValue authority = 4;
|
||||
google.protobuf.BoolValue payment_status = 5;
|
||||
google.protobuf.StringValue ref_id = 6;
|
||||
google.protobuf.StringValue order_id = 7;
|
||||
CurrencyEnum currency = 8;
|
||||
TransactionTypeEnum type = 9;
|
||||
}
|
||||
|
||||
message GetCustomerTransactionsByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated GetCustomerTransactionsByFilterResponseModel models = 2;
|
||||
}
|
||||
|
||||
message GetCustomerTransactionsByFilterResponseModel
|
||||
{
|
||||
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.StringValue authority = 8;
|
||||
google.protobuf.Int64Value fee = 9;
|
||||
CurrencyEnum currency = 10;
|
||||
bool payment_status = 11;
|
||||
google.protobuf.StringValue card_hash = 12;
|
||||
google.protobuf.StringValue card_pan = 13;
|
||||
google.protobuf.StringValue ref_id = 14;
|
||||
google.protobuf.StringValue order_id = 15;
|
||||
TransactionTypeEnum type = 16;
|
||||
}
|
||||
|
||||
// Customer Payment Request/Verification
|
||||
message CustomerPaymentRequestRequest
|
||||
{
|
||||
int64 amount = 1;
|
||||
string callback_url = 2;
|
||||
google.protobuf.StringValue description = 3;
|
||||
google.protobuf.StringValue mobile = 4;
|
||||
google.protobuf.StringValue email = 5;
|
||||
CurrencyEnum currency = 6;
|
||||
TransactionTypeEnum type = 7;
|
||||
google.protobuf.StringValue order_id = 8;
|
||||
}
|
||||
|
||||
message CustomerPaymentRequestResponse
|
||||
{
|
||||
string payment_g_w_url = 1;
|
||||
}
|
||||
|
||||
message CustomerPaymentVerificationRequest
|
||||
{
|
||||
string authority = 1;
|
||||
string status = 2;
|
||||
}
|
||||
|
||||
message CustomerPaymentVerificationResponse
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
// Enums for Customer API
|
||||
enum CurrencyEnum
|
||||
{
|
||||
IRR = 0;
|
||||
IRT = 1;
|
||||
}
|
||||
|
||||
enum TransactionTypeEnum
|
||||
{
|
||||
Real = 0;
|
||||
Sandbox = 1;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ syntax = "proto3";
|
||||
|
||||
package user;
|
||||
|
||||
import "public_messages.proto";
|
||||
import "City.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
@@ -67,6 +67,72 @@ service UserContract
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc CreateNewOtpToken(CreateNewOtpTokenRequest) returns (CreateNewOtpTokenResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/CreateNewOtpToken"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc VerifyOtpToken(VerifyOtpTokenRequest) returns (VerifyOtpTokenResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/VerifyOtpToken"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc AcceptContract(AcceptContractRequest) returns (AcceptContractResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/AcceptContract"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetUserForCustomer(GetUserForCustomerRequest) returns (GetUserForCustomerResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetUser"
|
||||
|
||||
};
|
||||
};
|
||||
rpc UpdateCustomerProfile(UpdateCustomerProfileRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/Customer/UpdateProfile"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerProfile(GetCustomerProfileRequest) returns (GetCustomerProfileResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetProfile"
|
||||
|
||||
};
|
||||
};
|
||||
rpc ChangeCustomerPassword(ChangeCustomerPasswordRequest) returns (ChangeCustomerPasswordResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/ChangePassword"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerReferrals(GetCustomerReferralsRequest) returns (GetCustomerReferralsResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetReferrals"
|
||||
|
||||
};
|
||||
};
|
||||
rpc UploadCustomerAvatar(UploadCustomerAvatarRequest) returns (UploadCustomerAvatarResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/UploadAvatar"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerSettings(GetCustomerSettingsRequest) returns (GetCustomerSettingsResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetSettings"
|
||||
|
||||
};
|
||||
};
|
||||
rpc UpdateCustomerSettings(UpdateCustomerSettingsRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/Customer/UpdateSettings"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewUserRequest
|
||||
{
|
||||
@@ -129,7 +195,7 @@ message GetUserResponse
|
||||
}
|
||||
message GetAllUserByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
city.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue sort_by = 2;
|
||||
GetAllUserByFilterFilter filter = 3;
|
||||
}
|
||||
@@ -153,7 +219,7 @@ message GetAllUserByFilterFilter
|
||||
}
|
||||
message GetAllUserByFilterResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
city.MetaData meta_data = 1;
|
||||
repeated GetAllUserByFilterResponseModel models = 2;
|
||||
}
|
||||
message GetAllUserByFilterResponseModel
|
||||
@@ -207,3 +273,193 @@ message RefreshTokenResponse
|
||||
bool success = 2;
|
||||
string message = 3;
|
||||
}
|
||||
message CreateNewOtpTokenRequest
|
||||
{
|
||||
string mobile = 1;
|
||||
string purpose = 2;
|
||||
google.protobuf.StringValue sign_guid = 3;
|
||||
}
|
||||
message CreateNewOtpTokenResponse
|
||||
{
|
||||
bool success = 1;
|
||||
string message = 2;
|
||||
int32 remaining_attempts = 3;
|
||||
int32 remaining_seconds = 4;
|
||||
}
|
||||
message VerifyOtpTokenRequest
|
||||
{
|
||||
string mobile = 1;
|
||||
string purpose = 2;
|
||||
string code = 3;
|
||||
google.protobuf.StringValue parent_referral_code = 4;
|
||||
}
|
||||
message VerifyOtpTokenResponse
|
||||
{
|
||||
bool success = 1;
|
||||
string message = 2;
|
||||
google.protobuf.StringValue token = 3;
|
||||
int32 remaining_attempts = 4;
|
||||
}
|
||||
message AcceptContractRequest
|
||||
{
|
||||
string code = 1;
|
||||
string contract_html = 2;
|
||||
string sign_guid = 3;
|
||||
}
|
||||
message AcceptContractResponse
|
||||
{
|
||||
string token = 1;
|
||||
}
|
||||
message GetUserForCustomerRequest
|
||||
{
|
||||
// Empty request - user identified by token
|
||||
}
|
||||
message GetUserForCustomerResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
google.protobuf.StringValue first_name = 2;
|
||||
google.protobuf.StringValue last_name = 3;
|
||||
string mobile = 4;
|
||||
google.protobuf.StringValue email = 5;
|
||||
google.protobuf.StringValue national_code = 6;
|
||||
google.protobuf.StringValue avatar_path = 7;
|
||||
google.protobuf.Int64Value parent_id = 8;
|
||||
string referral_code = 9;
|
||||
bool is_mobile_verified = 10;
|
||||
google.protobuf.Timestamp mobile_verified_at = 11;
|
||||
bool email_notifications = 12;
|
||||
bool sms_notifications = 13;
|
||||
bool push_notifications = 14;
|
||||
google.protobuf.Timestamp birth_date = 15;
|
||||
}
|
||||
|
||||
// ============= Customer Profile Messages =============
|
||||
|
||||
message UpdateCustomerProfileRequest
|
||||
{
|
||||
google.protobuf.StringValue first_name = 1;
|
||||
google.protobuf.StringValue last_name = 2;
|
||||
google.protobuf.StringValue email = 3;
|
||||
google.protobuf.StringValue national_code = 4;
|
||||
google.protobuf.Timestamp birth_date = 5;
|
||||
}
|
||||
|
||||
message GetCustomerProfileRequest
|
||||
{
|
||||
// Empty request - user identified by token
|
||||
}
|
||||
|
||||
message GetCustomerProfileResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
google.protobuf.StringValue first_name = 2;
|
||||
google.protobuf.StringValue last_name = 3;
|
||||
string mobile = 4;
|
||||
google.protobuf.StringValue email = 5;
|
||||
google.protobuf.StringValue national_code = 6;
|
||||
google.protobuf.StringValue avatar_path = 7;
|
||||
google.protobuf.Int64Value parent_id = 8;
|
||||
string referral_code = 9;
|
||||
bool is_mobile_verified = 10;
|
||||
google.protobuf.Timestamp mobile_verified_at = 11;
|
||||
bool email_notifications = 12;
|
||||
bool sms_notifications = 13;
|
||||
bool push_notifications = 14;
|
||||
google.protobuf.Timestamp birth_date = 15;
|
||||
string full_name = 16;
|
||||
int32 profile_completion_percentage = 17;
|
||||
}
|
||||
|
||||
message ChangeCustomerPasswordRequest
|
||||
{
|
||||
string current_password = 1;
|
||||
string new_password = 2;
|
||||
string confirm_password = 3;
|
||||
}
|
||||
|
||||
message ChangeCustomerPasswordResponse
|
||||
{
|
||||
bool success = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
// ============= Customer Referrals Messages =============
|
||||
|
||||
message GetCustomerReferralsRequest
|
||||
{
|
||||
city.PaginationState pagination_state = 1;
|
||||
google.protobuf.StringValue status_filter = 2; // ACTIVE, INACTIVE, ALL
|
||||
}
|
||||
|
||||
message GetCustomerReferralsResponse
|
||||
{
|
||||
city.MetaData meta_data = 1;
|
||||
repeated CustomerReferralModel referrals = 2;
|
||||
CustomerReferralStats stats = 3;
|
||||
}
|
||||
|
||||
message CustomerReferralModel
|
||||
{
|
||||
int64 id = 1;
|
||||
google.protobuf.StringValue first_name = 2;
|
||||
google.protobuf.StringValue last_name = 3;
|
||||
string mobile = 4;
|
||||
google.protobuf.Timestamp join_date = 5;
|
||||
bool is_active = 6;
|
||||
string status_message = 7;
|
||||
int32 level = 8;
|
||||
int64 total_commission = 9;
|
||||
}
|
||||
|
||||
message CustomerReferralStats
|
||||
{
|
||||
int32 total_referrals = 1;
|
||||
int32 active_referrals = 2;
|
||||
int64 total_commission_earned = 3;
|
||||
int64 this_month_commission = 4;
|
||||
}
|
||||
|
||||
// ============= Customer Avatar Messages =============
|
||||
|
||||
message UploadCustomerAvatarRequest
|
||||
{
|
||||
string file_name = 1;
|
||||
string file_mime_type = 2;
|
||||
bytes file_data = 3;
|
||||
}
|
||||
|
||||
message UploadCustomerAvatarResponse
|
||||
{
|
||||
bool success = 1;
|
||||
string message = 2;
|
||||
google.protobuf.StringValue avatar_url = 3;
|
||||
}
|
||||
|
||||
// ============= Customer Settings Messages =============
|
||||
|
||||
message GetCustomerSettingsRequest
|
||||
{
|
||||
// Empty request - user identified by token
|
||||
}
|
||||
|
||||
message GetCustomerSettingsResponse
|
||||
{
|
||||
bool email_notifications = 1;
|
||||
bool sms_notifications = 2;
|
||||
bool push_notifications = 3;
|
||||
bool marketing_notifications = 4;
|
||||
string preferred_language = 5;
|
||||
string time_zone = 6;
|
||||
bool two_factor_auth_enabled = 7;
|
||||
}
|
||||
|
||||
message UpdateCustomerSettingsRequest
|
||||
{
|
||||
bool email_notifications = 1;
|
||||
bool sms_notifications = 2;
|
||||
bool push_notifications = 3;
|
||||
bool marketing_notifications = 4;
|
||||
google.protobuf.StringValue preferred_language = 5;
|
||||
google.protobuf.StringValue time_zone = 6;
|
||||
google.protobuf.BoolValue two_factor_auth_enabled = 7;
|
||||
}
|
||||
|
||||
@@ -13,73 +13,155 @@ option csharp_namespace = "CMSMicroservice.Protobuf.Protos.UserCarts";
|
||||
|
||||
service UserCartsContract
|
||||
{
|
||||
rpc CreateNewUserCarts(CreateNewUserCartsRequest) returns (CreateNewUserCartsResponse){
|
||||
// ============= Admin Methods =============
|
||||
|
||||
rpc AddNewUserCart(AddNewUserCartRequest) returns (AddNewUserCartResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/CreateNewUserCarts"
|
||||
post: "/AddNewUserCart"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateUserCarts(UpdateUserCartsRequest) returns (google.protobuf.Empty){
|
||||
rpc UpdateUserCart(UpdateUserCartRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
put: "/UpdateUserCarts"
|
||||
put: "/UpdateUserCart"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc DeleteUserCarts(DeleteUserCartsRequest) returns (google.protobuf.Empty){
|
||||
rpc DeleteUserCart(DeleteUserCartRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
delete: "/DeleteUserCarts"
|
||||
delete: "/DeleteUserCart"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetUserCarts(GetUserCartsRequest) returns (GetUserCartsResponse){
|
||||
rpc GetUserCart(GetUserCartRequest) returns (GetUserCartResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetUserCarts"
|
||||
|
||||
get: "/GetUserCart"
|
||||
};
|
||||
};
|
||||
rpc GetAllUserCartsByFilter(GetAllUserCartsByFilterRequest) returns (GetAllUserCartsByFilterResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/GetAllUserCartsByFilter"
|
||||
|
||||
};
|
||||
};
|
||||
rpc ClearCart(ClearCartRequest) returns (ClearCartResponse){
|
||||
|
||||
// ============= Customer-specific Methods =============
|
||||
|
||||
rpc AddNewUserCartForCustomer(AddNewUserCartForCustomerRequest) returns (AddNewUserCartForCustomerResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/ClearCart"
|
||||
post: "/Customer/AddToCart"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc UpdateUserCartForCustomer(UpdateUserCartForCustomerRequest) returns (UpdateUserCartForCustomerResponse){
|
||||
option (google.api.http) = {
|
||||
put: "/Customer/UpdateCart"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc RemoveUserCartForCustomer(RemoveUserCartForCustomerRequest) returns (RemoveUserCartForCustomerResponse){
|
||||
option (google.api.http) = {
|
||||
delete: "/Customer/RemoveFromCart"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerCart(GetUserCartForCustomerRequest) returns (GetUserCartForCustomerResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetCart"
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewUserCartsRequest
|
||||
// ============= Admin Messages =============
|
||||
|
||||
message AddNewUserCartRequest
|
||||
{
|
||||
int64 product_id = 1;
|
||||
int64 user_id = 2;
|
||||
int32 count = 3;
|
||||
}
|
||||
message CreateNewUserCartsResponse
|
||||
message AddNewUserCartResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message UpdateUserCartsRequest
|
||||
message UpdateUserCartRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
int32 count = 2;
|
||||
}
|
||||
message DeleteUserCartsRequest
|
||||
message DeleteUserCartRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetUserCartsRequest
|
||||
message GetUserCartRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
message GetUserCartsResponse
|
||||
message GetUserCartResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 product_id = 2;
|
||||
int64 user_id = 3;
|
||||
int32 count = 4;
|
||||
}
|
||||
|
||||
// ============= Customer Messages =============
|
||||
|
||||
message AddNewUserCartForCustomerRequest
|
||||
{
|
||||
int64 product_id = 1;
|
||||
int32 count = 2;
|
||||
// user_id will be extracted from JWT token
|
||||
}
|
||||
message AddNewUserCartForCustomerResponse
|
||||
{
|
||||
int64 id = 1;
|
||||
string message = 2;
|
||||
bool success = 3;
|
||||
}
|
||||
message UpdateUserCartForCustomerRequest
|
||||
{
|
||||
int64 cart_item_id = 1;
|
||||
int32 count = 2;
|
||||
// user_id will be extracted from JWT token
|
||||
}
|
||||
message UpdateUserCartForCustomerResponse
|
||||
{
|
||||
string message = 1;
|
||||
bool success = 2;
|
||||
}
|
||||
message RemoveUserCartForCustomerRequest
|
||||
{
|
||||
int64 cart_item_id = 1;
|
||||
// user_id will be extracted from JWT token
|
||||
}
|
||||
message RemoveUserCartForCustomerResponse
|
||||
{
|
||||
string message = 1;
|
||||
bool success = 2;
|
||||
}
|
||||
message GetUserCartForCustomerRequest
|
||||
{
|
||||
// user_id will be extracted from JWT token
|
||||
// pagination could be added if needed
|
||||
}
|
||||
message GetUserCartForCustomerResponse
|
||||
{
|
||||
repeated UserCartItem items = 1;
|
||||
int64 total_price = 2;
|
||||
int32 total_items_count = 3;
|
||||
string message = 4;
|
||||
}
|
||||
message UserCartItem
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 product_id = 2;
|
||||
string product_title = 3;
|
||||
string product_short_information = 4;
|
||||
int64 product_price = 5;
|
||||
int32 product_discount = 6;
|
||||
string product_thumbnail_path = 7;
|
||||
int32 count = 8;
|
||||
int64 total_item_price = 9;
|
||||
}
|
||||
message GetAllUserCartsByFilterRequest
|
||||
{
|
||||
messages.PaginationState pagination_state = 1;
|
||||
@@ -112,15 +194,4 @@ message GetAllUserCartsByFilterResponseModel
|
||||
google.protobuf.Timestamp created = 10;
|
||||
}
|
||||
|
||||
// ClearCart Messages
|
||||
message ClearCartRequest
|
||||
{
|
||||
int64 user_id = 1;
|
||||
}
|
||||
|
||||
message ClearCartResponse
|
||||
{
|
||||
int64 user_id = 1;
|
||||
int32 removed_items_count = 2;
|
||||
string message = 3;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -43,6 +43,37 @@ service UserWalletContract
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
// ============= Customer-specific Methods =============
|
||||
|
||||
rpc GetCustomerWallet(google.protobuf.Empty) returns (GetCustomerWalletResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetWallet"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerWalletChangeLog(GetCustomerWalletChangeLogRequest) returns (GetCustomerWalletChangeLogResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/GetWalletChangeLog"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc CustomerWithdrawBalance(CustomerWithdrawBalanceRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/WithdrawBalance"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerWithdrawals(GetCustomerWithdrawalsRequest) returns (GetCustomerWithdrawalsResponse){
|
||||
option (google.api.http) = {
|
||||
post: "/Customer/GetWithdrawals"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
rpc GetCustomerWithdrawalSettings(google.protobuf.Empty) returns (GetCustomerWithdrawalSettingsResponse){
|
||||
option (google.api.http) = {
|
||||
get: "/Customer/GetWithdrawalSettings"
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewUserWalletRequest
|
||||
{
|
||||
@@ -101,3 +132,70 @@ message GetAllUserWalletByFilterResponseModel
|
||||
int64 balance = 3;
|
||||
int64 network_balance = 4;
|
||||
}
|
||||
|
||||
// ============= Customer-specific Messages =============
|
||||
|
||||
message GetCustomerWalletResponse
|
||||
{
|
||||
int64 balance = 1;
|
||||
int64 network_balance = 2;
|
||||
int64 discount_balance = 3;
|
||||
}
|
||||
|
||||
message GetCustomerWalletChangeLogRequest
|
||||
{
|
||||
google.protobuf.Int64Value reference_id = 1;
|
||||
google.protobuf.BoolValue is_increase = 2;
|
||||
}
|
||||
|
||||
message GetCustomerWalletChangeLogResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated CustomerWalletChangeLogModel models = 2;
|
||||
}
|
||||
|
||||
message CustomerWalletChangeLogModel
|
||||
{
|
||||
int64 current_balance = 1;
|
||||
int64 change_value = 2;
|
||||
int64 current_network_balance = 3;
|
||||
int64 change_nerwork_value = 4;
|
||||
bool is_increase = 5;
|
||||
google.protobuf.Int64Value refrence_id = 6;
|
||||
google.protobuf.Timestamp created_at = 7;
|
||||
}
|
||||
|
||||
message CustomerWithdrawBalanceRequest
|
||||
{
|
||||
int64 payout_id = 1;
|
||||
int32 withdrawal_method = 2; // 0: Cash, 1: Diamond
|
||||
google.protobuf.StringValue iban_number = 3;
|
||||
}
|
||||
|
||||
message GetCustomerWithdrawalsRequest
|
||||
{
|
||||
google.protobuf.Int32Value status = 1;
|
||||
}
|
||||
|
||||
message GetCustomerWithdrawalsResponse
|
||||
{
|
||||
messages.MetaData meta_data = 1;
|
||||
repeated CustomerWithdrawalModel models = 2;
|
||||
}
|
||||
|
||||
message CustomerWithdrawalModel
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 week_definition_id = 2;
|
||||
string week_display_name = 3;
|
||||
int64 total_amount = 4;
|
||||
int32 status = 5;
|
||||
google.protobuf.Int32Value withdrawal_method = 6;
|
||||
string iban_number = 7;
|
||||
google.protobuf.Timestamp created = 8;
|
||||
}
|
||||
|
||||
message GetCustomerWithdrawalSettingsResponse
|
||||
{
|
||||
int64 min_withdrawal_amount = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user