import { ResultBase } from '../../models/http/resultBase';
import { TaskDetails } from '../../models/tasks/taskDetails';
import { TaskType } from '../../models/tasks/taskType';
import { UserDetails } from '../../models/users/userDetails';
import { HttpCommandBase } from '../abstract/httpCommandBase';
import { HttpMethod } from '../abstract/httpMethod';

export class GetTaskDetailsCommand extends HttpCommandBase<UserDetails, TaskDetails, ResultBase> {
    public endpoint: string = '/tasks';
    public method: HttpMethod = HttpMethod.Get;

    constructor(private task: TaskType, private externalId: string | null) {
        super();
    }

    public buildEndpoint(): string {
        return `${this.endpoint}/${this.task}`;
    }

    public buildRequestContent(): UserDetails {
        return new UserDetails(this.externalId);
    }
}