teksi / wastewater

[DEV] Future TEKSI wastewater module, adapted data model to fit VSA-DSS 2020 new standard
https://teksi.github.io/wastewater
GNU General Public License v3.0
1 stars 5 forks source link

not able to change maintenance_type #52

Open urskaufmann opened 9 months ago

urskaufmann commented 9 months ago

I get these error when editing data from vsa_version 2015: WARNING Fehlerhafte Abfrage: UPDATE "tww_app"."vw_tww_maintenance_event" SET "maintenance_event_type"='examination' WHERE "obj_id"::text='ch080qwzEH001128' ergab 7 [ERROR: Type change not allowed for maintenance_event HINT: You cannot switch from unknown to examination CONTEXT: PL/pgSQL function tww_app.ft_vw_tww_maintenance_event_update() line 26 at RAISE

I agree it should not be possible (without further UI) to change the type, after it is set. But I think it should be possible to change once from "unknown" to one of the other types. "Unknown" is not a "type" (not a subclass of maintenance_event).

3nids commented 9 months ago

Is it allowed to have a maintenance_event without a type ? (i.e. is it abstract or not)

sjib commented 9 months ago

There was a change from 2015 to 2020: maintenance_event is in release 2020 ABSTRACT, before it was not.

urskaufmann commented 9 months ago

if I import the VSA-Musterdatensatz, I get type=unkown and I'm not able to correct this... What does the VSA-Checker convert2020 with old maintenance_event records?

3nids commented 9 months ago

So, this is not a problem of the data model but:

We can discuss if we want to fix/adapt pirogue for this.

cymed commented 1 month ago

It also does not allow manually inserting a row, as it is set to "unknown" as a default and then does not allow changing that value

sjib commented 1 month ago

May be we should change the default to maintenance instead and take out the option unknown, as unknown just seems to create problems.

sjib commented 1 month ago

@urskaufmann with my last import I did not have problems. 20240806_tww_app vw_maintenance_event

Maybe we first re-check before we further go with this.

sjib commented 1 month ago

We still are missing the data in the tww_od.re_maintenance_event_wastewater_structure table after import. see https://github.com/teksi/wastewater/issues/352