elioria-sst-x
    Preparing search index...

    Implements

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

    The db value.

    • Generated

      Returns the result of findById.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      Returns Promise<Incident | null>

      The function result.

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

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

    • Generated

      Returns the result of findByTenant.

      Parameters

      • tenantId: string

        The tenantId value.

      • companyId: string

        The companyId value.

      • Optionalquery: ListIncidentsQuery

        The query value.

      Returns Promise<PagedResult<Incident>>

      The function result.

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

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

    • Generated

      Returns the result of getNextIncidentNumber.

      Parameters

      • tenantId: string

        The tenantId value.

      • year: number

        The year value.

      Returns Promise<string>

      The function result.

      Objective: In module packages/db/src/repositories/investigacao-v2.repository.ts, retrieve data through getNextIncidentNumber.

      Behavior: Async; accepts tenantId and year; returns a value; invokes this.db.execute.

    • Generated

      Executes update.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      • data: UpdateIncidentData

        The data value.

      Returns Promise<Incident>

      The function result.

      Objective: In module packages/db/src/repositories/investigacao-v2.repository.ts, run update.

      Behavior: Async; accepts id and tenantId and data; returns a value; invokes this.db .update(incidents) .set(data as Record<string, unkno; may throw.

      When the function cannot complete normally.

    • Generated

      Updates data through updateIncidentStatus.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      • status: IncidentStatus

        The status value.

      Returns Promise<void>

      The function result.

      Objective: In module packages/db/src/repositories/investigacao-v2.repository.ts, change data through updateIncidentStatus.

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