Tax Management System is a .NET 8 Web API that manages tax invoices and related documents. It follows Clean Architecture with CQRS (MediatR) and Entity Framework Core for data access.
- Domain: Entities, events, aggregates, value objects.
- Application: CQRS commands/queries and DTOs.
- Infrastructure: EF Core DbContext, handlers, migrations.
- Presentation: ASP.NET Core API controllers and startup.
Tax/
├── Domain/Tax.Domain/ # Core domain model
├── Application/Tax.Application/# Use-cases (CQRS)
├── Infrastructure/Tax.Infrastructure/ # Data + handlers
└── Presentation/Tax.Api/Tax.Api/ # API host/controllers
- .NET 8.0
- Entity Framework Core 9.0.3 (SQL Server)
- MediatR 12.5.0 (CQRS)
- Swagger / OpenAPI
- .NET 8 SDK
- SQL Server (LocalDB/Express/full)
- IDE: Visual Studio 2022 or VS Code
- Clone
git clone <repository-url>
cd Tax- Configure DB connection in
Presentation/Tax.Api/Tax.Api/appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=TaxDb;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}- Apply migrations
cd Infrastructure/Tax.Infrastructure
dotnet ef database update- Build
dotnet build- Run
cd Presentation/Tax.Api/Tax.Api
dotnet runSwagger is available at https://localhost:5001/swagger.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/taxitems |
Get paginated tax items |
| POST | /api/taxitems/{id}/confirm |
Confirm a tax item |
Example:
GET /api/taxitems?pageNumber=1&pageSize=10- Add migration:
cd Infrastructure/Tax.Infrastructure
dotnet ef migrations add <MigrationName> --startup-project ../../Presentation/Tax.Api/Tax.Api- Project references:
- Tax.Application → Tax.Domain
- Tax.Infrastructure → Tax.Domain, Tax.Application
- Tax.Api → Tax.Application, Tax.Infrastructure
- MIT License.
- Contributions welcome via PR.
- For questions/support, open an issue.
سیستم مدیریت امور مالیاتی یک Web API بر پایه .NET 8 است که صورتحسابهای مالیاتی و اسناد مرتبط را مدیریت میکند. ساختار پروژه بر مبنای Clean Architecture و الگوی CQRS (با MediatR) و دسترسی به دادهها با Entity Framework Core است.
- Domain: موجودیتها، رویدادها، Aggregateها، Value Objectها
- Application: دستورات/پرسوجوهای CQRS و DTOها
- Infrastructure: DbContext، هندلرها و مایگریشنها
- Presentation: کنترلرهای ASP.NET Core و پیکربندی اجرا
Tax/
├── Domain/Tax.Domain/ # مدل دامنه
├── Application/Tax.Application/ # موارد استفاده (CQRS)
├── Infrastructure/Tax.Infrastructure/ # داده و هندلرها
└── Presentation/Tax.Api/Tax.Api/ # میزبان API / کنترلرها
- .NET 8.0
- Entity Framework Core 9.0.3 (SQL Server)
- MediatR 12.5.0 (CQRS)
- Swagger / OpenAPI
- .NET 8 SDK
- SQL Server (LocalDB/Express/نسخه کامل)
- محیط توسعه: Visual Studio 2022 یا VS Code
- کلون
git clone <repository-url>
cd Tax- تنظیم اتصال دیتابیس در
Presentation/Tax.Api/Tax.Api/appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=TaxDb;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}- اجرای مایگریشن
cd Infrastructure/Tax.Infrastructure
dotnet ef database update- بیلد
dotnet build- اجرا
cd Presentation/Tax.Api/Tax.Api
dotnet runSwagger در https://localhost:5001/swagger در دسترس است.
| متد | مسیر | توضیح |
|---|---|---|
| GET | /api/taxitems |
دریافت آیتمهای مالیاتی صفحهبندیشده |
| POST | /api/taxitems/{id}/confirm |
تأیید یک آیتم مالیاتی |
نمونه:
GET /api/taxitems?pageNumber=1&pageSize=10- افزودن مایگریشن:
cd Infrastructure/Tax.Infrastructure
dotnet ef migrations add <MigrationName> --startup-project ../../Presentation/Tax.Api/Tax.Api- وابستگی پروژهها:
- Tax.Application → Tax.Domain
- Tax.Infrastructure → Tax.Domain، Tax.Application
- Tax.Api → Tax.Application، Tax.Infrastructure
- مجوز MIT.
- مشارکت از طریق Pull Request پذیرفته میشود.
- برای سوال یا پشتیبانی، لطفاً یک Issue ثبت کنید.