elioria-sst-x
    Preparing search index...

    Class SupabaseCipaElectionRepository

    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<CipaElection | null>

      The function result.

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

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

    • Generated

      Returns the result of findByMandate.

      Parameters

      • mandateId: string

        The mandateId value.

      • tenantId: string

        The tenantId value.

      Returns Promise<CipaElection[]>

      The function result.

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

      Behavior: Async; accepts mandateId and tenantId; returns a value; invokes this.db.select().from(cipaElections).where(and(eq(cipaElecti.

    • Generated

      Updates data through updateProcessStatus.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      • processStatus: CipaProcessoEleitoralStatus

        The processStatus value.

      Returns Promise<CipaElection | null>

      The function result.

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

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

    • Generated

      Updates data through updateStatus.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      • status: CipaElectionStatus

        The status value.

      Returns Promise<CipaElection | null>

      The function result.

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

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

    • Generated

      Updates data through updateVoteTotals.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      • totals: {
            totalEleitores?: number;
            totalVotos?: number;
            votosBrancos?: number;
            votosNulos?: number;
            votosValidos?: number;
        }

        The totals value.

      Returns Promise<CipaElection | null>

      The function result.

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

      Behavior: Async; accepts id and tenantId and totals; returns a value; invokes this.db.update(cipaElections).set(payload).where(and(eq(cipa.