Company groups – system description
Tables of the company group master, content filtering of the list, company assignment endpoints and reference-protected deletion.
Master of company groups (client groups) and assignment of companies to them. A company is linked through its company_group_id field; finalised module.
Data model
Table names carry the installation's own prefix in the database.
| Table | Role |
|---|---|
company_group, company_group_description | group, name per language, order |
company | company_group_id holds the assignment |
permission_scope | content right |
Process
- List: paged and sorted; filtered to the allowed groups (
getAllowedCompanyGroupIds). - Save: name per language required;
addCompanyGroup()/editCompanyGroup(); returnscompany_group_id. - Assignment:
companysearch(name/tax number, max. 15),companyadd,companyremove– sets the company's group id or resets it to 0 (setCompanyGroup). - Delete: if the group has companies (
getTotalCompaniesByCompanyGroupId) it refuses and shows the count; otherwisedeleteCompanyGroup().
Permissions
- Function rights:
list,add(not in the catalogue; header button,canSave),edit,assign_company,delete,debug.
Known limitations
- Saving an existing group does not check the group's scope.
- The company search and assignment do not check content scope: any company can be reached.