types/types.ts and extend RowDataPacket from the mysql2 library where applicable.
Compra
Represents a purchase record from the Corprecam system.Fields
Unique purchase code identifier
Associated company/partner identifier (typically a tax ID or NIT)
Micro route code associated with this purchase. Used to fetch route details via
getMicro()Example
CompraItem
Represents a line item within a purchase.Fields
Unique purchase item identifier
Foreign key reference to the parent purchase (com_codigo)
Material ID reference. Used to fetch material details via
getMateriales()Quantity of material purchased
Unit price of the material
Total line item value (cantidad × valor_unitario)
Rejected quantity (amount not accepted)
Example
Material
Represents a material/product in the system.Fields
Unique material identifier
Material code (SKU or product code)
Material name or description
Foreign key reference to the company/enterprise
Example
Micro
Represents a micro route in the collection system.Fields
Unique micro route code identifier
Micro route name or description
Example
The Micro interface is defined twice in the source (lines 9-12 and 29-31). The complete definition includes both
mic_codigo and mic_nom fields.Products
Represents a product entry in a Siigo document.Fields
Product code/SKU
Product quantity
Product unit price
Example
DocumentoSoporte
Represents a support document structure used by Siigo for purchase recording. This is the final transformed structure sent to the Playwright automation.Fields
Provider/supplier identifier (typically the comp_asociado from Compra)
Micro route identifier (from Micro.mic_nom)
Array of products for the Corprecam company
Array of products for the Reciclemos company
Example
Usage
This interface is used as the final payload passed torun_playwright() for automated data entry into the Siigo web interface. The data is transformed from the raw Corprecam data using the transfromDs() utility function.
Type Hierarchy
Notes
- All database-related interfaces extend
RowDataPacketfrommysql2library - The
DocumentoSoporteinterface is the primary data structure for Siigo integration - Material IDs from
CompraItem.citem_materialare used to fetch fullMaterialrecords - The
com_micro_rutafromComprais converted to a number before fetchingMicrodata