Skip to content

daneshgar/Tax

Repository files navigation

Tax Management System | سیستم مدیریت امور مالیاتی

English | فارسی


English

📋 Overview

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.

🏗️ Architecture at a Glance

  • 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.

📁 Project Structure

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

🔧 Tech Stack

  • .NET 8.0
  • Entity Framework Core 9.0.3 (SQL Server)
  • MediatR 12.5.0 (CQRS)
  • Swagger / OpenAPI

📦 Prerequisites

🚀 Quick Start

  1. Clone
git clone <repository-url>
cd Tax
  1. Configure DB connection in Presentation/Tax.Api/Tax.Api/appsettings.json:
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=TaxDb;Trusted_Connection=True;MultipleActiveResultSets=true"
  }
}
  1. Apply migrations
cd Infrastructure/Tax.Infrastructure
dotnet ef database update
  1. Build
dotnet build
  1. Run
cd Presentation/Tax.Api/Tax.Api
dotnet run

Swagger is available at https://localhost:5001/swagger.

📡 API (current)

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

🧪 Development Notes

  • 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

📝 License | 🤝 Contributing | 📧 Contact

  • 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

🚀 شروع سریع

  1. کلون
git clone <repository-url>
cd Tax
  1. تنظیم اتصال دیتابیس در Presentation/Tax.Api/Tax.Api/appsettings.json:
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=TaxDb;Trusted_Connection=True;MultipleActiveResultSets=true"
  }
}
  1. اجرای مایگریشن
cd Infrastructure/Tax.Infrastructure
dotnet ef database update
  1. بیلد
dotnet build
  1. اجرا
cd Presentation/Tax.Api/Tax.Api
dotnet run

Swagger در https://localhost:5001/swagger در دسترس است.

📡 API فعلی

متد مسیر توضیح
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 ثبت کنید.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages