From 65a9344a7ccc543fde485efb7c5d67f7ecbb7592 Mon Sep 17 00:00:00 2001 From: nfel Date: Wed, 9 Jul 2025 12:34:03 +0330 Subject: [PATCH] v2: added user status Signed-off-by: nfel --- auth/v1/msg.proto | 65 +++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 36 deletions(-) diff --git a/auth/v1/msg.proto b/auth/v1/msg.proto index a95b29b..610ad6d 100644 --- a/auth/v1/msg.proto +++ b/auth/v1/msg.proto @@ -8,9 +8,7 @@ import "base/v1/msg.proto"; Internal */ -message InternalInitRoutesReq { - repeated InternalRoute routes = 1; -} +message InternalInitRoutesReq { repeated InternalRoute routes = 1; } message InternalRoute { string path = 1; string method = 2; @@ -32,20 +30,14 @@ message Permission { string method = 5; } -message PermissionList { - repeated Permission list = 1; -} +message PermissionList { repeated Permission list = 1; } /* UserSendOtp */ -message UserSendOtpReq { - string mobile = 1; -} -message UserSendOtpRes { - int64 expired_at = 1; -} +message UserSendOtpReq { string mobile = 1; } +message UserSendOtpRes { int64 expired_at = 1; } /* UserLogin @@ -55,9 +47,7 @@ message UserLoginReq { string mobile = 1; string otp_code = 2; } -message UserRefreshTokenReq { - string refresh_token = 1; -} +message UserRefreshTokenReq { string refresh_token = 1; } message UserAccessTokenRes { string access_token = 1; int64 access_expired_at = 2; @@ -102,9 +92,7 @@ message ReqWithIAMAndParams { optional bool accepted = 2; } -message ReqWithOptionalIAM { - optional InternalIAM iam = 1; -} +message ReqWithOptionalIAM { optional InternalIAM iam = 1; } /* User @@ -114,15 +102,26 @@ message GetUserReq { string national_id = 2; } +enum UserStatus { + USER_STATUS_UNKNOWN = 0; + USER_STATUS_CREATED = 1; + USER_STATUS_VALID_LV1 = 2; + USER_STATUS_VALID_LV2 = 3; + USER_STATUS_VALID_LV3 = 4; + USER_STATUS_BANNED = 5; + USER_STATUS_DELETED = 6; +} + message User { int64 id = 1; string national_id = 2; string mobile = 3; string email = 4; - repeated int64 roles = 5; + UserStatus status = 5; + repeated int64 roles = 6; } -message UserAddress{ +message UserAddress { string postal_code = 2; string user_address = 3; } @@ -162,7 +161,7 @@ message Identity { optional string employee_info = 23; string pub_key = 24; optional float balance = 25; - optional UserAddress user_address = 26; + optional UserAddress user_address = 26; } message IdentityBasic { @@ -185,7 +184,7 @@ message UserUpdateIdentityReq { string national_id = 2; string birthdate = 3; string email = 4; - optional UserAddress user_address = 5; + optional UserAddress user_address = 5; } message UserUpdateBankInfoReq { @@ -195,11 +194,10 @@ message UserUpdateBankInfoReq { string card_number = 4; } -message BankInfoList { - repeated BankInfo list = 1; -} +message BankInfoList { repeated BankInfo list = 1; } -// Status 0: Fail Verify, 1: Verified, 2: Does not Match user's credential , 3: Closed for potential fraud +// Status 0: Fail Verify, 1: Verified, 2: Does not Match user's credential , 3: +// Closed for potential fraud enum BankInfoStatusEnum { FAIL_VERIFY = 0; VERIFIED = 1; @@ -227,7 +225,8 @@ 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 + optional string reason = + 4; // issued jwt reason -> can be login, redeem, withdrawal optional int64 id = 5; optional TfaStateEnum state = 6; } @@ -275,13 +274,9 @@ message Recipient { optional string public_key = 5; } -message LookUpNameReq { - Recipient recipient = 1; -} +message LookUpNameReq { Recipient recipient = 1; } -message LookUpNameRes { - Recipient recipient = 1; -} +message LookUpNameRes { Recipient recipient = 1; } message BasicUserInfo { string name = 1; @@ -290,6 +285,4 @@ message BasicUserInfo { int64 user_id = 4; } -message BasicUserInfoList { - repeated BasicUserInfo list = 1; -} +message BasicUserInfoList { repeated BasicUserInfo list = 1; }