elioria-sst-x
    Preparing search index...

    Class SupabaseInspectionActionRepository

    Implements

    Index
    db: PostgresJsDatabase<packages/db/src/schema> & {}

    The db value.

    SORT_WHITELIST: Record<
        string,
        typeof inspectionActions[keyof typeof inspectionActions],
    > = ...
    • Generated

      Executes buildListConditions.

      Parameters

      • tenantId: string

        The tenantId value.

      • query: ListActionsQuery

        The query value.

      • Optionalfilter: HierarchyFilter

        The filter value.

      Returns SQL<unknown>[]

      The function result.

      Objective: In module packages/db/src/repositories/inspection-action.repository.ts, run buildListConditions.

      Behavior: accepts tenantId and query and filter; returns a value; invokes eq.

    • Generated

      Returns the result of findByFinding.

      Parameters

      • findingId: string

        The findingId value.

      • tenantId: string

        The tenantId value.

      Returns Promise<InspectionAction[]>

      The function result.

      Objective: In module packages/db/src/repositories/inspection-action.repository.ts, retrieve data through findByFinding.

      Behavior: Async; accepts findingId and tenantId; returns a value; invokes this.db.select().from(inspectionActions) .where(and(eq(inspe.

    • Generated

      Returns the result of findById.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      Returns Promise<InspectionAction | null>

      The function result.

      Objective: In module packages/db/src/repositories/inspection-action.repository.ts, retrieve data through findById.

      Behavior: Async; accepts id and tenantId; returns a value; invokes this.db.select().from(inspectionActions) .where(and(eq(inspe.

    • Generated

      Returns the result of findByStatus.

      Parameters

      • tenantId: string

        The tenantId value.

      • status: InspectionActionStatus

        The status value.

      • Optionalfilter: HierarchyFilter

        The filter value.

      Returns Promise<InspectionAction[]>

      The function result.

      Objective: In module packages/db/src/repositories/inspection-action.repository.ts, retrieve data through findByStatus.

      Behavior: Async; accepts tenantId and status and filter; returns a value; invokes eq.

    • Generated

      Returns the result of findByTenant.

      Parameters

      • tenantId: string

        The tenantId value.

      • Optionalfilter: HierarchyFilter

        The filter value.

      Returns Promise<InspectionAction[]>

      The function result.

      Objective: In module packages/db/src/repositories/inspection-action.repository.ts, retrieve data through findByTenant.

      Behavior: Async; accepts tenantId and filter; returns a value; invokes eq.

    • Generated

      Executes findingIdsSubquery.

      Parameters

      • tenantId: string

        The tenantId value.

      • filter: HierarchyFilter

        The filter value.

      Returns Omit<
          PgSelectBase<
              "inspection_findings",
              { id: PgColumn<{}, {}, {}> },
              "partial",
              Record<"inspection_findings", "not-null">,
              false,
              "where",
              { id: string }[],
              { id: PgColumn<{}, {}, {}> },
          >,
          "where",
      >

      The function result.

      Objective: In module packages/db/src/repositories/inspection-action.repository.ts, run findingIdsSubquery.

      Behavior: accepts tenantId and filter; returns a value; invokes eq.

    • Generated

      Returns the result of listPaged.

      Parameters

      • tenantId: string

        The tenantId value.

      • query: ListActionsQuery

        The query value.

      • Optionalfilter: HierarchyFilter

        The filter value.

      Returns Promise<PagedResult<InspectionAction>>

      The function result.

      Objective: In module packages/db/src/repositories/inspection-action.repository.ts, retrieve data through listPaged.

      Behavior: Async; accepts tenantId and query and filter; returns a value; invokes Math.max.

    • Generated

      Updates data through updateStatus.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      • status: InspectionActionStatus

        The status value.

      • Optionaltimestamps: { completedAt?: Date }

        The timestamps value.

      Returns Promise<InspectionAction | null>

      The function result.

      Objective: In module packages/db/src/repositories/inspection-action.repository.ts, change data through updateStatus.

      Behavior: Async; accepts id and tenantId and status and timestamps; returns a value; invokes this.db.update(inspectionActions).set({ status, ...extra }) .