# Task

### TaskModel

```typescript
{
    record_id?: string;

    organization_id: number;
    created_by_user_id: number;
    
    record_sub_type = RecordSubTypeEnum.task;
    access_type = RecordAccessTypeEnum.default;
    is_template = false;

    name?: string;
    description?: string;
    
    assigned_user?: OrganizationUserModel;

    priority?: RecordPriorityEnum;

    date_info: RecordDateModel = new RecordDateModel();

    planned_start?: Date;
    planned_due?: Date;

    status = RecordStatusEnum.incomplete;
    status_modified_at?: Date;
    completed_at?: Date;

    estimated_time?: number;
    actual_time?: number;
    billable: boolean = true;
    cost?: number;
    billable_amount?: number;

    parent?: RecordIdNameModel;

    member_role = MembershipRoleEnum.edit;      //Can only be edit / view

    sub_records_unarchived_count: number;
    sub_records_archived_count: number;

    archived = false;

    projects = new Array<ProjectRecordModel>();

    followers = new Array<OrganizationUserModel>();

    files = new Array<FileModel>(); 

    dependencies = new Array<RecordDependencyModel>();

    contacts = new Array<ContactTypeaheadModel>();
    contact_email?: string; //To link contact while import
    contact_phone?: string; //To link contact while import

    custom_field_values = new Array<CustomFieldValueModel>();

    created_at: Date;
    modified_at: Date;
}
```

### TaskSubType

* Defines the type of record this is - task or milestone

```typescript
{
    task = 'task',
    milestone = 'milestone',
}
```

### RecordAccessTypeEnum

* If its \`core\_members\` it means this task is only visible to internal members and not to the guest user

```typescript
{
    default = "default",
    core_members = "core_members"
}
```

### PriorityEnum

```typescript
{
    high = 'high',
    medium = 'medium',
    low = 'low',
}

```

### DateModel

```typescript
{
    start_date?: Date;
    due_date?: Date;
    duration?: number; //In days

    recurr_type: RecurrTypeEnum = RecurrTypeEnum.never_repeat;
    recurr_on: RecurrOnEnum = RecurrOnEnum.on_completion;
    recurr_interval = 1; 
    recurr_weekdays = new Array<DayOfWeek>(); 
    recurr_day_of_month = 1;
}
```

#### RecurrTypeEnum

```typescript
{
    never_repeat = 'never_repeat',
    days = 'days',
    weeks = 'weeks',
    months = 'months',
    years = 'years',
}
```

#### RecurrOnEnum

```typescript
{
    on_completion = "on_completion",
    on_schedule = "on_schedule"
}
```

### More Details

* For ProjectRecordModel please refer to [Project](/models/project.md)
* For FileModel please refer to [File](/models/file.md)
* For RecordStatusEnum please refer to [Record](/models/record.md)
* For OrganizationUserModel please refer to [Organization User](/models/company/companyuser.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.smarttask.io/models/task.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
