Compare commits

...

48 Commits

Author SHA1 Message Date
nfel 3f0f85a485 ci(stage): add build-proto shared action (buf lint + buf build)
CI/CD Stage / stage (push) Failing after 40s
2026-08-06 17:05:58 +03:30
nfel ef69aa469d ci(stage): add setup-mirrors action (fixes build error)
CI/CD Stage / stage (push) Failing after 40s
2026-08-06 17:03:37 +03:30
nfel 58f42350c4 CI: add Telegram notification to stage workflow
CI/CD Stage / stage (push) Failing after 32s
2026-08-06 16:40:57 +03:30
nfel 73269cc0ce CI: add stage workflow for proto validation
CI/CD Stage / stage (push) Failing after 19s
2026-08-06 16:40:24 +03:30
nfel 227e77d7e5 dev - int - uint
Signed-off-by: nfel <nfilsaraee@gmail.com>
2024-11-05 16:41:30 +03:30
nfel c67c92bdb5 dev - redeem token
Signed-off-by: nfel <nfilsaraee@gmail.com>
2024-11-05 16:37:26 +03:30
nfel eb7bb4854f dev - mobile added to identity
Signed-off-by: nfel <nfilsaraee@gmail.com>
2024-11-05 14:58:23 +03:30
nfel 88cfb4e150 dev - optional type instead of map
Signed-off-by: nfel <nfilsaraee@gmail.com>
2024-10-26 15:35:20 +03:30
nfel 3a44056962 dev - Added Request with extra params in order to support filters
Signed-off-by: nfel <nfilsaraee@gmail.com>
2024-10-26 13:09:36 +03:30
nfel c24f5b928f dev - redeem token list
Signed-off-by: nfel <nfilsaraee@gmail.com>
2024-10-26 13:07:40 +03:30
nfel 3cd0807585 dev - downgrade buf 2 -> 1
Signed-off-by: nfel <nfilsaraee@gmail.com>
2024-10-26 13:07:24 +03:30
nfel 4010238f8d dev - forgot optional type
Signed-off-by: nfel <nfilsaraee@gmail.com>
2024-09-23 14:22:58 +03:30
nfel dec09ea33a dev - transaction list req filter (status type)
Signed-off-by: nfel <nfilsaraee@gmail.com>
2024-09-23 14:22:04 +03:30
nfel 9609bdfa05 dev - trx status + type enum added
Signed-off-by: nfel <nfilsaraee@gmail.com>
2024-09-23 13:51:00 +03:30
nfel 330f8e8bf1 Added BankInfo Removal 2024-09-23 11:01:48 +03:30
nfel a42dd81ede removing token info from transaction histroy response 2024-09-10 11:12:02 +03:30
nfel cb42f5f673 bad name for redeem bank info 2024-09-09 16:07:38 +03:30
nfel 4d4d4d8820 changed req of calculation -> needs amount 2024-09-09 15:40:30 +03:30
nfel b3e04457f6 Dynamic two factor added - over the air otp + totp 2024-09-09 12:21:22 +03:30
nfel 016219f1da Redeem rpc and messages added 2024-09-09 12:20:47 +03:30
nfel bcdcb6bb21 Added possibility of adding bnpl to comapny 2024-08-31 10:28:11 +03:30
nfel 33896c1aaa iam - company - is now an array of companies 2024-08-31 10:09:06 +03:30
nfel 2f5fd8a095 Added Company to iam as optional 2024-08-28 14:19:57 +03:30
nfel 0479fca6b5 added asset_id in userBNPL Form 2024-08-12 10:49:33 +03:30
nfel 930dc67791 amount irr added to bnpl payments 2024-08-12 10:43:12 +03:30
nfel f87dc92d3e Optional Field -> request.put partial body 2024-08-12 10:26:03 +03:30
nfel 039ae2316f Comment added 2024-08-10 15:46:09 +03:30
nfel a61ba518d7 typo 2024-08-10 14:56:46 +03:30
nfel 9194906abf Added iam to cancle bnpl rpc 2024-08-10 14:56:04 +03:30
nfel ddee0dcfbb Formate proto + req with iam added to auth messages 2024-08-10 14:55:00 +03:30
nfel 6e94e0a847 Put+Delete added to bnpl 2024-08-10 14:12:21 +03:30
nfel dc8d2100b5 format 2024-08-10 12:08:32 +03:30
nfel 14cd8ca8b5 Added payment status 2024-08-10 12:08:16 +03:30
nfel 6b2b6b105a made comany optional for user 2024-08-05 14:57:45 +03:30
nfel 6d35ea5706 name_fa added to company message 2024-08-05 14:55:04 +03:30
nfel 1e8e8ca920 Format 2024-08-05 14:51:10 +03:30
nfel 4be296ee58 Chagned Paayment Period Info Field from Str -> int 2024-08-05 14:15:56 +03:30
nfel 39fa4037d8 [+] BankInfoStatusEnum 2024-08-05 12:27:08 +03:30
nfel 8f1aa65f99 Missing Field from User Form Submition 2024-08-04 13:40:35 +03:30
nfel 59284082ac Typo 2024-07-29 10:17:57 +03:30
nfel 68accdeef0 float to PaymentPeriodInfo in payment_period 2024-07-27 17:53:58 +03:30
nfel 81b00a7416 id type changed from int64 -> uint64 2024-07-27 11:21:36 +03:30
nfel 79374f9fe7 field changes 2024-07-25 12:17:35 +03:30
nfel 55e4b6cba2 Buf linter config addded 2024-07-24 14:25:14 +03:30
nfel c6850f7d9f Bad Input for Submitting BNPL form 2024-07-24 14:25:04 +03:30
nfel 95f6f8c032 New BNPL Added To wallet buf 2024-07-24 14:09:47 +03:30
nfel b8d8aac599 cleanup 2024-07-24 10:41:15 +03:30
nfel 0e93462481 Auto Formatter + Company & EmployeeID 2024-07-13 21:18:51 +03:30
10 changed files with 521 additions and 82 deletions
Vendored
BIN
View File
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
name: Build Proto
description: Install buf CLI, run buf lint and buf build
inputs:
buf_ref:
description: Git ref of actions/buf-bin to checkout
required: false
default: "main"
runs:
using: composite
steps:
- name: Checkout Buf CLI
uses: https://git.darano.ir/actions/checkout@v5
with:
repository: actions/buf-bin
ref: ${{ inputs.buf_ref }}
path: buf-bin
- name: Setup Buf CLI
shell: bash
run: |
cp buf-bin/buf /usr/local/bin/buf
chmod +x /usr/local/bin/buf
- name: Lint
shell: bash
run: buf lint
- name: Build
shell: bash
run: buf build
+151
View File
@@ -0,0 +1,151 @@
name: Setup package mirrors
description: Benchmark package mirrors and export the fastest reachable registry for each ecosystem
inputs:
npm_mirrors:
description: Newline-separated npm-compatible registries
required: false
default: |
https://npm.reg.darano.ir/
pypi_mirrors:
required: false
default: |
https://package-mirror.liara.ir/repository/pypi/simple
https://pypi.reg.darano.ir
https://pypi-iran.ir/simple/
https://pypi.org/simple/
go_mirrors:
description: Newline-separated Go module proxies
required: false
default: |
https://go.devneeds.ir/
https://package-mirror.liara.ir/repository/go/
https://go.reg.darano.ir/
https://proxy.golang.org/
debian_mirrors:
description: Newline-separated Debian package repository base URLs
required: false
default: |
http://repo.iut.ac.ir/debian/
http://deb.debian.org/debian/
connect_timeout:
description: curl connection timeout in seconds
required: false
default: "3"
max_time:
description: curl request timeout in seconds
required: false
default: "10"
outputs:
npm_registry:
description: Fastest reachable npm registry
value: ${{ steps.select.outputs.npm_registry }}
pypi_index:
description: Fastest reachable Python package index
value: ${{ steps.select.outputs.pypi_index }}
go_proxy:
description: Fastest reachable Go module proxy
value: ${{ steps.select.outputs.go_proxy }}
debian_mirror:
description: Fastest reachable Debian package repository
value: ${{ steps.select.outputs.debian_mirror }}
runs:
using: composite
steps:
- name: Rate mirrors and export package environments
id: select
shell: bash
env:
NPM_MIRRORS: ${{ inputs.npm_mirrors }}
PYPI_MIRRORS: ${{ inputs.pypi_mirrors }}
GO_MIRRORS: ${{ inputs.go_mirrors }}
DEBIAN_MIRRORS: ${{ inputs.debian_mirrors }}
CONNECT_TIMEOUT: ${{ inputs.connect_timeout }}
MAX_TIME: ${{ inputs.max_time }}
run: |
set -euo pipefail
if [[ ! "$CONNECT_TIMEOUT" =~ ^[0-9]+([.][0-9]+)?$ ]] ||
[[ ! "$MAX_TIME" =~ ^[0-9]+([.][0-9]+)?$ ]]; then
echo "Mirror timeouts must be positive numbers" >&2
exit 1
fi
select_fastest() {
local ecosystem="$1"
local mirrors="$2"
local scores mirror result status duration fallback
scores="$(mktemp)"
fallback=""
while IFS= read -r mirror; do
mirror="$(printf '%s' "$mirror" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
[[ -z "$mirror" || "$mirror" == \#* ]] && continue
if [[ ! "$mirror" =~ ^https?:// ]]; then
echo "[$ecosystem] skipped invalid URL: $mirror" >&2
continue
fi
[[ -z "$fallback" ]] && fallback="$mirror"
if result="$(curl \
--location \
--silent \
--show-error \
--output /dev/null \
--connect-timeout "$CONNECT_TIMEOUT" \
--max-time "$MAX_TIME" \
--write-out '%{http_code} %{time_total}' \
"$mirror" 2>/dev/null)"; then
read -r status duration <<< "$result"
if [[ "$status" =~ ^[0-9]{3}$ ]] &&
(((10#$status >= 200 && 10#$status < 400) || 10#$status == 404)) &&
[[ "$duration" =~ ^[0-9]+([.][0-9]+)?$ ]]; then
printf '%s\t%s\t%s\n' "$duration" "$status" "$mirror" >> "$scores"
continue
fi
fi
echo "[$ecosystem] unavailable: $mirror" >&2
done <<< "$mirrors"
if [[ ! -s "$scores" ]]; then
rm -f "$scores"
if [[ -z "$fallback" ]]; then
echo "No valid $ecosystem mirror was configured" >&2
return 1
fi
echo "[$ecosystem] no mirror responded; falling back to $fallback" >&2
printf '%s\n' "$fallback"
return 0
fi
echo "[$ecosystem] mirror ranking (seconds, HTTP status, URL):" >&2
sort -n -k1,1 "$scores" >&2
sort -n -k1,1 "$scores" | head -n 1 | cut -f3-
rm -f "$scores"
}
npm_registry="$(select_fastest npm "$NPM_MIRRORS")"
pypi_index="$(select_fastest pypi "$PYPI_MIRRORS")"
go_proxy="$(select_fastest go "$GO_MIRRORS")"
debian_mirror="$(select_fastest debian "$DEBIAN_MIRRORS")"
{
echo "NPM_CONFIG_REGISTRY=$npm_registry"
echo "npm_config_registry=$npm_registry"
echo "COREPACK_NPM_REGISTRY=$npm_registry"
echo "YARN_REGISTRY=$npm_registry"
echo "PNPM_CONFIG_REGISTRY=$npm_registry"
echo "BUN_CONFIG_REGISTRY=$npm_registry"
echo "PIP_INDEX_URL=$pypi_index"
echo "UV_DEFAULT_INDEX=$pypi_index"
echo "GOPROXY=$go_proxy"
echo "DEBIAN_MIRROR=$debian_mirror"
} >> "$GITHUB_ENV"
{
echo "npm_registry=$npm_registry"
echo "pypi_index=$pypi_index"
echo "go_proxy=$go_proxy"
echo "debian_mirror=$debian_mirror"
} >> "$GITHUB_OUTPUT"
+41
View File
@@ -0,0 +1,41 @@
---
name: CI/CD Stage
on:
push:
branches:
- stage
jobs:
stage:
runs-on: ubuntu-latest
steps:
- name: Checkout Git
uses: https://git.darano.ir/actions/checkout@v5
with:
token: ${{ gitea.token }}
path: ./
submodules: recursive
- name: Checkout Buf CLI
uses: https://git.darano.ir/actions/checkout@v5
with:
repository: actions/buf-bin
ref: main
path: buf-bin
- name: Setup package mirrors
uses: ./.gitea/actions/setup-mirrors
- name: Setup Buf CLI
run: |
cp buf-bin/buf /usr/local/bin/buf
chmod +x /usr/local/bin/buf
- name: Lint
run: buf lint
- name: Build
run: buf build
- name: Notify Telegram
if: always()
uses: ./.gitea/actions/notify-telegram
with:
bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
status: ${{ job.status }}
repository: ${{ gitea.repository }}
sha: ${{ gitea.sha }}
+13 -3
View File
@@ -2,8 +2,8 @@ syntax = "proto3";
package authorization; package authorization;
import "base_message.proto";
import "authorization_message.proto"; import "authorization_message.proto";
import "base_message.proto";
service AuthorizationService { service AuthorizationService {
rpc InternalAuthorizationDeleteCache(base.Empty) returns (base.StatusRes); rpc InternalAuthorizationDeleteCache(base.Empty) returns (base.StatusRes);
@@ -14,15 +14,25 @@ service AuthorizationService {
rpc UserLoginSendOTP(UserSendOtpReq) returns (UserSendOtpRes) {} rpc UserLoginSendOTP(UserSendOtpReq) returns (UserSendOtpRes) {}
rpc UserLoginWithOTP(UserLoginReq) returns (UserAccessTokenRes) {} rpc UserLoginWithOTP(UserLoginReq) returns (UserAccessTokenRes) {}
rpc UserGetAccessTokenByRefreshToken(UserRefreshTokenReq) returns (UserAccessTokenRes){} rpc UserGetAccessTokenByRefreshToken(UserRefreshTokenReq)
returns (UserAccessTokenRes) {}
rpc UserGetUserPermission(InternalIAM) returns (PermissionList) {} rpc UserGetUserPermission(InternalIAM) returns (PermissionList) {}
rpc UserGetIdentity(InternalIAM) returns (Identity) {} rpc UserGetIdentity(InternalIAM) returns (Identity) {}
rpc UserUpdateIdentity(UserUpdateIdentityReq) returns (base.StatusRes) {} rpc UserUpdateIdentity(UserUpdateIdentityReq) returns (base.StatusRes) {}
rpc UserGetBankInfoList(InternalIAM) returns (BankInfoList){} rpc UserGetBankInfoList(ReqWithIAMAndParams) returns (BankInfoList) {}
rpc UserUpdateBankInfo(UserUpdateBankInfoReq) returns (base.StatusRes) {} rpc UserUpdateBankInfo(UserUpdateBankInfoReq) returns (base.StatusRes) {}
rpc UserRemoveBankInfo(IdReqWithIAM) returns (base.StatusRes) {}
rpc GetUser(GetUserReq) returns (User) {} rpc GetUser(GetUserReq) returns (User) {}
// Two Factor Authentication
// For now it's only SMS-OTP - later will be Email-OTP or other methods can be
// added For HMAC-OTP there won't be a need to call this api
rpc SendTFAReq(TFAReq) returns (base.StatusRes) {}
// For HMAC-OTP an initialization step must be added to exchange keys
rpc InitTFAReq(InternalIAM) returns (TFAExRes) {}
rpc CheckTFACode(CheckTFAReq) returns (base.StatusRes) {}
} }
+53 -2
View File
@@ -75,6 +75,15 @@ message CheckIAMReq{
message InternalIAM { message InternalIAM {
User user = 1; User user = 1;
IdentityBasic identity = 2; IdentityBasic identity = 2;
repeated Company company = 3;
}
message IdReqWithIAM {
int64 id = 1;
InternalIAM iam = 2;
}
message ReqWithIAMAndParams {
InternalIAM iam = 1;
optional bool accepted = 2;
} }
/* /*
@@ -93,6 +102,14 @@ message User {
repeated int64 roles = 5; repeated int64 roles = 5;
} }
message Company {
int64 id = 1;
string name = 2;
string name_fa = 3;
string location = 4;
bool can_provide_bnpl = 5;
}
message Identity { message Identity {
string national_id = 1; string national_id = 1;
string national_serial_id = 2; string national_serial_id = 2;
@@ -114,7 +131,9 @@ message Identity {
string updated_at = 18; string updated_at = 18;
string created_at = 19; string created_at = 19;
string email = 20; string email = 20;
string mobile = 21;
optional Company company = 22;
optional string employee_info = 23;
} }
message IdentityBasic { message IdentityBasic {
@@ -148,12 +167,44 @@ message BankInfoList {
repeated BankInfo list = 1; repeated BankInfo list = 1;
} }
// Status 0: Fail Verify, 1: Verified, 2: Does not Match user's credential
enum BankInfoStatusEnum {
FAIL_VERIFY = 0;
VERIFIED = 1;
DOES_NOT_MATCH = 2;
}
message BankInfo { message BankInfo {
int64 id = 1; int64 id = 1;
string deposit_number = 2; string deposit_number = 2;
string iban_number = 3; string iban_number = 3;
string card_number = 4; string card_number = 4;
int32 status = 5; BankInfoStatusEnum status = 5;
string updated_at = 6; string updated_at = 6;
string created_at = 7; string created_at = 7;
} }
/* Two Factor Authentication */
message IdReqWithIAMAndTFA {
int64 id = 1;
InternalIAM iam = 2;
string tfa_code = 3;
}
message TFAReq {
InternalIAM iam = 1;
optional string mobile = 2;
optional string email = 3;
optional string reason = 4; // issued jwt reason -> can be login, redeem, withdrawal
}
// Two Factor Authentication Exchange Response
message TFAExRes {
InternalIAM iam = 1;
string secret = 2;
string qrcode_base64 = 3;
}
message CheckTFAReq {
InternalIAM iam = 1;
string code = 2;
optional string algorithm = 3;
optional string reason = 4; // Can be later used as a lookup
}
-1
View File
@@ -7,7 +7,6 @@ message Empty {}
message StatusRes { message StatusRes {
bool success = 1; bool success = 1;
} }
message IdRes { message IdRes {
int64 id = 1; int64 id = 1;
} }
+12
View File
@@ -0,0 +1,12 @@
---
version: v1
lint:
use:
- DEFAULT
# disallow_comment_ignores: false
# # The default behavior of this key has changed from v1
# enum_zero_value_suffix: _UNSPECIFIED
# rpc_allow_same_request_response: true
# rpc_allow_google_protobuf_empty_requests: false
# rpc_allow_google_protobuf_empty_responses: false
# service_suffix: Service
+14 -1
View File
@@ -2,8 +2,8 @@ syntax = "proto3";
package wallet; package wallet;
import "base_message.proto";
import "authorization_message.proto"; import "authorization_message.proto";
import "base_message.proto";
import "wallet_message.proto"; import "wallet_message.proto";
service WalletService { service WalletService {
@@ -26,4 +26,17 @@ service WalletService {
rpc SaleGetToken(SaleGetTokenReq) returns (SaleGetTokenRes); rpc SaleGetToken(SaleGetTokenReq) returns (SaleGetTokenRes);
rpc SaleConfirm(SaleConfirmReq) returns (SaleConfirmRes); rpc SaleConfirm(SaleConfirmReq) returns (SaleConfirmRes);
rpc AdminManualSaleDeposit(SaleManualReq) returns (base.StatusRes); rpc AdminManualSaleDeposit(SaleManualReq) returns (base.StatusRes);
// BNPL
rpc GetBNPLList(base.Empty) returns (BNPLList);
rpc GetBNPLInfo(base.IdReq) returns (BNPLInfo);
rpc GetUserBNPLInfo(GetUserBNPLInfoReq) returns (UserBNPLResp);
rpc SubmitBNPLForm(UserBNPLReq) returns (base.StatusRes);
rpc UpdateBNPL(UserBNPLReq) returns (base.StatusRes);
rpc CancleBNPL(authorization.IdReqWithIAM) returns (base.StatusRes);
// Redeem Token
rpc CalculateRedeemToken(RedeemTokenReq) returns (CalculateRedeemTokenRes);
rpc RedeemToken(RedeemTokenReq) returns (base.StatusRes);
rpc RedeemTokenList(authorization.ReqWithIAMAndParams) returns (RedeemTokenResList);
} }
+142 -7
View File
@@ -3,6 +3,7 @@ syntax = "proto3";
package wallet; package wallet;
import "authorization_message.proto"; import "authorization_message.proto";
import "base_message.proto";
/* /*
INTERNAL DATA INTERNAL DATA
@@ -41,7 +42,6 @@ message AssetList {
repeated Asset list = 1; repeated Asset list = 1;
} }
message Asset { message Asset {
int64 id = 1; int64 id = 1;
string name = 2; string name = 2;
@@ -100,6 +100,90 @@ message PropertyMeta {
string user_agreement_url = 11; string user_agreement_url = 11;
} }
/*
BNPL - not really but close name
*/
// enum BNPLPgState {
//
// }
message GetUserBNPLInfoReq {
authorization.InternalIAM iam = 1;
base.IdReq id = 2;
}
enum BNPLPaymentsStatus {
PENDING = 0;
PAYED = 1;
OVER_DUE = 2;
NOT_STARTED = 3;
NOT_YET_DUE = 4;
CANCLED = 5;
}
message BNPLPayments {
uint64 id = 1;
double amount = 2;
double amount_irr = 7;
bool is_paied = 3;
string due_date = 4;
string settlement_date = 5;
BNPLPaymentsStatus status = 6;
}
message UserBNPLResp {
uint64 id = 1;
BNPLInfo bnpl = 2;
int32 current_step = 3;
optional float amount = 4;
optional PaymentPeriodInfo payment_period = 5;
optional bool accepted_terms = 6;
repeated BNPLPayments payments = 7;
optional string employee_id = 8;
optional authorization.Company company = 10;
authorization.InternalIAM iam = 11;
optional string updated_at = 12;
optional string created_at = 13;
Asset selected_asset = 14;
}
message UserBNPLReq {
uint64 id = 1;
int64 bnpl_id = 2;
authorization.InternalIAM iam = 6;
optional string created_at = 3;
optional string employee_id = 4;
optional int64 company_id = 5;
optional float amount = 7;
optional PaymentPeriodInfo payment_period = 8;
optional bool has_agreed_contract = 9;
optional int32 current_step = 10; //Can be useful for admin to change the current step
optional int64 asset_id = 11;
}
message PaymentPeriodInfo {
uint64 id = 1;
uint64 period = 2;
bool enabled = 3;
}
message BNPLInfo {
uint64 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 expires_at = 14;
}
message BNPLList {
repeated BNPLInfo list = 1;
}
/* /*
Wallet Wallet
*/ */
@@ -135,10 +219,26 @@ message TransactionList {
int64 total_count = 2; int64 total_count = 2;
} }
enum TransactionType {
Unknown = 0;
Buy = 1;
Sell = 2;
Transfer = 3;
Redeem = 4;
}
enum TransactionStatus {
Undetermined = 0;
Failed = -10;
Suspended = -9;
Created = -1;
Pending = 1;
Successful = 2;
}
message Transaction { message Transaction {
int64 id = 1; int64 id = 1;
int64 asset_id = 2; int64 asset_id = 2;
Asset asset_info = 3; // Asset asset_info = 3; //Causing network overloading
optional int64 from_user_id = 4; optional int64 from_user_id = 4;
optional authorization.UserIdentityBasic from_user_info = 5; optional authorization.UserIdentityBasic from_user_info = 5;
optional int64 from_federation_id = 6; optional int64 from_federation_id = 6;
@@ -148,8 +248,8 @@ message Transaction {
optional int64 to_federation_id = 10; optional int64 to_federation_id = 10;
optional Federation to_federation_info = 11; optional Federation to_federation_info = 11;
double amount = 12; double amount = 12;
int32 status = 13; TransactionStatus status = 13;
int32 type = 14; TransactionType type = 14;
string updated_at = 15; string updated_at = 15;
string created_at = 16; string created_at = 16;
string tracking_code = 17; string tracking_code = 17;
@@ -167,8 +267,8 @@ message UserGetTransactionListReq {
optional int64 to_federation_id = 9; optional int64 to_federation_id = 9;
optional double amount_from = 10; optional double amount_from = 10;
optional double amount_to = 11; optional double amount_to = 11;
optional int32 status = 12; optional TransactionStatus status = 12;
optional int32 type = 13; optional TransactionType type = 13;
optional string tracking_code = 14; optional string tracking_code = 14;
} }
/* /*
@@ -241,4 +341,39 @@ message SaleManualReq {
string national_id = 6; string national_id = 6;
} }
/*
Redeem Token
*/
message RedeemTokenReq {
authorization.InternalIAM iam = 1;
int64 asset_id = 2;
uint64 bank_info_id = 3;
double amount = 4;
optional string tfa_code = 5;
}
message CalculateRedeemTokenRes {
Asset asset = 1;
double free_balance = 2;
double total_balance = 3;
double request_amount = 4;
double profit_capital = 5;
double user_capital = 6;
optional authorization.BankInfo bank_info = 7;
}
message RedeemTokenRes {
uint64 id = 1;
int64 user_id = 2;
Asset asset = 3;
double free_balance = 4;
double total_balance = 5;
double request_amount = 6;
string created_at = 7;
bool is_paied = 8;
// receipt.Receipt receipt = 8;
double calculated_profit = 9;
optional authorization.BankInfo bank_info = 10;
optional string receipt = 11;
}
message RedeemTokenResList {
repeated RedeemTokenRes list = 1;
}