clean up review

This commit is contained in:
Ravi Prasad
2025-06-03 22:56:34 -05:00
parent 24ec6675c9
commit 03177f58f2
12 changed files with 95242 additions and 13 deletions
+125 -4
View File
@@ -106,6 +106,58 @@ const docTemplate = `{
}
}
},
"/api/playeradvancedstats/scrape": {
"get": {
"tags": [
"PlayerStats"
],
"summary": "Scrape player advanced stats from BR website",
"parameters": [
{
"type": "integer",
"description": "Season (e.g. 2025)",
"name": "season",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "Whether playoffs?",
"name": "isPlayoff",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/playershotchart": {
"get": {
"security": [
@@ -160,9 +212,9 @@ const docTemplate = `{
}
}
},
"/api/playershotchart/fetch": {
"/api/playershotchart/scrape": {
"get": {
"description": "Imports shot-chart data for the given playerId and stores/updates in DB",
"description": "Scrapes seasons [startSeason…endSeason] for the given playerId",
"consumes": [
"application/json"
],
@@ -172,14 +224,28 @@ const docTemplate = `{
"tags": [
"PlayerShotChart"
],
"summary": "Fetch a single player's shot-chart data from external API",
"summary": "Scrape a player's shot-chart from BR website",
"parameters": [
{
"type": "string",
"description": "Player ID (e.g., hardeja01)",
"description": "Player ID (e.g. derozde01)",
"name": "playerId",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "Start season (e.g. 2024)",
"name": "startSeason",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "End season (e.g. 2021)",
"name": "endSeason",
"in": "query",
"required": true
}
],
"responses": {
@@ -302,6 +368,58 @@ const docTemplate = `{
}
}
}
},
"/api/playertotals/scrape": {
"get": {
"tags": [
"PlayerTotals"
],
"summary": "Scrape player total stats from BR website",
"parameters": [
{
"type": "integer",
"description": "Season (e.g. 2025)",
"name": "season",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "Whether playoffs?",
"name": "isPlayoff",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
@@ -438,6 +556,7 @@ const docTemplate = `{
"type": "integer"
},
"id": {
"description": "Autoincrement primary key — works in SQLite and any other DB.",
"type": "integer"
},
"lead": {
@@ -453,9 +572,11 @@ const docTemplate = `{
"type": "integer"
},
"playerId": {
"description": "────────── \"identity\" columns (the dedup key) ──────────",
"type": "string"
},
"playerName": {
"description": "────────── the rest of the payload ──────────",
"type": "string"
},
"qtr": {
+125 -4
View File
@@ -103,6 +103,58 @@
}
}
},
"/api/playeradvancedstats/scrape": {
"get": {
"tags": [
"PlayerStats"
],
"summary": "Scrape player advanced stats from BR website",
"parameters": [
{
"type": "integer",
"description": "Season (e.g. 2025)",
"name": "season",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "Whether playoffs?",
"name": "isPlayoff",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/playershotchart": {
"get": {
"security": [
@@ -157,9 +209,9 @@
}
}
},
"/api/playershotchart/fetch": {
"/api/playershotchart/scrape": {
"get": {
"description": "Imports shot-chart data for the given playerId and stores/updates in DB",
"description": "Scrapes seasons [startSeason…endSeason] for the given playerId",
"consumes": [
"application/json"
],
@@ -169,14 +221,28 @@
"tags": [
"PlayerShotChart"
],
"summary": "Fetch a single player's shot-chart data from external API",
"summary": "Scrape a player's shot-chart from BR website",
"parameters": [
{
"type": "string",
"description": "Player ID (e.g., hardeja01)",
"description": "Player ID (e.g. derozde01)",
"name": "playerId",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "Start season (e.g. 2024)",
"name": "startSeason",
"in": "query",
"required": true
},
{
"type": "integer",
"description": "End season (e.g. 2021)",
"name": "endSeason",
"in": "query",
"required": true
}
],
"responses": {
@@ -299,6 +365,58 @@
}
}
}
},
"/api/playertotals/scrape": {
"get": {
"tags": [
"PlayerTotals"
],
"summary": "Scrape player total stats from BR website",
"parameters": [
{
"type": "integer",
"description": "Season (e.g. 2025)",
"name": "season",
"in": "query",
"required": true
},
{
"type": "boolean",
"description": "Whether playoffs?",
"name": "isPlayoff",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
@@ -435,6 +553,7 @@
"type": "integer"
},
"id": {
"description": "Autoincrement primary key — works in SQLite and any other DB.",
"type": "integer"
},
"lead": {
@@ -450,9 +569,11 @@
"type": "integer"
},
"playerId": {
"description": "────────── \"identity\" columns (the dedup key) ──────────",
"type": "string"
},
"playerName": {
"description": "────────── the rest of the payload ──────────",
"type": "string"
},
"qtr": {
+85 -5
View File
@@ -88,6 +88,7 @@ definitions:
distanceFt:
type: integer
id:
description: Autoincrement primary key — works in SQLite and any other DB.
type: integer
lead:
type: boolean
@@ -98,8 +99,10 @@ definitions:
opponentTeamScore:
type: integer
playerId:
description: ────────── "identity" columns (the dedup key) ──────────
type: string
playerName:
description: ────────── the rest of the payload ──────────
type: string
qtr:
type: string
@@ -184,6 +187,40 @@ paths:
summary: Get player advanced stats
tags:
- PlayerStats
/api/playeradvancedstats/scrape:
get:
parameters:
- description: Season (e.g. 2025)
in: query
name: season
required: true
type: integer
- description: Whether playoffs?
in: query
name: isPlayoff
type: boolean
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Scrape player advanced stats from BR website
tags:
- PlayerStats
/api/playershotchart:
get:
consumes:
@@ -219,18 +256,27 @@ paths:
summary: Get shot-chart data
tags:
- PlayerShotChart
/api/playershotchart/fetch:
/api/playershotchart/scrape:
get:
consumes:
- application/json
description: Imports shot-chart data for the given playerId and stores/updates
in DB
description: Scrapes seasons [startSeason…endSeason] for the given playerId
parameters:
- description: Player ID (e.g., hardeja01)
- description: Player ID (e.g. derozde01)
in: query
name: playerId
required: true
type: string
- description: Start season (e.g. 2024)
in: query
name: startSeason
required: true
type: integer
- description: End season (e.g. 2021)
in: query
name: endSeason
required: true
type: integer
produces:
- application/json
responses:
@@ -252,7 +298,7 @@ paths:
additionalProperties:
type: string
type: object
summary: Fetch a single player's shot-chart data from external API
summary: Scrape a player's shot-chart from BR website
tags:
- PlayerShotChart
/api/playertotals:
@@ -314,6 +360,40 @@ paths:
summary: Get player total stats
tags:
- PlayerTotals
/api/playertotals/scrape:
get:
parameters:
- description: Season (e.g. 2025)
in: query
name: season
required: true
type: integer
- description: Whether playoffs?
in: query
name: isPlayoff
type: boolean
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
"400":
description: Bad Request
schema:
additionalProperties:
type: string
type: object
"500":
description: Internal Server Error
schema:
additionalProperties:
type: string
type: object
summary: Scrape player total stats from BR website
tags:
- PlayerTotals
schemes:
- http
- https