elioria-sst-x
    Preparing search index...

    Class SupabaseEpiWarehouseRepository

    Implements

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

    The db value.

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

      Returns the result of findById.

      Parameters

      • id: string

        The id value.

      Returns Promise<WarehouseEntry | null>

      The function result.

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

      Behavior: Async; accepts id; returns a value; invokes this.db.select().from(epiWarehouse).where(eq(epiWarehouse.id.

    • Generated

      Returns the result of findByTenantAndUnit.

      Parameters

      • tenantId: string

        The tenantId value.

      • unitId: string

        The unitId value.

      Returns Promise<WarehouseEntry[]>

      The function result.

      Objective: In module packages/db/src/repositories/epi-warehouse.repository.ts, retrieve data through findByTenantAndUnit.

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

    • Generated

      Returns the result of findByTenantUnitAndCatalog.

      Parameters

      • tenantId: string

        The tenantId value.

      • unitId: string

        The unitId value.

      • epiCatalogId: string

        The epiCatalogId value.

      Returns Promise<WarehouseEntry | null>

      The function result.

      Objective: In module packages/db/src/repositories/epi-warehouse.repository.ts, retrieve data through findByTenantUnitAndCatalog.

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

    • Generated

      Returns the result of findByTenantUnitCatalogAndVariant.

      Parameters

      • tenantId: string

        The tenantId value.

      • unitId: string

        The unitId value.

      • epiCatalogId: string

        The epiCatalogId value.

      • epiCatalogVariantId: string | null

        The epiCatalogVariantId value.

      Returns Promise<WarehouseEntry | null>

      The function result.

      Objective: In module packages/db/src/repositories/epi-warehouse.repository.ts, retrieve data through findByTenantUnitCatalogAndVariant.

      Behavior: Async; accepts tenantId and unitId and epiCatalogId and epiCatalogVariantId; returns a value; invokes eq.

    • Generated

      Returns the result of listPaged.

      Parameters

      • tenantId: string

        The tenantId value.

      • unitId: string

        The unitId value.

      • query: ListEpiWarehouseQuery

        The query value.

      Returns Promise<PagedResult<WarehouseEntry>>

      The function result.

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

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

    • Generated

      Updates data through updateStock.

      Parameters

      • id: string

        The id value.

      • quantityInStock: number

        The quantityInStock value.

      • lastMovementAt: Date

        The lastMovementAt value.

      Returns Promise<void>

      The function result.

      Objective: In module packages/db/src/repositories/epi-warehouse.repository.ts, change data through updateStock.

      Behavior: Async; accepts id and quantityInStock and lastMovementAt; returns a value; invokes this.db .update(epiWarehouse) .set({ quantityInStock, lastMo.