aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request-video-qadu-interface.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/request-video-qadu-interface.ts')
-rw-r--r--server/models/request-video-qadu-interface.ts31
1 files changed, 26 insertions, 5 deletions
diff --git a/server/models/request-video-qadu-interface.ts b/server/models/request-video-qadu-interface.ts
index 6fe34ee91..04de7f159 100644
--- a/server/models/request-video-qadu-interface.ts
+++ b/server/models/request-video-qadu-interface.ts
@@ -1,10 +1,28 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2 2
3import { VideoInstance } from './video-interface'
4import { PodInstance } from './pod-interface'
5
6export type RequestsVideoQaduGrouped = {
7 [ podId: number ]: {
8 request: RequestVideoQaduInstance
9 video: VideoInstance
10 pod: PodInstance
11 }
12}
13
3export namespace RequestVideoQaduMethods { 14export namespace RequestVideoQaduMethods {
4 export type CountTotalRequests = (callback) => void 15 export type CountTotalRequestsCallback = (err: Error, total: number) => void
5 export type ListWithLimitAndRandom = (limitPods, limitRequestsPerPod, callback) => void 16 export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void
6 export type RemoveByRequestIdsAndPod = (ids, podId, callback) => void 17
7 export type RemoveAll = (callback) => void 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
8} 26}
9 27
10export interface RequestVideoQaduClass { 28export interface RequestVideoQaduClass {
@@ -18,8 +36,11 @@ export interface RequestVideoQaduAttributes {
18 type: string 36 type: string
19} 37}
20 38
21export interface RequestVideoQaduInstance extends Sequelize.Instance<RequestVideoQaduAttributes> { 39export interface RequestVideoQaduInstance extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> {
22 id: number 40 id: number
41
42 Pod: PodInstance
43 Video: VideoInstance
23} 44}
24 45
25export interface RequestVideoQaduModel extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {} 46export interface RequestVideoQaduModel extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {}