From 95f6f8c032beae5101922b70e1afc3477e4028a6 Mon Sep 17 00:00:00 2001 From: nfel Date: Wed, 24 Jul 2024 14:09:47 +0330 Subject: [PATCH] New BNPL Added To wallet buf --- base_message.proto | 2 +- wallet.proto | 8 +++- wallet_message.proto | 111 ++++++++++++++++++++++++++++++++++--------- 3 files changed, 96 insertions(+), 25 deletions(-) diff --git a/base_message.proto b/base_message.proto index aa5b1a7..a6fdfe3 100644 --- a/base_message.proto +++ b/base_message.proto @@ -13,4 +13,4 @@ message IdRes { } message IdReq { int64 id = 1; -} \ No newline at end of file +} diff --git a/wallet.proto b/wallet.proto index 75372a6..a1750ef 100644 --- a/wallet.proto +++ b/wallet.proto @@ -26,4 +26,10 @@ service WalletService { rpc SaleGetToken(SaleGetTokenReq) returns(SaleGetTokenRes); rpc SaleConfirm(SaleConfirmReq) returns(SaleConfirmRes); rpc AdminManualSaleDeposit(SaleManualReq) returns (base.StatusRes); -} \ No newline at end of file + + // BNPL + rpc GetBNPLList(base.Empty) returns(BNPLList); + rpc GetBNPLInfo(base.IdReq) returns(BNPLInfo); + rpc GetUserBNPLInfo(GetUserBNPLInfoReq) returns(UserBNPLResp); + rpc SubmitBNPLForm(UserBNPLResp) returns(base.StatusRes); +} diff --git a/wallet_message.proto b/wallet_message.proto index 457d3c8..a0f30a2 100644 --- a/wallet_message.proto +++ b/wallet_message.proto @@ -3,17 +3,18 @@ syntax = "proto3"; package wallet; import "authorization_message.proto"; +import "base_message.proto"; /* - INTERNAL DATA - */ + INTERNAL DATA +*/ message InternalTransactionData { int64 transaction_id = 1; } /* - Federation + Federation */ message Federation { @@ -34,14 +35,13 @@ message GetFederationReq { } /* - Asset + Asset */ message AssetList { repeated Asset list = 1; } - message Asset { int64 id = 1; string name = 2; @@ -76,6 +76,73 @@ message Asset { int32 status = 31; AssetMeta meta = 32; } +/* + BNPL - not really but close name +*/ + +// enum BNPLPgState { +// +// } + +message GetUserBNPLInfoReq{ + authorization.InternalIAM iam =1 ; + base.IdReq id = 2; +} + +message BNPLPayments { + int64 id = 1; + double amount = 2; + bool is_paied = 3; + string payment_date = 4; + string settlement_date = 5; +} + +message UserBNPLResp { + int64 id = 1; + BNPLInfo bnpl = 2; + int32 current_step=3; + optional float amount = 4; + optional float payment_period = 5; + optional bool has_agreed_contract = 6; + repeated BNPLPayments payments = 7; + optional string employee_id = 8; + optional authorization.Company company = 10; + optional string updated_at = 12; + optional string created_at = 13; +} + +message UserBNPLReq { + int64 id = 1; + int64 bnpl_id = 2; + string created_at = 3; + string employee_id = 4; + int64 company_id = 5; + float amount = 7; + float payment_period = 8; + bool has_agreed_contract = 9; +} +message PaymentPeriodInfo { + int64 id = 1; + string period = 2; + bool enabled = 3; +} +message BNPLInfo { + int64 id = 1; + string description = 3; + repeated Asset supported_assets = 2; + optional bool enabled = 4; + float amount_start = 5; + float amount_end = 6; + float amount_steps = 7; + repeated PaymentPeriodInfo payment_period = 8; + repeated authorization.Company possible_companies = 11; + string updated_at = 12; + string created_at = 13; + string expiers_at = 14; +} +message BNPLList { + repeated BNPLInfo list = 1; +} message GetAssetReq { optional int64 id = 1; @@ -101,7 +168,7 @@ message PropertyMeta { } /* - Wallet + Wallet */ message WalletList { @@ -127,7 +194,7 @@ message UserInitWalletReq { } /* - Transaction + Transaction */ message TransactionList { @@ -172,7 +239,7 @@ message UserGetTransactionListReq { optional string tracking_code = 14; } /* - Buy + Buy */ message UserBuyAssetReq { @@ -182,11 +249,11 @@ message UserBuyAssetReq { } /* - Sell + Sell */ /* - Transfer + Transfer */ message UserTransferAssetReq { @@ -212,33 +279,31 @@ message SaleGetTokenReq { // represent the information regarding the ipg gateway message SaleGetTokenRes { string url = 1; - int64 unit_price = 2; - int64 total_price = 3; + int64 unit_price = 2; + int64 total_price = 3; double amount = 4; string asset = 5; } message SaleConfirmReq { - string RefId=1; - string ResCode=2; - string SaleOrderId=3; - string SaleReferenceId=4; - string CardHolderInfo=5; - string CardHolderPan=6; - string FinalAmount=7; + string RefId = 1; + string ResCode = 2; + string SaleOrderId = 3; + string SaleReferenceId = 4; + string CardHolderInfo = 5; + string CardHolderPan = 6; + string FinalAmount = 7; } message SaleConfirmRes { - string receiptLink=1; + string receiptLink = 1; } message SaleManualReq { authorization.InternalIAM iam = 1; - int64 asset_id = 2; + int64 asset_id = 2; double amount = 3; string paid_at = 4; string rrn = 5; string national_id = 6; } - -