Hierarchy

  • LookupPowers

Index

Methods

Static getApplicationLookup

  • getApplicationLookup<T>(lookupName: string): Promise<Lookup<T> | null>
  • Gets Application Lookup for a specific lookup name defined in the Admin Section and Andi Skills Manager fixedRateTypeValue = fixedRateType.value.

    throws

    {TypeError} if lookupName is missing

    example

    Getting the rate types then getting the value of the FixedType

    // Ensure you import LookupPowers
    // import { LookupPowers } from "@andi/powers";
    
    const rateTypes = await LookupPowers.getApplicationLookup("RateTypes");
    const fixedRateType = rateTypes.values.find(value => value.name === "Fixed");
    const fixedRateTypeValue = fixedRateType.value;

    Type parameters

    • T

    Parameters

    • lookupName: string

      name of lookup

    Returns Promise<Lookup<T> | null>

Static getApplicationLookups

  • getApplicationLookups<T>(): Promise<Lookup<T>[]>
  • Gets Application lookups defined in the Admin Section and Andi Skills Manager

    example

    Finding the rate types from all the defined types then getting the value of the FixedType

    // Ensure you import LookupPowers
    // import { LookupPowers } from "@andi/powers";
    
    const applicationLookups = await LookupPowers.getApplicationLookups();
    const rateTypes = applicationLookups.find(lookup => lookup.name === "RateTypes");
    const fixedRateType = rateTypes.values.find(value => value.name === "Fixed");
    const fixedRateTypeValue = fixedRateType.value;

    Type parameters

    • T

    Returns Promise<Lookup<T>[]>

    All application lookups or an empty array if none exist.

Generated using TypeDoc