Request Model (#79)

* feat(api): request model

Also adds request binding to search/discover results

* fix(api): rename Request to MediaRequest and update nextjs tsconfig

* refactor(api): move related request fetching code into MediaRequest entity
This commit is contained in:
sct
2020-09-13 00:01:38 +09:00
committed by GitHub
parent 342d1a3c75
commit 1910876706
9 changed files with 184 additions and 15 deletions

View File

@@ -260,6 +260,8 @@ components:
video:
type: boolean
example: false
request:
$ref: '#/components/schemas/MediaRequest'
TvResult:
type: object
properties:
@@ -301,6 +303,8 @@ components:
type: string
firstAirDate:
type: string
request:
$ref: '#/components/schemas/MediaRequest'
PersonResult:
type: object
properties:
@@ -321,6 +325,44 @@ components:
oneOf:
- $ref: '#/components/schemas/MovieResult'
- $ref: '#/components/schemas/TvResult'
MediaRequest:
type: object
properties:
id:
type: number
example: 123
readOnly: true
mediaId:
type: number
example: 123
description: TMDB Movie ID
mediaType:
type: string
enum: [movie, tv]
status:
type: number
example: 0
description: Status of the request. 0 = PENDING APPROVAL, 1 = APPROVED, 2 = DECLINED, 3 = AVAILABLE
readOnly: true
createdAt:
type: string
example: '2020-09-12T10:00:27.000Z'
readOnly: true
updatedAt:
type: string
example: '2020-09-12T10:00:27.000Z'
readOnly: true
requestedBy:
$ref: '#/components/schemas/User'
readOnly: true
modifiedBy:
$ref: '#/components/schemas/User'
readOnly: true
required:
- id
- mediaId
- mediaType
- status
securitySchemes:
cookieAuth: