2017-05-22 13:58:25 -05:00
|
|
|
import * as Sequelize from 'sequelize'
|
|
|
|
|
2017-06-16 02:45:46 -05:00
|
|
|
import { VideoInstance } from '../video'
|
|
|
|
import { PodInstance } from '../pod'
|
2017-06-10 15:15:25 -05:00
|
|
|
|
2017-06-16 03:36:18 -05:00
|
|
|
import { RequestVideoQaduType } from '../../../shared/models/request-scheduler.model'
|
|
|
|
|
2017-06-10 15:15:25 -05:00
|
|
|
export type RequestsVideoQaduGrouped = {
|
|
|
|
[ podId: number ]: {
|
|
|
|
request: RequestVideoQaduInstance
|
|
|
|
video: VideoInstance
|
|
|
|
pod: PodInstance
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-22 13:58:25 -05:00
|
|
|
export namespace RequestVideoQaduMethods {
|
2017-06-10 15:15:25 -05:00
|
|
|
export type CountTotalRequestsCallback = (err: Error, total: number) => void
|
|
|
|
export type CountTotalRequests = (callback: CountTotalRequestsCallback) => void
|
|
|
|
|
|
|
|
export type ListWithLimitAndRandomCallback = (err: Error, requestsGrouped?: RequestsVideoQaduGrouped) => void
|
|
|
|
export type ListWithLimitAndRandom = (limitPods: number, limitRequestsPerPod: number, callback: ListWithLimitAndRandomCallback) => void
|
|
|
|
|
|
|
|
export type RemoveByRequestIdsAndPodCallback = () => void
|
|
|
|
export type RemoveByRequestIdsAndPod = (ids: number[], podId: number, callback: RemoveByRequestIdsAndPodCallback) => void
|
|
|
|
|
|
|
|
export type RemoveAllCallback = () => void
|
|
|
|
export type RemoveAll = (callback: RemoveAllCallback) => void
|
2017-05-22 13:58:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface RequestVideoQaduClass {
|
|
|
|
countTotalRequests: RequestVideoQaduMethods.CountTotalRequests
|
|
|
|
listWithLimitAndRandom: RequestVideoQaduMethods.ListWithLimitAndRandom
|
|
|
|
removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod
|
|
|
|
removeAll: RequestVideoQaduMethods.RemoveAll
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RequestVideoQaduAttributes {
|
2017-06-16 03:36:18 -05:00
|
|
|
type: RequestVideoQaduType
|
2017-05-22 13:58:25 -05:00
|
|
|
}
|
|
|
|
|
2017-06-10 15:15:25 -05:00
|
|
|
export interface RequestVideoQaduInstance extends RequestVideoQaduClass, RequestVideoQaduAttributes, Sequelize.Instance<RequestVideoQaduAttributes> {
|
2017-05-22 13:58:25 -05:00
|
|
|
id: number
|
2017-06-10 15:15:25 -05:00
|
|
|
|
|
|
|
Pod: PodInstance
|
|
|
|
Video: VideoInstance
|
2017-05-22 13:58:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface RequestVideoQaduModel extends RequestVideoQaduClass, Sequelize.Model<RequestVideoQaduInstance, RequestVideoQaduAttributes> {}
|