{ "swagger": "2.0", "info": { "description": "This is server for FortuneBet.", "title": "FortuneBet API", "termsOfService": "http://swagger.io/terms/", "contact": { "name": "API Support", "url": "http://www.swagger.io/support", "email": "support@swagger.io" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0" }, "paths": { "/auth/login": { "post": { "description": "Login customer", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Login customer", "parameters": [ { "description": "Login customer", "name": "login", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.loginCustomerReq" } } ], "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" } } } } }, "/auth/logout": { "post": { "description": "Logout customer", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Logout customer", "parameters": [ { "description": "Logout customer", "name": "logout", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.logoutReq" } } ], "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" } } } } }, "/auth/refresh": { "post": { "description": "Refresh token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Refresh token", "parameters": [ { "description": "tokens", "name": "refresh", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.refreshToken" } } ], "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" } } } } }, "/bet": { "get": { "description": "Gets all the bets", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "bet" ], "summary": "Gets all bets", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handlers.BetRes" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } }, "post": { "description": "Creates a bet", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "bet" ], "summary": "Create a bet", "parameters": [ { "description": "Creates bet", "name": "createBet", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreateBetReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.BetRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/bet/{id}": { "get": { "description": "Gets a single bet by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "bet" ], "summary": "Gets bet by id", "parameters": [ { "type": "integer", "description": "Bet ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.BetRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } }, "delete": { "description": "Deletes bet by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "bet" ], "summary": "Deletes bet by id", "parameters": [ { "type": "integer", "description": "Bet ID", "name": "id", "in": "path", "required": true } ], "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" } } } }, "patch": { "description": "Updates the cashed out field", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "bet" ], "summary": "Updates the cashed out field", "parameters": [ { "type": "integer", "description": "Bet ID", "name": "id", "in": "path", "required": true }, { "description": "Updates Cashed Out", "name": "updateCashOut", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.UpdateCashOutReq" } } ], "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" } } } } }, "/branch": { "get": { "description": "Gets all branches", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Gets all branches", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handlers.BranchDetailRes" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } }, "post": { "description": "Creates a branch", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Create a branch", "parameters": [ { "description": "Creates branch", "name": "createBranch", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreateBranchReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.BranchRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/branch/{id}": { "get": { "description": "Gets a single branch by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Gets branch by id", "parameters": [ { "type": "integer", "description": "Branch ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.BranchDetailRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } }, "put": { "description": "Updates a branch", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Updates a branch", "parameters": [ { "type": "integer", "description": "Branch ID", "name": "id", "in": "path", "required": true }, { "description": "Update Branch", "name": "updateBranch", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreateBranchReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.BranchRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } }, "delete": { "description": "Delete the branch", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Delete the branch", "parameters": [ { "type": "integer", "description": "Branch ID", "name": "id", "in": "path", "required": true } ], "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" } } } } }, "/branch/{id}/operation": { "get": { "description": "Gets branch operations", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Gets branch operations", "parameters": [ { "type": "integer", "description": "Branch ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handlers.BranchOperationRes" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/branch/{id}/operation/{opID}": { "delete": { "description": "Delete the branch operation", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Delete the branch operation", "parameters": [ { "type": "integer", "description": "Branch ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "Branch Operation ID", "name": "opID", "in": "path", "required": true } ], "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" } } } } }, "/company/{id}/branch": { "get": { "description": "Gets branches by company id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Gets branches by company id", "parameters": [ { "type": "integer", "description": "Company ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handlers.BranchDetailRes" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/manager/{id}/branch": { "get": { "description": "Gets a branches by manager id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Gets branches by manager id", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handlers.BranchDetailRes" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/operation": { "post": { "description": "Creates a operation", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Create a operation", "parameters": [ { "description": "Creates operation", "name": "createBranchOperation", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreateBranchOperationReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.BranchOperationRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/supportedOperation": { "get": { "description": "Gets all supported operations", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Gets all supported operations", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handlers.BranchDetailRes" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } }, "post": { "description": "Creates a supported operation", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "branch" ], "summary": "Create a supported operation", "parameters": [ { "description": "Creates supported operation", "name": "createSupportedOperation", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreateSupportedOperationReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.SupportedOperationRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/ticket": { "get": { "description": "Retrieve all tickets", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "ticket" ], "summary": "Get all tickets", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handlers.TicketRes" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } }, "post": { "description": "Creates a temporary ticket", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "ticket" ], "summary": "Create a temporary ticket", "parameters": [ { "description": "Creates ticket", "name": "createTicket", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreateTicketReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.CreateTicketRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/ticket/{id}": { "get": { "description": "Retrieve ticket details by ticket ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "ticket" ], "summary": "Get ticket by ID", "parameters": [ { "type": "integer", "description": "Ticket ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.TicketRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/transaction": { "get": { "description": "Gets all the transactions", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "transaction" ], "summary": "Gets all transactions", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handlers.TransactionRes" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } }, "post": { "description": "Creates a transaction", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "transaction" ], "summary": "Create a transaction", "parameters": [ { "description": "Creates transaction", "name": "createBet", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreateTransactionReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.TransactionRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/transaction/{id}": { "get": { "description": "Gets a single transaction by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "transaction" ], "summary": "Gets transaction by id", "parameters": [ { "type": "integer", "description": "Transaction ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.TransactionRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } }, "patch": { "description": "Updates the cashed out field", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "transaction" ], "summary": "Updates the cashed out field", "parameters": [ { "type": "integer", "description": "Transaction ID", "name": "id", "in": "path", "required": true }, { "description": "Updates Transaction Verification", "name": "updateCashOut", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.UpdateTransactionVerifiedReq" } } ], "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" } } } } }, "/transfer/wallet": { "post": { "description": "Create a transfer to wallet", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "transfer" ], "summary": "Create a transfer to wallet", "parameters": [ { "description": "Create Transfer", "name": "transferToWallet", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreateTransferReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.TransferRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/user/checkPhoneEmailExist": { "post": { "description": "Check if phone number or email exist", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Check if phone number or email exist", "parameters": [ { "description": "Check phone number or email exist", "name": "checkPhoneEmailExist", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CheckPhoneEmailExistReq" } } ], "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" } } } } }, "/user/profile": { "get": { "security": [ { "Bearer": [] } ], "description": "Get user profile", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get user profile", "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" } } } } }, "/user/register": { "post": { "description": "Register user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Register user", "parameters": [ { "description": "Register user", "name": "registerUser", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.RegisterUserReq" } } ], "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" } } } } }, "/user/resetPassword": { "post": { "description": "Reset password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Reset password", "parameters": [ { "description": "Reset password", "name": "resetPassword", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.ResetPasswordReq" } } ], "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" } } } } }, "/user/search": { "post": { "description": "Search for user using name or phone", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Search for user using name or phone", "parameters": [ { "description": "Search for using his name or phone", "name": "searchUserByNameOrPhone", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.SearchUserByNameOrPhoneReq" } } ], "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" } } } } }, "/user/sendRegisterCode": { "post": { "description": "Send register code", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Send register code", "parameters": [ { "description": "Send register code", "name": "registerCode", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.RegisterCodeReq" } } ], "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" } } } } }, "/user/sendResetCode": { "post": { "description": "Send reset code", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Send reset code", "parameters": [ { "description": "Send reset code", "name": "resetCode", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.ResetCodeReq" } } ], "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" } } } } }, "/user/wallet": { "get": { "security": [ { "Bearer": [] } ], "description": "Retrieve customer wallet details", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "wallet" ], "summary": "Get customer wallet", "parameters": [ { "type": "integer", "description": "Company ID", "name": "company_id", "in": "header", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.CustomerWalletRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/wallet": { "get": { "description": "Retrieve all wallets", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "wallet" ], "summary": "Get all wallets", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/handlers.WalletRes" } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } } }, "/wallet/{id}": { "get": { "description": "Retrieve wallet details by wallet ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "wallet" ], "summary": "Get wallet by ID", "parameters": [ { "type": "integer", "description": "Wallet ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.WalletRes" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/response.APIResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/response.APIResponse" } } } }, "patch": { "description": "Can activate and deactivate wallet", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "wallet" ], "summary": "Activate and Deactivate Wallet", "parameters": [ { "type": "integer", "description": "Wallet ID", "name": "id", "in": "path", "required": true }, { "description": "Update Wallet Active", "name": "updateCashOut", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.UpdateWalletActiveReq" } } ], "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" } } } } } }, "definitions": { "domain.BetStatus": { "type": "integer", "enum": [ 0, 1, 2, 3 ], "x-enum-varnames": [ "BET_STATUS_PENDING", "BET_STATUS_WIN", "BET_STATUS_LOSS", "BET_STATUS_ERROR" ] }, "domain.Outcome": { "type": "object" }, "domain.PaymentOption": { "type": "integer", "enum": [ 0, 1, 2, 3 ], "x-enum-varnames": [ "CASH_TRANSACTION", "TELEBIRR_TRANSACTION", "ARIFPAY_TRANSACTION", "BANK" ] }, "domain.Role": { "type": "string", "enum": [ "super_admin", "admin", "branch_manager", "customer", "cashier" ], "x-enum-varnames": [ "RoleSuperAdmin", "RoleAdmin", "RoleBranchManager", "RoleCustomer", "RoleCashier" ] }, "handlers.BetRes": { "type": "object", "properties": { "amount": { "type": "number", "example": 100 }, "branch_id": { "type": "integer", "example": 2 }, "full_name": { "type": "string", "example": "John" }, "id": { "type": "integer", "example": 1 }, "is_shop_bet": { "type": "boolean", "example": false }, "outcomes": { "type": "array", "items": { "$ref": "#/definitions/domain.Outcome" } }, "phone_number": { "type": "string", "example": "1234567890" }, "status": { "allOf": [ { "$ref": "#/definitions/domain.BetStatus" } ], "example": 1 }, "total_odds": { "type": "number", "example": 4.22 }, "user_id": { "type": "integer", "example": 2 } } }, "handlers.BranchDetailRes": { "type": "object", "properties": { "branch_manager_id": { "type": "integer", "example": 1 }, "company_id": { "type": "integer", "example": 1 }, "is_self_owned": { "type": "boolean", "example": false }, "location": { "type": "string", "example": "Addis Ababa" }, "manager_name": { "type": "string", "example": "John Smith" }, "manager_phone_number": { "type": "string", "example": "0911111111" }, "name": { "type": "string", "example": "4-kilo Branch" }, "wallet_id": { "type": "integer", "example": 1 } } }, "handlers.BranchOperationRes": { "type": "object", "properties": { "description": { "type": "string", "example": "Betting on sport events" }, "name": { "type": "string", "example": "SportsBook" } } }, "handlers.BranchRes": { "type": "object", "properties": { "branch_manager_id": { "type": "integer", "example": 1 }, "company_id": { "type": "integer", "example": 1 }, "is_self_owned": { "type": "boolean", "example": false }, "location": { "type": "string", "example": "Addis Ababa" }, "name": { "type": "string", "example": "4-kilo Branch" }, "wallet_id": { "type": "integer", "example": 1 } } }, "handlers.CheckPhoneEmailExistReq": { "type": "object", "properties": { "email": { "type": "string", "example": "john.doe@example.com" }, "phone_number": { "type": "string", "example": "1234567890" } } }, "handlers.CheckPhoneEmailExistRes": { "type": "object", "properties": { "email_exist": { "type": "boolean" }, "phone_number_exist": { "type": "boolean" } } }, "handlers.CreateBetReq": { "type": "object", "properties": { "amount": { "type": "number", "example": 100 }, "full_name": { "type": "string", "example": "John" }, "is_shop_bet": { "type": "boolean", "example": false }, "outcomes": { "type": "array", "items": { "type": "integer" } }, "phone_number": { "type": "string", "example": "1234567890" }, "status": { "allOf": [ { "$ref": "#/definitions/domain.BetStatus" } ], "example": 1 }, "total_odds": { "type": "number", "example": 4.22 } } }, "handlers.CreateBranchOperationReq": { "type": "object", "properties": { "branch_id": { "type": "integer", "example": 1 }, "operation_id": { "type": "integer", "example": 1 } } }, "handlers.CreateBranchReq": { "type": "object", "properties": { "branch_manager_id": { "type": "integer", "example": 1 }, "company_id": { "type": "integer", "example": 1 }, "is_self_owned": { "type": "boolean", "example": false }, "location": { "type": "string", "example": "Addis Ababa" }, "name": { "type": "string", "example": "4-kilo Branch" }, "operations": { "type": "array", "items": { "type": "integer" } } } }, "handlers.CreateSupportedOperationReq": { "type": "object", "properties": { "description": { "type": "string", "example": "Betting on sport events" }, "name": { "type": "string", "example": "SportsBook" } } }, "handlers.CreateTicketReq": { "type": "object", "properties": { "amount": { "type": "number", "example": 100 }, "outcomes": { "type": "array", "items": { "type": "integer" } }, "total_odds": { "type": "number", "example": 4.22 } } }, "handlers.CreateTicketRes": { "type": "object", "properties": { "fast_code": { "type": "integer", "example": 1234 } } }, "handlers.CreateTransactionReq": { "type": "object", "properties": { "account_name": { "type": "string" }, "account_number": { "type": "string" }, "amount": { "type": "number", "example": 100 }, "bank_code": { "description": "Payment Details for bank", "type": "string" }, "beneficiary_name": { "type": "string" }, "bet_id": { "type": "integer", "example": 1 }, "branch_id": { "type": "integer", "example": 1 }, "cashier_id": { "type": "integer", "example": 1 }, "full_name": { "type": "string", "example": "John Smith" }, "payment_option": { "allOf": [ { "$ref": "#/definitions/domain.PaymentOption" } ], "example": 1 }, "phone_number": { "type": "string", "example": "0911111111" }, "reference_number": { "type": "string" } } }, "handlers.CreateTransferReq": { "type": "object", "properties": { "amount": { "type": "number", "example": 100 }, "payment_method": { "type": "string", "example": "cash" }, "receiver_id": { "type": "integer", "example": 1 } } }, "handlers.CustomerWalletRes": { "type": "object", "properties": { "company_id": { "type": "integer", "example": 1 }, "created_at": { "type": "string" }, "customer_id": { "type": "integer", "example": 1 }, "id": { "type": "integer", "example": 1 }, "regular_balance": { "type": "number", "example": 100 }, "regular_id": { "type": "integer", "example": 1 }, "regular_updated_at": { "type": "string" }, "static_balance": { "type": "number", "example": 100 }, "static_id": { "type": "integer", "example": 1 }, "static_updated_at": { "type": "string" } } }, "handlers.RegisterCodeReq": { "type": "object", "properties": { "email": { "type": "string", "example": "john.doe@example.com" }, "phone_number": { "type": "string", "example": "1234567890" } } }, "handlers.RegisterUserReq": { "type": "object", "properties": { "email": { "type": "string", "example": "john.doe@example.com" }, "first_name": { "type": "string", "example": "John" }, "last_name": { "type": "string", "example": "Doe" }, "otp": { "description": "Role string", "type": "string", "example": "123456" }, "password": { "type": "string", "example": "password123" }, "phone_number": { "type": "string", "example": "1234567890" }, "referal_code": { "type": "string", "example": "ABC123" } } }, "handlers.ResetCodeReq": { "type": "object", "properties": { "email": { "type": "string", "example": "john.doe@example.com" }, "phone_number": { "type": "string", "example": "1234567890" } } }, "handlers.ResetPasswordReq": { "type": "object", "properties": { "email": { "type": "string" }, "otp": { "type": "string" }, "password": { "type": "string" }, "phoneNumber": { "type": "string" } } }, "handlers.SearchUserByNameOrPhoneReq": { "type": "object", "properties": { "searchString": { "type": "string" } } }, "handlers.SupportedOperationRes": { "type": "object", "properties": { "description": { "type": "string", "example": "Betting on sport events" }, "id": { "type": "integer", "example": 1 }, "name": { "type": "string", "example": "SportsBook" } } }, "handlers.TicketRes": { "type": "object", "properties": { "amount": { "type": "number", "example": 100 }, "id": { "type": "integer", "example": 1 }, "outcomes": { "type": "array", "items": { "$ref": "#/definitions/domain.Outcome" } }, "total_odds": { "type": "number", "example": 4.22 } } }, "handlers.TransactionRes": { "type": "object", "properties": { "account_name": { "type": "string" }, "account_number": { "type": "string" }, "amount": { "type": "number", "example": 100 }, "bank_code": { "type": "string" }, "beneficiary_name": { "type": "string" }, "bet_id": { "type": "integer", "example": 1 }, "branch_id": { "type": "integer", "example": 1 }, "cashier_id": { "type": "integer", "example": 1 }, "full_name": { "type": "string", "example": "John Smith" }, "id": { "type": "integer", "example": 1 }, "payment_option": { "allOf": [ { "$ref": "#/definitions/domain.PaymentOption" } ], "example": 1 }, "phone_number": { "type": "string", "example": "0911111111" }, "reference_number": { "type": "string" }, "verified": { "type": "boolean", "example": true } } }, "handlers.TransferRes": { "type": "object", "properties": { "amount": { "type": "number", "example": 100 }, "cashier_id": { "type": "integer", "example": 789 }, "created_at": { "type": "string", "example": "2025-04-08T12:00:00Z" }, "id": { "type": "integer", "example": 1 }, "payment_method": { "type": "string", "example": "bank" }, "receiver_wallet_id": { "type": "integer", "example": 1 }, "sender_wallet_id": { "type": "integer", "example": 1 }, "type": { "type": "string", "example": "transfer" }, "updated_at": { "type": "string", "example": "2025-04-08T12:30:00Z" }, "verified": { "type": "boolean", "example": true } } }, "handlers.UpdateCashOutReq": { "type": "object", "properties": { "cashedOut": { "type": "boolean" } } }, "handlers.UpdateTransactionVerifiedReq": { "type": "object", "properties": { "verified": { "type": "boolean" } } }, "handlers.UpdateWalletActiveReq": { "type": "object", "properties": { "isActive": { "type": "boolean" } } }, "handlers.UserProfileRes": { "type": "object", "properties": { "created_at": { "type": "string" }, "email": { "type": "string" }, "email_verified": { "type": "boolean" }, "first_name": { "type": "string" }, "id": { "type": "integer" }, "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" } } }, "handlers.WalletRes": { "type": "object", "properties": { "amount": { "type": "number", "example": 100 }, "created_at": { "type": "string" }, "id": { "type": "integer", "example": 1 }, "is_active": { "type": "boolean", "example": true }, "is_bettable": { "type": "boolean", "example": true }, "is_transferable": { "type": "boolean", "example": true }, "is_withdraw": { "type": "boolean", "example": true }, "updated_at": { "type": "string" }, "user_id": { "type": "integer", "example": 1 } } }, "handlers.loginCustomerReq": { "type": "object", "properties": { "email": { "type": "string", "example": "john.doe@example.com" }, "password": { "type": "string", "example": "password123" }, "phone_number": { "type": "string", "example": "1234567890" } } }, "handlers.loginCustomerRes": { "type": "object", "properties": { "access_token": { "type": "string" }, "refresh_token": { "type": "string" } } }, "handlers.logoutReq": { "type": "object", "properties": { "refresh_token": { "type": "string" } } }, "handlers.refreshToken": { "type": "object", "properties": { "access_token": { "type": "string" }, "refresh_token": { "type": "string" } } }, "response.APIResponse": { "type": "object", "properties": { "data": {}, "message": { "type": "string" }, "metadata": {}, "status": { "$ref": "#/definitions/response.Status" }, "timestamp": { "type": "string" } } }, "response.Status": { "type": "string", "enum": [ "error", "success" ], "x-enum-varnames": [ "Error", "Success" ] } }, "securityDefinitions": { "Bearer": { "type": "apiKey", "name": "Authorization", "in": "header" } } }