src/domain/task/entity/task.ts

Summary

Maintainability
A
0 mins
Test Coverage
import type { List as ImmutableList } from 'immutable'
import type { Entity } from 'domain/common/type'

export type TaskStatus = 'processing' | 'success' | 'error'
export type TaskProgress = {
  min?: number
  max?: number
  current?: number
}

export type Task<T = string, I = string> = Entity<
  {
    readonly creationDate: Date
    readonly lastUpdateDate: Date
    readonly type: T
    readonly status: TaskStatus
    readonly initiator: string
    readonly progress?: TaskProgress
  },
  I
>

export type Tasks<T = string, I = string> = ImmutableList<Task<T, I>>