Files
fn_registry/scratchpad/lineage_graph.json
T
egutierrez 2ebc9efeb2 chore: auto-commit (8 archivos)
- scratchpad/gen_docs.py
- scratchpad/gen_intel.py
- scratchpad/gen_verify.py
- scratchpad/intel_build.json
- scratchpad/intel_lineage.json
- scratchpad/lineage_graph.json
- scratchpad/trace_intel.py
- scratchpad/trace_lineage.py

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-07-01 19:00:06 +02:00

332 lines
78 KiB
JSON

{
"project": "autingo-159109",
"seeds": [
"customer_marts.customer_brand_affinity",
"customer_marts.customer_category_spend",
"customer_marts.customer_channel",
"customer_marts.customer_contactability",
"customer_marts.customer_monetary",
"customer_marts.customer_payment_method",
"customer_marts.customer_predictive",
"customer_marts.customer_product",
"customer_marts.customer_profile",
"customer_marts.customer_promo_tolerance",
"customer_marts.customer_promo_usage",
"customer_marts.customer_store_spend",
"customer_marts.customer_temporal",
"customer_marts.customer_vehicles"
],
"graph": {
"customer_marts.customer_brand_affinity": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_brand_affinity`\nAS WITH lineas AS (\n SELECT\n f.persona_id,\n UPPER(TRIM(p.Producto___Nav__idAtributo3)) AS marca,\n f.importe,\n f.cantidad\n FROM `autingo-159109.clientes_intel.fact_transaccion` f\n JOIN `autingo-159109.anjana_bi_datamart.Objeto_productos` p\n ON f.producto_nav_id = p.nav_id\n WHERE f.persona_id IS NOT NULL\n AND p.Producto___Nav__idAtributo3 IS NOT NULL\n AND TRIM(p.Producto___Nav__idAtributo3) NOT IN ('', 'SIN', 'ENCARGO')\n),\nagg AS (\n SELECT\n persona_id,\n marca,\n SUM(importe) AS gasto,\n COUNT(*) AS n_lineas,\n SUM(cantidad) AS uds\n FROM lineas\n GROUP BY persona_id, marca\n)\nSELECT\n persona_id,\n marca,\n gasto,\n n_lineas,\n uds,\n SAFE_DIVIDE(gasto, SUM(gasto) OVER (PARTITION BY persona_id)) AS share_gasto_marca\nFROM agg;",
"refs": [
"anjana_bi_datamart.Objeto_productos",
"clientes_intel.fact_transaccion"
],
"depth": 0
},
"anjana_bi_datamart.Objeto_productos": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.anjana_bi_datamart.Objeto_productos`\nAS SELECT base.*, img.imagen_principal, img.imagen_secundaria\nFROM (\nSELECT * FROM (\nSELECT\n\n `source`.`id` AS `id`,\n\n `source`.`nav_id` AS `nav_id`,\n\n `source`.`description` AS `description`,\n\n `source`.`is_tecdoc` AS `is_tecdoc`,\n\n `source`.`Status_de_producto` AS `Status_de_producto`,\n\n `source`.`Is_Encargo` AS `Is_Encargo`,\n\n `source`.`is_service` AS `is_service`,\n\n `source`.`is_tpv` AS `is_tpv`,\n\n `source`.`Tipo___Navision` AS `Tipo___Navision`,\n\n `source`.`Indicadores_tag` AS `Indicadores_tag`,\n\n `source`.`Product_Groups__description` AS `Product_Groups__description`,\n\n `source`.`Product_Categories__description` AS `Product_Categories__description`,\n\n `source`.`Producto___Nav__idAtributo1` AS `Producto___Nav__idAtributo1`,\n\n `source`.`Producto___Nav__idAtributo2` AS `Producto___Nav__idAtributo2`,\n\n `source`.`Producto___Nav__idAtributo3` AS `Producto___Nav__idAtributo3`,\n\n `source`.`Producto___Nav__idAtributo5` AS `Producto___Nav__idAtributo5`,\n\n `source`.`Producto___Nav__idAtributo4` AS `Producto___Nav__idAtributo4`,\n\n `source`.`Producto___Nav__idAtributo6` AS `Producto___Nav__idAtributo6`,\n\n `source`.`Producto___Nav__idAtributo7` AS `Producto___Nav__idAtributo7`,\n\n `source`.`Producto___Nav__idAtributo8` AS `Producto___Nav__idAtributo8`,\n\n `source`.`Producto___Nav__idAtributo9` AS `Producto___Nav__idAtributo9`,\n\n `source`.`Producto___Nav__idAtributo10` AS `Producto___Nav__idAtributo10`,\n\n `source`.`Producto___Nav__idCategoria` AS `Producto___Nav__idCategoria`,\n\n `source`.`Producto___Nav__idGrupo` AS `Producto___Nav__idGrupo`,\n\n `source`.`Categoria_16_07_cgq___tipo_old__cat_cgq` AS `Categoria_16_07_cgq___tipo_old__cat_cgq`,\n\n `source`.`Categoria_16_07_cgq___tipo_old__tipo_cgq` AS `Categoria_16_07_cgq___tipo_old__tipo_cgq`,\n\n `source`.`Categoria_16_07_cgq___tipo_old__subcate_cgq` AS `Categoria_16_07_cgq___tipo_old__subcate_cgq`,\n\n `source`.`Tipologia_de_producto__tipo` AS `Tipologia_de_producto__tipo`\n\nFROM\n\n (\n\n SELECT\n\n `psql_dcpublic.products`.`id` AS `id`,\n\n `psql_dcpublic.products`.`nav_id` AS `nav_id`,\n\n `psql_dcpublic.products`.`description` AS `description`,\n\n `psql_dcpublic.products`.`is_tecdoc` AS `is_tecdoc`,\n\n CASE\n\n WHEN `psql_dcpublic.products`.`status` = 0 THEN 'Activo'\n\n WHEN `psql_dcpublic.products`.`status` = 1 THEN 'Activo para salida'\n\n WHEN `psql_dcpublic.products`.`status` = 2 THEN 'Activo para entrada'\n\n WHEN `psql_dcpublic.products`.`status` = 3 THEN 'Desactivado'\n\n END AS `Status_de_producto`,\n\n CASE\n\n WHEN `psql_dcpublic.products`.`is_encargo` IS NULL THEN FALSE\n\n END AS `Is_Encargo`,\n\n `psql_dcpublic.products`.`is_service` AS `is_service`,\n\n CASE\n\n WHEN `Producto___Nav`.`idProducto` IS NULL THEN 'Producto de Tpv'\n\n WHEN `Producto___Nav`.`idProducto` IS NOT NULL THEN 'Producto de Navision'\n\n END AS `is_tpv`,\n\n CASE\n\n WHEN `Producto___Nav`.`idTipo` = 0 THEN 'Tienda'\n\n WHEN `Producto___Nav`.`idTipo` = 1 THEN 'Taller'\n\n END AS `Tipo___Navision`,\n\n CASE\n\n WHEN (`Product_Groups`.`nav_id` = '4X4')\n\n \n\n OR (`Product_Groups`.`nav_id` = 'TRAN LIGER')\n\n OR (`Product_Groups`.`nav_id` = 'TURISMO') THEN 'neumaticos'\n\n WHEN `Product_Groups`.`nav_id` = 'BATERIAS' THEN 'baterias'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9101018')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9101037')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9101047')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9101019')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9101046')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9101020')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9101021')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9101022')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108047') THEN 'paralelos'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9103040')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103011')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103007')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103008')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103014')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103039')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103013')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103009')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103019')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103017')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103022')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103021') THEN 'frenado_mano_de_obra'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9103009')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103040') THEN 'discos_mano_de_obra'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9104019')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104021')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104003')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104004')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104022')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104020')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104001')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104015')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104002')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104016')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104014')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104017')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104018')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104026')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104024')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104006')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104028')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104027') THEN 'amortiguadores'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9301003')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9301005')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9301012')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9301006')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9301001')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9301007')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9301008')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9301010')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9301009')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9301011')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104010')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104025')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104011')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9104008') THEN 'fuelles'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9108053')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108054')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108052') THEN 'revision_liquidos'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9108065')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108064')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9102029')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9102041')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9102040')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9102028')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9102001')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9102003') THEN 'revisiones'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9108044')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108048')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108040')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108059')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108060')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108058')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108042')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108062')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108063')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108038')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108061')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108070')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108071')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108056')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108057')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108073')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108055')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108068')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108043')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108050')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108049')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108039')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108041')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108037')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108053')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108054')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108052')\n\n OR (`psql_dcpublic.products`.`nav_id` = '64594')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108069')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108087')\n\n OR (`psql_dcpublic.products`.`nav_id` = '23071')\n\n OR (`psql_dcpublic.products`.`nav_id` = '64191')\n\n OR (`psql_dcpublic.products`.`nav_id` = '68547')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108046')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108051')\n\n OR (`psql_dcpublic.products`.`nav_id` = '54850') THEN 'revisiones_de_calidad'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9108053')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108054')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108052')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103004')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103003')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103037')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103038')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103035')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103036')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103029')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9103030')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108004')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108005') THEN 'liquidos'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9108032')\n\n OR (`psql_dcpublic.products`.`nav_id` = '65631')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108066')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9108067') THEN 'diagnosis'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9201026')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9201027')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9201028') THEN 'diagnosis_montajes_bateria'\n\n WHEN (`psql_dcpublic.products`.`nav_id` = '9201024')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9201025')\n\n OR (`psql_dcpublic.products`.`nav_id` = '9201003') THEN 'montajes_bateria'\n\n END AS `Indicadores_tag`,\n\n `Product_Groups`.`description` AS `Product_Groups__description`,\n\n `Product_Categories`.`description` AS `Product_Categories__description`,\n\n `Producto___Nav`.`idAtributo1` AS `Producto___Nav__idAtributo1`,\n\n `Producto___Nav`.`idAtributo2` AS `Producto___Nav__idAtributo2`,\n\n `Producto___Nav`.`idAtributo3` AS `Producto___Nav__idAtributo3`,\n\n `Producto___Nav`.`idAtributo5` AS `Producto___Nav__idAtributo5`,\n\n `Producto___Nav`.`idAtributo4` AS `Producto___Nav__idAtributo4`,\n\n `Producto___Nav`.`idAtributo6` AS `Producto___Nav__idAtributo6`,\n\n `Producto___Nav`.`idAtributo7` AS `Producto___Nav__idAtributo7`,\n\n `Producto___Nav`.`idAtributo8` AS `Producto___Nav__idAtributo8`,\n\n `Producto___Nav`.`idAtributo9` AS `Producto___Nav__idAtributo9`,\n\n `Producto___Nav`.`idAtributo10` AS `Producto___Nav__idAtributo10`,\n\n `Producto___Nav`.`idCategoria` AS `Producto___Nav__idCategoria`,\n\n `Producto___Nav`.`idGrupo` AS `Producto___Nav__idGrupo`,\n\n `Categoria_16_07_cgq___tipo_old`.`cat_cgq` AS `Categoria_16_07_cgq___tipo_old__cat_cgq`,\n\n `Categoria_16_07_cgq___tipo_old`.`tipo_cgq` AS `Categoria_16_07_cgq___tipo_old__tipo_cgq`,\n\n `Categoria_16_07_cgq___tipo_old`.`subcate_cgq` AS `Categoria_16_07_cgq___tipo_old__subcate_cgq`,\n\n `Tipologia_de_producto`.`tipo` AS `Tipologia_de_producto__tipo`\n\n FROM\n\n `psql_dcpublic.products`\n\n \n\nLEFT JOIN `psql_dcpublic.product_groups` AS `Product_Groups` ON `psql_dcpublic.products`.`product_group_id` = `Product_Groups`.`id`\n\n LEFT JOIN `psql_dcpublic.product_categories` AS `Product_Categories` ON `Product_Groups`.`product_category_id` = `Product_Categories`.`id`\n\n LEFT JOIN `stg_anjana_bi.producto` AS `Producto___Nav` ON `psql_dcpublic.products`.`nav_id` = `Producto___Nav`.`idProducto`\n\n LEFT JOIN (\n\n SELECT\n\n string_field_0 as tipo_old,\n\n string_field_1 as cat_old,\n\n string_field_2 as sub_cat_old,\n\n string_field_3 as union_str,\n\n string_field_4 as cat_cgq,\n\n string_field_5 as tipo_cgq,\n\n string_field_6 as subcate_cgq\n\n FROM\n\n `autingo-159109.anjana_bi_datamart.Cruce_16_07_cgq`\n\n ) AS `Categoria_16_07_cgq___tipo_old` ON (\n\n CASE\n\n WHEN `Producto___Nav`.`idTipo` = 0 THEN 'Tienda'\n\n WHEN `Producto___Nav`.`idTipo` = 1 THEN 'Taller'\n\n END = `Categoria_16_07_cgq___tipo_old`.`tipo_old`\n\n )\n\n \n\n AND (\n\n `Producto___Nav`.`idCategoria` = `Categoria_16_07_cgq___tipo_old`.`cat_old`\n\n )\n\n AND (\n\n `Producto___Nav`.`idGrupo` = `Categoria_16_07_cgq___tipo_old`.`sub_cat_old`\n\n )\n\n LEFT JOIN (\n\n SELECT\n\n `psql_dcpublic.products`.`id` AS `id`,\n\n -- `psql_dcpublic.products`.`product_group_id` AS `product_group_id`,\n\n -- `psql_dcpublic.products`.`nav_id` AS `nav_id`,\n\n -- `psql_dcpublic.products`.`normalized_code` AS `normalized_code`,\n\n -- `psql_dcpublic.products`.`old_aurgi_family` AS `old_aurgi_family`,\n\n -- `psql_dcpublic.products`.`description` AS `description`,\n\n -- `psql_dcpublic.products`.`web_description` AS `web_description`,\n\n -- `psql_dcpublic.products`.`search_description` AS `search_description`,\n\n -- `psql_dcpublic.products`.`status` AS `status`,\n\n -- `psql_dcpublic.products`.`is_blocked` AS `is_blocked`,\n\n -- `psql_dcpublic.products`.`created_at` AS `created_at`,\n\n -- `psql_dcpublic.products`.`updated_at` AS `updated_at`,\n\n -- `psql_dcpublic.products`.`current_stock` AS `current_stock`,\n\n -- `psql_dcpublic.products`.`description_2` AS `description_2`,\n\n -- `psql_dcpublic.products`.`replenishment` AS `replenishment`,\n\n -- `psql_dcpublic.products`.`full_description` AS `full_description`,\n\n -- `psql_dcpublic.products`.`main_image` AS `main_image`,\n\n -- `psql_dcpublic.products`.`secondary_image` AS `secondary_image`,\n\n -- `psql_dcpublic.products`.`validation_pending` AS `validation_pending`,\n\n -- `psql_dcpublic.products`.`vendor_source_id` AS `vendor_source_id`,\n\n -- `psql_dcpublic.products`.`data` AS `data`,\n\n -- `psql_dcpublic.products`.`main_attributes` AS `main_attributes`,\n\n -- `psql_dcpublic.products`.`slug` AS `slug`,\n\n -- `psql_dcpublic.products`.`slugs` AS `slugs`,\n\n -- `psql_dcpublic.products`.`price_data` AS `price_data`,\n\n -- `psql_dcpublic.products`.`stock_data` AS `stock_data`,\n\n -- `psql_dcpublic.products`.`promo_data` AS `promo_data`,\n\n -- `psql_dcpublic.products`.`can_be_delivered` AS `can_be_delivered`,\n\n -- `psql_dcpublic.products`.`show_on_ecommerce` AS `show_on_ecommerce`,\n\n -- `psql_dcpublic.products`.`description_text` AS `description_text`,\n\n -- `psql_dcpublic.products`.`is_service` AS `is_service`,\n\n -- `psql_dcpublic.products`.`execution_time` AS `execution_time`,\n\n -- `psql_dcpublic.products`.`blocked_for_automatic_updates` AS `blocked_for_automatic_updates`,\n\n -- `psql_dcpublic.products`.`ecommerce_category_id` AS `ecommerce_category_id`,\n\n -- `psql_dcpublic.products`.`is_marketplace` AS `is_marketplace`,\n\n -- `psql_dcpublic.products`.`relevancy` AS `relevancy`,\n\n -- `psql_dcpublic.products`.`data_to_index` AS `data_to_index`,\n\n -- `psql_dcpublic.products`.`product_type_id` AS `product_type_id`,\n\n -- `psql_dcpublic.products`.`is_encargo` AS `is_encargo`,\n\n -- `psql_dcpublic.products`.`custom_price` AS `custom_price`,\n\n -- `psql_dcpublic.products`.`min_platform_stock` AS `min_platform_stock`,\n\n -- `psql_dcpublic.products`.`mechanic_commission` AS `mechanic_commission`,\n\n -- `psql_dcpublic.products`.`salesman_commission` AS `salesman_commission`,\n\n -- `psql_dcpublic.products`.`check_type_id` AS `check_type_id`,\n\n -- `psql_dcpublic.products`.`reviewer_commission` AS `reviewer_commission`,\n\n -- `psql_dcpublic.products`.`eci_allowed` AS `eci_allowed`,\n\n -- `psql_dcpublic.products`.`eci_file_path` AS `eci_file_path`,\n\n -- `psql_dcpublic.products`.`eci_files` AS `eci_files`,\n\n -- `psql_dcpublic.products`.`current_average_price` AS `current_average_price`,\n\n -- `psql_dcpublic.products`.`current_aurgi_all_included_price` AS `current_aurgi_all_included_price`,\n\n -- `psql_dcpublic.products`.`current_mt_all_included_price` AS `current_mt_all_included_price`,\n\n -- `psql_dcpublic.products`.`current_aurgi_price` AS `current_aurgi_price`,\n\n -- `psql_dcpublic.products`.`current_mt_price` AS `current_mt_price`,\n\n -- `psql_dcpublic.products`.`aurgi_published` AS `aurgi_published`,\n\n -- `psql_dcpublic.products`.`mt_published` AS `mt_published`,\n\n -- `psql_dcpublic.products`.`current_prices_updated_at` AS `current_prices_updated_at`,\n\n -- `psql_dcpublic.products`.`is_tecdoc` AS `is_tecdoc`,\n\n -- `psql_dcpublic.products`.`cross_docking` AS `cross_docking`,\n\n -- `psql_dcpublic.products`.`shipping_price` AS `shipping_price`,\n\n -- `psql_dcpublic.products`.`leadtime_to_ship` AS `leadtime_to_ship`,\n\n -- `psql_dcpublic.products`.`extra_item_set_id` AS `extra_item_set_id`,\n\n -- `psql_dcpublic.products`.`reference_supplier` AS `reference_supplier`,\n\n -- `psql_dcpublic.products`.`available_in_garage` AS `available_in_garage`,\n\n -- `psql_dcpublic.products`.`equivalents` AS `equivalents`,\n\n -- `psql_dcpublic.products`.`allow_automatic_provider_order` AS `allow_automatic_provider_order`,\n\n -- `psql_dcpublic.products`.`combo_products` AS `combo_products`,\n\n -- `psql_dcpublic.products`.`energy_tag` AS `energy_tag`,\n\n -- `psql_dcpublic.products`.`tyre_class` AS `tyre_class`,\n\n -- `psql_dcpublic.products`.`is_nav` AS `is_nav`,\n\n -- `psql_dcpublic.products`.`hierarchical` AS `hierarchical`,\n\n -- `psql_dcpublic.products`.`normalized_ref` AS `normalized_ref`,\n\n -- `psql_dcpublic.products`.`datastream_metadata` AS `datastream_metadata`,\n\n -- `psql_dcpublic.products`.`trans_descriptions` AS `trans_descriptions`,\n\n -- `psql_dcpublic.products`.`proportional_execution_time` AS `proportional_execution_time`,\n\n -- `psql_dcpublic.products`.`is_merchant` AS `is_merchant`,\n\n -- `psql_dcpublic.products`.`shop_pick_up` AS `shop_pick_up`,\n\n -- `psql_dcpublic.products`.`tecdoc_brand` AS `tecdoc_brand`,\n\n -- `psql_dcpublic.products`.`quantity_unit` AS `quantity_unit`,\n\n -- `psql_dcpublic.products`.`quantity_per_unit` AS `quantity_per_unit`,\n\n -- `psql_dcpublic.products`.`last_indexed_at` AS `last_indexed_at`,\n\n -- `psql_dcpublic.products`.`default_ean` AS `default_ean`,\n\n -- `psql_dcpublic.products`.`shopping_feed_last_updated` AS `shopping_feed_last_updated`,\n\n -- `psql_dcpublic.products`.`variant_code_id` AS `variant_code_id`,\n\n -- `psql_dcpublic.products`.`redirection_redirect_type` AS `redirection_redirect_type`,\n\n -- `psql_dcpublic.products`.`redirection_redirect_to` AS `redirection_redirect_to`,\n\n -- `psql_dcpublic.products`.`resource_type_id` AS `resource_type_id`,\n\n -- `psql_dcpublic.products`.`encargo_type` AS `encargo_type`,\n\n -- `psql_dcpublic.products`.`reception_time` AS `reception_time`,\n\n -- `psql_dcpublic.products`.`logistic_class` AS `logistic_class`,\n\n -- `psql_dcpublic.products`.`in_glass_idx` AS `in_glass_idx`,\n\n -- `psql_dcpublic.products`.`default_provider_id` AS `default_provider_id`,\n\n -- `psql_dcpublic.products`.`is_glass_commission` AS `is_glass_commission`,\n\n -- `psql_dcpublic.products`.`adas_required` AS `adas_required`,\n\n CASE\n\n WHEN `psql_dcpublic.products`.`is_service` = TRUE THEN 'Servicio'\n\n WHEN `psql_dcpublic.products`.`is_encargo` = TRUE THEN 'Encargo'\n\n WHEN `psql_dcpublic.products`.`description` IS NOT NULL\n\n AND `psql_dcpublic.products`.`description` LIKE '%SIGNFU%' THEN 'Ecotasa'\n\n WHEN `psql_dcpublic.products`.`description` IS NOT NULL\n\n AND `psql_dcpublic.products`.`description` LIKE '%APORTACION SIGAUS%' THEN 'Aportación SIGAUS'\n\n WHEN `Product_Categories`.`description` = 'TECDOC' THEN 'TecDoc'\n\n WHEN `Product_Categories`.`description` = 'Devolucion' THEN 'Devolución'\n\n WHEN `Product_Categories`.`description` = 'Lavado' THEN 'Lavado'\n\n WHEN `Product_Categories`.`description` = 'KITS' THEN 'Kits'\n\n WHEN `psql_dcpublic.products`.`description` IS NOT NULL\n\n AND `psql_dcpublic.products`.`description` LIKE '%ENTREGA%' THEN 'Entrega'\n\n WHEN `Product_Categories`.`description` = 'Autingo' THEN 'Autingo'\n\n WHEN `psql_dcpublic.products`.`nav_id` = 'COMISION_MIRAKL' THEN 'Comisión Mirakl'\n\n WHEN `Product_Categories`.`description` = 'Servicio Rapido' THEN 'Servicio Rápido'\n\n WHEN `Product_Categories`.`description` = 'Consumible taller' THEN 'Consumible taller'\n\n WHEN `Product_Categories`.`description` = 'Anticipos Aurgi' THEN 'Anticipos Aurgi'\n\n WHEN `Product_Categories`.`description` = 'Montaje Alcampo' THEN 'Montaje Alcampo'\n\n WHEN `Product_Categories`.`description` = 'Varios' THEN 'Varios'\n\n ELSE 'Productos'\n\n END AS `tipo`,\n\n -- `Product_Groups`.`description` AS `Product_Groups__description`,\n\n -- `Product_Groups`.`nav_id` AS `Product_Groups__nav_id`,\n\n -- `Product_Categories`.`description` AS `Product_Categories__description`,\n\n -- `Product_Categories`.`nav_id` AS `Product_Categories__nav_id`\n\n FROM\n\n `psql_dcpublic.products`\n\n LEFT JOIN `psql_dcpublic.product_groups` AS `Product_Groups` ON `psql_dcpublic.products`.`product_group_id` = `Product_Groups`.`id`\n\n LEFT JOIN `psql_dcpublic.product_categories` AS `Product_Categories` ON `Product_Groups`.`product_category_id` = `Product_Categories`.`id`\n\n ) AS `Tipologia_de_producto` ON `psql_dcpublic.products`.`id` = `Tipologia_de_producto`.`id`\n\n \n\nWHERE\n\n (`psql_dcpublic.products`.`nav_id` IS NOT NULL)\n\n AND (\n\n (`psql_dcpublic.products`.`nav_id` <> '')\n\n OR (`psql_dcpublic.products`.`nav_id` IS NULL)\n\n )\n\n AND (`psql_dcpublic.products`.`id` IS NOT NULL)\n\n \n\nORDER BY\n\n `psql_dcpublic.products`.`nav_id` DESC\n\n ) AS `source`\n)\nUNION ALL\nSELECT\n CAST(NULL AS INT64) AS `id`,\n pt.nav_id AS `nav_id`,\n pt.description AS `description`,\n CAST(NULL AS BOOLEAN) AS `is_tecdoc`,\n 'Activo' AS `Status_de_producto`,\n FALSE AS `Is_Encargo`,\n FALSE AS `is_service`,\n 'Producto de Navision' AS `is_tpv`,\n CAST(NULL AS STRING) AS `Tipo___Navision`,\n CAST(NULL AS STRING) AS `Indicadores_tag`,\n CAST(NULL AS STRING) AS `Product_Groups__description`,\n CAST(NULL AS STRING) AS `Product_Categories__description`,\n CAST(NULL AS STRING) AS `Producto___Nav__idAtributo1`,\n CAST(NULL AS STRING) AS `Producto___Nav__idAtributo2`,\n CAST(NULL AS STRING) AS `Producto___Nav__idAtributo3`,\n CAST(NULL AS STRING) AS `Producto___Nav__idAtributo5`,\n CAST(NULL AS STRING) AS `Producto___Nav__idAtributo4`,\n CAST(NULL AS STRING) AS `Producto___Nav__idAtributo6`,\n CAST(NULL AS STRING) AS `Producto___Nav__idAtributo7`,\n CAST(NULL AS STRING) AS `Producto___Nav__idAtributo8`,\n CAST(NULL AS STRING) AS `Producto___Nav__idAtributo9`,\n CAST(NULL AS STRING) AS `Producto___Nav__idAtributo10`,\n CAST(NULL AS STRING) AS `Producto___Nav__idCategoria`,\n CAST(NULL AS STRING) AS `Producto___Nav__idGrupo`,\n pt.cat_cgq AS `Categoria_16_07_cgq___tipo_old__cat_cgq`,\n pt.tipo_cgq AS `Categoria_16_07_cgq___tipo_old__tipo_cgq`,\n pt.subcat_cgq AS `Categoria_16_07_cgq___tipo_old__subcate_cgq`,\n CAST(NULL AS STRING) AS `Tipologia_de_producto__tipo`\n FROM `autingo-159109.claude_bi.productos_tasa_mat` pt\n) base\nLEFT JOIN `autingo-159109.external_datasets.product_object_images` img USING (nav_id);",
"refs": [
"anjana_bi_datamart.Cruce_16_07_cgq",
"claude_bi.productos_tasa_mat",
"external_datasets.product_object_images",
"psql_dcpublic.product_categories",
"psql_dcpublic.product_groups",
"psql_dcpublic.products",
"stg_anjana_bi.producto"
],
"depth": 1
},
"anjana_bi_datamart.Cruce_16_07_cgq": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.anjana_bi_datamart.Cruce_16_07_cgq`\n(\n string_field_0 STRING,\n string_field_1 STRING,\n string_field_2 STRING,\n string_field_3 STRING,\n string_field_4 STRING,\n string_field_5 STRING,\n string_field_6 STRING\n);",
"refs": [],
"depth": 2
},
"claude_bi.productos_tasa_mat": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.claude_bi.productos_tasa_mat`\n(\n nav_id STRING,\n description STRING,\n cat_cgq STRING,\n subcat_cgq STRING,\n tipo_cgq STRING,\n origen STRING\n)\nCLUSTER BY nav_id;",
"refs": [],
"depth": 2
},
"external_datasets.product_object_images": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.external_datasets.product_object_images`\n(\n nav_id STRING,\n imagen_principal STRING,\n imagen_secundaria STRING,\n n_imagenes INT64,\n origen STRING\n);",
"refs": [],
"depth": 2
},
"psql_dcpublic.product_categories": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.psql_dcpublic.product_categories`\n(\n id INT64,\n description STRING,\n slug STRING,\n nav_id STRING,\n created_at TIMESTAMP,\n updated_at TIMESTAMP,\n purchase_strategy INT64,\n min_platform_stock FLOAT64,\n shipping_price FLOAT64,\n h1 STRING,\n meta_title STRING,\n meta_description STRING,\n mechanic_commission FLOAT64,\n salesman_commission FLOAT64,\n reviewer_commission FLOAT64,\n datastream_metadata STRUCT<uuid STRING, source_timestamp INT64>,\n PRIMARY KEY (id) NOT ENFORCED\n)\nCLUSTER BY id\nOPTIONS(\n max_staleness=INTERVAL '0-0 0 1:0:0' YEAR TO SECOND\n);",
"refs": [],
"depth": 2
},
"psql_dcpublic.product_groups": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.psql_dcpublic.product_groups`\n(\n id INT64,\n product_category_id INT64,\n description STRING,\n slug STRING,\n nav_id STRING,\n navision_groups_config JSON,\n created_at TIMESTAMP,\n updated_at TIMESTAMP,\n h1 STRING,\n meta_title STRING,\n meta_description STRING,\n min_platform_stock FLOAT64,\n mechanic_commission FLOAT64,\n salesman_commission FLOAT64,\n reviewer_commission FLOAT64,\n datastream_metadata STRUCT<uuid STRING, source_timestamp INT64>,\n cross_selling_nav_ids JSON,\n encargo_group_id INT64,\n ecommerce_category_id INT64,\n logistic_class STRING,\n PRIMARY KEY (id) NOT ENFORCED\n)\nCLUSTER BY id\nOPTIONS(\n max_staleness=INTERVAL '0-0 0 1:0:0' YEAR TO SECOND\n);",
"refs": [],
"depth": 2
},
"psql_dcpublic.products": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.psql_dcpublic.products`\n(\n id INT64,\n product_group_id INT64,\n nav_id STRING,\n normalized_code STRING,\n old_aurgi_family STRING,\n description STRING,\n web_description STRING,\n search_description STRING,\n status INT64,\n is_blocked BOOL,\n created_at TIMESTAMP,\n updated_at TIMESTAMP,\n current_stock STRING,\n description_2 STRING,\n replenishment BOOL,\n full_description STRING,\n main_image STRING,\n secondary_image STRING,\n validation_pending BOOL,\n vendor_source_id INT64,\n data JSON,\n main_attributes JSON,\n slug STRING,\n slugs JSON,\n price_data JSON,\n stock_data JSON,\n promo_data JSON,\n can_be_delivered BOOL,\n show_on_ecommerce BOOL,\n description_text STRING,\n is_service BOOL,\n execution_time INT64,\n blocked_for_automatic_updates BOOL,\n ecommerce_category_id INT64,\n is_marketplace BOOL,\n relevancy INT64,\n data_to_index JSON,\n product_type_id INT64,\n is_encargo BOOL,\n custom_price BOOL,\n min_platform_stock FLOAT64,\n mechanic_commission FLOAT64,\n salesman_commission FLOAT64,\n check_type_id INT64,\n reviewer_commission FLOAT64,\n eci_allowed BOOL,\n eci_file_path STRING,\n eci_files JSON,\n current_average_price FLOAT64,\n current_aurgi_all_included_price FLOAT64,\n current_mt_all_included_price FLOAT64,\n current_aurgi_price FLOAT64,\n current_mt_price FLOAT64,\n aurgi_published BOOL,\n mt_published BOOL,\n current_prices_updated_at TIMESTAMP,\n is_tecdoc BOOL,\n cross_docking BOOL,\n shipping_price FLOAT64,\n leadtime_to_ship INT64,\n extra_item_set_id INT64,\n reference_supplier STRING,\n available_in_garage BOOL,\n equivalents JSON,\n allow_automatic_provider_order BOOL,\n combo_products JSON,\n energy_tag STRING,\n tyre_class STRING,\n is_nav BOOL,\n hierarchical JSON,\n normalized_ref STRING,\n datastream_metadata STRUCT<uuid STRING, source_timestamp INT64>,\n trans_descriptions JSON,\n proportional_execution_time BOOL,\n is_merchant BOOL,\n shop_pick_up BOOL,\n tecdoc_brand STRING,\n quantity_unit INT64,\n quantity_per_unit INT64,\n last_indexed_at TIMESTAMP,\n default_ean STRING,\n shopping_feed_last_updated TIMESTAMP,\n variant_code_id INT64,\n redirection_redirect_type STRING,\n redirection_redirect_to STRING,\n resource_type_id INT64,\n encargo_type INT64,\n reception_time INT64,\n logistic_class STRING,\n in_glass_idx BOOL,\n default_provider_id INT64,\n is_glass_commission BOOL,\n adas_required BOOL,\n is_minderest BOOL,\n provided_signal_word STRING,\n has_hazards BOOL,\n PRIMARY KEY (id) NOT ENFORCED\n)\nCLUSTER BY id\nOPTIONS(\n max_staleness=INTERVAL '0-0 0 1:0:0' YEAR TO SECOND\n);",
"refs": [],
"depth": 2
},
"stg_anjana_bi.producto": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.stg_anjana_bi.producto`\nAS select\r\np.No_ AS idProducto,\r\ncase\r\n\twhen p.Description is null or p.Description = '' then 'Sin especificar'\r\n\telse p.Description\r\nend AS nombreProducto,\r\np.Activo_Externo AS idActivoExterno,\r\np.Liquidacion AS idLiquidacion,\r\np.Estado_AURGI AS idEstado,\r\ncase\r\n\twhen p.Tipo_Producto_AURGI is null then -1\r\n\telse p.Tipo_Producto_AURGI\r\nend AS idTipo,\r\ncase\r\n\twhen p.Item_Category_Code is null or p.Item_Category_Code = '' then 'SE'\r\n\telse p.Item_Category_Code\r\nend AS idCategoria,\r\ncase\r\n\twhen p.Product_Group_Code is null or p.Product_Group_Code = '' then 'SE'\r\n\telse p.Product_Group_Code\r\nend AS idGrupo,\r\ncase\r\n\twhen p.Valor_Atributo_1 is null or p.Valor_Atributo_1 = '' then 'SE'\r\n\telse p.Valor_Atributo_1\r\nend AS idAtributo1,\r\ncase\r\n\twhen p.Valor_Atributo_2 is null or p.Valor_Atributo_2 = '' then 'SE'\r\n\telse p.Valor_Atributo_2\r\nend AS idAtributo2,\r\ncase\r\n\twhen p.Valor_Atributo_3 is null or p.Valor_Atributo_3 = '' then 'SE'\r\n\telse p.Valor_Atributo_3\r\nend AS idAtributo3,\r\ncase\r\n\twhen p.Valor_Atributo_4 is null or p.Valor_Atributo_4 = '' then 'SE'\r\n\telse p.Valor_Atributo_4\r\nend AS idAtributo4,\r\ncase\r\n\twhen p.Valor_Atributo_5 is null or p.Valor_Atributo_5 = '' then 'SE'\r\n\telse p.Valor_Atributo_5\r\nend AS idAtributo5,\r\ncase\r\n\twhen p.Valor_Atributo_6 is null or p.Valor_Atributo_6 = '' then 'SE'\r\n\telse p.Valor_Atributo_6\r\nend AS idAtributo6,\r\ncase\r\n\twhen p.Valor_Atributo_7 is null or p.Valor_Atributo_7 = '' then 'SE'\r\n\telse p.Valor_Atributo_7\r\nend AS idAtributo7,\r\ncase\r\n\twhen p.Valor_Atributo_8 is null or p.Valor_Atributo_8 = '' then 'SE'\r\n\telse p.Valor_Atributo_8\r\nend AS idAtributo8,\r\ncase\r\n\twhen p.Valor_Atributo_9 is null or p.Valor_Atributo_9 = '' then 'SE'\r\n\telse p.Valor_Atributo_9\r\nend AS idAtributo9,\r\ncase\r\n\twhen p.Valor_Atributo_10 is null or p.Valor_Atributo_10 = '' then 'SE'\r\n\telse p.Valor_Atributo_10\r\nend AS idAtributo10,\r\n0 AS Periodo_de_Cobertura,\r\ncase \r\n\twhen b.cod__matricula is null or b.cod__matricula = '' then 'Sin especificar'\r\n\telse b.cod__matricula\r\nend AS Matricula\r\nfrom `autingo-159109.mssql2022_dbo.item` p \r\nleft join `autingo-159109.mssql2022_dbo.equivalencias_matriculas_saf` b\r\n on p.No_ = b.num__producto\r\nunion all\r\nselect\r\n'SE' AS idProducto,\r\n'SE' AS nombreProducto,\r\n0 AS idActivoExterno,\r\n0 AS idLiquidacion,\r\n0 AS idEstado,\r\n-1 AS idTipo,\r\n'SE' AS idCategoria,\r\n'SE' AS idGrupo,\r\n'SE' AS idAtributo1,\r\n'SE' AS idAtributo2,\r\n'SE' AS idAtributo3,\r\n'SE' AS idAtributo4,\r\n'SE' AS idAtributo5,\r\n'SE' AS idAtributo6,\r\n'SE' AS idAtributo7,\r\n'SE' AS idAtributo8,\r\n'SE' AS idAtributo9,\r\n'SE' AS idAtributo10,\r\n0 AS Periodo_de_Cobertura,\r\n'Sin especificar' AS Matricula;",
"refs": [
"mssql2022_dbo.equivalencias_matriculas_saf",
"mssql2022_dbo.item"
],
"depth": 2
},
"mssql2022_dbo.equivalencias_matriculas_saf": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.mssql2022_dbo.equivalencias_matriculas_saf`\n(\n num__producto STRING,\n stock_web_plataforma BIGNUMERIC,\n fecha_modificacion DATETIME,\n matricula_antigua STRING,\n error_matricula INT64,\n cod__matricula STRING,\n usuario_modificacion STRING,\n fecha_alta DATETIME,\n usuario_alta STRING,\n timestamp BYTES,\n _fivetran_deleted BOOL,\n _fivetran_synced TIMESTAMP,\n PRIMARY KEY (num__producto) NOT ENFORCED\n);",
"refs": [],
"depth": 3
},
"mssql2022_dbo.item": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.mssql2022_dbo.item`\n(\n no_ STRING,\n reserve INT64,\n price_profit_calculation INT64,\n estado_aurgi INT64,\n alternative_item_no_ STRING,\n standard_cost BIGNUMERIC,\n product_group_code STRING,\n serial_nos_ STRING,\n imagen_pag_ppal STRING,\n manufacturing_policy INT64,\n periodo_de_vigencia___hasta__ DATETIME,\n perfil_web STRING,\n deshabilitar_prestashop INT64,\n item_category_code STRING,\n etiqueta STRING,\n duty_code STRING,\n categoria1_web STRING,\n blocked INT64,\n producto_aliexpress INT64,\n rolled_up_capacity_cost BIGNUMERIC,\n special_equipment_code STRING,\n freight_type STRING,\n desactivado_mt INT64,\n use_cross_docking INT64,\n llanta_web STRING,\n fecha_desactivado_mt DATETIME,\n pertenecegrupo01 INT64,\n pertenecegrupo05 INT64,\n pertenecegrupo04 INT64,\n descripcion_prestashop STRING,\n pertenecegrupo03 INT64,\n pertenecegrupo02 INT64,\n minimum_order_quantity BIGNUMERIC,\n unit_volume BIGNUMERIC,\n maximum_order_quantity BIGNUMERIC,\n periodo_de_vigencia___desde___m DATETIME,\n producto_aurgi INT64,\n timestamp BYTES,\n producto_mt_canarias INT64,\n created_from_nonstock_item INT64,\n routing_no_ STRING,\n overhead_rate BIGNUMERIC,\n order_tracking_policy INT64,\n destacado_prestashop INT64,\n single_level_material_cost BIGNUMERIC,\n liquidacion INT64,\n cod__velocidad_web STRING,\n pvp___anterior___mt BIGNUMERIC,\n vat_bus__posting_gr___price_ STRING,\n imagen_principal STRING,\n meta_stock BIGNUMERIC,\n last_direct_cost BIGNUMERIC,\n valor_atributo_1 STRING,\n producto_lh INT64,\n valor_atributo_3 STRING,\n valor_atributo_2 STRING,\n no__series STRING,\n tiempo_ejecucion_teorico BIGNUMERIC,\n valor_atributo_9 STRING,\n fecha_modificacion DATETIME,\n valor_atributo_8 STRING,\n search_description STRING,\n valor_atributo_5 STRING,\n valor_atributo_4 STRING,\n actualizar_imagen_web INT64,\n valor_atributo_7 STRING,\n valor_atributo_6 STRING,\n rolled_up_material_cost BIGNUMERIC,\n maximum_inventory BIGNUMERIC,\n proveedor_alta STRING,\n stock_minimo_web BIGNUMERIC,\n base_unit_of_measure STRING,\n desactivado_aurgi INT64,\n categoria2_web STRING,\n item_disc__group STRING,\n vat_prod__posting_group STRING,\n producto_autingo INT64,\n last_unit_cost_calc__date DATETIME,\n referencia_para_catalogo STRING,\n unit_list_price BIGNUMERIC,\n asin STRING,\n oferta INT64,\n producto_mt INT64,\n reorder_point BIGNUMERIC,\n budget_profit BIGNUMERIC,\n reordering_policy INT64,\n flushing_method INT64,\n service_item_group STRING,\n precio_web BIGNUMERIC,\n producto_ebay INT64,\n automatic_ext__texts INT64,\n activo_externo INT64,\n shelf_bin_no_ STRING,\n imagen_pag_sec STRING,\n budget_quantity BIGNUMERIC,\n marca_web STRING,\n producto_historico INT64,\n sales_unit_of_measure STRING,\n usuario_modificacion STRING,\n referencia_antigua STRING,\n replenishment_system INT64,\n net_weight BIGNUMERIC,\n busqueda_web STRING,\n pvp___anterior__ BIGNUMERIC,\n global_dimension_1_code STRING,\n statistics_group INT64,\n indirect_cost__ BIGNUMERIC,\n oferta_mt INT64,\n ean_code STRING,\n duty_unit_conversion BIGNUMERIC,\n duty_due__ BIGNUMERIC,\n prestashop INT64,\n unit_price BIGNUMERIC,\n tax_group_code STRING,\n ancho_web STRING,\n producto_glass INT64,\n webmt INT64,\n ae_id STRING,\n imgm STRING,\n categoria3_web STRING,\n allow_invoice_disc_ INT64,\n imgl STRING,\n destacado_web INT64,\n alta_pendiente INT64,\n descripcion_editable INT64,\n aviso_en_tpv STRING,\n imgs STRING,\n lot_size BIGNUMERIC,\n price_unit_conversion INT64,\n producto_amazon INT64,\n volumenequivalente BIGNUMERIC,\n deshabilitar_web_mt INT64,\n description STRING,\n country_region_of_origin_code STRING,\n allow_online_adjustment INT64,\n no__2 STRING,\n units_per_parcel BIGNUMERIC,\n global_dimension_2_code STRING,\n rounding_precision BIGNUMERIC,\n safety_lead_time STRING,\n unit_cost BIGNUMERIC,\n tipo_producto_aurgi INT64,\n periodo_de_vigencia___desde__ DATETIME,\n atencion_comercial INT64,\n descripcion_web STRING,\n description_2 STRING,\n commission_group INT64,\n profit__ BIGNUMERIC,\n safety_stock_quantity BIGNUMERIC,\n inventory_value_zero INT64,\n item_tracking_code STRING,\n mostrar_web INT64,\n medidas_web INT64,\n price_includes_vat INT64,\n gen__prod__posting_group STRING,\n inventory_posting_group STRING,\n low_level_code INT64,\n cod__subfamilia STRING,\n country_region_purchased_code STRING,\n cod__variedad STRING,\n consumible INT64,\n familia_aurgi__antigua_ STRING,\n cost_is_adjusted INT64,\n listing_id STRING,\n categoria_marketplace STRING,\n common_item_no_ STRING,\n order_multiple BIGNUMERIC,\n include_inventory INT64,\n budgeted_amount BIGNUMERIC,\n reorder_quantity BIGNUMERIC,\n periodo_de_vigencia___hasta___m DATETIME,\n fecha_creacion DATETIME,\n producto_exclusivo_web INT64,\n durability STRING,\n unidades_por_caja_web BIGNUMERIC,\n vendor_item_no_ STRING,\n tariff_no_ STRING,\n production_bom_no_ STRING,\n pvp_manual INT64,\n ecotasasigaus STRING,\n cod__familia STRING,\n doble_boleta INT64,\n actualizar_producto_web INT64,\n valor_atributo_10 STRING,\n gross_weight BIGNUMERIC,\n especificaciones_tecnicas STRING,\n valor_atributo_14 STRING,\n valor_atributo_13 STRING,\n categorybc STRING,\n valor_atributo_12 STRING,\n valor_atributo_11 STRING,\n reorder_cycle STRING,\n purch__unit_of_measure STRING,\n desactivar_control_uds_caja INT64,\n manufacturer_code STRING,\n last_date_modified DATETIME,\n valor_atributo_16 STRING,\n usuario_creacion STRING,\n valor_atributo_15 STRING,\n expiration_calculation STRING,\n discrete_order_quantity INT64,\n producto_saf STRING,\n costing_method INT64,\n lead_time_calculation STRING,\n generar_autofactura INT64,\n vendor_no_ STRING,\n lot_nos_ STRING,\n aire_acondicionado INT64,\n kiloequivalente BIGNUMERIC,\n _fivetran_deleted BOOL,\n _fivetran_synced TIMESTAMP,\n exclusivoscompra INT64,\n PRIMARY KEY (no_) NOT ENFORCED\n);",
"refs": [],
"depth": 3
},
"clientes_intel.fact_transaccion": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.fact_transaccion`\n(\n transaccion_id INT64,\n vehiculo_id STRING,\n customer_id_tpv INT64,\n fecha DATE,\n centro_nav_id STRING,\n centro_nombre STRING,\n empresa STRING,\n zona STRING,\n canal STRING,\n categoria STRING,\n grupo STRING,\n producto_nav_id STRING,\n producto_desc STRING,\n cantidad INT64,\n importe FLOAT64,\n importe_con_iva FLOAT64,\n coste_unitario FLOAT64,\n coste_linea_aprox FLOAT64,\n id_otr INT64,\n otr_status STRING,\n id_factura_nav STRING,\n otr_nav_id STRING,\n origen STRING,\n persona_id INT64\n)\nPARTITION BY fecha\nCLUSTER BY persona_id, centro_nav_id;",
"refs": [],
"depth": 1
},
"customer_marts.customer_category_spend": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_category_spend`\nAS WITH agg AS (\n SELECT\n persona_id,\n categoria,\n grupo,\n SUM(importe) AS gasto,\n SUM(importe - coste_linea_aprox) AS margen,\n COUNT(DISTINCT id_factura_nav) AS n_tickets,\n COUNT(*) AS n_lineas,\n SUM(cantidad) AS uds,\n MIN(fecha) AS primera_fecha,\n MAX(fecha) AS ultima_fecha\n FROM `autingo-159109.clientes_intel.fact_transaccion`\n WHERE persona_id IS NOT NULL\n GROUP BY persona_id, categoria, grupo\n)\nSELECT\n persona_id,\n categoria,\n grupo,\n gasto,\n margen,\n n_tickets,\n n_lineas,\n uds,\n primera_fecha,\n ultima_fecha,\n SAFE_DIVIDE(gasto, SUM(gasto) OVER (PARTITION BY persona_id)) AS share_gasto_categoria\nFROM agg;",
"refs": [
"clientes_intel.fact_transaccion"
],
"depth": 0
},
"customer_marts.customer_channel": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_channel`\nAS WITH fuentes AS (\n SELECT\n persona_id,\n ARRAY_AGG(DISTINCT fuente IGNORE NULLS ORDER BY fuente) AS fuentes\n FROM `autingo-159109.clientes_intel.map_persona_fuente`\n GROUP BY persona_id\n)\nSELECT\n dp.persona_id,\n -- canal preferido transaccional\n fcp.canal_preferido,\n -- mix de canal (pct de fact_transaccion)\n fcp.pct_aurgi,\n fcp.pct_motortown,\n fcp.pct_web,\n fcp.pct_servicio,\n -- canal de entrada / canal8\n c8.canal8,\n seg.canal_entrada,\n -- fuentes (ARRAY)\n f.fuentes,\n ARRAY_LENGTH(f.fuentes) AS n_fuentes\nFROM `autingo-159109.clientes_intel.dim_persona` dp\nLEFT JOIN `autingo-159109.clientes_intel.feat_cliente_persona` fcp USING (persona_id)\nLEFT JOIN `autingo-159109.clientes_intel.map_persona_canal8` c8 USING (persona_id)\nLEFT JOIN `autingo-159109.clientes_intel.seg_cliente_360` seg USING (persona_id)\nLEFT JOIN fuentes f USING (persona_id);",
"refs": [
"clientes_intel.dim_persona",
"clientes_intel.feat_cliente_persona",
"clientes_intel.map_persona_canal8",
"clientes_intel.map_persona_fuente",
"clientes_intel.seg_cliente_360"
],
"depth": 0
},
"clientes_intel.dim_persona": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.dim_persona`\n(\n persona_id INT64,\n confianza STRING,\n metodo_match STRING,\n document_number STRING,\n document_kind STRING,\n full_name STRING,\n email STRING,\n phone STRING,\n postal_code STRING,\n es_empresa BOOL,\n salesforce_customer_id STRING,\n tpv_nav_id STRING,\n email_optout BOOL,\n sms_optout BOOL,\n whatsapp_optout BOOL,\n do_not_call BOOL,\n num_fuentes INT64,\n in_tpv BOOL,\n in_web BOOL,\n in_otr BOOL,\n in_navision BOOL,\n in_citaprevia BOOL,\n in_salesforce BOOL,\n in_users BOOL\n);",
"refs": [],
"depth": 1
},
"clientes_intel.feat_cliente_persona": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.feat_cliente_persona`\n(\n persona_id INT64,\n recency_days INT64,\n frequency INT64,\n monetary_total FLOAT64,\n ticket_medio FLOAT64,\n ticket_std FLOAT64,\n tenure_days INT64,\n primera_compra DATE,\n ultima_compra DATE,\n valor_ponderado FLOAT64,\n mean_inter_visit_days FLOAT64,\n std_inter_visit_days FLOAT64,\n n_categorias INT64,\n n_centros INT64,\n pct_aurgi FLOAT64,\n pct_motortown FLOAT64,\n pct_web FLOAT64,\n pct_servicio FLOAT64,\n categoria_top STRING,\n pct_top_cat FLOAT64,\n centro_principal STRING,\n empresa_principal STRING,\n mes_top_compra INT64,\n margen_total FLOAT64,\n n_vehiculos INT64,\n es_excluido BOOL,\n r_score INT64,\n f_score INT64,\n m_score INT64,\n rfm_score INT64,\n rfm_sum INT64,\n rfm_segment STRING,\n margen_pct FLOAT64,\n canal_preferido STRING,\n full_name STRING,\n email STRING,\n phone STRING,\n es_empresa BOOL,\n confianza_identidad STRING,\n num_fuentes INT64,\n tiene_email BOOL,\n tiene_telefono BOOL,\n email_optout BOOL,\n sms_optout BOOL,\n whatsapp_optout BOOL,\n do_not_call BOOL,\n contactable BOOL\n)\nCLUSTER BY rfm_segment, persona_id;",
"refs": [],
"depth": 1
},
"clientes_intel.map_persona_canal8": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.map_persona_canal8`\n(\n persona_id INT64,\n canal8 STRING\n);",
"refs": [],
"depth": 1
},
"clientes_intel.map_persona_fuente": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.map_persona_fuente`\n(\n persona_id INT64,\n fuente STRING,\n source_id STRING\n);",
"refs": [],
"depth": 1
},
"clientes_intel.seg_cliente_360": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.seg_cliente_360`\n(\n persona_id INT64,\n full_name STRING,\n es_empresa BOOL,\n es_b2c BOOL,\n rfm_segment STRING,\n cluster STRING,\n tipo_cliente STRING,\n clv_nivel STRING,\n r_score INT64,\n f_score INT64,\n m_score INT64,\n rfm_score INT64,\n clv_score INT64,\n clv_decil INT64,\n clv_norm FLOAT64,\n recency_days INT64,\n frequency INT64,\n monetary_total FLOAT64,\n valor_ponderado FLOAT64,\n ticket_medio FLOAT64,\n mean_inter_visit_days FLOAT64,\n margen_total FLOAT64,\n margen_pct FLOAT64,\n clv_12m_margen FLOAT64,\n clv_12m_ingreso FLOAT64,\n prob_activo FLOAT64,\n n_categorias INT64,\n categoria_top STRING,\n n_centros INT64,\n centro_principal STRING,\n empresa_principal STRING,\n canal_entrada STRING,\n n_vehiculos INT64,\n itv_due_este_anio BOOL,\n antiguedad_media FLOAT64,\n score_confianza_norm FLOAT64,\n data_points INT64,\n contactable_email BOOL,\n contactable_telefono BOOL,\n email_optout BOOL,\n sms_optout BOOL,\n do_not_call BOOL,\n email STRING,\n phone STRING,\n n_acciones_reco INT64,\n top_accion_reco STRING,\n top_motivo STRING,\n top_submotivo STRING,\n es_mutualista STRING,\n provincia STRING,\n ccaa STRING,\n n_citas INT64,\n dias_sin_cita INT64,\n dias_inactivo INT64\n)\nCLUSTER BY rfm_segment, cluster;",
"refs": [],
"depth": 1
},
"customer_marts.customer_contactability": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_contactability`\nAS SELECT\n dp.persona_id,\n fcp.tiene_email,\n fcp.tiene_telefono,\n fcp.contactable,\n dp.email_optout,\n dp.sms_optout,\n dp.whatsapp_optout,\n dp.do_not_call,\n dp.num_fuentes,\n dp.in_tpv,\n dp.in_web,\n dp.in_otr,\n dp.in_navision,\n dp.in_citaprevia,\n dp.in_salesforce,\n seg.data_points\nFROM `autingo-159109.clientes_intel.dim_persona` dp\nLEFT JOIN `autingo-159109.clientes_intel.feat_cliente_persona` fcp USING (persona_id)\nLEFT JOIN `autingo-159109.clientes_intel.seg_cliente_360` seg USING (persona_id);",
"refs": [
"clientes_intel.dim_persona",
"clientes_intel.feat_cliente_persona",
"clientes_intel.seg_cliente_360"
],
"depth": 0
},
"customer_marts.customer_monetary": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_monetary`\nAS WITH ticket_stats AS (\n SELECT\n persona_id,\n COUNT(DISTINCT id_factura_nav) AS n_tickets,\n COUNT(*) AS n_lineas,\n SUM(cantidad) AS uds\n FROM `autingo-159109.clientes_intel.fact_transaccion`\n WHERE persona_id IS NOT NULL\n GROUP BY persona_id\n)\nSELECT\n fcp.persona_id,\n ts.n_tickets,\n fcp.monetary_total AS gasto_total,\n fcp.ticket_medio,\n fcp.ticket_std,\n SAFE_DIVIDE(ts.n_lineas, ts.n_tickets) AS lineas_por_ticket,\n SAFE_DIVIDE(ts.uds, ts.n_tickets) AS uds_por_ticket,\n fcp.margen_total,\n fcp.margen_pct,\n fcp.valor_ponderado\nFROM `autingo-159109.clientes_intel.feat_cliente_persona` fcp\nLEFT JOIN ticket_stats ts USING (persona_id);",
"refs": [
"clientes_intel.fact_transaccion",
"clientes_intel.feat_cliente_persona"
],
"depth": 0
},
"customer_marts.customer_payment_method": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_payment_method`\nAS WITH cust2persona AS (\n SELECT customer_id_tpv, ANY_VALUE(persona_id) AS persona_id\n FROM `autingo-159109.clientes_intel.fact_transaccion`\n WHERE customer_id_tpv IS NOT NULL\n GROUP BY customer_id_tpv\n),\npagos AS (\n SELECT\n o.customer_id,\n COALESCE(pt.description, '(sin tipo)') AS metodo_pago,\n p.amount,\n i.order_id\n FROM `autingo-159109.psql_dcpublic.tpv_orders_payment` p\n JOIN `autingo-159109.psql_dcpublic.tpv_orders_invoice` i ON p.invoice_id = i.id\n JOIN `autingo-159109.psql_dcpublic.tpv_orders_order` o ON o.id = i.order_id\n LEFT JOIN `autingo-159109.psql_dcpublic.tpv_payment_types` pt ON p.payment_type_id = pt.id\n WHERE i.order_id IS NOT NULL\n)\nSELECT\n c.persona_id,\n pg.metodo_pago,\n COUNT(*) AS n_pagos,\n COUNT(DISTINCT pg.order_id) AS n_ordenes,\n ROUND(SUM(pg.amount), 2) AS importe_pagado,\n ROUND(SAFE_DIVIDE(SUM(pg.amount),\n SUM(SUM(pg.amount)) OVER (PARTITION BY c.persona_id)), 4) AS share_importe\nFROM pagos pg\nJOIN cust2persona c ON c.customer_id_tpv = pg.customer_id\nWHERE c.persona_id IS NOT NULL\nGROUP BY c.persona_id, pg.metodo_pago;",
"refs": [
"clientes_intel.fact_transaccion",
"psql_dcpublic.tpv_orders_invoice",
"psql_dcpublic.tpv_orders_order",
"psql_dcpublic.tpv_orders_payment",
"psql_dcpublic.tpv_payment_types"
],
"depth": 0
},
"psql_dcpublic.tpv_orders_invoice": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.psql_dcpublic.tpv_orders_invoice`\n(\n id INT64,\n nav_id STRING(128),\n created_at TIMESTAMP,\n updated_at TIMESTAMP,\n order_id INT64,\n created_by_id INT64,\n terminal_id INT64,\n invoice_path STRING(256),\n ticket_path STRING(256),\n status INT64,\n clear_one_path STRING,\n customer_copy JSON,\n vehicle_copy JSON,\n show_vehicle BOOL,\n profit NUMERIC(10, 2),\n profit_currency STRING(3),\n delivery_note STRING(56),\n datastream_metadata STRUCT<uuid STRING, source_timestamp INT64>,\n adjusted_profit NUMERIC(10, 2),\n adjusted_profit_currency STRING(3),\n registered_in_sol BOOL,\n from_standard_billing_flow BOOL,\n PRIMARY KEY (id) NOT ENFORCED\n)\nCLUSTER BY id\nOPTIONS(\n max_staleness=INTERVAL '0-0 0 1:0:0' YEAR TO SECOND\n);",
"refs": [],
"depth": 1
},
"psql_dcpublic.tpv_orders_order": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.psql_dcpublic.tpv_orders_order`\n(\n id INT64,\n created_at TIMESTAMP,\n updated_at TIMESTAMP,\n customer_id INT64,\n total_cost NUMERIC(10, 2),\n total_cost_currency STRING(3),\n calculate_payload JSON,\n terminal_id INT64,\n vehicle_id INT64,\n shift INT64,\n has_exchange BOOL,\n parent_id INT64,\n is_precaweb BOOL,\n calculate_uuid STRING,\n has_service_request BOOL,\n collective_id INT64,\n execution_time INT64,\n shift_model_id INT64,\n allow_all_returns BOOL,\n return_custom_times JSON,\n payment_methods_override JSON,\n referenced_user_id INT64,\n allow_return_with_open_otr BOOL,\n driver_id INT64,\n owner_id INT64,\n allow_returns_in_cash BOOL,\n gt_request_id INT64,\n requires_payment_authorization BOOL,\n can_be_returned_special_customer BOOL,\n tax_applied FLOAT64,\n datastream_metadata STRUCT<uuid STRING, source_timestamp INT64>,\n last_promo_line_number INT64,\n last_item_line_number INT64,\n last_update_in_nav TIMESTAMP,\n voucher_code STRING(50),\n kilometers INT64,\n autogenerated_from_otr_id INT64,\n reason STRING,\n appointment_id INT64,\n stop_ralarsa_sync BOOL,\n skip_provider_requires_delivery_confirmation BOOL,\n insurance_claim_id INT64,\n need_insurance_validation BOOL,\n validate_sol_pieces_when_closing_otr BOOL,\n accident_type_description STRING(255),\n operation_type STRING(50),\n insurance_policy_id INT64,\n damage_type_description STRING(255),\n recorder_car_renounce_id INT64,\n allowed_car_revision BOOL,\n date_car_renounce TIMESTAMP,\n last_incident_id INT64,\n show_budget_vs_appraisal_comparison BOOL,\n can_link_appraissal BOOL,\n source STRING(255),\n external_id STRING(500),\n PRIMARY KEY (id) NOT ENFORCED\n)\nCLUSTER BY id\nOPTIONS(\n max_staleness=INTERVAL '0-0 0 1:0:0' YEAR TO SECOND\n);",
"refs": [],
"depth": 1
},
"psql_dcpublic.tpv_orders_payment": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.psql_dcpublic.tpv_orders_payment`\n(\n id INT64,\n amount_currency STRING(3),\n amount NUMERIC(10, 2),\n created_at TIMESTAMP,\n updated_at TIMESTAMP,\n invoice_id INT64,\n payment_type_id INT64,\n ticket_path STRING(256),\n status_change INT64,\n payment_token STRING(256),\n nav_id STRING(128),\n created_by_id INT64,\n advance_payment_id INT64,\n change_amount NUMERIC(10, 2),\n change_amount_currency STRING(3),\n return_amount NUMERIC(10, 2),\n return_amount_currency STRING(3),\n related_return_id INT64,\n terminal_id INT64,\n commerce_id STRING(64),\n pin_pad_terminal_id STRING(64),\n card_number STRING(19),\n shift INT64,\n ticket_path_co STRING(256),\n shift_model_id INT64,\n service_request_id STRING(20),\n account_holder STRING(128),\n aid STRING(128),\n arc STRING(2),\n bank_authorization_code STRING(64),\n bank_name STRING(128),\n bank_transaction_number STRING(64),\n bin STRING(64),\n card_brand STRING(128),\n card_network STRING(2),\n card_type STRING(8),\n clearone_amount STRING(10),\n country STRING(5),\n currency STRING(3),\n cvm STRING(2),\n date STRING(10),\n issuing_bank_id STRING(64),\n lbl STRING(128),\n num_op_bco STRING(64),\n operation_type STRING(128),\n pinpad_read_mode STRING(64),\n reference_num_op STRING(64),\n response_code STRING(1),\n session_id STRING(64),\n tax_free STRING(2),\n text_message STRING(128),\n ticket STRING(10),\n center_eci STRING(64),\n is_manual BOOL,\n payment_name_eci STRING(64),\n terminal_eci STRING(64),\n transaction_eci STRING(64),\n date_eci STRING(10),\n company_eci STRING(64),\n datastream_metadata STRUCT<uuid STRING, source_timestamp INT64>,\n identificador_rts STRING(128),\n moneda STRING(128),\n marca_tarjeta STRING(128),\n firma STRING(256),\n estado STRING(128),\n literales STRING(128),\n id_app STRING(128),\n tipo_pago STRING(128),\n tarjeta_comercio_recibo STRING(128),\n operacion_emv BOOL,\n tarjeta_cliente_recibo STRING(128),\n cod_resp_auto STRING(128),\n factura STRING(128),\n res_verificacion STRING(128),\n codigo_respuesta STRING(128),\n caducidad STRING(128),\n fecha_operacion TIMESTAMP,\n comercio STRING(128),\n conttrans STRING(128),\n tipo_tasa_aplicada STRING(128),\n redsys_terminal STRING(128),\n resultado STRING(128),\n pedido STRING(128),\n sec_tarjeta STRING(128),\n importe STRING(128),\n oper_contact_less STRING(128),\n recibo_solo_cliente STRING(128),\n etiqueta_app STRING(128),\n autenticado_por_pin STRING(128),\n PRIMARY KEY (id) NOT ENFORCED\n)\nCLUSTER BY id\nOPTIONS(\n max_staleness=INTERVAL '0-0 0 1:0:0' YEAR TO SECOND\n);",
"refs": [],
"depth": 1
},
"psql_dcpublic.tpv_payment_types": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.psql_dcpublic.tpv_payment_types`\n(\n id INT64,\n name STRING(50),\n description STRING(100),\n closure_required BOOL,\n aurgi_enabled BOOL,\n mt_enabled BOOL,\n datastream_metadata STRUCT<uuid STRING, source_timestamp INT64>,\n returns_by_dc BOOL,\n sort_order INT64,\n is_pin_pad_category BOOL,\n PRIMARY KEY (id) NOT ENFORCED\n)\nCLUSTER BY id\nOPTIONS(\n max_staleness=INTERVAL '0-0 0 1:0:0' YEAR TO SECOND\n);",
"refs": [],
"depth": 1
},
"customer_marts.customer_predictive": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_predictive`\nAS WITH nba AS (\n SELECT\n persona_id,\n accion AS next_best_action,\n motivo AS nba_motivo,\n prioridad_score AS nba_prioridad\n FROM (\n SELECT\n persona_id, accion, motivo, prioridad_score,\n ROW_NUMBER() OVER (\n PARTITION BY persona_id\n ORDER BY prioridad_score DESC, fecha_senal DESC\n ) AS rn\n FROM `autingo-159109.clientes_intel.reco_acciones`\n WHERE persona_id IS NOT NULL\n )\n WHERE rn = 1\n)\nSELECT\n scl.persona_id,\n scl.clv_12m_ingreso,\n scl.clv_12m_margen,\n scl.prob_activo,\n scl.pred_compras_12m,\n scl.clv_decil,\n scl.clv_score,\n seg.cluster,\n ROUND(1 - scl.prob_activo, 4) AS churn_risk,\n nba.next_best_action,\n nba.nba_motivo,\n nba.nba_prioridad\nFROM `autingo-159109.clientes_intel.score_clv` scl\nLEFT JOIN `autingo-159109.clientes_intel.seg_cliente_360` seg USING (persona_id)\nLEFT JOIN nba USING (persona_id);",
"refs": [
"clientes_intel.reco_acciones",
"clientes_intel.score_clv",
"clientes_intel.seg_cliente_360"
],
"depth": 0
},
"clientes_intel.reco_acciones": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.reco_acciones`\n(\n persona_id INT64,\n vehiculo_id STRING,\n license_plate STRING,\n accion STRING,\n motivo STRING,\n motivo_subcat STRING,\n check_color STRING,\n fecha_senal DATE,\n clv_norm FLOAT64,\n clv_score INT64,\n peso_accion INT64,\n prioridad_score FLOAT64,\n canal_entrada STRING,\n contactable_email BOOL,\n contactable_telefono BOOL,\n email_optout BOOL,\n sms_optout BOOL,\n do_not_call BOOL\n)\nCLUSTER BY accion, persona_id;",
"refs": [],
"depth": 1
},
"clientes_intel.score_clv": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.score_clv`\n(\n persona_id INT64,\n frequency FLOAT64,\n recency_weeks FLOAT64,\n T_weeks FLOAT64,\n monetary_value FLOAT64,\n pred_compras_12m FLOAT64,\n prob_activo FLOAT64,\n valor_esperado_transaccion FLOAT64,\n clv_12m_ingreso FLOAT64,\n margen_pct FLOAT64,\n clv_12m_margen FLOAT64,\n metodo STRING,\n clv_norm FLOAT64,\n clv_score INT64,\n clv_decil INT64\n);",
"refs": [],
"depth": 1
},
"customer_marts.customer_product": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_product`\nAS SELECT\n persona_id,\n producto_nav_id,\n ANY_VALUE(producto_desc) AS producto_desc,\n ANY_VALUE(categoria) AS categoria,\n ANY_VALUE(grupo) AS subcategoria,\n SUM(cantidad) AS cantidad,\n ROUND(SUM(importe), 2) AS venta_total,\n ROUND(SUM(importe - COALESCE(coste_linea_aprox, 0)), 2) AS margen_total,\n COUNT(DISTINCT id_factura_nav) AS n_tickets,\n COUNT(*) AS n_lineas,\n MIN(fecha) AS primera_compra,\n MAX(fecha) AS ultima_compra,\n ROUND(SAFE_DIVIDE(SUM(importe),\n SUM(SUM(importe)) OVER (PARTITION BY persona_id)), 4) AS share_venta\nFROM `autingo-159109.clientes_intel.fact_transaccion`\nWHERE persona_id IS NOT NULL AND producto_nav_id IS NOT NULL\nGROUP BY persona_id, producto_nav_id;",
"refs": [
"clientes_intel.fact_transaccion"
],
"depth": 0
},
"customer_marts.customer_profile": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_profile`\nAS SELECT\n _b.*,\n NOT COALESCE(_b.es_empresa, FALSE) AS es_particular,\n (_b.document_kind = 'DNI') AS es_dni,\n (NOT COALESCE(_b.es_empresa, FALSE) AND _b.document_kind = 'DNI') AS es_particular_dni\nFROM (\nSELECT\n dp.persona_id,\n -- Identidad\n dp.document_number,\n dp.document_kind,\n COALESCE(dp.full_name, fcp.full_name) AS full_name,\n COALESCE(dp.email, fcp.email) AS email,\n COALESCE(dp.phone, fcp.phone) AS phone,\n seg.provincia,\n seg.ccaa,\n dp.postal_code,\n dp.es_empresa,\n dp.salesforce_customer_id,\n -- RFM (fuente: feat_cliente_persona)\n fcp.r_score,\n fcp.f_score,\n fcp.m_score,\n fcp.rfm_score,\n fcp.rfm_segment,\n -- Monetario (fuente: feat_cliente_persona)\n fcp.monetary_total,\n fcp.ticket_medio,\n fcp.ticket_std,\n fcp.margen_total,\n fcp.margen_pct,\n fcp.valor_ponderado,\n -- Temporal (fuente: feat_cliente_persona)\n fcp.recency_days,\n fcp.frequency,\n fcp.tenure_days,\n fcp.primera_compra,\n fcp.ultima_compra,\n fcp.mean_inter_visit_days,\n fcp.std_inter_visit_days,\n fcp.mes_top_compra,\n -- Top-N / mix (fuente: feat_cliente_persona)\n fcp.categoria_top,\n fcp.pct_top_cat,\n fcp.centro_principal,\n fcp.empresa_principal,\n fcp.canal_preferido,\n fcp.n_categorias,\n fcp.n_centros,\n fcp.n_vehiculos,\n fcp.pct_aurgi,\n fcp.pct_motortown,\n fcp.pct_web,\n fcp.pct_servicio,\n -- Predictivo (fuente: score_clv para CLV; seg para cluster/tipo/nivel)\n scl.clv_12m_ingreso,\n scl.clv_12m_margen,\n scl.prob_activo,\n scl.pred_compras_12m,\n scl.clv_score,\n scl.clv_decil,\n scl.clv_norm,\n seg.cluster,\n seg.tipo_cliente,\n seg.clv_nivel,\n -- Mutualista\n seg.es_mutualista,\n -- Contacto\n fcp.contactable,\n fcp.tiene_email,\n fcp.tiene_telefono,\n dp.email_optout,\n dp.sms_optout,\n dp.whatsapp_optout,\n dp.do_not_call,\n dp.num_fuentes\nFROM `autingo-159109.clientes_intel.dim_persona` dp\nLEFT JOIN `autingo-159109.clientes_intel.feat_cliente_persona` fcp USING (persona_id)\nLEFT JOIN `autingo-159109.clientes_intel.score_clv` scl USING (persona_id)\nLEFT JOIN `autingo-159109.clientes_intel.seg_cliente_360` seg USING (persona_id)\n) AS _b;",
"refs": [
"clientes_intel.dim_persona",
"clientes_intel.feat_cliente_persona",
"clientes_intel.score_clv",
"clientes_intel.seg_cliente_360"
],
"depth": 0
},
"customer_marts.customer_promo_tolerance": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_promo_tolerance`\nAS WITH cust2pers AS (\n SELECT DISTINCT customer_id_tpv, persona_id\n FROM `autingo-159109.clientes_intel.fact_transaccion`\n WHERE customer_id_tpv IS NOT NULL\n),\norder_promo AS (\n -- por order: total lineas, lineas promo, flag de promo en el ticket\n SELECT\n o.id AS order_id,\n o.customer_id,\n COUNT(*) AS n_lineas,\n COUNTIF(oi.is_promo) AS n_lineas_promo,\n MAX(CAST(oi.is_promo AS INT64)) AS ticket_tiene_promo\n FROM `autingo-159109.psql_dcpublic.tpv_orders_order` o\n JOIN `autingo-159109.psql_dcpublic.tpv_orders_orderitem` oi\n ON oi.order_id = o.id\n GROUP BY o.id, o.customer_id\n),\npersona_promo AS (\n SELECT\n c.persona_id,\n SUM(op.n_lineas) AS n_lineas_total,\n SUM(op.n_lineas_promo) AS n_lineas_promo,\n COUNT(*) AS n_tickets,\n SUM(op.ticket_tiene_promo) AS n_tickets_con_promo\n FROM order_promo op\n JOIN cust2pers c ON op.customer_id = c.customer_id_tpv\n GROUP BY c.persona_id\n),\ncampana AS (\n SELECT\n persona_id,\n COUNTIF(abrio OR clico) AS n_campanas_respondidas,\n AVG(tasa_apertura) AS tasa_apertura_media,\n AVG(tasa_click) AS tasa_click_media\n FROM `autingo-159109.clientes_intel.fact_campana_respuesta`\n WHERE persona_id IS NOT NULL\n GROUP BY persona_id\n)\nSELECT\n persona_id,\n pp.n_lineas_total,\n pp.n_lineas_promo,\n SAFE_DIVIDE(pp.n_lineas_promo, pp.n_lineas_total) AS promo_share,\n pp.n_tickets,\n pp.n_tickets_con_promo,\n SAFE_DIVIDE(pp.n_tickets_con_promo, pp.n_tickets) AS discount_dependence,\n cp.n_campanas_respondidas,\n cp.tasa_apertura_media,\n cp.tasa_click_media\nFROM persona_promo pp\nFULL OUTER JOIN campana cp USING (persona_id);",
"refs": [
"clientes_intel.fact_campana_respuesta",
"clientes_intel.fact_transaccion",
"psql_dcpublic.tpv_orders_order",
"psql_dcpublic.tpv_orders_orderitem"
],
"depth": 0
},
"clientes_intel.fact_campana_respuesta": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.fact_campana_respuesta`\n(\n persona_id INT64,\n canal STRING,\n campana STRING,\n n_enviados INT64,\n n_entregados INT64,\n n_rebotados INT64,\n n_baja INT64,\n n_abiertos INT64,\n n_clicados INT64,\n tasa_apertura FLOAT64,\n tasa_click FLOAT64,\n abrio BOOL,\n clico BOOL,\n baja BOOL,\n primera_fecha DATE,\n ultima_fecha DATE\n)\nCLUSTER BY canal, persona_id;",
"refs": [],
"depth": 1
},
"psql_dcpublic.tpv_orders_orderitem": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.psql_dcpublic.tpv_orders_orderitem`\n(\n id INT64,\n quantity INT64,\n order_id INT64,\n product_id INT64,\n created_by_id INT64,\n total_cost NUMERIC(10, 2),\n total_cost_currency STRING(3),\n all_included_price NUMERIC(10, 2),\n all_included_price_currency STRING(3),\n item_type STRING(50),\n price NUMERIC(10, 2),\n price_currency STRING(3),\n override_cost BOOL,\n parent_item_id INT64,\n unit_price NUMERIC(10, 2),\n unit_price_currency STRING(3),\n is_promo BOOL,\n name STRING(256),\n encargo_description STRING(100),\n encargo_price NUMERIC(10, 2),\n is_commission BOOL,\n reference STRING(100),\n return_count INT64,\n promo_id INT64,\n invoice_nav_line STRING(10),\n quote_nav_line STRING(10),\n order_promo BOOL,\n season STRING(256),\n has_request_service BOOL,\n carga_aa INT64,\n custom_description STRING(100),\n custom_product_id INT64,\n return_reason STRING(256),\n original_item_id INT64,\n allow_return_in_other_center BOOL,\n tax_applied STRING(20),\n tax_percentage NUMERIC(5, 2),\n is_gt BOOL,\n delivery_note_ref STRING(256),\n purchase_price NUMERIC(10, 2),\n purchase_price_currency STRING(3),\n datastream_metadata STRUCT<uuid STRING, source_timestamp INT64>,\n last_extra_item_line_number INT64,\n line_number INT64,\n encargo_provider_id INT64,\n generate_question BOOL,\n encargo_data JSON,\n reason STRING(50),\n search_reference STRING(100),\n plate STRING(128),\n part_id INT64,\n piece_data JSON,\n tpv_assistant_screen_question JSON,\n encargo_status STRING(50),\n need_email_for_voucher BOOL,\n adjusted_purchase_price NUMERIC(10, 2),\n anjana_maintenance_id INT64,\n adjusted_purchase_price_currency STRING(3),\n warehouse_location STRING(256),\n delivery_note_date TIMESTAMP,\n taxes JSON,\n price_set_by_user BOOL,\n source STRING(256),\n PRIMARY KEY (id) NOT ENFORCED\n)\nCLUSTER BY id\nOPTIONS(\n labels=[(\"dataplex-dp-published-project\", \"autingo-159109\"), (\"dataplex-dp-published-location\", \"europe-west1\"), (\"dataplex-dp-published-scan\", \"a615d6de4-2947-4545-8363-b4c7c141da07\")],\n max_staleness=INTERVAL '0-0 0 1:0:0' YEAR TO SECOND\n);",
"refs": [],
"depth": 1
},
"customer_marts.customer_promo_usage": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_promo_usage`\nAS WITH cust2pers AS (\n SELECT DISTINCT customer_id_tpv, persona_id\n FROM `autingo-159109.clientes_intel.fact_transaccion`\n WHERE customer_id_tpv IS NOT NULL\n),\npromo_lines AS (\n SELECT\n c.persona_id,\n oi.order_id,\n oi.promo_id\n FROM `autingo-159109.psql_dcpublic.tpv_orders_orderitem` oi\n JOIN `autingo-159109.psql_dcpublic.tpv_orders_order` o\n ON oi.order_id = o.id\n JOIN cust2pers c\n ON o.customer_id = c.customer_id_tpv\n WHERE oi.is_promo = TRUE\n),\nagg AS (\n SELECT\n persona_id,\n COUNT(*) AS n_lineas_promo,\n COUNT(DISTINCT order_id) AS n_tickets_promo,\n COUNT(DISTINCT promo_id) AS n_promos_distintas\n FROM promo_lines\n GROUP BY persona_id\n)\nSELECT\n a.persona_id,\n a.n_lineas_promo,\n a.n_tickets_promo,\n a.n_promos_distintas,\n seg.es_mutualista\nFROM agg a\nLEFT JOIN `autingo-159109.clientes_intel.seg_cliente_360` seg\n USING (persona_id);",
"refs": [
"clientes_intel.fact_transaccion",
"clientes_intel.seg_cliente_360",
"psql_dcpublic.tpv_orders_order",
"psql_dcpublic.tpv_orders_orderitem"
],
"depth": 0
},
"customer_marts.customer_store_spend": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_store_spend`\nAS WITH agg AS (\n SELECT\n persona_id,\n centro_nav_id,\n ANY_VALUE(centro_nombre) AS centro_nombre,\n ANY_VALUE(empresa) AS empresa,\n ANY_VALUE(zona) AS zona,\n SUM(importe) AS gasto,\n SUM(importe - coste_linea_aprox) AS margen,\n COUNT(DISTINCT id_factura_nav) AS n_tickets,\n COUNT(*) AS n_lineas,\n MIN(fecha) AS primera_fecha,\n MAX(fecha) AS ultima_fecha\n FROM `autingo-159109.clientes_intel.fact_transaccion`\n WHERE persona_id IS NOT NULL\n GROUP BY persona_id, centro_nav_id\n)\nSELECT\n persona_id,\n centro_nav_id,\n centro_nombre,\n empresa,\n zona,\n gasto,\n margen,\n n_tickets,\n n_lineas,\n primera_fecha,\n ultima_fecha,\n SAFE_DIVIDE(gasto, SUM(gasto) OVER (PARTITION BY persona_id)) AS share_gasto_centro\nFROM agg;",
"refs": [
"clientes_intel.fact_transaccion"
],
"depth": 0
},
"customer_marts.customer_temporal": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_temporal`\nAS WITH trend AS (\n SELECT\n persona_id,\n SUM(IF(fecha >= DATE_SUB(CURRENT_DATE(), INTERVAL 12 MONTH), importe, 0)) AS gasto_ult_12m,\n SUM(IF(fecha < DATE_SUB(CURRENT_DATE(), INTERVAL 12 MONTH)\n AND fecha >= DATE_SUB(CURRENT_DATE(), INTERVAL 24 MONTH), importe, 0)) AS gasto_12m_previos\n FROM `autingo-159109.clientes_intel.fact_transaccion`\n WHERE persona_id IS NOT NULL\n GROUP BY persona_id\n)\nSELECT\n fcp.persona_id,\n fcp.recency_days,\n fcp.frequency,\n fcp.mean_inter_visit_days,\n fcp.std_inter_visit_days,\n fcp.tenure_days,\n fcp.primera_compra,\n fcp.ultima_compra,\n fcp.mes_top_compra,\n t.gasto_ult_12m,\n t.gasto_12m_previos,\n SAFE_DIVIDE(t.gasto_ult_12m, t.gasto_12m_previos) AS ratio_tendencia\nFROM `autingo-159109.clientes_intel.feat_cliente_persona` fcp\nLEFT JOIN trend t USING (persona_id);",
"refs": [
"clientes_intel.fact_transaccion",
"clientes_intel.feat_cliente_persona"
],
"depth": 0
},
"customer_marts.customer_vehicles": {
"type": "VIEW",
"ddl": "CREATE VIEW `autingo-159109.customer_marts.customer_vehicles`\nAS SELECT\n mpv.persona_id,\n mpv.plate_norm,\n COALESCE(dv.license_plate, fcv.license_plate) AS license_plate,\n COALESCE(dv.make, fcv.make) AS make,\n COALESCE(dv.model, fcv.model) AS model,\n COALESCE(dv.model_family, fcv.model_family) AS model_family,\n COALESCE(dv.fuel, fcv.fuel) AS fuel,\n dv.version,\n dv.year,\n dv.km,\n dv.tyre_size,\n fcv.antiguedad_anios,\n fcv.anio_matricula,\n -- Actividad del vehiculo en relacion a esta persona\n mpv.n_visitas,\n mpv.n_eventos,\n mpv.primera_fecha,\n mpv.ultima_fecha,\n -- Metricas del vehiculo (feat)\n fcv.importe_total,\n fcv.recency_days,\n fcv.n_lineas,\n fcv.n_categorias,\n fcv.pct_servicio,\n fcv.dias_desde_neumatico,\n fcv.dias_desde_revision,\n fcv.dias_desde_bateria,\n fcv.dias_desde_aceite,\n fcv.dias_desde_frenos,\n fcv.dias_desde_preitv,\n fcv.itv_periodicidad,\n fcv.proxima_itv_anio,\n fcv.itv_due_este_anio,\n fcv.persona_actual,\n -- Vias de relacion persona-vehiculo\n mpv.via_visita,\n mpv.via_owner_tpv,\n mpv.via_otr,\n mpv.via_citaprevia\nFROM `autingo-159109.clientes_intel.map_persona_vehiculo` mpv\nLEFT JOIN `autingo-159109.clientes_intel.dim_vehiculo` dv\n ON mpv.plate_norm = dv.plate_norm\nLEFT JOIN `autingo-159109.clientes_intel.feat_cliente_vehiculo` fcv\n ON mpv.plate_norm = fcv.vehiculo_id;",
"refs": [
"clientes_intel.dim_vehiculo",
"clientes_intel.feat_cliente_vehiculo",
"clientes_intel.map_persona_vehiculo"
],
"depth": 0
},
"clientes_intel.dim_vehiculo": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.dim_vehiculo`\n(\n plate_norm STRING,\n license_plate STRING,\n make STRING,\n model STRING,\n model_family STRING,\n version STRING,\n fuel STRING,\n year INT64,\n car_frame STRING,\n km INT64,\n tyre_size STRING,\n in_tpv BOOL,\n in_otr BOOL,\n in_lineas BOOL,\n in_citaprevia BOOL,\n vin STRING,\n vin_source STRING,\n tec_marca STRING,\n tec_modelo STRING,\n tec_modelo_generico STRING,\n tec_combustible STRING,\n tec_cilindrada INT64,\n tec_potencia_kw FLOAT64,\n tec_potencia_fiscal FLOAT64,\n tec_co2 FLOAT64,\n tec_plazas INT64,\n tec_peso_maximo INT64,\n tec_tara INT64,\n tec_tipo STRING,\n tec_segmento STRING,\n tec_mercado STRING,\n tec_procedencia STRING,\n tec_provincia_matricula STRING,\n tec_fecha_1a_matricula DATE,\n tec_fecha_matricula DATE,\n ktypes ARRAY<STRING>,\n car_versions ARRAY<STRING>\n);",
"refs": [],
"depth": 1
},
"clientes_intel.feat_cliente_vehiculo": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.feat_cliente_vehiculo`\n(\n vehiculo_id STRING,\n license_plate STRING,\n make STRING,\n model STRING,\n model_family STRING,\n fuel STRING,\n tyre_size STRING,\n year_declarado INT64,\n anio_estimado_matricula INT64,\n anio_real_matricula INT64,\n anio_matricula INT64,\n fuente_anio STRING,\n antiguedad_anios INT64,\n n_visitas INT64,\n n_lineas INT64,\n importe_total FLOAT64,\n primera_fecha DATE,\n ultima_fecha DATE,\n recency_days INT64,\n n_categorias INT64,\n pct_servicio FLOAT64,\n n_lineas_neumatico INT64,\n dias_desde_neumatico INT64,\n dias_desde_revision INT64,\n dias_desde_bateria INT64,\n dias_desde_aceite INT64,\n dias_desde_frenos INT64,\n dias_desde_preitv INT64,\n n_personas INT64,\n persona_actual INT64,\n vin STRING,\n tec_combustible STRING,\n tec_modelo_generico STRING,\n tec_cilindrada INT64,\n tec_potencia_kw FLOAT64,\n tec_potencia_fiscal FLOAT64,\n tec_co2 FLOAT64,\n tec_segmento STRING,\n tec_tipo STRING,\n tec_plazas INT64,\n tec_fecha_matricula DATE,\n tec_fecha_1a_matricula DATE,\n combustible STRING,\n itv_periodicidad STRING,\n proxima_itv_anio INT64,\n itv_due_este_anio BOOL\n)\nCLUSTER BY make, vehiculo_id;",
"refs": [],
"depth": 1
},
"clientes_intel.map_persona_vehiculo": {
"type": "BASE TABLE",
"ddl": "CREATE TABLE `autingo-159109.clientes_intel.map_persona_vehiculo`\n(\n persona_id INT64,\n plate_norm STRING,\n primera_fecha DATE,\n ultima_fecha DATE,\n n_visitas INT64,\n n_eventos INT64,\n via_visita BOOL,\n via_owner_tpv BOOL,\n via_otr BOOL,\n via_citaprevia BOOL\n);",
"refs": [],
"depth": 1
}
}
}