Appearance
Company and Branches
| Backlog field | Value |
|---|---|
| Story ID | AP-GS-002 |
| Epic | General Settings |
| Story type | Business workflow |
| Review status | Draft - business analyst and business owner review required |
| Source evidence | AppsPortal.Apis controller, application command/query handlers, validators, domain entities, and matching MFE workflow where available |
| Last source review | 2026-07-10 |
User story
As company administrators, I want to maintain company, legal, contact, address, and branch data so that all business documents use the correct organization identity.
Acceptance criteria
- Only authorized users can view or execute the feature's actions.
- Required business data, active dependencies, tenant/branch scope, and current document state are validated.
- Invalid requests return actionable validation errors without applying a partial change.
- Search, list, view, print, and export operations use the same authorized business scope.
- Material create, edit, status, approval, posting, reversal, and integration actions are auditable where applicable.
- Financial or stock effects are applied atomically and no more than once.
Business rules
Required
Company legal identity, country/currency, localized name, tax/legal data where applicable, and at least one usable branch are required.
Optional or conditional
Contacts, addresses, logos, registration details, and additional branches are optional/conditional.
Action behavior
Save changes future document identity and scope; posted documents retain their original legal snapshot.
Blocking rule or downstream effect
A branch with transactions cannot be deleted; user-branch access controls selection.
Frontend page coverage
The following UI coverage is sourced from the pulled MFE route configuration. A Module-level supporting artifact mapping is evidence of a reachable screen, but requires BA confirmation that it belongs to this story rather than a more specific feature story.
| Route/page | Component | Mode | Route permission/guard | Mapping confidence | Source |
|---|---|---|---|---|---|
| (module default) | CompanyDefinationDetailsComponent | View/detail | Permission: 'ALL_PERMISSIONS', AppGeneralSettingsPermissions.Company_View; Guards: PolicyAuthGuard | Feature token match | apps/erpHome/src/app/remote-entry/company-defination/company-defination-routing.module.ts:20 |
| (module default) | MainCompanyDefComponent | List/navigation | Guards: PolicyAuthGuard | Feature token match | apps/erpHome/src/app/remote-entry/company-defination/company-defination-routing.module.ts:12 |
| company | Lazy-loaded route | List/navigation | Guards: PolicyAuthGuard | Feature token match | apps/erpHome/src/app/remote-entry/general-setting/general-setting.module.ts:244 |
| edit/:id | EditCompanyDefinationComponent | Edit | Permission: 'ALL_PERMISSIONS', AppGeneralSettingsPermissions.Company_Edit; Guards: PolicyAuthGuard | Feature token match | apps/erpHome/src/app/remote-entry/company-defination/company-defination-routing.module.ts:36 |
| view | CompanyDefinationDetailsComponent | View/detail | Permission: 'ALL_PERMISSIONS', AppGeneralSettingsPermissions.Company_View; Guards: PolicyAuthGuard | Feature token match | apps/erpHome/src/app/remote-entry/company-defination/company-defination-routing.module.ts:25 |
Observed frontend fields and validation
| Component | Control | Observed frontend rule | Component source |
|---|---|---|---|
| AddressComponent | address | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/address/address.component.ts |
| AddressComponent | city | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/address/address.component.ts |
| AddressComponent | countryCode | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/address/address.component.ts |
| AddressComponent | currencyName | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/address/address.component.ts |
| AddressComponent | latitude | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/address/address.component.ts |
| AddressComponent | longitude | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/address/address.component.ts |
| AddressComponent | radius | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/address/address.component.ts |
| AddressComponent | region | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/address/address.component.ts |
| ContactComponent | companyAddress | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| ContactComponent | companyEmail | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| ContactComponent | companyLogo | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| ContactComponent | contactPersonal | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| ContactComponent | contactPersonalEmail | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| ContactComponent | contactPersonalMobileNumber | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| ContactComponent | contactPersonalMobileNumberCode | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| ContactComponent | contactPersonalPosition | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| ContactComponent | mobileNumber | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| ContactComponent | mobileNumberCode | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| ContactComponent | nameAr | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| ContactComponent | nameEn | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| EditAddressComponent | address | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-address/edit-address.component.ts |
| EditAddressComponent | city | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-address/edit-address.component.ts |
| EditAddressComponent | countryCode | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-address/edit-address.component.ts |
| EditAddressComponent | currencyId | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-address/edit-address.component.ts |
| EditAddressComponent | latitude | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-address/edit-address.component.ts |
| EditAddressComponent | longitude | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-address/edit-address.component.ts |
| EditAddressComponent | radius | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-address/edit-address.component.ts |
| EditAddressComponent | region | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-address/edit-address.component.ts |
| EditContactComponent | companyAddress | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | companyEmail | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | companyLogo | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | contactPersonal | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | contactPersonalEmail | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | contactPersonalMobileNumber | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | contactPersonalMobileNumberCode | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | contactPersonalPosition | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | mobileNumber | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | mobileNumberCode | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | nameAr | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | nameEn | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditLegacyComponent | activityCodeId | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | additionalStreetName | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | buildingNumber | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | businessCategory | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | cityName | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | citySubDivisionName | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | commercialId | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | companyEmail | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | companyName | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | countrySubEntity | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | organization | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | organizationUnit | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | postalZone | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | registeredAddress | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | registrationName | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | streetName | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | taxId | Required in component validator | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| LagalComponent | activityCodeId | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | additionalStreetName | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | buildingNumber | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | businessCategory | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | cityName | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | citySubDivisionName | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | commercialId | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | companyEmail | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | companyName | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | countrySubEntity | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | organization | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | organizationUnit | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | postalZone | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | registeredAddress | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | registrationName | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | streetName | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
| LagalComponent | taxId | Visible control; optional or API-dependent | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
Observed frontend actions
| Component | Click action/handler | Business review requirement | Component source |
|---|---|---|---|
| AddressComponent | navigateToEditAddress | Open the identified editable record only with Edit permission; posted/locked records remain blocked by route or action state and list context must be recoverable on return. | apps/erpHome/src/app/remote-entry/company-defination/pages/address/address.component.ts |
| CompanyDefinationBranchesListComponent | cancel | Leave or close without persisting; warn when the current form has unsaved changes and restore the prior list/filter context. | apps/erpHome/src/app/remote-entry/company-defination/pages/branches-list/branches-list.component.ts |
| CompanyDefinationBranchesListComponent | navigateToEdit | Open the identified editable record only with Edit permission; posted/locked records remain blocked by route or action state and list context must be recoverable on return. | apps/erpHome/src/app/remote-entry/company-defination/pages/branches-list/branches-list.component.ts |
| CompanyDefinationBranchesListComponent | onEdit | Open the identified editable record only with Edit permission; posted/locked records remain blocked by route or action state and list context must be recoverable on return. | apps/erpHome/src/app/remote-entry/company-defination/pages/branches-list/branches-list.component.ts |
| ContactComponent | navigateToEditContact | Open the identified editable record only with Edit permission; posted/locked records remain blocked by route or action state and list context must be recoverable on return. | apps/erpHome/src/app/remote-entry/company-defination/pages/viewContact/contact.component.ts |
| EditAddressComponent | cancel | Leave or close without persisting; warn when the current form has unsaved changes and restore the prior list/filter context. | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-address/edit-address.component.ts |
| EditAddressComponent | editAddress | Open the identified editable record only with Edit permission; posted/locked records remain blocked by route or action state and list context must be recoverable on return. | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-address/edit-address.component.ts |
| EditContactComponent | cancel | Leave or close without persisting; warn when the current form has unsaved changes and restore the prior list/filter context. | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditContactComponent | editContact | Open the identified editable record only with Edit permission; posted/locked records remain blocked by route or action state and list context must be recoverable on return. | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-contact/edit-contact.component.ts |
| EditLegacyComponent | cancel | Leave or close without persisting; warn when the current form has unsaved changes and restore the prior list/filter context. | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| EditLegacyComponent | editLegal | Open the identified editable record only with Edit permission; posted/locked records remain blocked by route or action state and list context must be recoverable on return. | apps/erpHome/src/app/remote-entry/company-defination/pages/edit-legal/edit-legacy.component.ts |
| LagalComponent | editLegal | Open the identified editable record only with Edit permission; posted/locked records remain blocked by route or action state and list context must be recoverable on return. | apps/erpHome/src/app/remote-entry/company-defination/pages/viewLagal/lagal.component.ts |
Page-specific frontend acceptance criteria
- (module default) - List/navigation: Load an authorized paged/searchable list or navigation page; preserve filters/sort/paging and expose only permitted row and bulk actions. Security observed: Guards: PolicyAuthGuard
- (module default) - View/detail: Load an authorized immutable/detail representation with status-aware actions, linked records, print/export where exposed, and not-found/forbidden handling. Security observed: Permission: 'ALL_PERMISSIONS', AppGeneralSettingsPermissions.Company_View; Guards: PolicyAuthGuard
- company - List/navigation: Load an authorized paged/searchable list or navigation page; preserve filters/sort/paging and expose only permitted row and bulk actions. Security observed: Guards: PolicyAuthGuard
- edit/:id - Edit: Load the identified record, enforce state/permission field locks, preserve concurrency identity, validate changes, and return without losing filters. Security observed: Permission: 'ALL_PERMISSIONS', AppGeneralSettingsPermissions.Company_Edit; Guards: PolicyAuthGuard
- view - View/detail: Load an authorized immutable/detail representation with status-aware actions, linked records, print/export where exposed, and not-found/forbidden handling. Security observed: Permission: 'ALL_PERMISSIONS', AppGeneralSettingsPermissions.Company_View; Guards: PolicyAuthGuard