2017-05-22 14:58:25 -04:00
|
|
|
import * as Sequelize from 'sequelize'
|
2017-07-05 07:26:25 -04:00
|
|
|
import * as Promise from 'bluebird'
|
2017-05-22 14:58:25 -04:00
|
|
|
|
2017-09-07 09:27:35 -04:00
|
|
|
import { PodInstance } from '../pod/pod-interface'
|
2017-06-10 16:15:25 -04:00
|
|
|
|
2017-05-22 14:58:25 -04:00
|
|
|
export namespace AuthorMethods {
|
2017-07-05 07:26:25 -04:00
|
|
|
export type FindOrCreateAuthor = (
|
|
|
|
name: string,
|
|
|
|
podId: number,
|
|
|
|
userId: number,
|
|
|
|
transaction: Sequelize.Transaction
|
|
|
|
) => Promise<AuthorInstance>
|
2017-05-22 14:58:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface AuthorClass {
|
|
|
|
findOrCreateAuthor: AuthorMethods.FindOrCreateAuthor
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AuthorAttributes {
|
|
|
|
name: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AuthorInstance extends AuthorClass, AuthorAttributes, Sequelize.Instance<AuthorAttributes> {
|
|
|
|
id: number
|
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
2017-06-10 16:15:25 -04:00
|
|
|
|
|
|
|
podId: number
|
|
|
|
Pod: PodInstance
|
2017-05-22 14:58:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface AuthorModel extends AuthorClass, Sequelize.Model<AuthorInstance, AuthorAttributes> {}
|