PHPackages                             azaharizaman/nexus-period - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. azaharizaman/nexus-period

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

azaharizaman/nexus-period
=========================

Nexus Period Management Package - Framework-agnostic fiscal period management

v0.1.0-alpha1(2mo ago)024MITPHPPHP ^8.3

Since May 5Pushed 2mo agoCompare

[ Source](https://github.com/azaharizaman/nexus-period)[ Packagist](https://packagist.org/packages/azaharizaman/nexus-period)[ RSS](/packages/azaharizaman-nexus-period/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (4)

Nexus\\Period
=============

[](#nexusperiod)

Framework-agnostic fiscal period management package for the Nexus ERP system.

Purpose
-------

[](#purpose)

The Period package manages fiscal periods for various business processes (Accounting, Inventory, Payroll, Manufacturing). It ensures that transactions can only be posted to open periods and provides period lifecycle management (Pending → Open → Closed → Locked).

Key Features
------------

[](#key-features)

- **Multiple Period Types**: Independent period management for Accounting, Inventory, Payroll, Manufacturing
- **Period Lifecycle**: Pending → Open → Closed → Locked with validation
- **Transaction Validation**: Fast period validation (&lt;5ms) for every transaction
- **Audit Trail**: Comprehensive logging of period status changes
- **Year-End Close**: Automated year-end closing with reconciliation support

Architecture
------------

[](#architecture)

### Contracts (Interfaces)

[](#contracts-interfaces)

- `PeriodManagerInterface` - Main service contract for period operations
- `PeriodInterface` - Period entity contract
- `PeriodRepositoryInterface` - Persistence contract
- `PeriodValidatorInterface` - Validation logic contract
- `PeriodAuditLoggerInterface` - Audit logging contract

### Enums

[](#enums)

- `PeriodType` - Accounting, Inventory, Payroll, Manufacturing
- `PeriodStatus` - Pending, Open, Closed, Locked

### Value Objects

[](#value-objects)

- `PeriodDateRange` - Immutable start/end date range with validation
- `PeriodMetadata` - Name, description, fiscal year information
- `FiscalYear` - Fiscal year with start/end dates

Usage Example
-------------

[](#usage-example)

```
use Nexus\Period\Services\PeriodManager;
use Nexus\Period\Enums\PeriodType;

// Check if posting is allowed for a specific date
$canPost = $periodManager->isPostingAllowed(
    new \DateTimeImmutable('2024-11-15'),
    PeriodType::Accounting
);

// Close the current accounting period
$periodManager->closePeriod(
    $periodId,
    'Monthly close for October 2024',
    $userId
);

// Lock a closed period (prevents any further changes)
$periodManager->lockPeriod(
    $periodId,
    'Year-end finalization',
    $userId
);

// Lock all periods in a fiscal year
$lockedCount = $periodManager->lockFiscalYear(
    '2024',
    PeriodType::Accounting,
    'Annual audit completed',
    $userId
);

// Get all periods for a fiscal year
$periods = $periodManager->getPeriodsForFiscalYear('2024', PeriodType::Accounting);

// Unlock a locked period (exceptional case, requires special authorization)
$periodManager->unlockPeriod(
    $periodId,
    'Audit adjustment required',
    $userId
);

// Get the currently open period
$openPeriod = $periodManager->getOpenPeriod(PeriodType::Accounting);
```

Integration
-----------

[](#integration)

This package is consumed by:

- `Nexus\Finance` - for journal entry validation
- `Nexus\Accounting` - for financial statement period management
- `Nexus\Inventory` - for stock movement validation
- `Nexus\Payroll` - for payroll posting validation
- `Nexus\Manufacturing` - for production order validation

Performance Requirements
------------------------

[](#performance-requirements)

- Period posting validation: &lt; 5ms (critical path for all transactions)
- Get open period query: &lt; 10ms with proper caching
- Period status change: &lt; 50ms including audit logging
- List periods for fiscal year: &lt; 100ms
- Bulk period creation (12 periods): &lt; 500ms

📖 Documentation
---------------

[](#-documentation)

### Package Documentation

[](#package-documentation)

- [Getting Started Guide](docs/getting-started.md)
- [API Reference](docs/api-reference.md)
- [Integration Guide](docs/integration-guide.md)
- [Examples](docs/examples/)

### Additional Resources

[](#additional-resources)

- `IMPLEMENTATION_SUMMARY.md` - Implementation progress
- `REQUIREMENTS.md` - Requirements
- `TEST_SUITE_SUMMARY.md` - Tests
- `VALUATION_MATRIX.md` - Valuation

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance84

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 76.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

81d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/117408?v=4)[Azahari Zaman](/maintainers/azaharizaman)[@azaharizaman](https://github.com/azaharizaman)

---

Top Contributors

[![azaharizaman](https://avatars.githubusercontent.com/u/117408?v=4)](https://github.com/azaharizaman "azaharizaman (461 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (139 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

### Embed Badge

![Health badge](/badges/azaharizaman-nexus-period/health.svg)

```
[![Health](https://phpackages.com/badges/azaharizaman-nexus-period/health.svg)](https://phpackages.com/packages/azaharizaman-nexus-period)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
