Skip to content

Products App

The Products app provides unified product and price management for Hantera. It contributes the product, priceList, and price asset types, the Graph nodes and edges that connect them, derived price lists, validation rules, and a Filtrera module for looking up effective prices over a time window.

This page describes the public interface that the Products app exposes to other apps. If your app needs to query product data, navigate to prices, or compute effective prices, declare a dependency on the contract documented here using the standard requires mechanism.

What it provides

SurfaceDescription
Graph nodes & edgesasset.product, asset.product.sku, asset.priceList, asset.price, the products / priceLists / prices sets, and the edges that connect them.
Price Lookup moduleA Filtrera module exporting lookupPrices, used to compute current/lowest/highest effective prices and a price-change history within a window.
Activity log event typespriceChange, priceDeactivation, priceReactivation, priceListActivation, priceListDeactivation are emitted on the price and price-list asset activity logs.
Portal extensionAdds product, price list, and price management views to the Hantera portal. (Not part of the developer-facing contract.)

Depending on the Products app

Apps that read product or price data, navigate price-list edges, or call into lookupPrices should declare the relevant subset in requires so their components compile in isolation and surface clear errors when the Products app is missing.

A typical reactor that needs prices for an order would declare:

yaml
requires:
  graph:
    nodes:
      asset.product:
        fields:
          name:
            type: text
            dimension: locale
          vatClass:
            type: enum
        edges:
          prices:
            cardinality: many
            relatedNode: asset.price
      asset.price:
        fields:
          currentPrice:
            type: number
          priceListKey:
            type: text
          deactivatedAt:
            type: instant
        edges:
          priceList:
            cardinality: single
            relatedNode: asset.priceList
      asset.priceList:
        fields:
          active:
            type: boolean
    sets:
      products: { node: asset.product }

  modules:
    /apps/products/price-lookup.module.hrc:
      exports:
        lookupPrices:
          type: '(params: { productNumbers: [text], currencyCode: text, priceListKeys: [text], window: duration }) => { text -> { currentPrice: number | nothing, history: [{ at: instant, price: number | nothing }], lowestPrice: number | nothing, highestPrice: number | nothing } }'

For the full surface and copy-pasteable per-node snippets, see Graph and Price Lookup module.

Getting started

This documentation assumes the Products app is already installed on your Hantera instance. With it installed, you can:

  1. Manage products, price lists, and prices through the Products portal extension, or via standard Hantera asset commands.
  2. Build apps that consume the contract documented here — pricing rules, custom price-lookup ingresses, ERP/PIM exports, EU Omnibus 30-day-low displays, and so on.

© 2024 Hantera AB. All rights reserved.