Phone numbers – system description

Tables of the phone number master, the normalising and de-duplicating save, permanent deletion protected by a reference check, and the trash.

Phone number master with raw number, canonical key (phone_key), operator, note, and person and company links. The list is narrowed to allowed companies.

Data model

Table names carry the installation's own prefix in the database.

TableRole
phonenumbernumber, canonical key, operator, note, status (0/1/9)
person_phonenumber, company_phonenumberlink with role
phone_usagecost records (delete check)

Process

  1. List: filter by number, operator, company, person, status; filter_allowed_ids; trash only with canSeeDeleted(); message link with the backup/iphonebackup messages right. autocomplete: active numbers, max. 10.
  2. Save: number required; savePhonenumber() normalises and de-duplicates: invalid → error_number_invalid, duplicate → the existing id, schema → missing table.
  3. Delete: with delete a reference check (getLinkCounts: persons, companies, cost records, messages), then DELETE; with statusdelete only, status = 9; several items need the bulk delete right.

Permissions

  • Function rights: list; form/save canSave(); status edit; delete, statusdelete, bulkdelete; debug. The keys have a catalogue seed.
  • Company picker: companiesByGroup.

Known limitations

No record-level company scope; only the list is narrowed.

Related topics: phone numbers permissions