aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/models/job/job-interface.ts
blob: 411a05029e56fa2fe7e95da66f362177180a7594 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                      
                                   
 
                                                                        
 
                             
                                                                                                                         


                           
                                                             


                                
                 
                     
                       








                                                                                                 
import * as Sequelize from 'sequelize'
import * as Promise from 'bluebird'

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

export namespace JobMethods {
  export type ListWithLimitByCategory = (limit: number, state: JobState, category: JobCategory) => Promise<JobInstance[]>
}

export interface JobClass {
  listWithLimitByCategory: JobMethods.ListWithLimitByCategory
}

export interface JobAttributes {
  state: JobState
  handlerName: string
  handlerInputData: any
}

export interface JobInstance extends JobClass, JobAttributes, Sequelize.Instance<JobAttributes> {
  id: number
  createdAt: Date
  updatedAt: Date
}

export interface JobModel extends JobClass, Sequelize.Model<JobInstance, JobAttributes> {}