diff --git a/Khronos-Swagger-Spec-v1.json b/Khronos-Swagger-Spec-v1.json index 2e900cfa..f35f311b 100644 --- a/Khronos-Swagger-Spec-v1.json +++ b/Khronos-Swagger-Spec-v1.json @@ -18,14 +18,7 @@ "parameters": [], "responses": { "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "number" - } - } - } + "description": "" } } } @@ -512,14 +505,7 @@ "parameters": [], "responses": { "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } + "description": "" } }, "tags": [ @@ -1025,9 +1011,6 @@ "200": { "description": "Matchups synced successfully" }, - "201": { - "description": "" - }, "500": { "description": "Internal server error" } @@ -1051,9 +1034,6 @@ "200": { "description": "Game status updated successfully" }, - "201": { - "description": "" - }, "500": { "description": "Internal server error" } @@ -1068,6 +1048,231 @@ ] } }, + "/betslips": { + "get": { + "operationId": "getAllBetslips", + "summary": "Get all betslips with pagination", + "parameters": [ + { + "name": "start", + "required": false, + "in": "query", + "description": "Starting index for pagination", + "schema": { + "type": "number" + } + }, + { + "name": "end", + "required": false, + "in": "query", + "description": "Ending index for pagination", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlacedBetslip" + } + } + } + } + } + }, + "tags": [ + "Betslips" + ], + "security": [ + { + "x-api-key": [] + } + ] + } + }, + "/betslips/user/{userid}": { + "get": { + "operationId": "getUserBetslips", + "summary": "Get all betslips for a specific user", + "parameters": [ + { + "name": "userid", + "required": true, + "in": "path", + "description": "The ID of the user", + "schema": { + "type": "string" + } + }, + { + "name": "start", + "required": false, + "in": "query", + "description": "Starting index for pagination", + "schema": { + "type": "number" + } + }, + { + "name": "end", + "required": false, + "in": "query", + "description": "Ending index for pagination", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlacedBetslip" + } + } + } + } + } + }, + "tags": [ + "Betslips" + ], + "security": [ + { + "x-api-key": [] + } + ] + } + }, + "/betslips/active/{userid}": { + "get": { + "operationId": "getActiveBetslips", + "summary": "Get all active betslips for a user.", + "parameters": [ + { + "name": "userid", + "required": true, + "in": "path", + "description": "The ID of the user.", + "schema": { + "example": "208016830491525120", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlacedBetslip" + } + } + } + } + }, + "404": { + "description": "Possible error responses", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KHApiErrStandard" + }, + "examples": { + "example1": { + "summary": "NO_ACTIVE_BETS", + "value": { + "statusCode": 404, + "message": "No active bets were found", + "exception": "NO_ACTIVE_BETS" + } + } + } + } + } + } + }, + "tags": [ + "Betslips" + ], + "security": [ + { + "x-api-key": [] + } + ] + } + }, + "/betslips/{betId}": { + "get": { + "operationId": "getBetslip", + "summary": "Get a specific betslip by ID", + "parameters": [ + { + "name": "betId", + "required": true, + "in": "path", + "description": "The ID of the betslip", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PlacedBetslip" + } + } + } + }, + "404": { + "description": "Possible error responses", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KHApiErrStandard" + }, + "examples": { + "example1": { + "summary": "BET_NOT_FOUND", + "value": { + "statusCode": 404, + "message": "The specified bet was not found", + "exception": "BET_NOT_FOUND" + } + } + } + } + } + } + }, + "tags": [ + "Betslips" + ], + "security": [ + { + "x-api-key": [] + } + ] + } + }, "/betslips/init": { "post": { "operationId": "initBetslip", @@ -1312,40 +1517,121 @@ ] } }, - "/betslips/modify/{betId}": { - "patch": { - "operationId": "changeBetAmount", - "summary": "Change the amount of a bet.", + "/betslips/clearpending/{userid}": { + "post": { + "operationId": "clearPendingBets", + "summary": "Clear a pending betslip for a user. Called when a user has cancelled a potential bet", "parameters": [ { - "name": "betId", + "name": "userid", "required": true, "in": "path", - "description": "The ID of the bet to modify.", + "description": "The ID of the user.", "schema": { - "type": "number" + "example": "208016830491525120", + "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChangeBetAmountDto" - } - } - } - }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IChangeBetAmountResp" - } - } + "example": { + "statusCode": 200, + "message": "Successfully cleared pending betslip." + } + } + } + } + } + }, + "tags": [ + "Betslips" + ], + "security": [ + { + "x-api-key": [] + } + ] + } + }, + "/betslips/closeoutstanding/{matchid}": { + "post": { + "operationId": "closeOutstandingBets", + "summary": "Close outstanding bets for a match", + "parameters": [ + { + "name": "matchid", + "required": true, + "in": "path", + "description": "The ID of the match to close bets for", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "example": { + "statusCode": 200, + "message": "Successfully closed bets." + } + } + } + } + } + }, + "tags": [ + "Betslips" + ], + "security": [ + { + "x-api-key": [] + } + ] + } + }, + "/betslips/modify/{betId}": { + "patch": { + "operationId": "changeBetAmount", + "summary": "Change the amount of a bet.", + "parameters": [ + { + "name": "betId", + "required": true, + "in": "path", + "description": "The ID of the bet to modify.", + "schema": { + "type": "number" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangeBetAmountDto" + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IChangeBetAmountResp" + } + } } }, "400": { @@ -1423,6 +1709,101 @@ ] } }, + "/betslips/doubledown/{userId}/{betId}": { + "patch": { + "operationId": "doubleDownBet", + "summary": "Double the amount of an existing bet.", + "description": "Doubles the bet amount for an existing betslip, if the user's balance permits. A new profit and payout will be calculated as well.", + "parameters": [ + { + "name": "userId", + "required": true, + "in": "path", + "description": "The ID of the user.", + "schema": { + "type": "string" + } + }, + { + "name": "betId", + "required": true, + "in": "path", + "description": "The ID of the bet to double.", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Bet doubled successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DoubleDownDto" + } + } + } + }, + "400": { + "description": "Possible error responses", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KHApiErrStandard" + }, + "examples": { + "example1": { + "summary": "INSUFFICIENT_BALANCE", + "value": { + "statusCode": 400, + "message": "Insufficient balance for this bet", + "exception": "INSUFFICIENT_BALANCE" + } + }, + "example2": { + "summary": "MatchHasEnded", + "value": { + "statusCode": 400, + "message": "The requested match has ended.", + "exception": "MatchHasEnded" + } + } + } + } + } + }, + "404": { + "description": "Possible error responses", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KHApiErrStandard" + }, + "examples": { + "example1": { + "summary": "BET_NOT_FOUND", + "value": { + "statusCode": 404, + "message": "The specified bet was not found", + "exception": "BET_NOT_FOUND" + } + } + } + } + } + } + }, + "tags": [ + "Betslips" + ], + "security": [ + { + "x-api-key": [] + } + ] + } + }, "/betslips/cancel/{betId}": { "delete": { "operationId": "cancelBetslip", @@ -1523,16 +1904,15 @@ ] } }, - "/betslips/active/{userid}": { - "get": { - "operationId": "getActiveBetslips", - "summary": "Get all active betslips for a user.", + "/accounts/create/{userid}": { + "post": { + "operationId": "createAccount", + "summary": "Create Account", "parameters": [ { "name": "userid", "required": true, "in": "path", - "description": "The ID of the user.", "schema": { "example": "208016830491525120", "type": "string" @@ -1540,20 +1920,17 @@ } ], "responses": { - "200": { + "201": { "description": "", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PlacedBetslip" - } + "$ref": "#/components/schemas/Account" } } } }, - "404": { + "409": { "description": "Possible error responses", "content": { "application/json": { @@ -1562,11 +1939,11 @@ }, "examples": { "example1": { - "summary": "NO_ACTIVE_BETS", + "summary": "AccountAlreadyExists", "value": { - "statusCode": 404, - "message": "No active bets were found", - "exception": "NO_ACTIVE_BETS" + "statusCode": 409, + "message": "You already have an account registered.", + "exception": "AccountAlreadyExists" } } } @@ -1575,7 +1952,7 @@ } }, "tags": [ - "Betslips" + "Accounts" ], "security": [ { @@ -1584,16 +1961,15 @@ ] } }, - "/betslips/clearpending/{userid}": { - "post": { - "operationId": "clearPendingBets", - "summary": "Clear a pending betslip for a user. Called when a user has cancelled a potential bet", + "/accounts/balance/{userid}": { + "get": { + "operationId": "getBalance", + "summary": "Get an account's balance", "parameters": [ { "name": "userid", "required": true, "in": "path", - "description": "The ID of the user.", "schema": { "example": "208016830491525120", "type": "string" @@ -1606,249 +1982,26 @@ "content": { "application/json": { "schema": { - "example": { - "statusCode": 200, - "message": "Successfully cleared pending betslip." - } - } - } - } - }, - "201": { - "description": "" - } - }, - "tags": [ - "Betslips" - ], - "security": [ - { - "x-api-key": [] - } - ] - } - }, - "/betslips/closeoutstanding/{matchid}": { - "post": { - "operationId": "BetslipController_manualClose", - "parameters": [ - { - "name": "matchid", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "201": { - "description": "" - } - }, - "tags": [ - "Betslips" - ], - "security": [ - { - "x-api-key": [] - } - ] - } - }, - "/betslips/doubledown/{userId}/{betId}": { - "patch": { - "operationId": "doubleDownBet", - "summary": "Double the amount of an existing bet.", - "description": "Doubles the bet amount for an existing betslip, if the user's balance permits. A new profit and payout will be calculated as well.", - "parameters": [ - { - "name": "userId", - "required": true, - "in": "path", - "description": "The ID of the user.", - "schema": { - "type": "string" - } - }, - { - "name": "betId", - "required": true, - "in": "path", - "description": "The ID of the bet to double.", - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "Bet doubled successfully.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DoubleDownDto" - } - } - } - }, - "400": { - "description": "Possible error responses", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KHApiErrStandard" - }, - "examples": { - "example1": { - "summary": "INSUFFICIENT_BALANCE", - "value": { - "statusCode": 400, - "message": "Insufficient balance for this bet", - "exception": "INSUFFICIENT_BALANCE" - } - }, - "example2": { - "summary": "MatchHasEnded", - "value": { - "statusCode": 400, - "message": "The requested match has ended.", - "exception": "MatchHasEnded" - } - } - } - } - } - }, - "404": { - "description": "Possible error responses", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KHApiErrStandard" - }, - "examples": { - "example1": { - "summary": "BET_NOT_FOUND", - "value": { - "statusCode": 404, - "message": "The specified bet was not found", - "exception": "BET_NOT_FOUND" - } - } - } - } - } - } - }, - "tags": [ - "Betslips" - ], - "security": [ - { - "x-api-key": [] - } - ] - } - }, - "/accounts/create/{userid}": { - "post": { - "operationId": "createAccount", - "summary": "Create Account", - "parameters": [ - { - "name": "userid", - "required": true, - "in": "path", - "schema": { - "example": "208016830491525120", - "type": "string" - } - } - ], - "responses": { - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Account" - } - } - } - }, - "409": { - "description": "Possible error responses", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KHApiErrStandard" - }, - "examples": { - "example1": { - "summary": "AccountAlreadyExists", - "value": { - "statusCode": 409, - "message": "You already have an account registered.", - "exception": "AccountAlreadyExists" - } - } - } - } - } - } - }, - "tags": [ - "Accounts" - ], - "security": [ - { - "x-api-key": [] - } - ] - } - }, - "/accounts/balance/{userid}": { - "get": { - "operationId": "getBalance", - "summary": "Get an account's balance", - "parameters": [ - { - "name": "userid", - "required": true, - "in": "path", - "schema": { - "example": "208016830491525120", - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetBalanceDto" - } - } - } - }, - "404": { - "description": "Possible error responses", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KHApiErrStandard" - }, - "examples": { - "example1": { - "summary": "AccountNotFound", - "value": { - "statusCode": 404, - "message": "The requested account could not be found.\nTry using `/register` first to instantly create an account.", - "exception": "AccountNotFound" - } + "$ref": "#/components/schemas/GetBalanceDto" + } + } + } + }, + "404": { + "description": "Possible error responses", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KHApiErrStandard" + }, + "examples": { + "example1": { + "summary": "AccountNotFound", + "value": { + "statusCode": 404, + "message": "The requested account could not be found.\nTry using `/register` first to instantly create an account.", + "exception": "AccountNotFound" + } } } } @@ -2113,7 +2266,7 @@ ] }, "post": { - "operationId": "createAccount", + "operationId": "createAccountWithBody", "summary": "Create a new account", "parameters": [], "requestBody": { @@ -3302,9 +3455,6 @@ } } }, - "201": { - "description": "" - }, "400": { "description": "Invalid sport provided" }, @@ -3354,7 +3504,7 @@ }, { "name": "time_frame", - "required": false, + "required": true, "in": "query", "description": "Time frame for the leaderboard", "schema": { @@ -3504,82 +3654,34 @@ "exception" ] }, + "GetMatchInfoDto": { + "type": "object", + "properties": {} + }, "Channel": { + "type": "object", + "properties": {} + }, + "Score": { + "type": "object", + "properties": {} + }, + "Match": { "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique identifier for the match" }, - "sport": { - "type": "string" + "channel": { + "$ref": "#/components/schemas/Channel" }, - "channelname": { - "type": "string" + "score": { + "$ref": "#/components/schemas/Score" }, - "crontime": { - "type": "string" - }, - "gametime": { - "format": "date-time", - "type": "string" - }, - "created": { - "type": "boolean" - } - }, - "required": [ - "id", - "sport", - "channelname", - "crontime", - "gametime", - "created" - ] - }, - "Score": { - "type": "object", - "properties": { - "matchup_id": { - "type": "string" - }, - "home_score": { - "type": "number" - }, - "away_score": { - "type": "number" - }, - "commence_time": { - "format": "date-time", - "type": "string" - }, - "complete": { - "type": "boolean" - } - }, - "required": [ - "matchup_id", - "home_score", - "away_score", - "commence_time", - "complete" - ] - }, - "Match": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the match" - }, - "channel": { - "$ref": "#/components/schemas/Channel" - }, - "score": { - "$ref": "#/components/schemas/Score" - }, - "sport_key": { - "type": "string", - "description": "e.g 'americanfootball_nfl' or 'basketball_nba'." + "sport_key": { + "type": "string", + "description": "e.g 'americanfootball_nfl' or 'basketball_nba'." }, "sport_title": { "type": "string", @@ -3607,6 +3709,8 @@ "description": "e.g 'FanDuel' or 'DraftKings'." }, "market_key": { + "type": "string", + "description": "Market type for betting.", "enum": [ "h2h", "totals", @@ -3660,8 +3764,6 @@ "player_rebounds_assists_alternate", "player_points_rebounds_assists_alternate" ], - "type": "string", - "description": "Market type for betting.", "default": "h2h" }, "last_update": { @@ -3746,27 +3848,6 @@ "description" ] }, - "GetMatchInfoDto": { - "type": "object", - "properties": { - "statusCode": { - "type": "number", - "default": 200 - }, - "message": { - "type": "string", - "default": "Successfully fetched matchup info." - }, - "match": { - "$ref": "#/components/schemas/Match" - } - }, - "required": [ - "statusCode", - "message", - "match" - ] - }, "GetAllMatchesDto": { "type": "object", "properties": { @@ -3809,68 +3890,15 @@ }, "AllChannelsDto": { "type": "object", - "properties": { - "statusCode": { - "type": "number", - "default": 200 - }, - "channels": { - "type": "object" - } - }, - "required": [ - "statusCode", - "channels" - ] + "properties": {} }, "RemoveAllChannelsDto": { "type": "object", - "properties": { - "statusCode": { - "type": "number", - "default": 200 - }, - "message": { - "type": "string", - "default": "All channels have been removed successfully" - } - }, - "required": [ - "statusCode", - "message" - ] + "properties": {} }, "StoredChannelDto": { "type": "object", - "properties": { - "id": { - "type": "string" - }, - "sport": { - "type": "string" - }, - "channelname": { - "type": "string" - }, - "crontime": { - "type": "string" - }, - "gametime": { - "format": "date-time", - "type": "string" - }, - "created": { - "type": "boolean" - } - }, - "required": [ - "id", - "sport", - "channelname", - "crontime", - "gametime", - "created" - ] + "properties": {} }, "UpdateChannelDto": { "type": "object", @@ -3948,6 +3976,8 @@ "description": "Guild ID associated with the setting" }, "setting_type": { + "type": "string", + "description": "Type of setting", "enum": [ "GAMES_CATEGORY", "BETTING_CHAN", @@ -3956,8 +3986,6 @@ "LOGS_CHAN", "LOGS_ENABLED" ], - "type": "string", - "description": "Type of setting", "example": "GAMES_CATEGORY" }, "setting_value": { @@ -3984,26 +4012,7 @@ }, "CreateGuildDto": { "type": "object", - "properties": { - "guild_id": { - "type": "string" - }, - "guild_name": { - "type": "string" - }, - "date_joined": { - "type": "string" - }, - "sport": { - "type": "string" - } - }, - "required": [ - "guild_id", - "guild_name", - "date_joined", - "sport" - ] + "properties": {} }, "CreateConfigDto": { "type": "object", @@ -4014,6 +4023,8 @@ "example": "123456789" }, "setting_type": { + "type": "string", + "description": "The type of setting for the Discord configuration", "enum": [ "GAMES_CATEGORY", "BETTING_CHAN", @@ -4022,8 +4033,6 @@ "LOGS_CHAN", "LOGS_ENABLED" ], - "type": "string", - "description": "The type of setting for the Discord configuration", "example": "PREDICTIONS_CHAN" }, "setting_value": { @@ -4050,6 +4059,8 @@ "description": "Guild ID associated with the setting" }, "setting_type": { + "type": "string", + "description": "Type of setting", "enum": [ "GAMES_CATEGORY", "BETTING_CHAN", @@ -4058,8 +4069,6 @@ "LOGS_CHAN", "LOGS_ENABLED" ], - "type": "string", - "description": "Type of setting", "example": "GAMES_CATEGORY" }, "setting_value": { @@ -4084,6 +4093,87 @@ "guild" ] }, + "PlacedBetslip": { + "type": "object", + "properties": { + "betid": { + "type": "number", + "description": "The unique identifier for the betslip", + "example": 1 + }, + "userid": { + "type": "string", + "description": "The user ID associated with the betslip", + "example": "user123" + }, + "team": { + "type": "string", + "description": "The team/player chosen in the bet", + "example": "Team A" + }, + "matchup_id": { + "type": "string", + "description": "ID of related match", + "example": "match123" + }, + "amount": { + "type": "number", + "description": "The amount bet", + "example": 100 + }, + "profit": { + "type": "number", + "description": "The profit from the bet, if applicable", + "example": 50, + "nullable": true + }, + "payout": { + "type": "number", + "description": "The total payout from the bet, if applicable", + "example": 150, + "nullable": true + }, + "betresult": { + "type": "string", + "description": "The result of the bet", + "example": "pending", + "enum": [ + "pending", + "won", + "lost" + ] + }, + "dateofbet": { + "type": "string", + "description": "The date of the bet", + "example": "2024-01-01", + "nullable": true + }, + "guild_id": { + "type": "string", + "description": "The Discord guild ID associated with the betslip", + "example": "1234567891011121314" + }, + "newBalance": { + "type": "number", + "description": "New Balance", + "example": 1000 + } + }, + "required": [ + "betid", + "userid", + "team", + "matchup_id", + "amount", + "profit", + "payout", + "betresult", + "dateofbet", + "guild_id", + "newBalance" + ] + }, "InitBetslipDTO": { "type": "object", "properties": { @@ -4117,59 +4207,6 @@ "description": "The Identifier for a match. This is & must be provided if there's multiple matches for the team, and the user submits the specific match they want to bet on." }, "market_key": { - "enum": [ - "h2h", - "totals", - "player_pass_tds", - "player_pass_yds", - "player_pass_completions", - "player_pass_attempts", - "player_pass_interceptions", - "player_pass_longest_completion", - "player_rush_yds", - "player_rush_attempts", - "player_rush_longest", - "player_receptions", - "player_reception_yds", - "player_reception_longest", - "player_kicking_points", - "player_field_goals", - "player_tackles_assists", - "player_1st_td", - "player_last_td", - "player_anytime_td", - "player_pass_tds_alternate", - "player_pass_yds_alternate", - "player_rush_yds_alternate", - "player_rush_reception_yds_alternate", - "player_reception_yds_alternate", - "player_receptions_alternate", - "player_points", - "player_rebounds", - "player_assists", - "player_threes", - "player_blocks", - "player_steals", - "player_blocks_steals", - "player_turnovers", - "player_points_rebounds_assists", - "player_points_rebounds", - "player_points_assists", - "player_rebounds_assists", - "player_first_basket", - "player_double_double", - "player_triple_double", - "player_points_alternate", - "player_rebounds_alternate", - "player_assists_alternate", - "player_blocks_alternate", - "player_steals_alternate", - "player_threes_alternate", - "player_points_assists_alternate", - "player_points_rebounds_alternate", - "player_rebounds_assists_alternate", - "player_points_rebounds_assists_alternate" - ], "type": "string", "example": "h2h", "default": "h2h", @@ -4256,7 +4293,6 @@ "properties": { "statusCode": { "type": "number", - "default": 201, "description": "The HTTP status code", "example": 201 }, @@ -4300,59 +4336,6 @@ "example": "9768de636bd9b326cee827df527c6b0f" }, "market_key": { - "enum": [ - "h2h", - "totals", - "player_pass_tds", - "player_pass_yds", - "player_pass_completions", - "player_pass_attempts", - "player_pass_interceptions", - "player_pass_longest_completion", - "player_rush_yds", - "player_rush_attempts", - "player_rush_longest", - "player_receptions", - "player_reception_yds", - "player_reception_longest", - "player_kicking_points", - "player_field_goals", - "player_tackles_assists", - "player_1st_td", - "player_last_td", - "player_anytime_td", - "player_pass_tds_alternate", - "player_pass_yds_alternate", - "player_rush_yds_alternate", - "player_rush_reception_yds_alternate", - "player_reception_yds_alternate", - "player_receptions_alternate", - "player_points", - "player_rebounds", - "player_assists", - "player_threes", - "player_blocks", - "player_steals", - "player_blocks_steals", - "player_turnovers", - "player_points_rebounds_assists", - "player_points_rebounds", - "player_points_assists", - "player_rebounds_assists", - "player_first_basket", - "player_double_double", - "player_triple_double", - "player_points_alternate", - "player_rebounds_alternate", - "player_assists_alternate", - "player_blocks_alternate", - "player_steals_alternate", - "player_threes_alternate", - "player_points_assists_alternate", - "player_points_rebounds_alternate", - "player_rebounds_assists_alternate", - "player_points_rebounds_assists_alternate" - ], "type": "string", "description": "The prop type the match & bet belongs to.", "example": "h2h" @@ -4367,91 +4350,6 @@ "market_key" ] }, - "PlacedBetslip": { - "type": "object", - "properties": { - "betid": { - "type": "number", - "description": "The unique identifier for the betslip", - "example": 1 - }, - "userid": { - "type": "string", - "description": "The user ID associated with the betslip", - "example": "user123" - }, - "team": { - "type": "string", - "description": "The team/player chosen in the bet", - "example": "Team A" - }, - "matchup_id": { - "type": "string", - "description": "ID of related match", - "example": "match123" - }, - "amount": { - "type": "number", - "description": "The amount bet", - "example": 100 - }, - "profit": { - "type": "number", - "description": "The profit from the bet, if applicable", - "example": 50, - "nullable": true - }, - "payout": { - "type": "number", - "description": "The total payout from the bet, if applicable", - "example": 150, - "nullable": true - }, - "betresult": { - "type": "string", - "description": "The result of the bet", - "example": "pending", - "enum": [ - "pending", - "won", - "lost" - ] - }, - "dateofbet": { - "type": "string", - "description": "The date of the bet", - "example": "2024-01-01", - "nullable": true - }, - "guild_id": { - "type": "string", - "description": "The Discord guild ID associated with the betslip", - "example": "1234567891011121314" - }, - "newBalance": { - "type": "number", - "description": "New Balance", - "example": 1000 - }, - "dateofmatchup": { - "type": "string" - } - }, - "required": [ - "betid", - "userid", - "team", - "matchup_id", - "amount", - "profit", - "payout", - "betresult", - "dateofbet", - "guild_id", - "newBalance", - "dateofmatchup" - ] - }, "PlacedBetslipDto": { "type": "object", "properties": { @@ -4537,19 +4435,6 @@ "modified" ] }, - "PatreonDataDto": { - "type": "object", - "properties": { - "patreonOverride": { - "type": "boolean", - "description": "Indicates if the Patreon override is enabled, which means the user is a Patreon member and in some cases, meets the required Patreon tier.", - "example": true - } - }, - "required": [ - "patreonOverride" - ] - }, "DoubledBetslipDto": { "type": "object", "properties": { @@ -4629,51 +4514,26 @@ "betslip" ] }, - "XpEntity": { + "PatreonDataDto": { "type": "object", "properties": { - "userid": { - "type": "string" - }, - "xp": { - "type": "number" - }, - "level": { - "type": "number" - }, - "tier": { - "type": "string" - }, - "account": { - "$ref": "#/components/schemas/Account" + "patreonOverride": { + "type": "boolean", + "description": "Indicates if the Patreon override is enabled, which means the user is a Patreon member and in some cases, meets the required Patreon tier.", + "example": true } }, "required": [ - "userid", - "xp", - "level", - "tier", - "account" + "patreonOverride" ] }, + "XpEntity": { + "type": "object", + "properties": {} + }, "BetslipPending": { "type": "object", - "properties": { - "userid": { - "type": "string" - }, - "account": { - "$ref": "#/components/schemas/Account" - }, - "amount": { - "type": "number" - } - }, - "required": [ - "userid", - "account", - "amount" - ] + "properties": {} }, "Account": { "type": "object", @@ -4742,8 +4602,8 @@ "properties": { "statusCode": { "type": "number", - "default": 201, "example": 201, + "default": 201, "description": "" }, "balance": { @@ -4777,7 +4637,6 @@ "properties": { "statusCode": { "type": "number", - "default": 200, "example": 200 }, "userid": { @@ -4911,402 +4770,122 @@ "type": "string", "description": "The unique key for the bookmaker" }, - "title": { - "type": "string", - "description": "The title of the bookmaker" - }, - "last_update": { - "format": "date-time", - "type": "string", - "description": "The last update timestamp" - }, - "markets": { - "description": "The list of markets available", - "type": "array", - "items": { - "$ref": "#/components/schemas/Market" - } - } - }, - "required": [ - "key", - "title", - "last_update", - "markets" - ] - }, - "Odds": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique identifier for the odds/match" - }, - "sport_key": { - "type": "string", - "description": "The sport key" - }, - "sport_title": { - "type": "string", - "description": "The title of the sport" - }, - "commence_time": { - "format": "date-time", - "type": "string", - "description": "The time the event commences" - }, - "home_team": { - "type": "string", - "description": "The home team" - }, - "away_team": { - "type": "string", - "description": "The away team" - }, - "bookmakers": { - "description": "The list of bookmakers", - "type": "array", - "items": { - "$ref": "#/components/schemas/Bookmaker" - } - } - }, - "required": [ - "id", - "sport_key", - "sport_title", - "commence_time", - "home_team", - "away_team", - "bookmakers" - ] - }, - "CreatePropDto": { - "type": "object", - "properties": { - "event_id": { - "type": "string", - "description": "Unique identifier for the event. This is provided by the source of the props (The-Odds API)", - "example": "123e4567-e89b-12d3-a456-426614174000" - }, - "sport_key": { - "type": "string", - "description": "Key of the sport", - "example": "americanfootball_nfl" - }, - "sport_title": { - "type": "string", - "description": "Title of the sport", - "example": "nfl" - }, - "commence_time": { - "format": "date-time", - "type": "string", - "description": "The commencement time of the event" - }, - "home_team": { - "type": "string", - "description": "The name of the home team" - }, - "away_team": { - "type": "string", - "description": "The name of the away team" - }, - "bookmaker_key": { - "type": "string", - "description": "The key of the bookmaker" - }, - "bookmaker_title": { - "type": "string", - "description": "The title of the bookmaker" - }, - "last_update": { - "format": "date-time", - "type": "string", - "description": "The last update time" - }, - "market_key": { - "enum": [ - "h2h", - "totals", - "player_pass_tds", - "player_pass_yds", - "player_pass_completions", - "player_pass_attempts", - "player_pass_interceptions", - "player_pass_longest_completion", - "player_rush_yds", - "player_rush_attempts", - "player_rush_longest", - "player_receptions", - "player_reception_yds", - "player_reception_longest", - "player_kicking_points", - "player_field_goals", - "player_tackles_assists", - "player_1st_td", - "player_last_td", - "player_anytime_td", - "player_pass_tds_alternate", - "player_pass_yds_alternate", - "player_rush_yds_alternate", - "player_rush_reception_yds_alternate", - "player_reception_yds_alternate", - "player_receptions_alternate", - "player_points", - "player_rebounds", - "player_assists", - "player_threes", - "player_blocks", - "player_steals", - "player_blocks_steals", - "player_turnovers", - "player_points_rebounds_assists", - "player_points_rebounds", - "player_points_assists", - "player_rebounds_assists", - "player_first_basket", - "player_double_double", - "player_triple_double", - "player_points_alternate", - "player_rebounds_alternate", - "player_assists_alternate", - "player_blocks_alternate", - "player_steals_alternate", - "player_threes_alternate", - "player_points_assists_alternate", - "player_points_rebounds_alternate", - "player_rebounds_assists_alternate", - "player_points_rebounds_assists_alternate" - ], - "type": "string", - "description": "The key of the betting market" - }, - "price": { - "type": "number", - "description": "The price of the bet" - }, - "point": { - "type": "number", - "description": "The point value of the bet, if applicable" - }, - "status": { - "enum": [ - "pending", - "completed", - "error" - ], - "type": "string", - "description": "The status of the prop", - "nullable": true - }, - "result": { - "type": "string", - "description": "The result of the prop/event. The winner goes here.", - "nullable": true - }, - "description": { - "type": "string", - "description": "The player involved in the prop.", - "example": "Jayson Tatum", - "nullable": true - } - }, - "required": [ - "event_id", - "sport_key", - "sport_title", - "commence_time", - "home_team", - "away_team", - "bookmaker_key", - "bookmaker_title", - "last_update", - "market_key", - "price" - ] - }, - "ProcessedPredictions": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the processing record" - }, - "prediction_id": { - "type": "string", - "description": "ID of the associated prediction" - }, - "process_type": { - "enum": [ - "prop_result", - "leaderboard" - ], - "type": "string", - "description": "Type of processing (e.g., \"leaderboard\")" - }, - "processed_at": { - "format": "date-time", - "type": "string", - "description": "Timestamp of when the prediction was processed" - }, - "status": { - "enum": [ - "success", - "failure", - "in_progress" - ], - "type": "string", - "description": "Status of the processing. New records default to IN_PROGRESS" - }, - "details": { - "type": "object", - "description": "Any additional processing details or metadata" - }, - "created_at": { - "format": "date-time", + "title": { "type": "string", - "description": "Timestamp of when the record was created" + "description": "The title of the bookmaker" }, - "updated_at": { + "last_update": { "format": "date-time", "type": "string", - "description": "Timestamp of when the record was last updated" + "description": "The last update timestamp" }, - "prediction": { - "$ref": "#/components/schemas/Prediction" + "markets": { + "description": "The list of markets available", + "type": "array", + "items": { + "$ref": "#/components/schemas/Market" + } } }, "required": [ - "id", - "prediction_id", - "process_type", - "processed_at", - "status", - "details", - "created_at", - "updated_at", - "prediction" + "key", + "title", + "last_update", + "markets" ] }, - "Prediction": { + "Odds": { "type": "object", "properties": { "id": { "type": "string", - "description": "Unique identifier for the prediction" - }, - "user_id": { - "type": "string", - "description": "User ID" - }, - "created_at": { - "format": "date-time", - "type": "string", - "description": "Creation timestamp" + "description": "The unique identifier for the odds/match" }, - "prop_id": { + "sport_key": { "type": "string", - "description": "ID of the associated prop" + "description": "The sport key" }, - "choice": { + "sport_title": { "type": "string", - "description": "User's choice" - }, - "is_correct": { - "type": "boolean", - "description": "Whether the prediction is correct" + "description": "The title of the sport" }, - "status": { + "commence_time": { + "format": "date-time", "type": "string", - "description": "Status of the prediction" + "description": "The time the event commences" }, - "updated_at": { - "format": "date-time", + "home_team": { "type": "string", - "description": "Last update timestamp" + "description": "The home team" }, - "guild_id": { + "away_team": { "type": "string", - "description": "Guild ID" + "description": "The away team" }, - "processed_predictions": { - "description": "Processed predictions", - "nullable": true, + "bookmakers": { + "description": "The list of bookmakers", "type": "array", "items": { - "$ref": "#/components/schemas/ProcessedPredictions" + "$ref": "#/components/schemas/Bookmaker" } - }, - "prop": { - "$ref": "#/components/schemas/Prop" - }, - "market_key": { - "type": "string" } }, "required": [ "id", - "user_id", - "created_at", - "prop_id", - "choice", - "is_correct", - "status", - "updated_at", - "guild_id", - "processed_predictions", - "prop", - "market_key" + "sport_key", + "sport_title", + "commence_time", + "home_team", + "away_team", + "bookmakers" ] }, - "Prop": { + "CreatePropDto": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the prop" - }, "event_id": { "type": "string", - "description": "Events ID associated with the prop" + "description": "Unique identifier for the event. This is provided by the source of the props (The-Odds API)", + "example": "123e4567-e89b-12d3-a456-426614174000" }, "sport_key": { "type": "string", - "description": "Sport key, e.g., americanfootball_nfl" + "description": "Key of the sport", + "example": "americanfootball_nfl" }, "sport_title": { "type": "string", - "description": "Sport title, e.g., NFL, NBA" + "description": "Title of the sport", + "example": "nfl" }, "commence_time": { "format": "date-time", "type": "string", - "description": "Commencement time of the event" + "description": "The commencement time of the event" }, "home_team": { "type": "string", - "description": "Home team name" + "description": "The name of the home team" }, "away_team": { "type": "string", - "description": "Away team name" + "description": "The name of the away team" }, "bookmaker_key": { "type": "string", - "description": "Bookmaker key, e.g., fanduel" + "description": "The key of the bookmaker" }, "bookmaker_title": { "type": "string", - "description": "Bookmaker title, e.g., FanDuel" + "description": "The title of the bookmaker" }, "last_update": { "format": "date-time", "type": "string", - "description": "The last update time of the prop details in ISO 8601 format. Provided by The Odds API." + "description": "The last update time" }, "market_key": { - "description": "Market key type, e.g., h2h, totals", + "type": "string", "enum": [ "h2h", "totals", @@ -5360,58 +4939,39 @@ "player_rebounds_assists_alternate", "player_points_rebounds_assists_alternate" ], - "type": "string" + "description": "The key of the betting market" }, "price": { "type": "number", - "description": "Price of the prop. E.g -140", - "example": -140 + "description": "The price of the bet" }, "point": { "type": "number", - "description": "Point value, e.g., 40.5", - "nullable": true + "description": "The point value of the bet, if applicable" }, "status": { + "type": "string", "enum": [ "pending", "completed", "error" ], - "type": "string", - "description": "Status of the prop" - }, - "created_at": { - "format": "date-time", - "type": "string", - "description": "Creation timestamp" + "description": "The status of the prop", + "nullable": true }, "result": { "type": "string", - "description": "Result of the prop", + "description": "The result of the prop/event. The winner goes here.", "nullable": true }, "description": { "type": "string", - "description": "The player involved in the prop. If not a player prop, this will be null.", + "description": "The player involved in the prop.", + "example": "Jayson Tatum", "nullable": true - }, - "event": { - "$ref": "#/components/schemas/Events" - }, - "updated_at": { - "format": "date-time", - "type": "string" - }, - "predictions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Prediction" - } } }, "required": [ - "id", "event_id", "sport_key", "sport_title", @@ -5422,85 +4982,106 @@ "bookmaker_title", "last_update", "market_key", - "price", - "point", - "status", - "created_at", - "result", - "description", - "event", - "updated_at" + "price" ] }, - "Events": { + "Prop": { "type": "object", "properties": { "id": { "type": "string", - "example": "123e4567-e89b-12d3-a456-426614174000", - "description": "Unique identifier for the event, provided by the incoming request" + "description": "Unique identifier for the prop" }, - "espn_id": { + "event_id": { "type": "string", - "example": "401547689", - "description": "ESPN unique identifier for the event" + "description": "Events ID associated with the prop" }, "sport_key": { "type": "string", - "example": "americanfootball_nfl", - "description": "Key identifying the sport" + "description": "Sport key, e.g., americanfootball_nfl" }, "sport_title": { "type": "string", - "example": "NFL", - "description": "Title of the sport" + "description": "Sport title, e.g., NFL, NBA" }, "commence_time": { "format": "date-time", "type": "string", - "example": "2024-09-06T00:20:00Z", - "description": "Timestamp when the event is scheduled to start" + "description": "Commencement time of the event" }, "home_team": { "type": "string", - "example": "Kansas City Chiefs", - "description": "Name of the home team" + "description": "Home team name" }, "away_team": { "type": "string", - "example": "Baltimore Ravens", - "description": "Name of the away team" + "description": "Away team name" }, - "props": { - "description": "List of props associated with this event", - "type": "array", - "items": { - "$ref": "#/components/schemas/Prop" - } + "bookmaker_key": { + "type": "string", + "description": "Bookmaker key, e.g., fanduel" }, - "created_at": { + "bookmaker_title": { + "type": "string", + "description": "Bookmaker title, e.g., FanDuel" + }, + "last_update": { "format": "date-time", "type": "string", - "example": "2024-08-27T21:27:19Z", - "description": "Timestamp of when the event was created" + "description": "The last update time of the prop details in ISO 8601 format. Provided by The Odds API." + }, + "market_key": { + "type": "string", + "description": "Market key type, e.g., h2h, totals" }, - "updated_at": { + "price": { + "type": "number", + "description": "Price of the prop. E.g -140", + "example": -140 + }, + "point": { + "type": "number", + "description": "Point value, e.g., 40.5", + "nullable": true + }, + "status": { + "type": "string", + "description": "Status of the prop" + }, + "created_at": { "format": "date-time", "type": "string", - "example": "2024-08-27T21:27:19Z", - "description": "Timestamp of when the event was last updated" + "description": "Creation timestamp" + }, + "result": { + "type": "string", + "description": "Result of the prop", + "nullable": true + }, + "description": { + "type": "string", + "description": "The player involved in the prop. If not a player prop, this will be null.", + "nullable": true } }, "required": [ "id", + "event_id", "sport_key", "sport_title", "commence_time", "home_team", "away_team", - "props", + "bookmaker_key", + "bookmaker_title", + "last_update", + "market_key", + "price", + "point", + "status", "created_at", - "updated_at" + "result", + "description" ] }, "UpdatePropDto": { @@ -5548,6 +5129,7 @@ "description": "The last update time" }, "market_key": { + "type": "string", "enum": [ "h2h", "totals", @@ -5601,7 +5183,6 @@ "player_rebounds_assists_alternate", "player_points_rebounds_assists_alternate" ], - "type": "string", "description": "The key of the betting market" }, "price": { @@ -5613,12 +5194,12 @@ "description": "The point value of the bet, if applicable" }, "status": { + "type": "string", "enum": [ "pending", "completed", "error" ], - "type": "string", "description": "The status of the prop", "nullable": true }, @@ -5649,12 +5230,12 @@ "example": "Team A" }, "status": { + "type": "string", "enum": [ "pending", "completed", "error" ], - "type": "string", "description": "The new status of the prop", "example": "completed" }, @@ -5776,9 +5357,9 @@ }, "description": { "type": "string", - "nullable": true, "description": "Additional description of the prediction", - "example": "Total points scored in the game" + "example": "Total points scored in the game", + "nullable": true }, "sport": { "type": "string", @@ -5821,12 +5402,12 @@ "example": "Jayson Tatum" }, "status": { + "type": "string", "enum": [ "pending", "completed", "error" ], - "type": "string", "description": "Status of the prediction", "example": "pending" }, @@ -5880,13 +5461,13 @@ "nullable": true }, "status": { + "type": "string", + "description": "Status of the prediction", "enum": [ "pending", "completed", "error" ], - "type": "string", - "description": "Status of the prediction", "example": "pending" }, "updated_at": { @@ -5920,10 +5501,12 @@ "created_at", "prop_id", "choice", + "is_correct", "status", "updated_at", "guild_id", - "market_key" + "market_key", + "prop" ] }, "PropPredictionsDto": { @@ -5938,7 +5521,6 @@ ] }, "predictions": { - "nullable": true, "description": "Array of predictions for this prop", "type": "array", "items": { @@ -5997,7 +5579,7 @@ "nullable": true, "type": "array", "items": { - "$ref": "#/components/schemas/ProcessedPredictions" + "type": "string" } }, "match_string": { @@ -6009,12 +5591,6 @@ "type": "string", "description": "Optional description of the prediction", "example": "Prediction for the final score" - }, - "prop": { - "$ref": "#/components/schemas/Prop" - }, - "market_key": { - "type": "string" } }, "required": [ @@ -6028,9 +5604,7 @@ "updated_at", "guild_id", "processed_predictions", - "match_string", - "prop", - "market_key" + "match_string" ] }, "UpdatePredictionDto": { @@ -6069,13 +5643,13 @@ "nullable": true }, "status": { + "type": "string", + "description": "Status of the prediction", "enum": [ "pending", "completed", "error" ], - "type": "string", - "description": "Status of the prediction", "example": "pending" }, "updated_at": { @@ -6137,15 +5711,15 @@ }, "seasonYear": { "type": "number", - "minimum": 2000, "description": "The year of the season", - "example": 2024 + "example": 2024, + "minimum": 2000 }, "weekNumber": { "type": "number", - "minimum": 1, "description": "The week number in the season", - "example": 1 + "example": 1, + "minimum": 1 }, "startDate": { "type": "string", @@ -6186,33 +5760,33 @@ }, "score": { "type": "number", - "minimum": 0, "description": "Total score", - "default": 0 + "default": 0, + "minimum": 0 }, "correct_predictions": { "type": "number", - "minimum": 0, "description": "Number of correct predictions", - "default": 0 + "default": 0, + "minimum": 0 }, "incorrect_predictions": { "type": "number", - "minimum": 0, "description": "Number of incorrect predictions", - "default": 0 + "default": 0, + "minimum": 0 }, "week_number": { "type": "number", - "minimum": 1, "description": "Week number relative to the system start", + "minimum": 1, "maximum": 53 }, "season_year": { "type": "number", - "minimum": 2024, "description": "Year of the season", - "example": 2024 + "example": 2024, + "minimum": 2024 }, "created_at": { "format": "date-time", diff --git a/src/utils/api/Khronos/bets/BetslipsManager.ts b/src/utils/api/Khronos/bets/BetslipsManager.ts index 7ec1bf55..5d350b01 100644 --- a/src/utils/api/Khronos/bets/BetslipsManager.ts +++ b/src/utils/api/Khronos/bets/BetslipsManager.ts @@ -304,10 +304,13 @@ export class BetslipManager { payout: betData.payData.payout, }); const formattedBetData = this.formatBetStr(betAmount, payout, profit); + // uppercase the first letter of users team choice with lodash + const usersTeamUpper = _.upperFirst(usersTeam); + const embed = new EmbedBuilder() .setTitle('Pending Betslip') .setDescription( - `## ${chosenTeamStr} *vs.* ${oppTeamStr}\n**${usersTeam}** | **${dateofmatchup}**\n${formattedBetData}\n*Confirm your bet via the buttons below*`, + `## ${chosenTeamStr} *vs.* ${oppTeamStr}\n**${usersTeamUpper}** | **${dateofmatchup}**\n${formattedBetData}\n*Confirm your bet via the buttons below*`, ) .setColor(embedColors.PlutoYellow) .setFooter({