3489 lines
84 KiB
YAML
3489 lines
84 KiB
YAML
definitions:
|
|
domain.Bank:
|
|
properties:
|
|
acct_length:
|
|
type: integer
|
|
active:
|
|
type: integer
|
|
bank_logo:
|
|
description: URL or base64
|
|
type: string
|
|
country_id:
|
|
type: integer
|
|
created_at:
|
|
type: string
|
|
currency:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
is_24hrs:
|
|
description: nullable
|
|
type: integer
|
|
is_active:
|
|
type: integer
|
|
is_mobilemoney:
|
|
description: nullable
|
|
type: integer
|
|
is_rtgs:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
slug:
|
|
type: string
|
|
swift:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
domain.BranchDetailRes:
|
|
properties:
|
|
balance:
|
|
example: 100.5
|
|
type: number
|
|
branch_manager_id:
|
|
example: 1
|
|
type: integer
|
|
company_id:
|
|
example: 1
|
|
type: integer
|
|
company_name:
|
|
example: fortune
|
|
type: string
|
|
deducted_stake:
|
|
type: number
|
|
id:
|
|
example: 1
|
|
type: integer
|
|
is_active:
|
|
example: false
|
|
type: boolean
|
|
is_self_owned:
|
|
example: false
|
|
type: boolean
|
|
is_wallet_active:
|
|
example: false
|
|
type: boolean
|
|
location:
|
|
example: Addis Ababa
|
|
type: string
|
|
manager_name:
|
|
example: John Smith
|
|
type: string
|
|
manager_phone_number:
|
|
example: "0911111111"
|
|
type: string
|
|
name:
|
|
example: 4-kilo Branch
|
|
type: string
|
|
number_of_unsettled:
|
|
type: integer
|
|
profit_percentage:
|
|
example: 0.1
|
|
type: number
|
|
stats_updated_at:
|
|
type: string
|
|
total_bets:
|
|
type: integer
|
|
total_cash_backs:
|
|
type: number
|
|
total_cash_out:
|
|
type: number
|
|
total_cashiers:
|
|
type: integer
|
|
total_stake:
|
|
type: number
|
|
total_unsettled_amount:
|
|
type: number
|
|
wallet_id:
|
|
example: 1
|
|
type: integer
|
|
type: object
|
|
domain.BranchLocation:
|
|
properties:
|
|
key:
|
|
example: addis_ababa
|
|
type: string
|
|
name:
|
|
example: Addis Ababa
|
|
type: string
|
|
type: object
|
|
domain.BranchOperationRes:
|
|
properties:
|
|
description:
|
|
example: Betting on sport events
|
|
type: string
|
|
name:
|
|
example: SportsBook
|
|
type: string
|
|
type: object
|
|
domain.BranchRes:
|
|
properties:
|
|
branch_manager_id:
|
|
example: 1
|
|
type: integer
|
|
company_id:
|
|
example: 1
|
|
type: integer
|
|
id:
|
|
example: 1
|
|
type: integer
|
|
is_active:
|
|
example: false
|
|
type: boolean
|
|
is_self_owned:
|
|
example: false
|
|
type: boolean
|
|
location:
|
|
example: Addis Ababa
|
|
type: string
|
|
name:
|
|
example: 4-kilo Branch
|
|
type: string
|
|
profit_percentage:
|
|
example: 0.1
|
|
type: number
|
|
wallet_id:
|
|
example: 1
|
|
type: integer
|
|
type: object
|
|
domain.CompanyRes:
|
|
properties:
|
|
admin_id:
|
|
example: 1
|
|
type: integer
|
|
deducted_percentage:
|
|
example: 0.1
|
|
type: number
|
|
id:
|
|
example: 1
|
|
type: integer
|
|
is_active:
|
|
example: true
|
|
type: boolean
|
|
name:
|
|
example: CompanyName
|
|
type: string
|
|
slug:
|
|
example: slug
|
|
type: string
|
|
wallet_id:
|
|
example: 1
|
|
type: integer
|
|
type: object
|
|
domain.CreateBranchOperationReq:
|
|
properties:
|
|
branch_id:
|
|
example: 1
|
|
type: integer
|
|
operation_id:
|
|
example: 1
|
|
type: integer
|
|
type: object
|
|
domain.CreateBranchReq:
|
|
properties:
|
|
branch_manager_id:
|
|
example: 1
|
|
type: integer
|
|
company_id:
|
|
example: 1
|
|
type: integer
|
|
is_self_owned:
|
|
example: false
|
|
type: boolean
|
|
location:
|
|
example: Addis Ababa
|
|
maxLength: 100
|
|
minLength: 3
|
|
type: string
|
|
name:
|
|
example: 4-kilo Branch
|
|
maxLength: 100
|
|
minLength: 3
|
|
type: string
|
|
operations:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
profit_percentage:
|
|
example: 0.1
|
|
type: number
|
|
required:
|
|
- branch_manager_id
|
|
- location
|
|
- name
|
|
- operations
|
|
type: object
|
|
domain.CreateCompanyReq:
|
|
properties:
|
|
admin_id:
|
|
example: 1
|
|
type: integer
|
|
deducted_percentage:
|
|
example: 0.1
|
|
type: number
|
|
is_active:
|
|
type: boolean
|
|
name:
|
|
example: CompanyName
|
|
type: string
|
|
slug:
|
|
type: string
|
|
type: object
|
|
domain.CreateSupportedOperationReq:
|
|
properties:
|
|
description:
|
|
example: Betting on sport events
|
|
type: string
|
|
name:
|
|
example: SportsBook
|
|
type: string
|
|
type: object
|
|
domain.ErrorResponse:
|
|
properties:
|
|
error:
|
|
type: string
|
|
message:
|
|
type: string
|
|
type: object
|
|
domain.GetCompanyRes:
|
|
properties:
|
|
admin_first_name:
|
|
example: John
|
|
type: string
|
|
admin_id:
|
|
example: 1
|
|
type: integer
|
|
admin_last_name:
|
|
example: Doe
|
|
type: string
|
|
admin_phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
balance:
|
|
example: 1
|
|
type: number
|
|
deducted_percentage:
|
|
example: 0.1
|
|
type: number
|
|
deducted_stake:
|
|
type: number
|
|
id:
|
|
example: 1
|
|
type: integer
|
|
is_active:
|
|
example: false
|
|
type: boolean
|
|
is_wallet_active:
|
|
example: false
|
|
type: boolean
|
|
name:
|
|
example: CompanyName
|
|
type: string
|
|
number_of_unsettled:
|
|
type: integer
|
|
slug:
|
|
example: slug
|
|
type: string
|
|
stats_updated_at:
|
|
type: string
|
|
total_admins:
|
|
type: integer
|
|
total_approvers:
|
|
type: integer
|
|
total_bets:
|
|
type: integer
|
|
total_branches:
|
|
type: integer
|
|
total_cash_backs:
|
|
type: number
|
|
total_cash_out:
|
|
type: number
|
|
total_cashiers:
|
|
type: integer
|
|
total_customers:
|
|
type: integer
|
|
total_managers:
|
|
type: integer
|
|
total_stake:
|
|
type: number
|
|
total_unsettled_amount:
|
|
type: number
|
|
wallet_id:
|
|
example: 1
|
|
type: integer
|
|
type: object
|
|
domain.InstResponse:
|
|
properties:
|
|
data:
|
|
description: Changed to interface{} for flexibility
|
|
message:
|
|
type: string
|
|
pagination:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Pagination'
|
|
description: Made pointer and optional
|
|
status:
|
|
type: string
|
|
type: object
|
|
domain.LogEntry:
|
|
properties:
|
|
caller:
|
|
type: string
|
|
env:
|
|
type: string
|
|
fields:
|
|
additionalProperties: true
|
|
type: object
|
|
level:
|
|
type: string
|
|
message:
|
|
type: string
|
|
service:
|
|
type: string
|
|
stacktrace:
|
|
type: string
|
|
timestamp:
|
|
type: string
|
|
type: object
|
|
domain.LogResponse:
|
|
properties:
|
|
data:
|
|
items:
|
|
$ref: '#/definitions/domain.LogEntry'
|
|
type: array
|
|
message:
|
|
type: string
|
|
pagination:
|
|
$ref: '#/definitions/domain.Pagination'
|
|
type: object
|
|
domain.Pagination:
|
|
properties:
|
|
current_page:
|
|
type: integer
|
|
limit:
|
|
type: integer
|
|
total:
|
|
type: integer
|
|
total_pages:
|
|
type: integer
|
|
type: object
|
|
domain.ReferralStats:
|
|
properties:
|
|
totalReferrals:
|
|
type: integer
|
|
totalRewardEarned:
|
|
type: integer
|
|
type: object
|
|
domain.ReportedIssue:
|
|
properties:
|
|
created_at:
|
|
type: string
|
|
description:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
issue_type:
|
|
type: string
|
|
metadata:
|
|
additionalProperties: true
|
|
type: object
|
|
status:
|
|
type: string
|
|
subject:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
user_id:
|
|
type: integer
|
|
user_role:
|
|
$ref: '#/definitions/domain.Role'
|
|
type: object
|
|
domain.Response:
|
|
properties:
|
|
data: {}
|
|
message:
|
|
type: string
|
|
metadata: {}
|
|
status_code:
|
|
type: integer
|
|
success:
|
|
type: boolean
|
|
type: object
|
|
domain.Role:
|
|
enum:
|
|
- super_admin
|
|
- admin
|
|
- branch_manager
|
|
- customer
|
|
- cashier
|
|
- transaction_approver
|
|
type: string
|
|
x-enum-varnames:
|
|
- RoleSuperAdmin
|
|
- RoleAdmin
|
|
- RoleBranchManager
|
|
- RoleCustomer
|
|
- RoleCashier
|
|
- RoleTransactionApprover
|
|
domain.SupportedOperationRes:
|
|
properties:
|
|
description:
|
|
example: Betting on sport events
|
|
type: string
|
|
id:
|
|
example: 1
|
|
type: integer
|
|
name:
|
|
example: SportsBook
|
|
type: string
|
|
type: object
|
|
domain.UpdateCompanyReq:
|
|
properties:
|
|
admin_id:
|
|
example: 1
|
|
type: integer
|
|
deducted_percentage:
|
|
example: 0.1
|
|
type: number
|
|
is_active:
|
|
example: true
|
|
type: boolean
|
|
name:
|
|
example: CompanyName
|
|
type: string
|
|
slug:
|
|
type: string
|
|
type: object
|
|
handlers.AdminProfileRes:
|
|
properties:
|
|
created_at:
|
|
type: string
|
|
email:
|
|
type: string
|
|
email_verified:
|
|
type: boolean
|
|
first_name:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
last_login:
|
|
type: string
|
|
last_name:
|
|
type: string
|
|
phone_number:
|
|
type: string
|
|
phone_verified:
|
|
type: boolean
|
|
role:
|
|
$ref: '#/definitions/domain.Role'
|
|
suspended:
|
|
type: boolean
|
|
suspended_at:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
handlers.AdminRes:
|
|
properties:
|
|
created_at:
|
|
type: string
|
|
email:
|
|
type: string
|
|
email_verified:
|
|
type: boolean
|
|
first_name:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
last_login:
|
|
type: string
|
|
last_name:
|
|
type: string
|
|
phone_number:
|
|
type: string
|
|
phone_verified:
|
|
type: boolean
|
|
role:
|
|
$ref: '#/definitions/domain.Role'
|
|
suspended:
|
|
type: boolean
|
|
suspended_at:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
handlers.CheckPhoneEmailExistReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
type: object
|
|
handlers.CheckPhoneEmailExistRes:
|
|
properties:
|
|
email_exist:
|
|
type: boolean
|
|
phone_number_exist:
|
|
type: boolean
|
|
type: object
|
|
handlers.CreateAdminReq:
|
|
properties:
|
|
company_id:
|
|
example: 1
|
|
type: integer
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
first_name:
|
|
example: John
|
|
type: string
|
|
last_name:
|
|
example: Doe
|
|
type: string
|
|
password:
|
|
example: password123
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
type: object
|
|
handlers.CreateCashierReq:
|
|
properties:
|
|
branch_id:
|
|
example: 1
|
|
type: integer
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
first_name:
|
|
example: John
|
|
type: string
|
|
last_name:
|
|
example: Doe
|
|
type: string
|
|
password:
|
|
example: password123
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
suspended:
|
|
example: false
|
|
type: boolean
|
|
type: object
|
|
handlers.CreateManagerReq:
|
|
properties:
|
|
company_id:
|
|
example: 1
|
|
type: integer
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
first_name:
|
|
example: John
|
|
type: string
|
|
last_name:
|
|
example: Doe
|
|
type: string
|
|
password:
|
|
example: password123
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
type: object
|
|
handlers.CreateTransactionApproverReq:
|
|
properties:
|
|
company_id:
|
|
example: 1
|
|
type: integer
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
first_name:
|
|
example: John
|
|
type: string
|
|
last_name:
|
|
example: Doe
|
|
type: string
|
|
password:
|
|
example: password123
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
type: object
|
|
handlers.CustomerProfileRes:
|
|
properties:
|
|
created_at:
|
|
type: string
|
|
email:
|
|
type: string
|
|
email_verified:
|
|
type: boolean
|
|
first_name:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
last_login:
|
|
type: string
|
|
last_name:
|
|
type: string
|
|
phone_number:
|
|
type: string
|
|
phone_verified:
|
|
type: boolean
|
|
referral_code:
|
|
type: string
|
|
role:
|
|
$ref: '#/definitions/domain.Role'
|
|
suspended:
|
|
type: boolean
|
|
suspended_at:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
handlers.CustomersRes:
|
|
properties:
|
|
company_id:
|
|
type: integer
|
|
company_name:
|
|
type: string
|
|
created_at:
|
|
type: string
|
|
email:
|
|
type: string
|
|
email_verified:
|
|
type: boolean
|
|
first_name:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
last_login:
|
|
type: string
|
|
last_name:
|
|
type: string
|
|
phone_number:
|
|
type: string
|
|
phone_verified:
|
|
type: boolean
|
|
role:
|
|
$ref: '#/definitions/domain.Role'
|
|
suspended:
|
|
type: boolean
|
|
suspended_at:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
handlers.GetCashierRes:
|
|
properties:
|
|
branch_id:
|
|
type: integer
|
|
branch_location:
|
|
type: string
|
|
branch_name:
|
|
type: string
|
|
branch_wallet:
|
|
type: integer
|
|
created_at:
|
|
type: string
|
|
email:
|
|
type: string
|
|
email_verified:
|
|
type: boolean
|
|
first_name:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
last_login:
|
|
type: string
|
|
last_name:
|
|
type: string
|
|
phone_number:
|
|
type: string
|
|
phone_verified:
|
|
type: boolean
|
|
role:
|
|
$ref: '#/definitions/domain.Role'
|
|
suspended:
|
|
type: boolean
|
|
suspended_at:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
handlers.LoginAdminRes:
|
|
properties:
|
|
access_token:
|
|
type: string
|
|
refresh_token:
|
|
type: string
|
|
role:
|
|
type: string
|
|
type: object
|
|
handlers.ManagersRes:
|
|
properties:
|
|
created_at:
|
|
type: string
|
|
email:
|
|
type: string
|
|
email_verified:
|
|
type: boolean
|
|
first_name:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
last_login:
|
|
type: string
|
|
last_name:
|
|
type: string
|
|
phone_number:
|
|
type: string
|
|
phone_verified:
|
|
type: boolean
|
|
role:
|
|
$ref: '#/definitions/domain.Role'
|
|
suspended:
|
|
type: boolean
|
|
suspended_at:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
handlers.RegisterCodeReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
type: object
|
|
handlers.RegisterUserReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
first_name:
|
|
example: John
|
|
type: string
|
|
last_name:
|
|
example: Doe
|
|
type: string
|
|
otp:
|
|
example: "123456"
|
|
type: string
|
|
password:
|
|
example: password123
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
referral_code:
|
|
example: ABC123
|
|
type: string
|
|
type: object
|
|
handlers.ResetCodeReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
type: object
|
|
handlers.ResetPasswordReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
otp:
|
|
example: "123456"
|
|
type: string
|
|
password:
|
|
example: newpassword123
|
|
minLength: 8
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
required:
|
|
- otp
|
|
- password
|
|
type: object
|
|
handlers.SearchUserByNameOrPhoneReq:
|
|
properties:
|
|
query:
|
|
type: string
|
|
role:
|
|
$ref: '#/definitions/domain.Role'
|
|
type: object
|
|
handlers.UpdateUserSuspendReq:
|
|
properties:
|
|
suspended:
|
|
example: true
|
|
type: boolean
|
|
user_id:
|
|
example: 123
|
|
type: integer
|
|
required:
|
|
- user_id
|
|
type: object
|
|
handlers.UpdateUserSuspendRes:
|
|
properties:
|
|
suspended:
|
|
type: boolean
|
|
user_id:
|
|
type: integer
|
|
type: object
|
|
handlers.UserProfileRes:
|
|
properties:
|
|
created_at:
|
|
type: string
|
|
email:
|
|
type: string
|
|
email_verified:
|
|
type: boolean
|
|
first_name:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
last_login:
|
|
type: string
|
|
last_name:
|
|
type: string
|
|
phone_number:
|
|
type: string
|
|
phone_verified:
|
|
type: boolean
|
|
referral_code:
|
|
type: string
|
|
role:
|
|
$ref: '#/definitions/domain.Role'
|
|
suspended:
|
|
type: boolean
|
|
suspended_at:
|
|
type: string
|
|
updated_at:
|
|
type: string
|
|
type: object
|
|
handlers.loginAdminReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
password:
|
|
example: password123
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
required:
|
|
- password
|
|
type: object
|
|
handlers.loginCustomerReq:
|
|
properties:
|
|
email:
|
|
example: john.doe@example.com
|
|
type: string
|
|
password:
|
|
example: password123
|
|
type: string
|
|
phone_number:
|
|
example: "1234567890"
|
|
type: string
|
|
required:
|
|
- password
|
|
type: object
|
|
handlers.loginCustomerRes:
|
|
properties:
|
|
access_token:
|
|
type: string
|
|
refresh_token:
|
|
type: string
|
|
role:
|
|
type: string
|
|
type: object
|
|
handlers.logoutReq:
|
|
properties:
|
|
refresh_token:
|
|
example: <refresh-token>
|
|
type: string
|
|
required:
|
|
- refresh_token
|
|
type: object
|
|
handlers.refreshToken:
|
|
properties:
|
|
access_token:
|
|
example: <jwt-token>
|
|
type: string
|
|
refresh_token:
|
|
example: <refresh-token>
|
|
type: string
|
|
required:
|
|
- access_token
|
|
- refresh_token
|
|
type: object
|
|
handlers.updateAdminReq:
|
|
properties:
|
|
company_id:
|
|
example: 1
|
|
type: integer
|
|
first_name:
|
|
example: John
|
|
type: string
|
|
last_name:
|
|
example: Doe
|
|
type: string
|
|
suspended:
|
|
example: false
|
|
type: boolean
|
|
type: object
|
|
handlers.updateCashierReq:
|
|
properties:
|
|
first_name:
|
|
example: John
|
|
type: string
|
|
last_name:
|
|
example: Doe
|
|
type: string
|
|
suspended:
|
|
example: false
|
|
type: boolean
|
|
type: object
|
|
handlers.updateCustomerReq:
|
|
properties:
|
|
first_name:
|
|
example: John
|
|
type: string
|
|
last_name:
|
|
example: Doe
|
|
type: string
|
|
suspended:
|
|
example: false
|
|
type: boolean
|
|
type: object
|
|
handlers.updateManagerReq:
|
|
properties:
|
|
company_id:
|
|
example: 1
|
|
type: integer
|
|
first_name:
|
|
example: John
|
|
type: string
|
|
last_name:
|
|
example: Doe
|
|
type: string
|
|
suspended:
|
|
example: false
|
|
type: boolean
|
|
type: object
|
|
response.APIResponse:
|
|
properties:
|
|
data: {}
|
|
message:
|
|
type: string
|
|
metadata: {}
|
|
page:
|
|
type: integer
|
|
status:
|
|
$ref: '#/definitions/response.Status'
|
|
timestamp:
|
|
type: string
|
|
total:
|
|
type: integer
|
|
type: object
|
|
response.Status:
|
|
enum:
|
|
- error
|
|
- success
|
|
type: string
|
|
x-enum-varnames:
|
|
- Error
|
|
- Success
|
|
info:
|
|
contact:
|
|
email: support@swagger.io
|
|
name: API Support
|
|
url: http://www.swagger.io/support
|
|
description: This is server for Yimaru.
|
|
license:
|
|
name: Apache 2.0
|
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
|
termsOfService: http://swagger.io/terms/
|
|
title: Yimaru API
|
|
version: 1.0.1
|
|
paths:
|
|
/api/v1/{tenant_slug}/admin-login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Login customer
|
|
parameters:
|
|
- description: Login admin
|
|
in: body
|
|
name: login
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.loginAdminReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.LoginAdminRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Login customer
|
|
tags:
|
|
- auth
|
|
/api/v1/{tenant_slug}/customer-login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Login customer
|
|
parameters:
|
|
- description: Login customer
|
|
in: body
|
|
name: login
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.loginCustomerReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.loginCustomerRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Login customer
|
|
tags:
|
|
- auth
|
|
/api/v1/{tenant_slug}/user/admin-profile:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get user profile
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.AdminProfileRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get user profile
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/checkPhoneEmailExist:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Check if phone number or email exist
|
|
parameters:
|
|
- description: Check phone number or email exist
|
|
in: body
|
|
name: checkPhoneEmailExist
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.CheckPhoneEmailExistReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.CheckPhoneEmailExistRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Check if phone number or email exist
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/customer-profile:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get user profile
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.CustomerProfileRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get user profile
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/register:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Register user
|
|
parameters:
|
|
- description: Register user
|
|
in: body
|
|
name: registerUser
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.RegisterUserReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Register user
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/resetPassword:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Reset tenant password
|
|
parameters:
|
|
- description: Reset password
|
|
in: body
|
|
name: resetPassword
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.ResetPasswordReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Reset tenant password
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/search:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Search for user using name or phone
|
|
parameters:
|
|
- description: Search for using his name or phone
|
|
in: body
|
|
name: searchUserByNameOrPhone
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.SearchUserByNameOrPhoneReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.UserProfileRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Search for user using name or phone
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/sendRegisterCode:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Send register code
|
|
parameters:
|
|
- description: Send register code
|
|
in: body
|
|
name: registerCode
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.RegisterCodeReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Send register code
|
|
tags:
|
|
- user
|
|
/api/v1/{tenant_slug}/user/sendResetCode:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Send reset code
|
|
parameters:
|
|
- description: Send reset code
|
|
in: body
|
|
name: resetCode
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.ResetCodeReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Send reset code
|
|
tags:
|
|
- user
|
|
/api/v1/admin:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get all Admins
|
|
parameters:
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: page_size
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.AdminRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get all Admins
|
|
tags:
|
|
- admin
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create transaction approver
|
|
parameters:
|
|
- description: Create transaction approver
|
|
in: body
|
|
name: manger
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.CreateTransactionApproverReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Create transaction approver
|
|
tags:
|
|
- admin
|
|
/api/v1/admin-company:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets a single company by id
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.GetCompanyRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets company by id
|
|
tags:
|
|
- company
|
|
/api/v1/admin/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get a single admin by id
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.AdminRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get admin by id
|
|
tags:
|
|
- admin
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update Admin
|
|
parameters:
|
|
- description: Update Admin
|
|
in: body
|
|
name: admin
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateAdminReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Update Admin
|
|
tags:
|
|
- admin
|
|
/api/v1/auth/logout:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Logout customer
|
|
parameters:
|
|
- description: Logout customer
|
|
in: body
|
|
name: logout
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.logoutReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Logout customer
|
|
tags:
|
|
- auth
|
|
/api/v1/auth/refresh:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Refresh token
|
|
parameters:
|
|
- description: tokens
|
|
in: body
|
|
name: refresh
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.refreshToken'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.loginCustomerRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Refresh token
|
|
tags:
|
|
- auth
|
|
/api/v1/banks:
|
|
get:
|
|
parameters:
|
|
- description: Filter by country ID
|
|
in: query
|
|
name: country_id
|
|
type: integer
|
|
- description: Filter by active status
|
|
in: query
|
|
name: is_active
|
|
type: boolean
|
|
- description: Search term for bank name or code
|
|
in: query
|
|
name: search
|
|
type: string
|
|
- default: 1
|
|
description: Page number
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- default: 50
|
|
description: Items per page
|
|
in: query
|
|
maximum: 100
|
|
name: page_size
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.InstResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: List all banks with pagination and filtering
|
|
tags:
|
|
- Institutions - Banks
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
parameters:
|
|
- description: Bank Info
|
|
in: body
|
|
name: bank
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.Bank'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.Bank'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Create a new bank
|
|
tags:
|
|
- Institutions - Banks
|
|
/api/v1/banks/{id}:
|
|
delete:
|
|
parameters:
|
|
- description: Bank ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"204":
|
|
description: Deleted successfully
|
|
schema:
|
|
type: string
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Delete a bank
|
|
tags:
|
|
- Institutions - Banks
|
|
get:
|
|
parameters:
|
|
- description: Bank ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Bank'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get a bank by ID
|
|
tags:
|
|
- Institutions - Banks
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
parameters:
|
|
- description: Bank ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Bank Info
|
|
in: body
|
|
name: bank
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.Bank'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Bank'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"404":
|
|
description: Not Found
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Update a bank
|
|
tags:
|
|
- Institutions - Banks
|
|
/api/v1/branch:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets all branches
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.BranchDetailRes'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets all branches
|
|
tags:
|
|
- branch
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a branch
|
|
parameters:
|
|
- description: Creates branch
|
|
in: body
|
|
name: createBranch
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.CreateBranchReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.BranchRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Create a branch
|
|
tags:
|
|
- branch
|
|
/api/v1/branch/{id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: Delete the branch
|
|
parameters:
|
|
- description: Branch ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Delete the branch
|
|
tags:
|
|
- branch
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets a single branch by id
|
|
parameters:
|
|
- description: Branch ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.BranchDetailRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets branch by id
|
|
tags:
|
|
- branch
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Updates a branch
|
|
parameters:
|
|
- description: Branch ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Update Branch
|
|
in: body
|
|
name: updateBranch
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.CreateBranchReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.BranchRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Updates a branch
|
|
tags:
|
|
- branch
|
|
/api/v1/branch/{id}/cashier:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets branch cashiers
|
|
parameters:
|
|
- description: Branch ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/handlers.GetCashierRes'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets branch cashiers
|
|
tags:
|
|
- branch
|
|
/api/v1/branch/{id}/operation:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets branch operations
|
|
parameters:
|
|
- description: Branch ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.BranchOperationRes'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets branch operations
|
|
tags:
|
|
- branch
|
|
/api/v1/branch/{id}/operation/{opID}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: Delete the branch operation
|
|
parameters:
|
|
- description: Branch ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Branch Operation ID
|
|
in: path
|
|
name: opID
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Delete the branch operation
|
|
tags:
|
|
- branch
|
|
/api/v1/branch/{id}/return:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Unassign the branch wallet to company
|
|
parameters:
|
|
- description: Branch ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.BranchDetailRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Unassign the branch wallet to company
|
|
tags:
|
|
- branch
|
|
/api/v1/branchCashier:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets branch for cahier
|
|
parameters:
|
|
- description: Branch ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.BranchDetailRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets branch for cahier
|
|
tags:
|
|
- branch
|
|
/api/v1/branchLocation:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets all branch locations
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.BranchLocation'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets all branch locations
|
|
tags:
|
|
- branch
|
|
/api/v1/cashier/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get a single cashier by id
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.UserProfileRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get cashier by id
|
|
tags:
|
|
- cashier
|
|
/api/v1/cashiers:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get all cashiers
|
|
parameters:
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: page_size
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/handlers.GetCashierRes'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get all cashiers
|
|
tags:
|
|
- cashier
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create cashier
|
|
parameters:
|
|
- description: Create cashier
|
|
in: body
|
|
name: cashier
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.CreateCashierReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Create cashier
|
|
tags:
|
|
- cashier
|
|
/api/v1/cashiers/{id}:
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update cashier
|
|
parameters:
|
|
- description: Cashier ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Update cashier
|
|
in: body
|
|
name: cashier
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateCashierReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Update cashier
|
|
tags:
|
|
- cashier
|
|
/api/v1/company:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets all companies
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.GetCompanyRes'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets all companies
|
|
tags:
|
|
- company
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a company
|
|
parameters:
|
|
- description: Creates company
|
|
in: body
|
|
name: createCompany
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.CreateCompanyReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.CompanyRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Create a company
|
|
tags:
|
|
- company
|
|
/api/v1/company/{id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: Delete the company
|
|
parameters:
|
|
- description: Company ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Delete the company
|
|
tags:
|
|
- company
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets a single company by id
|
|
parameters:
|
|
- description: Company ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.GetCompanyRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets company by id
|
|
tags:
|
|
- company
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Updates a company
|
|
parameters:
|
|
- description: Company ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
- description: Update Company
|
|
in: body
|
|
name: updateCompany
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.UpdateCompanyReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.CompanyRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Updates a company
|
|
tags:
|
|
- company
|
|
/api/v1/company/{id}/branch:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets branches by company id
|
|
parameters:
|
|
- description: Company ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.BranchDetailRes'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets branches by company id
|
|
tags:
|
|
- branch
|
|
/api/v1/currencies:
|
|
get:
|
|
description: Returns list of supported currencies
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
type: object
|
|
summary: Get supported currencies
|
|
tags:
|
|
- Multi-Currency
|
|
/api/v1/currencies/convert:
|
|
get:
|
|
description: Converts amount from one currency to another
|
|
parameters:
|
|
- description: Source currency code (e.g., USD)
|
|
in: query
|
|
name: from
|
|
required: true
|
|
type: string
|
|
- description: Target currency code (e.g., ETB)
|
|
in: query
|
|
name: to
|
|
required: true
|
|
type: string
|
|
- description: Amount to convert
|
|
in: query
|
|
name: amount
|
|
required: true
|
|
type: number
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
allOf:
|
|
- $ref: '#/definitions/domain.Response'
|
|
- properties:
|
|
data:
|
|
type: number
|
|
type: object
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Convert currency
|
|
tags:
|
|
- Multi-Currency
|
|
/api/v1/customer:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get all Customers
|
|
parameters:
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: page_size
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.CustomersRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get all Customers
|
|
tags:
|
|
- customer
|
|
/api/v1/customer/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get a single customer by id
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.CustomersRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get customer by id
|
|
tags:
|
|
- customer
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update Customers
|
|
parameters:
|
|
- description: Update Customers
|
|
in: body
|
|
name: Customers
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateCustomerReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Update Customers
|
|
tags:
|
|
- customer
|
|
/api/v1/issues:
|
|
get:
|
|
description: Admin endpoint to list all reported issues with pagination
|
|
parameters:
|
|
- description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.ReportedIssue'
|
|
type: array
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get all reported issues
|
|
tags:
|
|
- Issues
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Allows a customer to report a new issue related to the betting
|
|
platform
|
|
parameters:
|
|
- description: Issue to report
|
|
in: body
|
|
name: issue
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.ReportedIssue'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"201":
|
|
description: Created
|
|
schema:
|
|
$ref: '#/definitions/domain.ReportedIssue'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Report an issue
|
|
tags:
|
|
- Issues
|
|
/api/v1/issues/{issue_id}:
|
|
delete:
|
|
description: Admin endpoint to delete a reported issue
|
|
parameters:
|
|
- description: Issue ID
|
|
in: path
|
|
name: issue_id
|
|
required: true
|
|
type: integer
|
|
responses:
|
|
"204":
|
|
description: No Content
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Delete a reported issue
|
|
tags:
|
|
- Issues
|
|
/api/v1/issues/{issue_id}/status:
|
|
patch:
|
|
consumes:
|
|
- application/json
|
|
description: Admin endpoint to update the status of a reported issue
|
|
parameters:
|
|
- description: Issue ID
|
|
in: path
|
|
name: issue_id
|
|
required: true
|
|
type: integer
|
|
- description: New issue status (pending, in_progress, resolved, rejected)
|
|
in: body
|
|
name: status
|
|
required: true
|
|
schema:
|
|
properties:
|
|
status:
|
|
type: string
|
|
type: object
|
|
responses:
|
|
"204":
|
|
description: No Content
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Update issue status
|
|
tags:
|
|
- Issues
|
|
/api/v1/issues/user/{user_id}:
|
|
get:
|
|
description: Returns all issues reported by a specific user
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: user_id
|
|
required: true
|
|
type: integer
|
|
- description: Limit
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
- description: Offset
|
|
in: query
|
|
name: offset
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.ReportedIssue'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Get reported issues by a user
|
|
tags:
|
|
- Issues
|
|
/api/v1/logs:
|
|
get:
|
|
description: Fetches application logs from MongoDB with pagination, level filtering,
|
|
and search
|
|
parameters:
|
|
- description: Filter logs by level (debug, info, warn, error, dpanic, panic,
|
|
fatal)
|
|
in: query
|
|
name: level
|
|
type: string
|
|
- description: Search term to match against message or fields
|
|
in: query
|
|
name: search
|
|
type: string
|
|
- default: 1
|
|
description: 'Page number for pagination (default: 1)'
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- default: 50
|
|
description: 'Number of items per page (default: 50, max: 100)'
|
|
in: query
|
|
name: limit
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: Paginated list of application logs
|
|
schema:
|
|
$ref: '#/definitions/domain.LogResponse'
|
|
"400":
|
|
description: Invalid request parameters
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
"500":
|
|
description: Internal server error
|
|
schema:
|
|
$ref: '#/definitions/domain.ErrorResponse'
|
|
summary: Retrieve application logs with filtering and pagination
|
|
tags:
|
|
- Logs
|
|
/api/v1/manager/{id}/branch:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets a branches by manager id
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.BranchDetailRes'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets branches by manager id
|
|
tags:
|
|
- branch
|
|
/api/v1/managers:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get all Managers
|
|
parameters:
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: page_size
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.ManagersRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get all Managers
|
|
tags:
|
|
- manager
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Create Manager
|
|
parameters:
|
|
- description: Create manager
|
|
in: body
|
|
name: manger
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.CreateManagerReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Create Manager
|
|
tags:
|
|
- manager
|
|
/api/v1/managers/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get a single manager by id
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.ManagersRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get manager by id
|
|
tags:
|
|
- manager
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update Managers
|
|
parameters:
|
|
- description: Update Managers
|
|
in: body
|
|
name: Managers
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateManagerReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Update Managers
|
|
tags:
|
|
- manager
|
|
/api/v1/operation:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a operation
|
|
parameters:
|
|
- description: Creates operation
|
|
in: body
|
|
name: createBranchOperation
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.CreateBranchOperationReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.BranchOperationRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Create a operation
|
|
tags:
|
|
- branch
|
|
/api/v1/search/branch:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Search branches by name or location
|
|
parameters:
|
|
- description: Search query
|
|
in: query
|
|
name: q
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.BranchDetailRes'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Search branches
|
|
tags:
|
|
- branch
|
|
/api/v1/search/company:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets all companies
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.CompanyRes'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets all companies
|
|
tags:
|
|
- company
|
|
/api/v1/super-login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Login super-admin
|
|
parameters:
|
|
- description: Login super-admin
|
|
in: body
|
|
name: login
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.loginAdminReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.LoginAdminRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Login super-admin
|
|
tags:
|
|
- auth
|
|
/api/v1/supportedOperation:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Gets all supported operations
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.BranchDetailRes'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Gets all supported operations
|
|
tags:
|
|
- branch
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Creates a supported operation
|
|
parameters:
|
|
- description: Creates supported operation
|
|
in: body
|
|
name: createSupportedOperation
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.CreateSupportedOperationReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.SupportedOperationRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Create a supported operation
|
|
tags:
|
|
- branch
|
|
/api/v1/t-approver:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get all Admins
|
|
parameters:
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: page_size
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.AdminRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get all Admins
|
|
tags:
|
|
- admin
|
|
/api/v1/t-approver/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get a single admin by id
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.AdminRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get admin by id
|
|
tags:
|
|
- admin
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update Admin
|
|
parameters:
|
|
- description: Update Admin
|
|
in: body
|
|
name: admin
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateAdminReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Update Admin
|
|
tags:
|
|
- admin
|
|
/api/v1/tenant:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Check if phone number or email exist
|
|
parameters:
|
|
- description: Check phone number or email exist
|
|
in: body
|
|
name: checkPhoneEmailExist
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.CheckPhoneEmailExistReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.CheckPhoneEmailExistRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Check if phone number or email exist
|
|
tags:
|
|
- user
|
|
/api/v1/tenant/{tenant_slug}/customer:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get all Customers
|
|
parameters:
|
|
- description: Page number
|
|
in: query
|
|
name: page
|
|
type: integer
|
|
- description: Page size
|
|
in: query
|
|
name: page_size
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.CustomersRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get all Customers
|
|
tags:
|
|
- customer
|
|
/api/v1/tenant/{tenant_slug}/customer/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get a single customer by id
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.CustomersRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get customer by id
|
|
tags:
|
|
- customer
|
|
put:
|
|
consumes:
|
|
- application/json
|
|
description: Update Customers
|
|
parameters:
|
|
- description: Update Customers
|
|
in: body
|
|
name: Customers
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.updateCustomerReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Update Customers
|
|
tags:
|
|
- customer
|
|
/api/v1/tenant/{tenant_slug}/referral/stats:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Retrieves referral statistics for the authenticated user
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.ReferralStats'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
security:
|
|
- Bearer: []
|
|
summary: Get referral statistics
|
|
tags:
|
|
- referral
|
|
/api/v1/user/delete/{id}:
|
|
delete:
|
|
consumes:
|
|
- application/json
|
|
description: Delete a user by their ID
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Delete user by ID
|
|
tags:
|
|
- user
|
|
/api/v1/user/resetPassword:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Reset password
|
|
parameters:
|
|
- description: Reset password
|
|
in: body
|
|
name: resetPassword
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.ResetPasswordReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Reset password
|
|
tags:
|
|
- user
|
|
/api/v1/user/search:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Search for user using name or phone
|
|
parameters:
|
|
- description: Search for using his name or phone
|
|
in: body
|
|
name: searchUserByNameOrPhone
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.SearchUserByNameOrPhoneReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.UserProfileRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Search for user using name or phone
|
|
tags:
|
|
- user
|
|
/api/v1/user/sendResetCode:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Send reset code
|
|
parameters:
|
|
- description: Send reset code
|
|
in: body
|
|
name: resetCode
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.ResetCodeReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Send reset code
|
|
tags:
|
|
- user
|
|
/api/v1/user/single/{id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: Get a single user by id
|
|
parameters:
|
|
- description: User ID
|
|
in: path
|
|
name: id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.UserProfileRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"401":
|
|
description: Unauthorized
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Get user by id
|
|
tags:
|
|
- user
|
|
/api/v1/user/suspend:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Suspend or unsuspend a user
|
|
parameters:
|
|
- description: Suspend or unsuspend a user
|
|
in: body
|
|
name: updateUserSuspend
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/handlers.UpdateUserSuspendReq'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/handlers.UpdateUserSuspendRes'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/response.APIResponse'
|
|
summary: Suspend or unsuspend a user
|
|
tags:
|
|
- user
|
|
securityDefinitions:
|
|
Bearer:
|
|
in: header
|
|
name: Authorization
|
|
type: apiKey
|
|
swagger: "2.0"
|