-
Notifications
You must be signed in to change notification settings - Fork 388
/
task-object.model.ts
79 lines (69 loc) · 2.33 KB
/
task-object.model.ts
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
import { Observable } from 'rxjs';
import { link, typedObject } from '../../cache/builders/build-decorators';
import { CacheableObject } from '../../cache/object-cache.reducer';
import { RemoteData } from '../../data/remote-data';
import { EPerson } from '../../eperson/models/eperson.model';
import { EPERSON } from '../../eperson/models/eperson.resource-type';
import { Group } from '../../eperson/models/group.model';
import { GROUP } from '../../eperson/models/group.resource-type';
import { DSpaceObject } from '../../shared/dspace-object.model';
import { HALLink } from '../../shared/hal-link.model';
import { WorkflowItem } from '../../submission/models/workflowitem.model';
import { TASK_OBJECT } from './task-object.resource-type';
import { WORKFLOWITEM } from '../../eperson/models/workflowitem.resource-type';
import { WORKFLOW_ACTION } from './workflow-action-object.resource-type';
import { WorkflowAction } from './workflow-action-object.model';
/**
* An abstract model class for a TaskObject.
*/
@typedObject
@inheritSerialization(DSpaceObject)
export class TaskObject extends DSpaceObject implements CacheableObject {
static type = TASK_OBJECT;
/**
* The task identifier
*/
@autoserialize
id: string;
/**
* The workflow step
*/
@autoserialize
step: string;
/**
* The {@link HALLink}s for this TaskObject
*/
@deserialize
_links: {
self: HALLink;
owner: HALLink;
group: HALLink;
workflowitem: HALLink;
action: HALLink;
};
/**
* The EPerson for this task
* Will be undefined unless the eperson {@link HALLink} has been resolved.
*/
@link(EPERSON, false, 'owner')
eperson?: Observable<RemoteData<EPerson>>;
/**
* The Group for this task
* Will be undefined unless the group {@link HALLink} has been resolved.
*/
@link(GROUP)
group?: Observable<RemoteData<Group>>;
/**
* The WorkflowItem for this task
* Will be undefined unless the workflowitem {@link HALLink} has been resolved.
*/
@link(WORKFLOWITEM)
workflowitem?: Observable<RemoteData<WorkflowItem>> | WorkflowItem;
/**
* The task action type
* Will be undefined unless the group {@link HALLink} has been resolved.
*/
@link(WORKFLOW_ACTION, false, 'action')
action: Observable<RemoteData<WorkflowAction>>;
}