Interface IItemService

Interface for a generic service.

Hierarchy

Implemented by

Properties

db: Dexie
moduleName: string

Methods

  • Adds an image to an item.

    Parameters

    • file: File

      The image file to add.

    • item: IItem

      The item to add the image to.

    Returns Promise<IItem>

    A Promise that resolves to the updated IItem object.

  • Adds a modifier to an item.

    Parameters

    • item: IItem

      The item to add the modifier to.

    • modifier: ICoreItem

      The modifier to add.

    Returns Promise<IItem>

    A Promise that resolves to the updated IItem object.

  • Adds a modifier category to an item.

    Parameters

    • item: IItem

      The item to add the modifier category to.

    • category: ICategory

      The category to add.

    Returns Promise<IItem>

    A Promise that resolves to the updated IItem object.

  • attach a ungrouped modifier to a modifier group (category) if you want to detach a modifier from a group, pass an empty string as the category_uid

    Parameters

    • item: IItem

      the item to attach the modifier to it's modifier category

    • modifier_uid: string

      the uid of the modifier to attach

    • category_uid: string

      the uid of the category to attach the modifier to

    Returns Promise<IItem>

  • change the stock of an item by increment or decrement

    Parameters

    • uid: string

      uid of the item to change stock

    • stock: number

      the quantity to change the stock by, can be negative

    Returns Promise<IItem>

  • Retrieves multiple entities with optional pagination and filtering.

    Parameters

    • params: any

      [UNUSED PARAMETER, KEPT FOR POSSIBLE FUTURE USE] Filtering parameters.

    • options: {
          page?: number;
          pageSize?: number;
      }

      Query options including pagination.

      • Optional page?: number
      • Optional pageSize?: number

    Returns Promise<{
        count: number;
        list: IItem[];
        page: number;
        pageSize: number;
    }>

    An object containing the retrieved entities and total count.

  • Removes a modifier from an item.

    Parameters

    • item: IItem

      The item to remove the modifier from.

    • modifier: ICoreItem

      The modifier to remove.

    Returns Promise<IItem>

    A Promise that resolves to the updated IItem object.

  • Removes a modifier category from an item.

    Parameters

    • item: IItem

      The item to remove the modifier category from.

    • category: ICategory

      The category to remove.

    Returns Promise<IItem>

    A Promise that resolves to the updated IItem object.

  • Searches for items by name, codename or barcode.

    Parameters

    • query: string

      The search query.

    Returns Promise<IItem[]>

    A Promise that resolves to an array of IItem objects.

  • Updates a modifier of an item.

    Parameters

    • item: IItem

      The item to update the modifier of.

    • modifier: ICoreItem

      The modifier to update.

    Returns Promise<IItem>

    A Promise that resolves to the updated IItem object.

  • Updates a modifier category of an item.

    Parameters

    • item: IItem

      The item to update the modifier category of.

    • category: ICategory

      The category to update.

    Returns Promise<IItem>

    A Promise that resolves to the updated IItem object.

Generated using TypeDoc