elioria-sst-x
    Preparing search index...

    Class SupabaseEpiPurchaseRequestRepository

    Implements

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

    The db value.

    SORT_WHITELIST: Record<string, any> = ...
    • Generated

      Executes countByTenantAndUnit.

      Parameters

      • tenantId: string

        The tenantId value.

      • unitId: string

        The unitId value.

      Returns Promise<number>

      The function result.

      Objective: In module packages/db/src/repositories/epi-purchase-request.repository.ts, run countByTenantAndUnit.

      Behavior: Async; accepts tenantId and unitId; returns a value; invokes this.db .select() .from(epiPurchaseRequests) .where.

    • Generated

      Executes create.

      Parameters

      • data: CreateEpiPurchaseRequestData

        The data value.

      Returns Promise<EpiPurchaseRequest>

      The function result.

      Objective: In module packages/db/src/repositories/epi-purchase-request.repository.ts, run create.

      Behavior: Async; accepts data; returns a value; invokes this.db .insert(epiPurchaseRequests) .values({ tenantId: dat.

    • Generated

      Returns the result of findById.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      Returns Promise<EpiPurchaseRequest | null>

      The function result.

      Objective: In module packages/db/src/repositories/epi-purchase-request.repository.ts, retrieve data through findById.

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

    • Generated

      Returns the result of findByTenant.

      Parameters

      • tenantId: string

        The tenantId value.

      Returns Promise<EpiPurchaseRequest[]>

      The function result.

      Objective: In module packages/db/src/repositories/epi-purchase-request.repository.ts, retrieve data through findByTenant.

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

    • Generated

      Returns the result of findByUnit.

      Parameters

      • tenantId: string

        The tenantId value.

      • unitId: string

        The unitId value.

      Returns Promise<EpiPurchaseRequest[]>

      The function result.

      Objective: In module packages/db/src/repositories/epi-purchase-request.repository.ts, retrieve data through findByUnit.

      Behavior: Async; accepts tenantId and unitId; returns a value; invokes this.db .select() .from(epiPurchaseRequests) .where(and(eq(e.

    • Generated

      Returns the result of listPaged.

      Parameters

      • tenantId: string

        The tenantId value.

      • companyId: string

        The companyId value.

      • query: ListEpiPurchaseRequestsQuery

        The query value.

      Returns Promise<PagedResult<EpiPurchaseRequest>>

      The function result.

      Objective: In module packages/db/src/repositories/epi-purchase-request.repository.ts, retrieve data through listPaged.

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

    • Generated

      Executes update.

      Parameters

      • id: string

        The id value.

      • tenantId: string

        The tenantId value.

      • data: Partial<CreateEpiPurchaseRequestData> & {
            approvedAt?: Date;
            approvedBy?: string;
            cancellationReason?: string;
            cancelledAt?: Date;
            cancelledBy?: string;
            rejectedAt?: Date;
            rejectedBy?: string;
            rejectionReason?: string;
            status?: EpiPurchaseRequestStatus;
            submittedAt?: Date;
        }

        The data value.

      Returns Promise<EpiPurchaseRequest>

      The function result.

      Objective: In module packages/db/src/repositories/epi-purchase-request.repository.ts, run update.

      Behavior: Async; accepts id and tenantId and data; returns a value; invokes this.db .update(epiPurchaseRequests) .set(updatePayload) .wh.