2020-01-16 20:01:12 +03:00
|
|
|
import Model, {attr, belongsTo} from '@ember-data/model';
|
2019-11-25 16:20:16 +03:00
|
|
|
import {equal} from '@ember/object/computed';
|
2019-11-07 11:37:26 +03:00
|
|
|
|
|
|
|
export default Model.extend({
|
|
|
|
emailCount: attr('number'),
|
|
|
|
error: attr('string'),
|
|
|
|
html: attr('string'),
|
|
|
|
plaintext: attr('string'),
|
|
|
|
stats: attr('json-string'),
|
|
|
|
status: attr('string'),
|
|
|
|
subject: attr('string'),
|
|
|
|
submittedAtUTC: attr('moment-utc'),
|
|
|
|
uuid: attr('string'),
|
|
|
|
|
2019-11-08 13:07:47 +03:00
|
|
|
createdAtUTC: attr('moment-utc'),
|
2019-11-07 11:37:26 +03:00
|
|
|
createdBy: attr('string'),
|
2019-11-08 13:07:47 +03:00
|
|
|
updatedAtUTC: attr('moment-utc'),
|
2019-11-07 11:37:26 +03:00
|
|
|
updatedBy: attr('string'),
|
|
|
|
|
2019-11-22 18:09:48 +03:00
|
|
|
post: belongsTo('post'),
|
|
|
|
|
2019-11-25 16:20:16 +03:00
|
|
|
isSuccess: equal('status', 'submitted'),
|
|
|
|
isFailure: equal('status', 'failed'),
|
|
|
|
|
2019-11-22 18:09:48 +03:00
|
|
|
retry() {
|
|
|
|
return this.store.adapterFor('email').retry(this);
|
|
|
|
}
|
2019-11-07 11:37:26 +03:00
|
|
|
});
|