diff --git a/projects/common/src/fm/models/itemTask.ts b/projects/common/src/fm/models/itemTask.ts index a95a260..acc0915 100644 --- a/projects/common/src/fm/models/itemTask.ts +++ b/projects/common/src/fm/models/itemTask.ts @@ -2,14 +2,22 @@ export interface IItemTask { code?: string; taskType?: string; - attributes?:any + attributes?: any; + message?: string, + state?: number, + started?: Date, + finished?: Date } export class ItemTask implements IItemTask { public code?:string; public taskType?: string; public attributes?: any; + public message?: string; + public state?: number; + public started?: Date; + public finished?: Date; constructor() { } -} +} \ No newline at end of file diff --git a/projects/common/src/fm/services/item.service.ts b/projects/common/src/fm/services/item.service.ts index 31044b4..e2c92c2 100644 --- a/projects/common/src/fm/services/item.service.ts +++ b/projects/common/src/fm/services/item.service.ts @@ -148,5 +148,9 @@ export class ItemService { postItemTask(item: IItem, task: IItemTask): Observable { return this.httpClient.post(`${this.ApiEndpoint()}/api/v1/items/${item.code}/tasks`, task); } + + getItemTaskList(itemcode: string): Observable { + return this.httpClient.get(`${this.ApiEndpoint()}/api/v1/items/${itemcode}/tasks`).pipe(map(ia => ia.map(i => this.parseDates(i)))); + } }