Field registry of the property data sheet, area calculation and utility matching

Data sheet fields stored in columns and in JSON, type-dependent visibility, normalisation, area calculation based on room type rules, utility meters and cost invoice matching.

The field registry lives SQL-free in the Dlbtproperty library (TYPES, USES, COLUMNS, FIELDS, GROUPS, RETIRED, ROOM_TYPES, UTILITIES, DOC_ROLES, ENERGY_SCALE, COUNTS_AS, AREA_BUCKETS). Storage belongs to the owner model.

Fields

  • In columns (searchable): area_net, area_gross, area_plot, rooms, half_rooms, build_year (1000–2200), floor_level (−5–200), building_floors; plus area_terrace, area_garden, area_storage, wc_count, bathroom_count.
  • In JSON (details): select, multi, bool and date fields of the groups (size, building, condition, comfort, parking, energy, energy_cert, plot, development, commercial).
  • Types: flat, house, terraced, holiday, plot, development, condominium, office, retail, warehouse, garage, agricultural, hospitality, other; uses: residential, office, retail, hospitality, warehouse, workshop, medical, education.
  • Visibility: a field is shown if it belongs to any selected type; without a type, all. Text at most 255 characters.
  • Retired advert fields (RETIRED: available_from, min_rent_months, deposit_months, pets, smoking, common_cost_payer, utility_payer) are not shown on the form, the data sheet or the export, but earlier values are written back from hidden fields.
  • Legacy parking values: garage_included and garage_optional → garage, none → removed.

Normalisation

normalize(): only fields of the selected type(s) remain, out-of-range numbers become NULL (without error), select and multi values are whitelisted. normalizeRooms(): empty rows are dropped, unknown type becomes other, negative area 0. normalizeMeters(): rows without identifier are dropped.

Area calculation

  1. computeAreas() calculates with the room type master rules when rooms and rules exist; it overwrites area_net, rooms, half_rooms, wc_count, bathroom_count, area_terrace, area_garden, area_storage.
  2. The sum of area × area_factor of types without threshold is the living space; from the bucket of threshold types area_factor applies up to threshold_pct % of the living space, above it factor_over.
  3. Room (counts_as = room): below half_room_max a half room; toilets and bathrooms by count.
  4. A common (ownership = common) room does not count towards the flat's area or room counts, only towards the common total; a room with unknown code counts as "other, 100%".
  5. Without a room list the manual value stays. Live calculation: the computeareas endpoint (edit or add), called by the form with a 250 ms delay; an empty list returns empty.

Tables

Table names carry the installation's own prefix in the database. property_room: property_id, level, room_type, name, area, windowless, sort_order, ownership (private, common). property_meter: property_id, utility, provider, identifier (indexed), payer (owner, tenant), note. The room type picker offers the master's active types and a type already recorded in the row but deactivated since; before migration the 20 built-in types.

Cost invoice matching

getByMatchValue(): first match_value (active property), otherwise property_meter.identifier; then it also returns the meter's utility and payer. The source review did not find a caller of this method; where it is used cannot be determined from the code.