QGEP / qgepqwat2ili

3 stars 3 forks source link

Faulty extension handling on export #128

Closed cymed closed 6 months ago

cymed commented 1 year ago

Describe the bug When exporting a SIA405 from a DB with value list extensions, the value_de is matched directly from the primary key instead of the vsacode. This results in unexpected behaviour. In the test case, the value 'Platzwasser' was inserted into the vl of channel_usage_current to conform with AG-96 ili here.

The vl addition was done using plain sql:

INSERT INTO qgep_vl.channel_usage_current (code,vsacode,value_de,value_en,active) VALUES (999993,4520,'Platzwasser','square_water',true) ON CONFLICT DO NOTHING;

In the export, the result is [...]<Nutzungsart_Ist>Platzwasser</Nutzungsart_Ist>[...] instead of [...]<Nutzungsart_Ist>Regenabwasser</Nutzungsart_Ist>[...]

To Reproduce Exact steps to reproduce the behavior:

  1. Add vl addition accordizbg to description
  2. Add a channel with usage_current='Platzwasser'
  3. Export Interlis
  4. Check output

Expected behavior qgepqwat2ili should map the vl indirectly by accessing the vsacode (if distinct from code) and get the corresponding value_de

Screenshots / data DB dump can be sent privately (live data), to be used for bug fixing only

Desktop (please complete the following information):

Additional context See vsacode handling in #208

sjib commented 6 months ago

Solved with https://github.com/QGEP/datamodel/pull/220