aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request/request-video-qadu-interface.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/request/request-video-qadu-interface.ts')
-rw-r--r--server/models/request/request-video-qadu-interface.ts46
1 files changed, 46 insertions, 0 deletions
diff --git a/server/models/request/request-video-qadu-interface.ts b/server/models/request/request-video-qadu-interface.ts
new file mode 100644
index 000000000..625b063dc
--- /dev/null
+++ b/server/models/request/request-video-qadu-interface.ts
@@ -0,0 +1,46 @@
1import * as Sequelize from 'sequelize'
2
3import { VideoInstance } from '../video'
4import { PodInstance } from '../pod'
5
6export type RequestsVideoQaduGrouped = {
7 [ podId: number ]: {
8 request: RequestVideoQaduInstance
9 video: VideoInstance
10 pod: PodInstance
11 }
12}
13
14export namespace RequestVideoQaduMethods {
15 export type CountTotalRequestsCallback = (err: Error, total: number) => void
16 export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void
17
18 export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsVideoQaduGrouped) => void
19 export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number, callback: ListWithLimitAndRandomCallback) => void
20
21 export type RemoveByRequestIdsAndPodCallback = () => void
22 export type RemoveByRequestIdsAndPod = (ids: number[], podId: number, callback: RemoveByRequestIdsAndPodCallback) => void
23
24 export type RemoveAllCallback = () => void
25 export type RemoveAll = (callback: RemoveAllCallback) => void
26}
27
28export interface RequestVideoQaduClass {
29 countTotalRequests: RequestVideoQaduMethods.CountTotalRequests
30 listWithLimitAndRandom: RequestVideoQaduMethods.ListWithLimitAndRandom
31 removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod
32 removeAll: RequestVideoQaduMethods.RemoveAll
33}
34
35export interface RequestVideoQaduAttributes {
36 type: string
37}
38
39export interface RequestVideoQaduInstance extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> {
40 id: number
41
42 Pod: PodInstance
43 Video: VideoInstance
44}
45
46export interface RequestVideoQaduModel extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {}