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.
| Table | Role |
|---|---|
phonenumber | number, canonical key, operator, note, status (0/1/9) |
person_phonenumber, company_phonenumber | link with role |
phone_usage | cost records (delete check) |
Process
- List: filter by number, operator, company, person, status;
filter_allowed_ids; trash only withcanSeeDeleted(); message link with thebackup/iphonebackupmessagesright.autocomplete: active numbers, max. 10. - Save: number required;
savePhonenumber()normalises and de-duplicates:invalid→error_number_invalid,duplicate→ the existing id,schema→ missing table. - Delete: with
deletea reference check (getLinkCounts: persons, companies, cost records, messages), thenDELETE; withstatusdeleteonly,status = 9; several items need the bulk delete right.
Permissions
- Function rights:
list; form/savecanSave(); statusedit;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.