elioria-sst-x
    Preparing search index...

    Class SupabaseUserCompanyRoleRepository

    Implements

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

    The db value.

    • Generated

      Executes assign.

      Parameters

      • data: {
            assignedBy?: string;
            companyId?: string;
            role: UserRole;
            sectorId?: string;
            tenantId?: string;
            unitId?: string;
            userId: string;
        }

        The data value.

      Returns Promise<UserCompanyRole>

      The function result.

      Objective: In module packages/db/src/repositories/user-company-role.repository.ts, run assign.

      Behavior: Async; accepts data; returns a value; invokes this.db .insert(userCompanyRoles) // eslint-disable-next-lin.

    • Generated

      Returns the result of findByCompany.

      Parameters

      • companyId: string

        The companyId value.

      Returns Promise<UserCompanyRole[]>

      The function result.

      Objective: In module packages/db/src/repositories/user-company-role.repository.ts, retrieve data through findByCompany.

      Behavior: Async; accepts companyId; returns a value; invokes this.db .select() .from(userCompanyRoles) .where.

    • Generated

      Returns the result of findByUser.

      Parameters

      • userId: string

        The userId value.

      Returns Promise<UserCompanyRole[]>

      The function result.

      Objective: In module packages/db/src/repositories/user-company-role.repository.ts, retrieve data through findByUser.

      Behavior: Async; accepts userId; returns a value; invokes this.db .select() .from(userCompanyRoles) .where.

    • Generated

      Checks whether hasRole is satisfied.

      Parameters

      • userId: string

        The userId value.

      • role: UserRole

        The role value.

      • OptionalcompanyId: string

        The companyId value.

      Returns Promise<boolean>

      The function result.

      Objective: In module packages/db/src/repositories/user-company-role.repository.ts, evaluate hasRole.

      Behavior: Async; accepts userId and role and companyId; returns a value; invokes this.db.$count.

    • Generated

      Executes remove.

      Parameters

      • userId: string

        The userId value.

      • role: UserRole

        The role value.

      • OptionalcompanyId: string

        The companyId value.

      Returns Promise<void>

      The function result.

      Objective: In module packages/db/src/repositories/user-company-role.repository.ts, run remove.

      Behavior: Async; accepts userId and role and companyId; returns a value; invokes this.db .delete(userCompanyRoles) .where.