Skip to content
Light
English

Order validations by Field Policies

Below you will find information about:

Validations are only applied when the request meets the scenario of a Field Policy with configured restrictions (value > 0). If the field is 0(zero), the rule is considered not applicable. The rules are independent of other existing rules (flex balance, bonus balance, etc.).

See how to register and integrate Order validations (restrictions)

Minimum interval between requests of the same type

Section titled “Minimum interval between requests of the same type”
  • Field: intervaloDeDiasEntrePedidos (INT, default 0)
  • Definition: Minimum number of days required between orders issued from the same seller, same Order Type and same company (customer).
  • Validation: The system searches for the seller’s last order that simultaneously fulfills: same codVendedor, same codCliente and same field policy rule.
  • Blocking: If the difference in days between the current order and the last order is less than the configured interval, saving is blocked.
  • Behavior: Displays an informative dialog stating that the last order was less than X days ago.
  • Field: qtdeMaximaDeItens (INT, default 0)
  • Definition: Maximum quantity of different SKUs allowed in the order.
  • Validation: Occurs when incrementing items, saving items and saving the order.
  • Visual indicator: When inconsistent, the item’s inconsistency icon is displayed and, when saving, it displays an informative dialog.
  • Field: qtdeMaximaDeUnidadesPorItem (INT, default 0)
  • Definition: Maximum quantity allowed for the same SKU within the order.
  • Validation: Occurs when incrementing items, saving items and saving the order.
  • Visual indicator: When inconsistent, the item’s inconsistency icon is displayed and, when saving, it displays an informative dialog.

When are validations applied?

  • Validations for maximum quantity of items and maximum quantity per SKU occur in real time: when incrementing, decrementing, entering quantity, adding an item via the carousel and when saving the order.
  • Validation of minimum interval between orders occurs when saving the order, searching for the last order via API.

Where are rules configured?

  • The rules are configured in Demander Web, in the table Table 180 - Order Field Policies, through the field jsonRegras in the restrictions block.
  • They are linked to a policy scenario (seller, customer, type of order, etc.).

What happens if the policy has no restrictions?

  • If the restriction block does not exist in the JSON, no restriction validation is performed.
  • If the fields exist but have a value of 0 (zero), the rule is also considered not applicable.