---
tags: [companyuser, cross-module]
module: CompanyUser
---

# CrossModuleDependencies

## Connections
[[_CompanyUser]] · [[[Model]User]] · [[[Model]RecurringEntity]] · [[[Service]IntegrationServices]] · [[[Service]RecurringServices]] · [[[Service]DashboardServices]] · [[[Job]Jobs]] · [[[Observer]Observers]]

---

## Sales Module
| Used | Type | Purpose |
|---|---|---|
| `Invoice` | Model | [[[Model]RecurringEntity]] morphTo target; recurring invoice generation |
| `InvoiceReturn` | Model | Dashboard metrics |
| `Customer` | Model | Integration sync target |
| `SalesEstimate` | Model | Dashboard/reporting |
| `GenerateRecurringInvoiceService` | Service | Called by [[[Job]Jobs#GenerateRecurringEntityJob]] to clone recurring invoices |
| `RetrievingActiveCustomersService` | Service | Onboarding customer import |

---

## Accounting Module
| Used | Type | Purpose |
|---|---|---|
| [[[Model]JournalEntry]] | Model | [[[Model]RecurringEntity]] morphTo target |
| [[[Model]Account]] | Model | Integration account mapping |
| [[[Model]JournalRecord]] | Model | Dashboard balance lookups |
| [[[Service]JournalEntryServices]] `GenerateRecurringJournalEntryService` | Service | Called by [[[Job]Jobs#GenerateRecurringEntityJob]] |
| `AccountIntegrationsRepository` | Repository | Reads/writes integration account mappings |
| `SyncingIntegratedOrdersService` | Service | Dispatched via [[[Job]Jobs]] for order sync |
| `HandleRecurringExternalIssues` | Service (**exported**) | Called from AccountObserver when account status changes to deactivate affected [[[Model]RecurringEntity]] records |

---

## Purchases Module
| Used | Type | Purpose |
|---|---|---|
| `PurchaseBill` | Model | Dashboard metrics |
| `BillReturn` | Model | Dashboard metrics |
| `Expense` | Model | Dashboard metrics |
| `Supplier` | Model | Integration sync target |
| `SyncingIntegratedSuppliersService` | Service | Called from [[[Service]IntegrationServices]] |

---

## Products Module
| Used | Type | Purpose |
|---|---|---|
| `CostCenter` | Model | Integration cost-center mapping |
| `CostCenterIntegrationsRepository` | Repository | Saves integration branch → cost-center mappings |
| `SyncingIntegratedBranchesService` | Service | Called from [[[Service]IntegrationServices]] |

---

## Inventory Module
| Used | Type | Purpose |
|---|---|---|
| [[Inventory/[Model]Warehouse\|[Model]Warehouse]] | Model | Dashboard warehouse status check |
| [[Inventory/[Enum]Enums\|[Enum]Enums]] `WarehouseStatusEnum` | Enum | Warehouse status values |

---

## Settings Module
| Used | Type | Purpose |
|---|---|---|
| [[Settings/[Model]FiscalYear\|[Model]FiscalYear]] | Model | Dashboard + recurring entity date context |
| [[Settings/[Model]Tax\|[Model]Tax]] | Model | Dashboard tax displays |
| [[Settings/[Model]FormDesign\|[Model]FormDesign]] | Model | Email template layouts |
| [[Settings/[Service]FiscalYearServices\|[Service]FiscalYearServices]] `RetrievingCurrentFinancialYearService` | Service | Fiscal year context in recurring generation |
| [[Settings/[Service]SettingsServices\|[Service]SettingsServices]] `RetrievingSettingsService` | Service | General settings for dashboard |
| [[Settings/[Service]FormDesignServices\|[Service]FormDesignServices]] `RetrievingFormDesignByFormTypeService` | Service | Email/PDF form designs |

---

## Reports Module
| Used | Type | Purpose |
|---|---|---|
| `IncomeStatementService` | Service | Called by [[[Service]DashboardServices#IncomeStatementChartService]] |
| `IncomeStatementRequestEntity` | DTO | Request entity for income statement |

---

## Tenant Module
| Used | Type | Purpose |
|---|---|---|
| `Website` | Model | Subdomain/tenant lookup |
| `CompanyInfo` | Model | Stores `total_users`, `inactive_users` (updated by [[[Observer]Observers#UserObserver]]) |
| `ActiveSubscription` | Model | Feature limit enforcement |
| `RetrievingTenantBySubdomainService` | Service | Re-establishes tenant context in async [[[Job]Jobs]] |
| `FeatureNameEnum` | Enum | Feature flag keys for subscription checks |
| `PackagesFeaturesEnum` | Enum | Package-level feature flags |

---

## VomPay Module
| Used | Type | Purpose |
|---|---|---|
| `NotifySupplierApprovalContentGenerator` | Notification | Content for supplier approval notifications |
| `NotifySupplierRejectionContentGenerator` | Notification | Content for supplier rejection notifications |

---

## SuperAdmin Module
| Used | Type | Purpose |
|---|---|---|
| `NetPromoterScoreController` | Controller | NPS score endpoint embedded in startup guidance |
| `LoginPromotionContent` | Model | Login page promotions |

---

## HR Module
| Used | Type | Purpose |
|---|---|---|
| [[[Model]Employee]] | Model | `EmployeesRepository` used in payroll creation |
| [[[Model]PayrollEntry]] | Model | HR payroll entries reference [[CompanyUser]] `User` as `created_by` |
| [[[Service]PayrollServices]] | Service | Creates JEs; calls back into Accounting |

---

## Attachments Module
| Used | Type | Purpose |
|---|---|---|
| [[[Model]GeneralAttachment]] | Model | `added_by` and `deleted_by` link back to [[[Model]User]] |
| [[[Service]AttachmentServices]] `AttachingFileToModelService` | Service | Used to attach staged files to Invoices / Bills / Expenses |

---

## App (Core)
| Used | Type | Purpose |
|---|---|---|
| `TenantBaseController` | Base class | All web controllers extend this |
| `SendingEmailService` | Service | All transactional emails |
| `ConvertingEncodedStringsToFileService` | Service | Base64 → file conversion for API uploads |
| `MobileNumberFormatTrait` | Trait | [[[Model]User]] mobile formatting |
| `FormatDateAndTimeTrait` | Trait | Date formatting in jobs |
| `GenerateRecurringInvoiceTrait` | Trait | Shared with Sales module |
| `GenerateRecurringJournalEntryTrait` | Trait | Shared with Accounting module |
