Represents a plan in the system. A plan contains multiple tasks and hooks, and tracks its status and retries.

Constructors

  • Creates an instance of the Plan class.

    Parameters

    • data: {
          action: AbstractAction;
          created_at: number;
          description: string;
          hook: Hook[];
          id: string;
          max_failure_retry: number;
          parent_plan_id?: string;
          period_time: string;
          status: PlanStatus;
          type: AbstractPlanType;
          updated_at: number;
          user_id: string;
      }

      The plan data including ID, user ID, description, type, status, max failure retry, action, hooks, and timestamps.

    Returns Plan

Properties

The action to be executed as part of the plan.

created_at: number

The timestamp (in milliseconds) when the plan was created.

description: string

A description of the plan.

hook: Hook[]

A list of hooks associated with the plan.

id: string

The unique identifier for the plan.

max_failure_retry: number

The maximum number of failure retries for tasks in the plan.

parent_plan_id?: string

The parent plan ID, if this plan is a sub-plan. Optional.

period_time: string

The period of time (e.g., "daily", "weekly") for which the plan repeats.

status: PlanStatus

The status of the plan (e.g., CREATED, RUNNING, COMPLETED).

The type of the plan (e.g., recurring, one-time).

updated_at: number

The timestamp (in milliseconds) when the plan was last updated.

user_id: string

The ID of the user who created the plan.