import {ProductVersion} from "./product"; export class JobQueue { label: string; name: string; constructor(label: string, name: string) { this.label = label; this.name = name; } } export class Job { job_arch_status: string; job_endtime: number; job_endtime_formatted: string; job_id: number; job_name: string; job_starttime: number; job_starttime_formatted: string; job_status: string; jobspec_creation_date: number; jobspec_creation_date_formatted: string; jobspec_id: number; jobspec_name: string; jobspec_sdm_id: string; jobspec_status: string; static QUEUES = [ new JobQueue('Calibration', 'calibration'), new JobQueue('Quicklook', 'quicklook'), new JobQueue('SE Calibration', 'se_calibration'), //new JobQueue('SE Cont', 'se_cont'), new JobQueue('SE Continuum Image', 'se_continuum_imaging'), new JobQueue('SE Coarse Cube Image', 'se_coarse_cube_imaging') ]; static getQueueFromName(queueName: string): JobQueue { for (const queue of this.QUEUES) { if (queue.name === queueName) { return queue; } } } static SORT_COLUMNS = ['id', 'name', 'start_date', 'end_date', 'status']; } export class Task { end: number; endDate: string; finalTask: boolean; id: number; name: string; pbsJobId: string; results: object; start: number; startDate: string; status: string; } export class JobExecution { analyst: string; archivalJob: string; archiveStatus: string; end: number; endDate: string; id: number; jobSpecId: number; jsonResults: string; name: string; notes: string; queueName: string; sdmId: string; start: number; startDate: string; status: string; tasks: Array<Task>; } export class JobSpecFile { id: number; name: string; contentType: string; } export class JobSpec { creationDate: number; executions: Array<JobExecution>; files: Array<JobSpecFile>; id: number; inputs: object; // object = named array of ProductVersion lastJob: JobExecution; name: string; queueName: string; sbId: number; sdmId: string; status: string; targets: Array<ProductVersion>; static SORT_COLUMNS = ['id', 'name', 'creation_date', 'status']; }