aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/job/job-interface.ts
blob: 31b3773670d0eab841efee7c2c4c30d13202f105 (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
import * as Sequelize from 'sequelize'

import { JobState } from '../../../shared/models/job.model'

export namespace JobMethods {
  export type ListWithLimitCallback = (err: Error, jobInstances: JobInstance[]) => void
  export type ListWithLimit = (limit: number, state: JobState, callback: ListWithLimitCallback) => void
}

export interface JobClass {
  listWithLimit: JobMethods.ListWithLimit
}

export interface JobAttributes {
  state: JobState
  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> {}