]>
Commit | Line | Data |
---|---|---|
e02643f3 C |
1 | import * as Sequelize from 'sequelize' |
2 | ||
74889a71 C |
3 | import { VideoInstance } from '../video' |
4 | import { PodInstance } from '../pod' | |
69818c93 | 5 | |
ee9e7b61 C |
6 | import { RequestVideoQaduType } from '../../../shared/models/request-scheduler.model' |
7 | ||
69818c93 C |
8 | export type RequestsVideoQaduGrouped = { |
9 | [ podId: number ]: { | |
10 | request: RequestVideoQaduInstance | |
11 | video: VideoInstance | |
12 | pod: PodInstance | |
13 | } | |
14 | } | |
15 | ||
e02643f3 | 16 | export namespace RequestVideoQaduMethods { |
69818c93 C |
17 | export type CountTotalRequestsCallback = (err: Error, total: number) => void |
18 | export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void | |
19 | ||
20 | export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsVideoQaduGrouped) => void | |
21 | export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number, callback: ListWithLimitAndRandomCallback) => void | |
22 | ||
23 | export type RemoveByRequestIdsAndPodCallback = () => void | |
24 | export type RemoveByRequestIdsAndPod = (ids: number[], podId: number, callback: RemoveByRequestIdsAndPodCallback) => void | |
25 | ||
26 | export type RemoveAllCallback = () => void | |
27 | export type RemoveAll = (callback: RemoveAllCallback) => void | |
e02643f3 C |
28 | } |
29 | ||
30 | export interface RequestVideoQaduClass { | |
31 | countTotalRequests: RequestVideoQaduMethods.CountTotalRequests | |
32 | listWithLimitAndRandom: RequestVideoQaduMethods.ListWithLimitAndRandom | |
33 | removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod | |
34 | removeAll: RequestVideoQaduMethods.RemoveAll | |
35 | } | |
36 | ||
37 | export interface RequestVideoQaduAttributes { | |
ee9e7b61 | 38 | type: RequestVideoQaduType |
e02643f3 C |
39 | } |
40 | ||
69818c93 | 41 | export interface RequestVideoQaduInstance extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> { |
e02643f3 | 42 | id: number |
69818c93 C |
43 | |
44 | Pod: PodInstance | |
45 | Video: VideoInstance | |
e02643f3 C |
46 | } |
47 | ||
48 | export interface RequestVideoQaduModel extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {} |