2018-03-08 22:14:55 +00:00
|
|
|
import { bool, equal } from '@ember/object/computed';
|
2017-11-29 01:21:56 +00:00
|
|
|
import Model from 'ember-data/model';
|
|
|
|
import attr from 'ember-data/attr';
|
|
|
|
import { belongsTo } from 'ember-data/relationships';
|
|
|
|
import { fragmentArray } from 'ember-data-model-fragments/attributes';
|
|
|
|
import shortUUIDProperty from '../utils/properties/short-uuid';
|
|
|
|
|
|
|
|
export default Model.extend({
|
|
|
|
shortId: shortUUIDProperty('id'),
|
|
|
|
priority: attr('number'),
|
|
|
|
type: attr('string'),
|
|
|
|
triggeredBy: attr('string'),
|
|
|
|
status: attr('string'),
|
|
|
|
statusDescription: attr('string'),
|
|
|
|
failedTGAllocs: fragmentArray('placement-failure', { defaultValue: () => [] }),
|
|
|
|
|
2017-12-15 21:39:18 +00:00
|
|
|
hasPlacementFailures: bool('failedTGAllocs.length'),
|
2018-03-08 22:14:55 +00:00
|
|
|
isBlocked: equal('status', 'blocked'),
|
2017-11-29 01:21:56 +00:00
|
|
|
|
|
|
|
job: belongsTo('job'),
|
|
|
|
|
|
|
|
modifyIndex: attr('number'),
|
2019-08-22 13:11:24 +00:00
|
|
|
modifyTime: attr('date'),
|
|
|
|
|
|
|
|
createIndex: attr('number'),
|
|
|
|
createTime: attr('date'),
|
2018-05-03 19:17:06 +00:00
|
|
|
|
|
|
|
waitUntil: attr('date'),
|
2017-11-29 01:21:56 +00:00
|
|
|
});
|