How vkumar0303/-schoolerp-accounting works
Purpose and Solution Shape
SchoolERP is an early-stage .NET school ERP focused on a double-entry accounting module. The implemented core is a domain-driven accounting model with Entity Framework Core persistence; API, application, contracts, and UI projects are present but largely scaffolding. The solution root is SchoolERP.slnx.
Runtime Entry Points
Two executable hosts exist:
• ASP.NET Core API: src/SchoolERP.Api/Program.cs, configured through src/SchoolERP.Api/appsettings.json.
• Blazor web host: src/SchoolERP.Web/Program.cs, with root routing/UI in src/SchoolERP.Web/Components/App.razor and src/SchoolERP.Web/Components/Routes.razor.
The web project currently contains template pages and layout rather than accounting workflows. The API’s exposed endpoint surface cannot be inferred beyond its host bootstrap.
Accounting Domain Core
The authoritative business layer is src/SchoolERP.Domain/Accounting. It models organizational scope and chart-of-accounts hierarchy:
• Organization and branch ownership: Organization.cs, Branch.cs.
• Account classification and balances: LedgerAccount.cs, AccountGroup.cs, AccountType.cs.
• A proposed school-specific seed chart: DefaultSchoolChartOfAccounts.cs.
Domain entities inherit shared identity/error primitives in src/SchoolERP.Domain/Shared/Entity.cs and DomainException.cs, keeping accounting invariant enforcement independent of transport and database concerns.
Financial Calendar and Posting Lifecycle
Financial control is represented by fiscal years and accounting periods:
• FinancialYear.cs and FinancialYearStatus.cs
• AccountingPeriod.cs and AccountingPeriodStatus.cs
Transaction processing centers on vouchers and journal entries:
• Source/approval-facing voucher lifecycle: Voucher.cs, VoucherStatus.cs, VoucherType.cs.
• Double-entry representation and lifecycle: JournalEntry.cs, JournalEntryLine.cs, JournalEntryStatus.cs.
• Posting and reversal orchestration: AccountingPostingService.cs, AccountingReversalService.cs.
The intended control flow is voucher/journal creation → validation of accounts, balances, period/year status, and entry state → posting via the domain service → reversal through a dedicated domain service rather than editing posted records.
Persistence Boundary
SchoolERP.Infrastructure owns the EF Core boundary. src/SchoolERP.Infrastructure/Persistence/SchoolErpDbContext.cs maps domain entities to relational storage, while the per-aggregate configurations under Persistence/Configurations define schema and relationships. SchoolErpDbContextFactory.cs supports design-time context creation.
The initial durable schema is captured in:
• src/SchoolERP.Infrastructure/Migrations/20260805083641_InitialAccountingPersistence.cs
• src/SchoolERP.Infrastructure/Migrations/SchoolErpDbContextModelSnapshot.cs
Database provider and connection details are not visible from the supplied tree; configuration is expected to come from host appsettings files.
Application and Contract Boundary
src/SchoolERP.Application and src/SchoolERP.Contracts establish intended boundaries for use cases and transport DTOs, but each currently has only Class1.cs. Consequently, hosts should not yet depend on a mature application-command/query layer; the concrete implemented behavior resides in the domain and infrastructure projects.
Legacy Discovery and Migration Context
Repository-root reports and scripts support discovery of legacy financial data rather than runtime operation. Key artifacts include sql/legacy_financial_discovery.sql, financial_data_source_map.md, receipt_reconciliation_report.md, and the accounting migration proposal in docs/legacy_accounting_mapping_proposal.md. Python scripts such as process_schema.py and generate_reports.py appear to profile and document source data for future migration planning.
Infrastructure and External Dependencies
Material runtime technologies are .NET/ASP.NET Core, Blazor, and EF Core migrations. No deployed infrastructure, identity provider, messaging system, payment gateway, or external SaaS integration is evidenced in the tree. Bootstrap is bundled under src/SchoolERP.Web/wwwroot/lib/bootstrap for the web host’s presentation layer.
Main entry points: SchoolErpDbContext.cs EF Core DbContext · AccountingPostingService.cs Posting service · Accounting Accounting model · JournalEntry.cs Journal entries
Components 19
Executable Hosts
- ASP.NET Core API · Endpoint surface is not yet defined.
src/SchoolERP.Api/Program.cs - API settings
src/SchoolERP.Api/appsettings.json - Blazor web host · Currently serves template UI rather than accounting workflows.
src/SchoolERP.Web/Program.cs - Blazor routes and UI
src/SchoolERP.Web/Components/Routes.razor
Accounting Domain
- Domain primitives · Entity identity and domain exception primitives.
src/SchoolERP.Domain/Shared/Entity.cs - Accounting model · Organizations, branches, chart hierarchy, and account balances.
src/SchoolERP.Domain/Accounting - Default school chart
src/SchoolERP.Domain/Accounting/DefaultSchoolChartOfAccounts.cs - Financial calendar · Fiscal-year and accounting-period status controls.
src/SchoolERP.Domain/Accounting/FinancialYear.cs - Voucher lifecycle · Source and approval-facing voucher state.
src/SchoolERP.Domain/Accounting/Voucher.cs - Journal entries · Journal headers, lines, and entry state.
src/SchoolERP.Domain/Accounting/JournalEntry.cs - Posting service · Validates and posts balanced entries in open periods.
src/SchoolERP.Domain/Accounting/AccountingPostingService.cs - Reversal service · Reverses posted records without editing them.
src/SchoolERP.Domain/Accounting/AccountingReversalService.cs
Persistence
- EF Core DbContext · Maps accounting aggregates to relational storage.
src/SchoolERP.Infrastructure/Persistence/SchoolErpDbContext.cs - Entity mappings · Per-aggregate schema and relationship mappings.
src/SchoolERP.Infrastructure/Persistence/Configurations - Initial accounting schema
src/SchoolERP.Infrastructure/Migrations/20260805083641_InitialAccountingPersistence.cs
Legacy Discovery
- Legacy financial discovery · Profiles legacy financial source data for migration planning.
sql/legacy_financial_discovery.sql - Accounting mapping proposal
docs/legacy_accounting_mapping_proposal.md
Other components
- Application layer · No implemented use-case layer yet.
src/SchoolERP.Application/Class1.cs - Contracts layer · No implemented transport DTOs yet.
src/SchoolERP.Contracts/Class1.cs
Connections 17
- API settings → ASP.NET Core API: configures
- Blazor web host → Blazor routes and UI: serves
- Accounting model → Domain primitives: inherits primitives
- Default school chart → Accounting model: seeds
- Voucher lifecycle → Journal entries: creates journal entries
- Posting service → Voucher lifecycle: processes
- Posting service → Journal entries: posts
- Posting service → Accounting model: validates accounts
- Posting service → Financial calendar: checks period status
- Reversal service → Journal entries: reverses
- EF Core DbContext → Accounting model: persists
- EF Core DbContext → Financial calendar: persists
- EF Core DbContext → Voucher lifecycle: persists
- EF Core DbContext → Journal entries: persists
- Entity mappings → EF Core DbContext: configures
- Initial accounting schema → EF Core DbContext: captures schema
- Legacy financial discovery → Accounting mapping proposal: informs