---
tags: [accounting, middleware]
module: Accounting
---

# Middleware

## Connections
[[_Accounting]] · [[[Model]JournalEntry]] · [[[Controller]JournalEntryController]] · [[[Controller]AssetController]] · [[[Model]Account]] · [[[Cross]CrossModuleDependencies]]

## Source
`Modules/Accounting/Http/Middleware/`

## CheckManualEntryLocking
**Alias**: `check-manual-entry-locking`
**Purpose**: Prevents concurrent write operations on manual journal entries (distributed lock)
**Applied to**: POST/PUT/DELETE journal entry routes, account status change

## UnLockManualEntryOperation
**Alias**: `unlock-manual-entry-operation`
**Purpose**: Releases the lock after the operation completes (always runs, even on exception)
**Applied to**: Same routes as CheckManualEntryLocking (paired)

## PreventManualCreatedBySystem
**Alias**: `prevent-manual-created-by-system`
**Purpose**: Rejects edit/delete attempts on [[[Model]JournalEntry]] records that were auto-created by the system (integrations, payroll, etc.)
**Applied to**: `journal-entries/{entry}/edit`

## PreventManualThatHasInactiveAccounts
**Alias**: `prevent-manual-that-has-inactive-accounts`
**Purpose**: Rejects edits to JEs that reference deactivated [[[Model]Account]] records
**Applied to**: `journal-entries/{entry}/edit`

## RestrictAssetsToUnlimitedPackage
**Alias**: `restrict-assets-with-unlimited-package`
**Purpose**: Returns 403 if the tenant subscription does not include the assets feature ([[[Cross]CrossModuleDependencies#Tenant]])
**Applied to**: Asset create/store routes
