elioria-sst-x
    Preparing search index...

    Implements

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

    The db value.

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

      Executes buildListConditions.

      Parameters

      • tenantId: string

        The tenantId value.

      • query: ListInspectionsQuery

        The query value.

      • Optionalfilter: HierarchyFilter

        The filter value.

      Returns SQL<unknown>[]

      The function result.

      Objective: In module packages/db/src/repositories/inspecoes.repository.ts, run buildListConditions.

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

    • Generated

      Executes compareAndSetStatus.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      • expectedStatus: InspectionStatus

        The expectedStatus value.

      • nextStatus: InspectionStatus

        The nextStatus value.

      Returns Promise<boolean>

      The function result.

      Objective: In module packages/db/src/repositories/inspecoes.repository.ts, run compareAndSetStatus.

      Behavior: Async; accepts id and tenantId and expectedStatus and nextStatus; returns a value; invokes this.db .update(inspections) .set({ status: nextStatus }) .w.

    • Generated

      Executes existsOccurrenceKey.

      Parameters

      • key: string

        The key value.

      Returns Promise<boolean>

      The function result.

      Objective: In module packages/db/src/repositories/inspecoes.repository.ts, run existsOccurrenceKey.

      Behavior: Async; accepts key; returns a value; invokes this.db.select({ id: inspections.id }) .from(inspections) .w.

    • Generated

      Returns the result of findById.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      Returns Promise<Inspection | null>

      The function result.

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

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

    • Generated

      Returns the result of findByTenant.

      Parameters

      • tenantId: string

        The tenantId value.

      Returns Promise<Inspection[]>

      The function result.

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

      Behavior: Async; accepts tenantId; returns a value; invokes this.db .select() .from(inspections) .where(eq(inspections.t.

    • Generated

      Returns the result of listPaged.

      Parameters

      • tenantId: string

        The tenantId value.

      • query: ListInspectionsQuery

        The query value.

      • Optionalfilter: HierarchyFilter

        The filter value.

      Returns Promise<PagedResult<Inspection>>

      The function result.

      Objective: In module packages/db/src/repositories/inspecoes.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: InspectionStatus

        The status value.

      Returns Promise<void>

      The function result.

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

      Behavior: Async; accepts id and tenantId and status; returns a value; invokes this.db .update(inspections) .set({ status }) .where.