import * as Sequelize from 'sequelize'
+import * as Promise from 'bluebird'
-import { VideoRateType } from '../../../shared/models/user-video-rate.model'
+import { VideoRateType } from '../../../shared/models/videos/video-rate.type'
export namespace UserVideoRateMethods {
- export type LoadCallback = (err: Error, userVideoRateInstance: UserVideoRateInstance) => void
- export type Load = (userId: number, videoId: string, transaction: Sequelize.Transaction, callback: LoadCallback) => void
+ export type Load = (userId: number, videoId: number, transaction: Sequelize.Transaction) => Promise<UserVideoRateInstance>
}
export interface UserVideoRateClass {
export interface UserVideoRateAttributes {
type: VideoRateType
+ userId: number
+ videoId: number
}
export interface UserVideoRateInstance extends UserVideoRateClass, UserVideoRateAttributes, Sequelize.Instance<UserVideoRateAttributes> {