Skip to content

Technical Reference: ZiveFirmy

Data Model

The module extends the Lead entity with the following fields:

  • companyName: Varchar, uses a custom view for autocomplete (utilizes Ares/suggest endpoint).
  • companySicCode: Varchar, trigger for data fetching. Custom view zive-firmy:views/lead/fields/company-sic-code.
  • employeeInfo: JsonObject, stores employee history.
  • turnoverInfo: JsonObject, stores turnover history.

Fetching Logic

Trigger: Change of value in the companySicCode field on the client side.

  1. JavaScript view company-sic-code.js detects the change.
  2. Sends a GET request to ZiveFirmy/lookup/{sicCode}.
  3. Backend (Api/ZiveFirmy.php) calls external API https://api3.zivefirmy.cz/firmdata/.
  4. Returns data on turnover and employees.
  5. JavaScript saves data into employeeInfo and turnoverInfo fields.

Dependencies

The module implicitly assumes the existence of the Ares/suggest endpoint for company name autocomplete, but for the data enrichment itself (employees/turnover), filling the ID in any way is sufficient.