Property master list, deletion, permissions and relations

The property list query and columns, enabling, protection of permanent deletion, bulk store assignment, the map layer, export, permission layers and related modules.

The masterdata/property module appears in the Master data menu group (canSee('masterdata/property', 'list')) and is one of the modules under development. The property master is global: list, form, deletion and enabling are not narrowed to a company.

List

  • Filter: filter_name (LIKE on name, identifier, address, match value), filter_status; the values travel in the list AJAX URL (with limit, sort, order). With debug permission the query SQL is shown.
  • Columns: checkbox, Property (name, identifier, inactive badge, address, operator), Owner (from md), Match value (from lg), Action. The interface sorts by name (the model also knows identifier and date_added).
  • With brokerend the number of active brokerage rows is fetched per row (contract/contract::countActiveBrokerages()).
  • Without permission a warning box: "Warning: You do not have permission to manage properties!".

Enabling and deletion

  1. enable / disable: status 1 / 0 with edit; no content check.
  2. delete (one row by GET or selected[] by POST): first getLinkCount() for each selected (how many contracts' property_id points to it); if any is above zero, nothing is deleted. Otherwise deleteProperty() deletes the master row, store rows, description, rooms and utility identifiers; documents, powers of attorney and the map point are not deleted.
  3. The statusdelete key is in the catalogue but has no endpoint: bin deletion is not available for properties.

Bulk store assignment, map, export

  • bulkstore (POST selected[], mode add or remove, store_ids[]): edit for one item, canBulkAction(route, 'edit') for several, plus the core modify permission; Dlbtstorebulk::apply() writes through the model's getPropertyStores and savePropertyStores.
  • Map layer (map permission): the "Properties" layer of the Geo map and geocoding from the address; candidates: getGeocodeCandidates() (active properties with address and no coordinates, at most 2000), write-back: setCoordinates().
  • Export (export permission): getPropertyFull() + documents within scope, shaped by Dlbtproperty::exportShape(), as a download.
  • autocomplete: at most 8 active properties; used by the advert form and the shared folder form.

Permissions

  1. Core route: masterdata/property access and modify; bulkstore requires modify separately.
  2. Function keys: list, edit, delete, debug; statusdelete (no endpoint); map, export (SYSTEM); brokerend (BASE). There is no add key, so a new property also needs edit; computeareas runs with edit or add.
  3. Content scope: on selecting and saving the client (operator), on documents, the main image, the export and on documents in the REST interface.

Relations

Contracts (property_id, properties to broker, power of attorney badge, deletion protection); data room (tiles, data sheet, gallery, documents inside the shared folder); document centre (storage, linking, "Assign to property" bulk button); shared folders (object picker); tax authority tourism tax return (accommodation picker getOperatedProperties()); Geo map; adverts; labels; stores; REST (api/masterdata/property; catalog model: getPropertyForApi(), getPropertyChanges()).

Related topics: property permissions map