From 6c37cc277f12849437a2a600a05f5ba513fa6a81 Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Sat, 16 Aug 2025 18:29:33 +0000 Subject: [PATCH 1/2] Apply patch [skip ci] --- AGENTS.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..bc0bfed --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,45 @@ + +- When creating new controllers, always first check the Controllers/Implementations directory to see if one exists. If not, use the Python script `python generate_controllers.py` in the LaundrySystem.Api directory to generate standardized controllers that inherit from BaseController. +- When creating new services, always first check the Services/Interfaces and Services/Implementations directories. If not found, use the Python script `python generate_bll_files.py` in the LaundrySystem.BLL directory to generate both interface and implementation files that follow the IBaseService pattern. +- When creating new repositories, always first check the Repos/Interfaces and Repos/Implementations directories. If not found, use the Python script `python generate_repos.py` in the LaundrySystem.DAL directory to generate both interface and implementation files that inherit from BaseRepo. +- All entities must use Guid as the primary key type and follow the naming convention: Entity -> EntityModel -> IEntityService -> EntityService -> IEntityRepo -> EntityRepo. +- Always wrap service responses in ServiceResponse objects to maintain consistent API responses. +- When adding new entities, ensure you create corresponding Model classes in the Domain.Model project and configure Mapster mappings in MappingConfig.cs. +- Register all new services and repositories in ServiceCollectionExtensions.cs following the existing scoped lifetime pattern. +- Use async/await patterns consistently across all layers (repositories, services, and controllers). +- Enable nullable reference types and handle null values appropriately throughout the codebase. +- Generate XML documentation for all public APIs by setting GenerateDocumentationFile to true in project files. + + + +- **LaundrySystem.Api**: ASP.NET Core Web API project containing controllers, mappings, and application startup configuration. Controllers inherit from BaseController and are organized in Base/ and Implementations/ directories. +- **LaundrySystem.BLL**: Business Logic Layer containing services, email/SMS integrations, and dependency injection configuration. Services follow the IBaseService pattern and are organized in Base/, Interfaces/, and Implementations/ directories. +- **LaundrySystem.DAL**: Data Access Layer containing Entity Framework DbContext, repositories, migrations, and entity configurations. Repositories inherit from BaseRepo and are organized in Base/, Interfaces/, and Implementations/ directories. +- **LaundrySystem.Domain.Model**: Contains domain entities, models (DTOs), enums, responses, and value objects. Entities represent database tables while Models represent API contracts. +- **Test Projects**: LaundrySystem.BLL.Tests, LaundrySystem.DAL.Tests, and LaundrySystem.Base.Tests contain unit tests using NUnit framework. +- **Python Scripts**: Code generation scripts located in each project directory (generate_controllers.py, generate_bll_files.py, generate_repos.py) for creating standardized boilerplate code. +- **Media Directory**: Contains static files and documentation assets. + + + +- Requires .NET 8.0 SDK for development and runtime. +- Uses NuGet Package Manager for dependency management - run `dotnet restore` at solution level to install all packages. +- Database: SQL Server with Entity Framework Core - connection string configured in appsettings.json. +- External Services: Twilio for SMS (configure in appsettings.json Twilio section) and Brevo/SendGrid for email (configure API keys). +- Key packages: Entity Framework Core, ASP.NET Core Identity, Mapster for object mapping, JWT Bearer authentication, Swagger/OpenAPI. +- Run `dotnet build` to build the entire solution or `dotnet run --project LaundrySystem.Api` to start the API. + + + +- Uses NUnit testing framework with NUnit3TestAdapter for test execution. +- Test projects follow naming convention: [ProjectName].Tests (e.g., LaundrySystem.BLL.Tests). +- Run tests using `dotnet test` command at solution level or target specific test projects. +- Tests should cover business logic in BLL layer and data access logic in DAL layer. +- Use coverlet.collector for code coverage analysis. +- Test classes should use [SetUp] and [Test] attributes following NUnit conventions. +- Mock external dependencies and database contexts for unit testing. +- Integration tests should use separate test database configurations. + + + + From 8896e1505473b688a1b8d762c21a4f8bc9efb63a Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Sat, 16 Aug 2025 18:31:14 +0000 Subject: [PATCH 2/2] Empty commit to trigger CI