aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-share-interface.ts
blob: 8ad10e095b6ed9a3ab27b2cce309b3260bb23b99 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import * as Bluebird from 'bluebird'
import * as Sequelize from 'sequelize'
import { Transaction } from 'sequelize'
import { AccountInstance } from '../account/account-interface'
import { VideoInstance } from './video-interface'

export namespace VideoShareMethods {
  export type LoadAccountsByShare = (videoId: number, t: Transaction) => Bluebird<AccountInstance[]>
  export type Load = (accountId: number, videoId: number, t: Transaction) => Bluebird<VideoShareInstance>
}

export interface VideoShareClass {
  loadAccountsByShare: VideoShareMethods.LoadAccountsByShare
  load: VideoShareMethods.Load
}

export interface VideoShareAttributes {
  accountId: number
  videoId: number
}

export interface VideoShareInstance extends VideoShareClass, VideoShareAttributes, Sequelize.Instance<VideoShareAttributes> {
  id: number
  createdAt: Date
  updatedAt: Date

  Account?: AccountInstance
  Video?: VideoInstance
}

export interface VideoShareModel extends VideoShareClass, Sequelize.Model<VideoShareInstance, VideoShareAttributes> {}