2017-05-22 13:58:25 -05:00
|
|
|
import * as Sequelize from 'sequelize'
|
|
|
|
|
2017-06-16 03:36:18 -05:00
|
|
|
import { JobState } from '../../../shared/models/job.model'
|
|
|
|
|
2017-05-22 13:58:25 -05:00
|
|
|
export namespace JobMethods {
|
2017-06-10 15:15:25 -05:00
|
|
|
export type ListWithLimitCallback = (err: Error, jobInstances: JobInstance[]) => void
|
2017-06-16 03:36:18 -05:00
|
|
|
export type ListWithLimit = (limit: number, state: JobState, callback: ListWithLimitCallback) => void
|
2017-05-22 13:58:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface JobClass {
|
|
|
|
listWithLimit: JobMethods.ListWithLimit
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface JobAttributes {
|
2017-06-16 03:36:18 -05:00
|
|
|
state: JobState
|
2017-05-22 13:58:25 -05:00
|
|
|
handlerName: string
|
|
|
|
handlerInputData: object
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface JobInstance extends JobClass, JobAttributes, Sequelize.Instance<JobAttributes> {
|
|
|
|
id: number
|
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface JobModel extends JobClass, Sequelize.Model<JobInstance, JobAttributes> {}
|