server cleanup

This commit is contained in:
hamid
2026-06-16 01:46:53 +03:30
parent 69bbd28bb0
commit 5b4c0d183f
205 changed files with 641 additions and 628 deletions
+2 -2
View File
@@ -32,9 +32,9 @@ There is **no root-level build** — each project is built and run on its own. `
cd client && npm install && npm run dev # http://localhost:3000
# Backend
cd server && dotnet run --project src/API/CleanArc.Web.Api/CleanArc.Web.Api.csproj # https://localhost:5002/swagger
cd server && dotnet run --project src/API/Baya.Web.Api/Baya.Web.Api.csproj # https://localhost:5002/swagger
```
## Naming note
The server's C# namespaces and solution file still use the `CleanArc*` prefix (e.g. `CleanArc.Web.Api`, `CleanArcTemplate.sln`). This is the internal project naming and is **not** template branding — do not mass-rename it unless explicitly asked, as it touches every file, the `.sln`, and EF migrations.
The server's C# namespaces, projects, and solution file all use the `Baya*` prefix (e.g. `Baya.Web.Api`, `Baya.sln`). Keep new server code under the same `Baya.*` namespace convention.
+1 -1
View File
@@ -16,7 +16,7 @@ NEXT_PUBLIC_DEBUG = true
NEXT_PUBLIC_PUBLIC_URL = http://localhost:3000
# API/Backend basic URL (the CleanArc server)
# API/Backend basic URL (the Baya server)
NEXT_PUBLIC_API_URL = https://localhost:5002
# NEXT_PUBLIC_API_URL = https://dev-api.domain.com
# NEXT_PUBLIC_API_URL = https://api.domain.com
+1 -1
View File
@@ -339,4 +339,4 @@ ASALocalRun/
# BeatPulse healthcheck temp database
healthchecksdb
/nuget.exe
/src/API/CleanArc.Web.Api/logs/log.json
/src/API/Baya.Web.Api/logs/log.json
+24 -24
View File
@@ -17,37 +17,37 @@ Agent-oriented guide to the backend. For human setup/run instructions see [READM
| Task | Command |
| ---------- | --------------------------------------------------------------------------------- |
| Restore | `dotnet restore CleanArcTemplate.sln` |
| Build | `dotnet build CleanArcTemplate.sln` |
| Run API | `dotnet run --project src/API/CleanArc.Web.Api/CleanArc.Web.Api.csproj` |
| Test | `dotnet test CleanArcTemplate.sln` |
| Add migration | `dotnet ef migrations add <Name> --project src/Infrastructure/CleanArc.Infrastructure.Persistence --startup-project src/API/CleanArc.Web.Api` |
| Restore | `dotnet restore Baya.sln` |
| Build | `dotnet build Baya.sln` |
| Run API | `dotnet run --project src/API/Baya.Web.Api/Baya.Web.Api.csproj` |
| Test | `dotnet test Baya.sln` |
| Add migration | `dotnet ef migrations add <Name> --project src/Infrastructure/Baya.Infrastructure.Persistence --startup-project src/API/Baya.Web.Api` |
**Startup project:** `src/API/CleanArc.Web.Api`. Default URL `https://localhost:5002`, Swagger at `/swagger`. On boot the app applies EF migrations and seeds default users (`Program.cs``ApplyMigrationsAsync()` / `SeedDefaultUsersAsync()`), so a reachable DB is required.
**Startup project:** `src/API/Baya.Web.Api`. Default URL `https://localhost:5002`, Swagger at `/swagger`. On boot the app applies EF migrations and seeds default users (`Program.cs``ApplyMigrationsAsync()` / `SeedDefaultUsersAsync()`), so a reachable DB is required.
## Projects by layer
```
src/
├── Core/
│ ├── CleanArc.Domain Entities (User, Order, Role...), BaseEntity, IEntity, ITimeModification
│ └── CleanArc.Application CQRS Features/, Contracts/ (interfaces), Models/, MediatR pipeline (Common/)
│ ├── Baya.Domain Entities (User, Order, Role...), BaseEntity, IEntity, ITimeModification
│ └── Baya.Application CQRS Features/, Contracts/ (interfaces), Models/, MediatR pipeline (Common/)
├── Infrastructure/
│ ├── CleanArc.Infrastructure.Persistence ApplicationDbContext, Configuration/, Repositories/, Migrations/
│ ├── CleanArc.Infrastructure.Identity Jwt/, Identity/ (Managers, Stores, PermissionManager, Seed), ServiceConfiguration/
│ ├── CleanArc.Infrastructure.CrossCutting Logging (Serilog)
│ └── CleanArc.Infrastructure.Monitoring HealthCheck / OpenTelemetry / Prometheus configs
│ ├── Baya.Infrastructure.Persistence ApplicationDbContext, Configuration/, Repositories/, Migrations/
│ ├── Baya.Infrastructure.Identity Jwt/, Identity/ (Managers, Stores, PermissionManager, Seed), ServiceConfiguration/
│ ├── Baya.Infrastructure.CrossCutting Logging (Serilog)
│ └── Baya.Infrastructure.Monitoring HealthCheck / OpenTelemetry / Prometheus configs
├── API/
│ ├── CleanArc.Web.Api Program.cs, Controllers/V1/, appsettings*.json
│ ├── CleanArc.WebFramework BaseController, Filters/, Middlewares/, Swagger/, Attributes/
│ └── Plugins/CleanArc.Web.Plugins.Grpc GrpcPluginStartup, Services/, ProtoModels/
├── Shared/CleanArc.SharedKernel Extensions + validation base used by all layers
└── Tests/ CleanArc.Tests.Setup + CleanArc.Test.Infrastructure.Identity
│ ├── Baya.Web.Api Program.cs, Controllers/V1/, appsettings*.json
│ ├── Baya.WebFramework BaseController, Filters/, Middlewares/, Swagger/, Attributes/
│ └── Plugins/Baya.Web.Plugins.Grpc GrpcPluginStartup, Services/, ProtoModels/
├── Shared/Baya.SharedKernel Extensions + validation base used by all layers
└── Tests/ Baya.Tests.Setup + Baya.Test.Infrastructure.Identity
```
Dependency direction points **inward**: Domain depends on nothing; Application depends on Domain; Infrastructure and API implement/consume Application's contracts. Never make Domain or Application reference Infrastructure or the API.
## Startup wiring — `src/API/CleanArc.Web.Api/Program.cs`
## Startup wiring — `src/API/Baya.Web.Api/Program.cs`
Service registration is composed from per-layer extension methods (in each project's `ServiceConfiguration`):
@@ -67,7 +67,7 @@ When adding infrastructure, expose it as an extension method and call it here ra
## CQRS — how a feature is shaped
Features live under `CleanArc.Application/Features/<Area>/{Commands|Queries}/<Name>/`. A query example (`Features/Order/Queries/GetAllOrders/`):
Features live under `Baya.Application/Features/<Area>/{Commands|Queries}/<Name>/`. A query example (`Features/Order/Queries/GetAllOrders/`):
- `GetAllOrdersQuery.cs``record ... : IRequest<OperationResult<...>>`
- `GetAllOrdersQueryHandler.cs``internal` handler; depends on `IUnitOfWork`, `IMapper`; returns `OperationResult<T>`
@@ -79,26 +79,26 @@ Commands additionally implement `IValidatableModel<T>` and declare FluentValidat
## Controllers & results
- Controllers live in `CleanArc.Web.Api/Controllers/V1/` and inherit `BaseController` (`CleanArc.WebFramework/BaseController/BaseController.cs`), which exposes `UserId`/`UserName`/etc. from claims and maps `OperationResult<T>``IActionResult`.
- Controllers live in `Baya.Web.Api/Controllers/V1/` and inherit `BaseController` (`Baya.WebFramework/BaseController/BaseController.cs`), which exposes `UserId`/`UserName`/etc. from claims and maps `OperationResult<T>``IActionResult`.
- All responses are wrapped in `OperationResult<T>` (`Application/Models/Common/`): `Result`, `IsSuccess`, `ErrorMessages`, `IsNotFound`, `IsException`. Use the factory methods (`SuccessResult`, `FailureResult`, `NotFoundResult`).
- Protected endpoints use `[Authorize(ConstantPolicies.DynamicPermission)]`.
## Persistence
- `ApplicationDbContext` (`CleanArc.Infrastructure.Persistence/ApplicationDbContext.cs`) extends `IdentityDbContext<...>`; it auto-registers `IEntity` types and applies all `IEntityTypeConfiguration` from the assembly.
- `ApplicationDbContext` (`Baya.Infrastructure.Persistence/ApplicationDbContext.cs`) extends `IdentityDbContext<...>`; it auto-registers `IEntity` types and applies all `IEntityTypeConfiguration` from the assembly.
- Per-entity config in `Configuration/<Area>Config/`. Repositories in `Repositories/` derive from `BaseAsyncRepository<T>`; expose them through `IUnitOfWork` (interface in `Application/Contracts/Persistence/`). Commit via `unitOfWork.CommitAsync()`.
- Migrations in `Migrations/`. Add new ones with the `dotnet ef` command above.
## Identity & auth
- Token service: `CleanArc.Infrastructure.Identity/Jwt/JwtService.cs` (`IJwtService`) — issues JWE (HMAC-SHA256 signed, AES-128 encrypted), refresh tokens, and OTP/phone-based tokens.
- Token service: `Baya.Infrastructure.Identity/Jwt/JwtService.cs` (`IJwtService`) — issues JWE (HMAC-SHA256 signed, AES-128 encrypted), refresh tokens, and OTP/phone-based tokens.
- Custom Identity managers/stores under `Identity/Manager/` and `Identity/Store/`.
- Dynamic permissions: `Identity/PermissionManager/` (`DynamicPermissionService`, `DynamicPermissionHandler`, `ConstantPolicies`).
- Settings from `appsettings.json``IdentitySettings` (`SecretKey`, `Encryptkey` = 16 chars, `Issuer`, `Audience`, lifetimes).
## gRPC plugin
`Plugins/CleanArc.Web.Plugins.Grpc` is a self-contained module mounted via Application Parts. `GrpcPluginStartup.cs` provides `ConfigureGrpcPluginServices()` / `ConfigureGrpcPipeline()` (called from `Program.cs`). Proto contracts in `ProtoModels/*.proto`, services in `Services/`. The host uses HTTP/2 (`Kestrel` config) for gRPC.
`Plugins/Baya.Web.Plugins.Grpc` is a self-contained module mounted via Application Parts. `GrpcPluginStartup.cs` provides `ConfigureGrpcPluginServices()` / `ConfigureGrpcPipeline()` (called from `Program.cs`). Proto contracts in `ProtoModels/*.proto`, services in `Services/`. The host uses HTTP/2 (`Kestrel` config) for gRPC.
## Conventions
@@ -106,4 +106,4 @@ Commands additionally implement `IValidatableModel<T>` and declare FluentValidat
- Keep handlers `internal`; return `OperationResult<T>`; don't throw for expected failures (use `FailureResult`/`NotFoundResult`).
- Use Mapster for entity↔DTO mapping; FluentValidation for input validation.
- Centralize package versions in `Directory.Packages.props` (no inline `Version=` in `.csproj`).
- The `CleanArc*` namespace/`.sln` naming is internal project naming, **not** template branding — don't rename it without an explicit request (it touches every file and the EF migrations).
- The `Baya*` namespace/`.sln` naming is internal project naming, **not** template branding — don't rename it without an explicit request (it touches every file and the EF migrations).
+12 -12
View File
@@ -15,35 +15,35 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{DF0CD4
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{542840FF-B0CC-4F8A-9F6E-1898BE0573D7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArc.SharedKernel", "src\Shared\CleanArc.SharedKernel\CleanArc.SharedKernel.csproj", "{56C4DDD2-4F8C-4D35-85D4-CC9064C52398}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Baya.SharedKernel", "src\Shared\Baya.SharedKernel\Baya.SharedKernel.csproj", "{56C4DDD2-4F8C-4D35-85D4-CC9064C52398}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArc.Infrastructure.CrossCutting", "src\Infrastructure\CleanArc.Infrastructure.CrossCutting\CleanArc.Infrastructure.CrossCutting.csproj", "{09E81356-0531-42A0-9F7F-00C495F1226E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Baya.Infrastructure.CrossCutting", "src\Infrastructure\Baya.Infrastructure.CrossCutting\Baya.Infrastructure.CrossCutting.csproj", "{09E81356-0531-42A0-9F7F-00C495F1226E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArc.Infrastructure.Identity", "src\Infrastructure\CleanArc.Infrastructure.Identity\CleanArc.Infrastructure.Identity.csproj", "{3AFD5AAD-8DCD-44D6-86B9-078FBE8F2A1F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Baya.Infrastructure.Identity", "src\Infrastructure\Baya.Infrastructure.Identity\Baya.Infrastructure.Identity.csproj", "{3AFD5AAD-8DCD-44D6-86B9-078FBE8F2A1F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArc.Infrastructure.Persistence", "src\Infrastructure\CleanArc.Infrastructure.Persistence\CleanArc.Infrastructure.Persistence.csproj", "{9F3B3E49-3E3C-4244-AE88-D209B18B28B8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Baya.Infrastructure.Persistence", "src\Infrastructure\Baya.Infrastructure.Persistence\Baya.Infrastructure.Persistence.csproj", "{9F3B3E49-3E3C-4244-AE88-D209B18B28B8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArc.Application", "src\Core\CleanArc.Application\CleanArc.Application.csproj", "{9C0BCB6F-614C-4FA9-83A2-E95834E3C153}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Baya.Application", "src\Core\Baya.Application\Baya.Application.csproj", "{9C0BCB6F-614C-4FA9-83A2-E95834E3C153}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArc.Domain", "src\Core\CleanArc.Domain\CleanArc.Domain.csproj", "{DC49CD3F-840E-4634-B9DA-595F160E9499}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Baya.Domain", "src\Core\Baya.Domain\Baya.Domain.csproj", "{DC49CD3F-840E-4634-B9DA-595F160E9499}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArc.Web.Plugins.Grpc", "src\API\Plugins\CleanArc.Web.Plugins.Grpc\CleanArc.Web.Plugins.Grpc.csproj", "{8F7135E8-68C9-4DA8-AA06-04518EBB403B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Baya.Web.Plugins.Grpc", "src\API\Plugins\Baya.Web.Plugins.Grpc\Baya.Web.Plugins.Grpc.csproj", "{8F7135E8-68C9-4DA8-AA06-04518EBB403B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArc.Web.Api", "src\API\CleanArc.Web.Api\CleanArc.Web.Api.csproj", "{BE13FF32-B8D5-4AE7-B173-6CA96040B788}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Baya.Web.Api", "src\API\Baya.Web.Api\Baya.Web.Api.csproj", "{BE13FF32-B8D5-4AE7-B173-6CA96040B788}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CleanArc.WebFramework", "src\API\CleanArc.WebFramework\CleanArc.WebFramework.csproj", "{44DD0A96-BA65-476E-BC59-C8D2CFA703B9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Baya.WebFramework", "src\API\Baya.WebFramework\Baya.WebFramework.csproj", "{44DD0A96-BA65-476E-BC59-C8D2CFA703B9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{77986571-8153-4120-AD08-36729310A56B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BaseSetup", "BaseSetup", "{34B1F72E-A991-4705-ACC5-08E65E46D26E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanArc.Tests.Setup", "src\Tests\CleanArc.Tests.Setup\CleanArc.Tests.Setup.csproj", "{33AF382A-9E22-42F0-82E5-4F78BCFD40C1}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Baya.Tests.Setup", "src\Tests\Baya.Tests.Setup\Baya.Tests.Setup.csproj", "{33AF382A-9E22-42F0-82E5-4F78BCFD40C1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Infrastructure", "Infrastructure", "{45FA88C0-9986-40E5-A2E2-7742302518D2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanArc.Test.Infrastructure.Identity", "src\Tests\CleanArc.Test.Infrastructure.Identity\CleanArc.Test.Infrastructure.Identity\CleanArc.Test.Infrastructure.Identity.csproj", "{54203B4F-3CE8-4EBA-B5E2-F7C985FACE60}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Baya.Test.Infrastructure.Identity", "src\Tests\Baya.Test.Infrastructure.Identity\Baya.Test.Infrastructure.Identity\Baya.Test.Infrastructure.Identity.csproj", "{54203B4F-3CE8-4EBA-B5E2-F7C985FACE60}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanArc.Infrastructure.Monitoring", "src\Infrastructure\CleanArc.Infrastructure.Monitoring\CleanArc.Infrastructure.Monitoring.csproj", "{7699705C-2C15-467F-957D-4C5EBE4FD92E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Baya.Infrastructure.Monitoring", "src\Infrastructure\Baya.Infrastructure.Monitoring\Baya.Infrastructure.Monitoring.csproj", "{7699705C-2C15-467F-957D-4C5EBE4FD92E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{704FAE1E-F0D2-468E-8B3D-E9E6F323ABE8}"
ProjectSection(SolutionItems) = preProject
+17 -17
View File
@@ -8,29 +8,29 @@ EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY ["../Directory.Packages.props", "./"]
COPY ["src/API/CleanArc.Web.Api/CleanArc.Web.Api.csproj", "src/API/CleanArc.Web.Api/"]
COPY ["src/API/CleanArc.WebFramework/CleanArc.WebFramework.csproj", "src/API/CleanArc.WebFramework/"]
COPY ["src/API/Plugins/CleanArc.Web.Plugins.Grpc/CleanArc.Web.Plugins.Grpc.csproj", "src/API/Plugins/CleanArc.Web.Plugins.Grpc/"]
COPY ["src/Core/CleanArc.Application/CleanArc.Application.csproj", "src/Core/CleanArc.Application/"]
COPY ["src/Core/CleanArc.Domain/CleanArc.Domain.csproj", "src/Core/CleanArc.Domain/"]
COPY ["src/Infrastructure/CleanArc.Infrastructure.CrossCutting/CleanArc.Infrastructure.CrossCutting.csproj", "src/Infrastructure/CleanArc.Infrastructure.CrossCutting/"]
COPY ["src/Infrastructure/CleanArc.Infrastructure.Identity/CleanArc.Infrastructure.Identity.csproj", "src/Infrastructure/CleanArc.Infrastructure.Identity/"]
COPY ["src/Infrastructure/CleanArc.Infrastructure.Persistence/CleanArc.Infrastructure.Persistence.csproj", "src/Infrastructure/CleanArc.Infrastructure.Persistence/"]
COPY ["src/Infrastructure/CleanArc.Infrastructure.Monitoring/CleanArc.Infrastructure.Monitoring.csproj", "src/Infrastructure/CleanArc.Infrastructure.Monitoring/"]
COPY ["src/Shared/CleanArc.SharedKernel/CleanArc.SharedKernel.csproj", "src/Shared/CleanArc.SharedKernel/"]
COPY ["src/Tests/CleanArc.Test.Infrastructure.Identity/CleanArc.Test.Infrastructure.Identity/CleanArc.Test.Infrastructure.Identity.csproj", "src/Tests/CleanArc.Test.Infrastructure.Identity/CleanArc.Test.Infrastructure.Identity/"]
COPY ["src/Tests/CleanArc.Tests.Setup/CleanArc.Tests.Setup.csproj", "src/Tests/CleanArc.Tests.Setup/"]
COPY ["src/API/Baya.Web.Api/Baya.Web.Api.csproj", "src/API/Baya.Web.Api/"]
COPY ["src/API/Baya.WebFramework/Baya.WebFramework.csproj", "src/API/Baya.WebFramework/"]
COPY ["src/API/Plugins/Baya.Web.Plugins.Grpc/Baya.Web.Plugins.Grpc.csproj", "src/API/Plugins/Baya.Web.Plugins.Grpc/"]
COPY ["src/Core/Baya.Application/Baya.Application.csproj", "src/Core/Baya.Application/"]
COPY ["src/Core/Baya.Domain/Baya.Domain.csproj", "src/Core/Baya.Domain/"]
COPY ["src/Infrastructure/Baya.Infrastructure.CrossCutting/Baya.Infrastructure.CrossCutting.csproj", "src/Infrastructure/Baya.Infrastructure.CrossCutting/"]
COPY ["src/Infrastructure/Baya.Infrastructure.Identity/Baya.Infrastructure.Identity.csproj", "src/Infrastructure/Baya.Infrastructure.Identity/"]
COPY ["src/Infrastructure/Baya.Infrastructure.Persistence/Baya.Infrastructure.Persistence.csproj", "src/Infrastructure/Baya.Infrastructure.Persistence/"]
COPY ["src/Infrastructure/Baya.Infrastructure.Monitoring/Baya.Infrastructure.Monitoring.csproj", "src/Infrastructure/Baya.Infrastructure.Monitoring/"]
COPY ["src/Shared/Baya.SharedKernel/Baya.SharedKernel.csproj", "src/Shared/Baya.SharedKernel/"]
COPY ["src/Tests/Baya.Test.Infrastructure.Identity/Baya.Test.Infrastructure.Identity/Baya.Test.Infrastructure.Identity.csproj", "src/Tests/Baya.Test.Infrastructure.Identity/Baya.Test.Infrastructure.Identity/"]
COPY ["src/Tests/Baya.Tests.Setup/Baya.Tests.Setup.csproj", "src/Tests/Baya.Tests.Setup/"]
RUN dotnet restore "src/API/CleanArc.Web.Api/CleanArc.Web.Api.csproj"
RUN dotnet restore "src/API/Baya.Web.Api/Baya.Web.Api.csproj"
COPY . .
WORKDIR "src/API/CleanArc.Web.Api"
RUN dotnet build "CleanArc.Web.Api.csproj" -c Release -o /app/build
WORKDIR "src/API/Baya.Web.Api"
RUN dotnet build "Baya.Web.Api.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "CleanArc.Web.Api.csproj" -c Release -o /app/publish /p:UseAppHost=false --no-restore
RUN dotnet publish "Baya.Web.Api.csproj" -c Release -o /app/publish /p:UseAppHost=false --no-restore
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "CleanArc.Web.Api.dll"]
ENTRYPOINT ["dotnet", "Baya.Web.Api.dll"]
+18 -18
View File
@@ -21,9 +21,9 @@ Backend API for the Balinyaar application. It is an **ASP.NET Core (.NET 10)** s
From the `server/` folder:
```bash
dotnet restore CleanArcTemplate.sln
dotnet build CleanArcTemplate.sln
dotnet run --project src/API/CleanArc.Web.Api/CleanArc.Web.Api.csproj
dotnet restore Baya.sln
dotnet build Baya.sln
dotnet run --project src/API/Baya.Web.Api/Baya.Web.Api.csproj
```
By default the API listens on **https://localhost:5002** and serves Swagger UI at **/swagger**.
@@ -32,7 +32,7 @@ On startup the app **applies EF Core migrations** and **seeds default users** au
### Configuration
Settings live in `src/API/CleanArc.Web.Api/appsettings.json` (+ `appsettings.Development.json`):
Settings live in `src/API/Baya.Web.Api/appsettings.json` (+ `appsettings.Development.json`):
- `ConnectionStrings:SqlServer` — main application database
- `ConnectionStrings:logDb` — Serilog SQL sink database
@@ -43,14 +43,14 @@ Settings live in `src/API/CleanArc.Web.Api/appsettings.json` (+ `appsettings.Dev
Generate a development HTTPS certificate (used by the container):
```bash
dotnet dev-certs https -ep $env:USERPROFILE/.aspnet/https/cleanarc.pfx -p Strong@Password
dotnet dev-certs https -ep $env:USERPROFILE/.aspnet/https/baya.pfx -p Strong@Password
dotnet dev-certs https --trust
```
Build and start the API together with SQL Server 2022:
```bash
docker build -t balinyaar-server -f Dockerfile .
docker build -t bobby-baya -f Dockerfile .
docker-compose up -d
```
@@ -61,19 +61,19 @@ The compose stack exposes the API on `http://localhost:5000` / `https://localhos
```
src/
├── Core/
│ ├── CleanArc.Domain Entities + domain primitives (the core / "brain")
│ └── CleanArc.Application CQRS features, contracts (interfaces), MediatR pipeline
│ ├── Baya.Domain Entities + domain primitives (the core / "brain")
│ └── Baya.Application CQRS features, contracts (interfaces), MediatR pipeline
├── Infrastructure/
│ ├── CleanArc.Infrastructure.Persistence EF Core DbContext, configs, repositories, UoW, migrations
│ ├── CleanArc.Infrastructure.Identity Identity, JWE/JWT, OTP, dynamic permissions
│ ├── CleanArc.Infrastructure.CrossCutting Cross-cutting concerns (logging)
│ └── CleanArc.Infrastructure.Monitoring Health checks, OpenTelemetry, Prometheus
│ ├── Baya.Infrastructure.Persistence EF Core DbContext, configs, repositories, UoW, migrations
│ ├── Baya.Infrastructure.Identity Identity, JWE/JWT, OTP, dynamic permissions
│ ├── Baya.Infrastructure.CrossCutting Cross-cutting concerns (logging)
│ └── Baya.Infrastructure.Monitoring Health checks, OpenTelemetry, Prometheus
├── API/
│ ├── CleanArc.Web.Api Presentation: REST controllers, Program.cs (startup)
│ ├── CleanArc.WebFramework Reusable web config: base controller, filters, middleware, Swagger
│ └── Plugins/CleanArc.Web.Plugins.Grpc Self-contained gRPC plugin
│ ├── Baya.Web.Api Presentation: REST controllers, Program.cs (startup)
│ ├── Baya.WebFramework Reusable web config: base controller, filters, middleware, Swagger
│ └── Plugins/Baya.Web.Plugins.Grpc Self-contained gRPC plugin
├── Shared/
│ └── CleanArc.SharedKernel Shared extensions/helpers referenced by every layer
│ └── Baya.SharedKernel Shared extensions/helpers referenced by every layer
└── Tests/ xUnit test setup + Identity tests
```
@@ -111,10 +111,10 @@ A standalone module that adds gRPC endpoints to the same host via **Application
## Tests
```bash
dotnet test CleanArcTemplate.sln
dotnet test Baya.sln
```
Each layer is designed to be testable in isolation; `CleanArc.Tests.Setup` provides the shared test scaffolding.
Each layer is designed to be testable in isolation; `Baya.Tests.Setup` provides the shared test scaffolding.
## License
+3 -3
View File
@@ -1,12 +1,12 @@
version: "3.9" # optional since v1.27.0
services:
web_api:
image: bobby-cleanarc
container_name: bobby-cleanarc-app
image: bobby-baya
container_name: bobby-baya-app
environment:
"ASPNETCORE_URLS": "https://+;http://+"
"ASPNETCORE_Kestrel__Certificates__Default__Password": "Strong@Password"
"ASPNETCORE_Kestrel__Certificates__Default__Path": "/https/cleanarc.pfx"
"ASPNETCORE_Kestrel__Certificates__Default__Path": "/https/baya.pfx"
ports:
- "5000:80"
- "5001:443"
@@ -18,9 +18,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Infrastructure\CleanArc.Infrastructure.Monitoring\CleanArc.Infrastructure.Monitoring.csproj" />
<ProjectReference Include="..\CleanArc.WebFramework\CleanArc.WebFramework.csproj" />
<ProjectReference Include="..\Plugins\CleanArc.Web.Plugins.Grpc\CleanArc.Web.Plugins.Grpc.csproj" />
<ProjectReference Include="..\..\Infrastructure\Baya.Infrastructure.Monitoring\Baya.Infrastructure.Monitoring.csproj" />
<ProjectReference Include="..\Baya.WebFramework\Baya.WebFramework.csproj" />
<ProjectReference Include="..\Plugins\Baya.Web.Plugins.Grpc\Baya.Web.Plugins.Grpc.csproj" />
</ItemGroup>
</Project>
@@ -1,14 +1,14 @@
using Asp.Versioning;
using CleanArc.Application.Features.Admin.Commands.AddAdminCommand;
using CleanArc.Application.Features.Admin.Queries.GetToken;
using CleanArc.Application.Models.Jwt;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using Baya.Application.Features.Admin.Commands.AddAdminCommand;
using Baya.Application.Features.Admin.Queries.GetToken;
using Baya.Application.Models.Jwt;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Mediator;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.Web.Api.Controllers.V1.Admin
namespace Baya.Web.Api.Controllers.V1.Admin
{
[ApiVersion("1")]
[ApiController]
@@ -1,14 +1,14 @@
using CleanArc.Infrastructure.Identity.Identity.PermissionManager;
using Baya.Infrastructure.Identity.Identity.PermissionManager;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using Asp.Versioning;
using CleanArc.Application.Features.Order.Queries.GetAllOrders;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using Baya.Application.Features.Order.Queries.GetAllOrders;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Mediator;
namespace CleanArc.Web.Api.Controllers.V1.Admin
namespace Baya.Web.Api.Controllers.V1.Admin
{
[ApiVersion("1")]
[ApiController]
@@ -1,17 +1,17 @@
using System.ComponentModel.DataAnnotations;
using Asp.Versioning;
using CleanArc.Application.Features.Role.Commands.AddRoleCommand;
using CleanArc.Application.Features.Role.Commands.UpdateRoleClaimsCommand;
using CleanArc.Application.Features.Role.Queries.GetAllRolesQuery;
using CleanArc.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
using CleanArc.Infrastructure.Identity.Identity.PermissionManager;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using Baya.Application.Features.Role.Commands.AddRoleCommand;
using Baya.Application.Features.Role.Commands.UpdateRoleClaimsCommand;
using Baya.Application.Features.Role.Queries.GetAllRolesQuery;
using Baya.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
using Baya.Infrastructure.Identity.Identity.PermissionManager;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Mediator;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.Web.Api.Controllers.V1.Admin
namespace Baya.Web.Api.Controllers.V1.Admin
{
[ApiVersion("1")]
[ApiController]
@@ -1,14 +1,14 @@
using CleanArc.Infrastructure.Identity.Identity.PermissionManager;
using Baya.Infrastructure.Identity.Identity.PermissionManager;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using Asp.Versioning;
using CleanArc.Application.Features.Users.Queries.GetUsers;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using Baya.Application.Features.Users.Queries.GetUsers;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Mediator;
namespace CleanArc.Web.Api.Controllers.V1.Admin
namespace Baya.Web.Api.Controllers.V1.Admin
{
[ApiVersion("1")]
[ApiController]
@@ -1,13 +1,13 @@
using Asp.Versioning;
using CleanArc.Application.Features.Order.Commands;
using CleanArc.Application.Features.Order.Queries.GetUserOrders;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using Baya.Application.Features.Order.Commands;
using Baya.Application.Features.Order.Queries.GetUserOrders;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Mediator;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.Web.Api.Controllers.V1.Order;
namespace Baya.Web.Api.Controllers.V1.Order;
[ApiVersion("1")]
[ApiController]
@@ -1,20 +1,20 @@
using Asp.Versioning;
using CleanArc.Application.Features.Users.Commands.Create;
using CleanArc.Application.Features.Users.Commands.RefreshUserTokenCommand;
using CleanArc.Application.Features.Users.Commands.RequestLogout;
using CleanArc.Application.Features.Users.Queries.GenerateUserToken;
using CleanArc.Application.Features.Users.Queries.TokenRequest;
using CleanArc.Application.Models.Jwt;
using CleanArc.WebFramework.Attributes;
using CleanArc.WebFramework.BaseController;
using CleanArc.WebFramework.Swagger;
using Baya.Application.Features.Users.Commands.Create;
using Baya.Application.Features.Users.Commands.RefreshUserTokenCommand;
using Baya.Application.Features.Users.Commands.RequestLogout;
using Baya.Application.Features.Users.Queries.GenerateUserToken;
using Baya.Application.Features.Users.Queries.TokenRequest;
using Baya.Application.Models.Jwt;
using Baya.WebFramework.Attributes;
using Baya.WebFramework.BaseController;
using Baya.WebFramework.Swagger;
using Mediator;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.Web.Api.Controllers.V1.UserManagement;
namespace Baya.Web.Api.Controllers.V1.UserManagement;
[ApiVersion("1")]
[ApiController]
@@ -1,22 +1,22 @@
using System.Diagnostics;
using CleanArc.Application.Features.Users.Commands.Create;
using CleanArc.Application.Models.ApiResult;
using CleanArc.Application.Models.Identity;
using CleanArc.Application.ServiceConfiguration;
using CleanArc.Domain.Entities.User;
using CleanArc.Infrastructure.CrossCutting.Logging;
using CleanArc.Infrastructure.Identity.Identity.Dtos;
using CleanArc.Infrastructure.Identity.Jwt;
using CleanArc.Infrastructure.Identity.ServiceConfiguration;
using CleanArc.Infrastructure.Monitoring.Configurations;
using CleanArc.Infrastructure.Persistence.ServiceConfiguration;
using CleanArc.SharedKernel.Extensions;
using CleanArc.Web.Api.Controllers.V1.UserManagement;
using CleanArc.Web.Plugins.Grpc;
using CleanArc.WebFramework.Filters;
using CleanArc.WebFramework.Middlewares;
using CleanArc.WebFramework.ServiceConfiguration;
using CleanArc.WebFramework.Swagger;
using Baya.Application.Features.Users.Commands.Create;
using Baya.Application.Models.ApiResult;
using Baya.Application.Models.Identity;
using Baya.Application.ServiceConfiguration;
using Baya.Domain.Entities.User;
using Baya.Infrastructure.CrossCutting.Logging;
using Baya.Infrastructure.Identity.Identity.Dtos;
using Baya.Infrastructure.Identity.Jwt;
using Baya.Infrastructure.Identity.ServiceConfiguration;
using Baya.Infrastructure.Monitoring.Configurations;
using Baya.Infrastructure.Persistence.ServiceConfiguration;
using Baya.SharedKernel.Extensions;
using Baya.Web.Api.Controllers.V1.UserManagement;
using Baya.Web.Plugins.Grpc;
using Baya.WebFramework.Filters;
using Baya.WebFramework.Middlewares;
using Baya.WebFramework.ServiceConfiguration;
using Baya.WebFramework.Swagger;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using Serilog;
@@ -1,6 +1,6 @@
{
"ConnectionStrings": {
"SqlServer": "Data Source=localhost;Initial Catalog=CleanArc_DB_8_0;Integrated Security=true;Encrypt=False"
"SqlServer": "Data Source=localhost;Initial Catalog=Baya_DB_8_0;Integrated Security=true;Encrypt=False"
},
"Logging": {
"LogLevel": {
@@ -1,7 +1,7 @@
{
"ConnectionStrings": {
"SqlServer": "Server=sql_server2022;Database=CleanArc_DB_Docker;User Id=SA;Password=A&VeryComplex123Password;MultipleActiveResultSets=true;encrypt=false",
"logDb": "Server=sql_server2022;Database=CleanArc_Log_DB_Docker;User Id=SA;Password=A&VeryComplex123Password;MultipleActiveResultSets=true;encrypt=false"
"SqlServer": "Server=sql_server2022;Database=Baya_DB_Docker;User Id=SA;Password=A&VeryComplex123Password;MultipleActiveResultSets=true;encrypt=false",
"logDb": "Server=sql_server2022;Database=Baya_Log_DB_Docker;User Id=SA;Password=A&VeryComplex123Password;MultipleActiveResultSets=true;encrypt=false"
},
"IdentitySettings": {
"SecretKey": "ShouldBe-LongerThan-16Char-SecretKey",
@@ -1,8 +1,8 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.WebFramework.Attributes;
namespace Baya.WebFramework.Attributes;
/// <summary>
/// Documents the 200 OK response type of endpoint as ApiResult
@@ -1,10 +1,10 @@
using System.Security.Claims;
using CleanArc.Application.Models.Common;
using CleanArc.SharedKernel.Extensions;
using CleanArc.WebFramework.Filters;
using Baya.Application.Models.Common;
using Baya.SharedKernel.Extensions;
using Baya.WebFramework.Filters;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.WebFramework.BaseController;
namespace Baya.WebFramework.BaseController;
public class BaseController : ControllerBase
{
@@ -14,10 +14,10 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\CleanArc.Application\CleanArc.Application.csproj" />
<ProjectReference Include="..\..\Infrastructure\CleanArc.Infrastructure.CrossCutting\CleanArc.Infrastructure.CrossCutting.csproj" />
<ProjectReference Include="..\..\Infrastructure\CleanArc.Infrastructure.Identity\CleanArc.Infrastructure.Identity.csproj" />
<ProjectReference Include="..\..\Infrastructure\CleanArc.Infrastructure.Persistence\CleanArc.Infrastructure.Persistence.csproj" />
<ProjectReference Include="..\..\Core\Baya.Application\Baya.Application.csproj" />
<ProjectReference Include="..\..\Infrastructure\Baya.Infrastructure.CrossCutting\Baya.Infrastructure.CrossCutting.csproj" />
<ProjectReference Include="..\..\Infrastructure\Baya.Infrastructure.Identity\Baya.Infrastructure.Identity.csproj" />
<ProjectReference Include="..\..\Infrastructure\Baya.Infrastructure.Persistence\Baya.Infrastructure.Persistence.csproj" />
</ItemGroup>
</Project>
@@ -1,7 +1,7 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
namespace CleanArc.WebFramework.EndpointFilters;
namespace Baya.WebFramework.EndpointFilters;
public class BadRequestResultEndpointFilter:IEndpointFilter
{
@@ -1,7 +1,7 @@
using FluentValidation;
using Microsoft.AspNetCore.Http;
namespace CleanArc.WebFramework.EndpointFilters;
namespace Baya.WebFramework.EndpointFilters;
public class ModelStateValidationEndpointFilter:IEndpointFilter
{
@@ -1,7 +1,7 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
namespace CleanArc.WebFramework.EndpointFilters;
namespace Baya.WebFramework.EndpointFilters;
public class NotFoundResultEndpointFilter:IEndpointFilter
{
@@ -1,7 +1,7 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
namespace CleanArc.WebFramework.EndpointFilters;
namespace Baya.WebFramework.EndpointFilters;
public class OkResultEndpointFilter:IEndpointFilter
{
@@ -1,9 +1,9 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
[Obsolete(message:"Separated filters added")]
public class ApiResultFilterAttribute : ResultFilterAttribute
@@ -1,10 +1,10 @@
using CleanArc.Application.Models.ApiResult;
using CleanArc.SharedKernel.Extensions;
using Baya.Application.Models.ApiResult;
using Baya.SharedKernel.Extensions;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class BadRequestResultFilterAttribute : ActionFilterAttribute
{
@@ -1,8 +1,8 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class ContentResultFilterAttribute : ResultFilterAttribute
{
@@ -1,11 +1,11 @@
using CleanArc.Application.Models.ApiResult;
using CleanArc.SharedKernel.Extensions;
using Baya.Application.Models.ApiResult;
using Baya.SharedKernel.Extensions;
using FluentValidation;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using StatusCodes = Microsoft.AspNetCore.Http.StatusCodes;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class ModelStateValidationAttribute : ActionFilterAttribute
{
@@ -1,9 +1,9 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class NotFoundResultAttribute : ResultFilterAttribute
{
@@ -1,8 +1,8 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class OkResultAttribute:ResultFilterAttribute
{
@@ -1,8 +1,8 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace CleanArc.WebFramework.Filters;
namespace Baya.WebFramework.Filters;
public class ServerErrorResult:IActionResult
{
@@ -1,12 +1,12 @@
using CleanArc.Application.Models.ApiResult;
using Baya.Application.Models.ApiResult;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Http;
using CleanArc.SharedKernel.Extensions;
using Baya.SharedKernel.Extensions;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace CleanArc.WebFramework.Middlewares;
namespace Baya.WebFramework.Middlewares;
public class ExceptionHandler(ILogger<ExceptionHandler> logger,IWebHostEnvironment environment) : IExceptionHandler
{
@@ -1,7 +1,7 @@
using Asp.Versioning;
using Microsoft.Extensions.DependencyInjection;
namespace CleanArc.WebFramework.ServiceConfiguration;
namespace Baya.WebFramework.ServiceConfiguration;
public static class ServiceCollectionExtension
{
@@ -1,8 +1,8 @@
using CleanArc.SharedKernel.Extensions;
using Baya.SharedKernel.Extensions;
using NSwag.Generation.Processors;
using NSwag.Generation.Processors.Contexts;
namespace CleanArc.WebFramework.Swagger;
namespace Baya.WebFramework.Swagger;
public class ApiVersionDocumentProcessor: IDocumentProcessor
{
@@ -3,7 +3,7 @@ using NSwag.Generation.Processors.Contexts;
using Pluralize.NET;
namespace CleanArc.WebFramework.Swagger;
namespace Baya.WebFramework.Swagger;
public class ApplySummariesOperationFilter : IOperationProcessor
{
@@ -3,7 +3,7 @@ using NSwag.Generation.Processors;
using NSwag.Generation.Processors.Contexts;
namespace CleanArc.WebFramework.Swagger;
namespace Baya.WebFramework.Swagger;
public class CustomTokenRequiredOperationFilter : IOperationProcessor
{
@@ -1,4 +1,4 @@
namespace CleanArc.WebFramework.Swagger;
namespace Baya.WebFramework.Swagger;
/// <summary>
@@ -4,7 +4,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using NSwag;
namespace CleanArc.WebFramework.Swagger;
namespace Baya.WebFramework.Swagger;
public static class SwaggerConfigurationExtensions
{
@@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Core\CleanArc.Application\CleanArc.Application.csproj" />
<ProjectReference Include="..\..\..\Core\Baya.Application\Baya.Application.csproj" />
</ItemGroup>
<ItemGroup>
@@ -1,9 +1,9 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using CleanArc.Web.Plugins.Grpc.Services;
using Baya.Web.Plugins.Grpc.Services;
namespace CleanArc.Web.Plugins.Grpc;
namespace Baya.Web.Plugins.Grpc;
public static class GrpcPluginStartup
{
@@ -1,6 +1,6 @@
syntax = "proto3";
option csharp_namespace = "CleanArc.Web.Plugins.Grpc.ProtoModels";
option csharp_namespace = "Baya.Web.Plugins.Grpc.ProtoModels";
import "google/protobuf/empty.proto";
package GrpcOrderController;
@@ -1,7 +1,7 @@

syntax = "proto3";
option csharp_namespace = "CleanArc.Web.Plugins.Grpc.ProtoModels";
option csharp_namespace = "Baya.Web.Plugins.Grpc.ProtoModels";
package GrpcUserController;
@@ -1,12 +1,12 @@
using CleanArc.Application.Features.Order.Queries.GetUserOrders;
using CleanArc.SharedKernel.Extensions;
using CleanArc.Web.Plugins.Grpc.ProtoModels;
using Baya.Application.Features.Order.Queries.GetUserOrders;
using Baya.SharedKernel.Extensions;
using Baya.Web.Plugins.Grpc.ProtoModels;
using Google.Protobuf.WellKnownTypes;
using Grpc.Core;
using Mediator;
using Microsoft.AspNetCore.Authorization;
namespace CleanArc.Web.Plugins.Grpc.Services
namespace Baya.Web.Plugins.Grpc.Services
{
[Authorize]
public class OrderGrpcServices:OrderServices.OrderServicesBase
@@ -1,10 +1,10 @@
using CleanArc.Application.Features.Users.Queries.GenerateUserToken;
using CleanArc.Application.Features.Users.Queries.TokenRequest;
using CleanArc.Web.Plugins.Grpc.ProtoModels;
using Baya.Application.Features.Users.Queries.GenerateUserToken;
using Baya.Application.Features.Users.Queries.TokenRequest;
using Baya.Web.Plugins.Grpc.ProtoModels;
using Grpc.Core;
using Mediator;
namespace CleanArc.Web.Plugins.Grpc.Services;
namespace Baya.Web.Plugins.Grpc.Services;
public class UserGrpcServices : UserServices.UserServicesBase
{
@@ -11,7 +11,7 @@
<None Remove="Common\ValidationBase\**" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CleanArc.Domain\CleanArc.Domain.csproj" />
<ProjectReference Include="..\Baya.Domain\Baya.Domain.csproj" />
<PackageReference Include="Mediator.SourceGenerator">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
@@ -1,8 +1,8 @@
using CleanArc.Application.Models.Common;
using Baya.Application.Models.Common;
using Mediator;
using Microsoft.Extensions.Logging;
namespace CleanArc.Application.Common;
namespace Baya.Application.Common;
public class LoggingBehavior<TRequest, TResponse>(ILogger<LoggingBehavior<TRequest, TResponse>> logger)
: IPipelineBehavior<TRequest, TResponse>
@@ -2,7 +2,7 @@
using System.Diagnostics.Metrics;
using Mediator;
namespace CleanArc.Application.Common;
namespace Baya.Application.Common;
public class MetricsBehaviour<TRequest, TResponse> :
IPipelineBehavior<TRequest, TResponse> where TRequest : IRequest<TResponse>
@@ -1,9 +1,9 @@
using CleanArc.Application.Models.Common;
using Baya.Application.Models.Common;
using FluentValidation;
using FluentValidation.Results;
using Mediator;
namespace CleanArc.Application.Common;
namespace Baya.Application.Common;
public class ValidateCommandBehavior<TRequest, TResponse>(IEnumerable<IValidator<TRequest>> validators)
: IPipelineBehavior<TRequest, TResponse>
@@ -1,8 +1,8 @@
using System.Security.Claims;
using CleanArc.Application.Models.Jwt;
using CleanArc.Domain.Entities.User;
using Baya.Application.Models.Jwt;
using Baya.Domain.Entities.User;
namespace CleanArc.Application.Contracts;
namespace Baya.Application.Contracts;
public interface IJwtService
{
@@ -1,7 +1,7 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.AspNetCore.Identity;
namespace CleanArc.Application.Contracts.Identity;
namespace Baya.Application.Contracts.Identity;
public interface IAppUserManager
{
@@ -1,8 +1,8 @@
using CleanArc.Application.Models.Identity;
using CleanArc.Domain.Entities.User;
using Baya.Application.Models.Identity;
using Baya.Domain.Entities.User;
using Microsoft.AspNetCore.Identity;
namespace CleanArc.Application.Contracts.Identity;
namespace Baya.Application.Contracts.Identity;
public interface IRoleManagerService
{
@@ -1,6 +1,6 @@
using CleanArc.Domain.Entities.Order;
using Baya.Domain.Entities.Order;
namespace CleanArc.Application.Contracts.Persistence;
namespace Baya.Application.Contracts.Persistence;
public interface IOrderRepository
{
@@ -1,4 +1,4 @@
namespace CleanArc.Application.Contracts.Persistence;
namespace Baya.Application.Contracts.Persistence;
public interface IUnitOfWork
{
@@ -1,6 +1,6 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
namespace CleanArc.Application.Contracts.Persistence;
namespace Baya.Application.Contracts.Persistence;
public interface IUserRefreshTokenRepository
{
@@ -1,10 +1,10 @@
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using CleanArc.Domain.Entities.User;
using CleanArc.SharedKernel.Extensions;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Baya.Domain.Entities.User;
using Baya.SharedKernel.Extensions;
using Mediator;
namespace CleanArc.Application.Features.Admin.Commands.AddAdminCommand
namespace Baya.Application.Features.Admin.Commands.AddAdminCommand
{
internal class AddAdminCommandHandler:IRequestHandler<AddAdminCommand,OperationResult<bool>>
{
@@ -1,10 +1,10 @@
using CleanArc.Application.Models.Common;
using CleanArc.SharedKernel.ValidationBase;
using CleanArc.SharedKernel.ValidationBase.Contracts;
using Baya.Application.Models.Common;
using Baya.SharedKernel.ValidationBase;
using Baya.SharedKernel.ValidationBase.Contracts;
using FluentValidation;
using Mediator;
namespace CleanArc.Application.Features.Admin.Commands.AddAdminCommand;
namespace Baya.Application.Features.Admin.Commands.AddAdminCommand;
public record AddAdminCommand
(string UserName, string Email, string Password, int RoleId) : IRequest<OperationResult<bool>>,
@@ -1,10 +1,10 @@
using CleanArc.Application.Contracts;
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using CleanArc.Application.Models.Jwt;
using Baya.Application.Contracts;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Baya.Application.Models.Jwt;
using Mediator;
namespace CleanArc.Application.Features.Admin.Queries.GetToken;
namespace Baya.Application.Features.Admin.Queries.GetToken;
public class AdminGetTokenQueryHandler:IRequestHandler<AdminGetTokenQuery,OperationResult<AdminGetTokenQueryResult>>
{
@@ -0,0 +1,5 @@
using Baya.Application.Models.Jwt;
namespace Baya.Application.Features.Admin.Queries.GetToken;
public record AdminGetTokenQueryResult(AccessToken Token,string[] Roles);
@@ -1,11 +1,11 @@
using CleanArc.Application.Models.Common;
using CleanArc.Application.Models.Jwt;
using CleanArc.SharedKernel.ValidationBase;
using CleanArc.SharedKernel.ValidationBase.Contracts;
using Baya.Application.Models.Common;
using Baya.Application.Models.Jwt;
using Baya.SharedKernel.ValidationBase;
using Baya.SharedKernel.ValidationBase.Contracts;
using FluentValidation;
using Mediator;
namespace CleanArc.Application.Features.Admin.Queries.GetToken;
namespace Baya.Application.Features.Admin.Queries.GetToken;
public record AdminGetTokenQuery(string UserName, string Password) : IRequest<OperationResult<AdminGetTokenQueryResult>>,
IValidatableModel<AdminGetTokenQuery>
@@ -1,9 +1,9 @@
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Contracts.Persistence;
using CleanArc.Application.Models.Common;
using Baya.Application.Contracts.Identity;
using Baya.Application.Contracts.Persistence;
using Baya.Application.Models.Common;
using Mediator;
namespace CleanArc.Application.Features.Order.Commands;
namespace Baya.Application.Features.Order.Commands;
internal class AddOrderCommandHandler(IUnitOfWork unitOfWork, IAppUserManager userManager)
: IRequestHandler<AddOrderCommand, OperationResult<bool>>
@@ -1,11 +1,11 @@
using System.Text.Json.Serialization;
using CleanArc.Application.Models.Common;
using CleanArc.SharedKernel.ValidationBase;
using CleanArc.SharedKernel.ValidationBase.Contracts;
using Baya.Application.Models.Common;
using Baya.SharedKernel.ValidationBase;
using Baya.SharedKernel.ValidationBase.Contracts;
using FluentValidation;
using Mediator;
namespace CleanArc.Application.Features.Order.Commands;
namespace Baya.Application.Features.Order.Commands;
public record AddOrderCommand( string OrderName) : IRequest<OperationResult<bool>>,
IValidatableModel<AddOrderCommand>
@@ -1,8 +1,8 @@
using CleanArc.Application.Contracts.Persistence;
using CleanArc.Application.Models.Common;
using Baya.Application.Contracts.Persistence;
using Baya.Application.Models.Common;
using Mediator;
namespace CleanArc.Application.Features.Order.Commands;
namespace Baya.Application.Features.Order.Commands;
public class DeleteUserOrdersCommandHandler(IUnitOfWork unitOfWork) : IRequestHandler<DeleteUserOrdersCommand,OperationResult<bool>>
{
@@ -0,0 +1,6 @@
using Baya.Application.Models.Common;
using Mediator;
namespace Baya.Application.Features.Order.Commands;
public record DeleteUserOrdersCommand(int UserId):IRequest<OperationResult<bool>>;
@@ -1,8 +1,8 @@
using CleanArc.Application.Contracts.Persistence;
using CleanArc.Application.Models.Common;
using Baya.Application.Contracts.Persistence;
using Baya.Application.Models.Common;
using Mediator;
namespace CleanArc.Application.Features.Order.Commands;
namespace Baya.Application.Features.Order.Commands;
public class UpdateUserOrderCommandHandler(IUnitOfWork unitOfWork) : IRequestHandler<UpdateUserOrderCommand,OperationResult<bool>>
{
@@ -1,11 +1,11 @@
using System.Text.Json.Serialization;
using CleanArc.Application.Models.Common;
using CleanArc.SharedKernel.ValidationBase;
using CleanArc.SharedKernel.ValidationBase.Contracts;
using Baya.Application.Models.Common;
using Baya.SharedKernel.ValidationBase;
using Baya.SharedKernel.ValidationBase.Contracts;
using FluentValidation;
using Mediator;
namespace CleanArc.Application.Features.Order.Commands;
namespace Baya.Application.Features.Order.Commands;
public record UpdateUserOrderCommand
(int OrderId, string OrderName) : IRequest<OperationResult<bool>>,IValidatableModel<UpdateUserOrderCommand>
@@ -0,0 +1,6 @@
using Baya.Application.Models.Common;
using Mediator;
namespace Baya.Application.Features.Order.Queries.GetAllOrders;
public record GetAllOrdersQuery():IRequest<OperationResult<List<GetAllOrdersQueryResult>>>;
@@ -1,9 +1,9 @@
using CleanArc.Application.Contracts.Persistence;
using CleanArc.Application.Models.Common;
using Baya.Application.Contracts.Persistence;
using Baya.Application.Models.Common;
using MapsterMapper;
using Mediator;
namespace CleanArc.Application.Features.Order.Queries.GetAllOrders
namespace Baya.Application.Features.Order.Queries.GetAllOrders
{
internal class GetAllOrdersQueryHandler(IUnitOfWork unitOfWork, IMapper mapper)
: IRequestHandler<GetAllOrdersQuery, OperationResult<List<GetAllOrdersQueryResult>>>
@@ -2,7 +2,7 @@
using Mapster;
namespace CleanArc.Application.Features.Order.Queries.GetAllOrders;
namespace Baya.Application.Features.Order.Queries.GetAllOrders;
public record GetAllOrdersQueryResult(int OrderId, string OrderName, int OrderOwnerId, string OrderOwnerUserName);
@@ -1,8 +1,8 @@
using CleanArc.Application.Contracts.Persistence;
using CleanArc.Application.Models.Common;
using Baya.Application.Contracts.Persistence;
using Baya.Application.Models.Common;
using Mediator;
namespace CleanArc.Application.Features.Order.Queries.GetUserOrders;
namespace Baya.Application.Features.Order.Queries.GetUserOrders;
internal class GetUserOrdersQueryHandler(IUnitOfWork unitOfWork)
: IRequestHandler<GetUserOrdersQueryModel, OperationResult<List<GetUsersQueryResultModel>>>
@@ -1,6 +1,6 @@
using CleanArc.Application.Models.Common;
using Baya.Application.Models.Common;
using Mediator;
namespace CleanArc.Application.Features.Order.Queries.GetUserOrders;
namespace Baya.Application.Features.Order.Queries.GetUserOrders;
public record GetUserOrdersQueryModel(int UserId) : IRequest<OperationResult<List<GetUsersQueryResultModel>>>;
@@ -0,0 +1,3 @@
namespace Baya.Application.Features.Order.Queries.GetUserOrders;
public record GetUsersQueryResultModel(int OrderId, string OrderName);
@@ -1,9 +1,9 @@
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using CleanArc.Application.Models.Identity;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Baya.Application.Models.Identity;
using Mediator;
namespace CleanArc.Application.Features.Role.Commands.AddRoleCommand
namespace Baya.Application.Features.Role.Commands.AddRoleCommand
{
internal class AddRoleCommandHandler(IRoleManagerService roleManagerService)
: IRequestHandler<AddRoleCommand, OperationResult<bool>>
@@ -1,10 +1,10 @@
using CleanArc.Application.Models.Common;
using CleanArc.SharedKernel.ValidationBase;
using CleanArc.SharedKernel.ValidationBase.Contracts;
using Baya.Application.Models.Common;
using Baya.SharedKernel.ValidationBase;
using Baya.SharedKernel.ValidationBase.Contracts;
using FluentValidation;
using Mediator;
namespace CleanArc.Application.Features.Role.Commands.AddRoleCommand;
namespace Baya.Application.Features.Role.Commands.AddRoleCommand;
public record AddRoleCommand(string RoleName) : IRequest<OperationResult<bool>>,
IValidatableModel<AddRoleCommand>
@@ -1,9 +1,9 @@
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using CleanArc.Application.Models.Identity;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Baya.Application.Models.Identity;
using Mediator;
namespace CleanArc.Application.Features.Role.Commands.UpdateRoleClaimsCommand
namespace Baya.Application.Features.Role.Commands.UpdateRoleClaimsCommand
{
internal class UpdateRoleClaimsCommandHandler(IRoleManagerService roleManagerService)
: IRequestHandler<UpdateRoleClaimsCommand, OperationResult<bool>>
@@ -1,7 +1,7 @@

using CleanArc.Application.Models.Common;
using Baya.Application.Models.Common;
using Mediator;
namespace CleanArc.Application.Features.Role.Commands.UpdateRoleClaimsCommand;
namespace Baya.Application.Features.Role.Commands.UpdateRoleClaimsCommand;
public record UpdateRoleClaimsCommand( int RoleId, List<string> RoleClaimValue):IRequest<OperationResult<bool>>;
@@ -1,8 +1,8 @@
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Mediator;
namespace CleanArc.Application.Features.Role.Queries.GetAllRolesQuery
namespace Baya.Application.Features.Role.Queries.GetAllRolesQuery
{
internal class GetAllRolesQueryHandler(IRoleManagerService roleManagerService)
: IRequestHandler<GetAllRolesQuery, OperationResult<List<GetAllRolesQueryResponse>>>
@@ -0,0 +1,3 @@
namespace Baya.Application.Features.Role.Queries.GetAllRolesQuery;
public record GetAllRolesQueryResponse(int RoleId,string RoleName);
@@ -0,0 +1,6 @@
using Baya.Application.Models.Common;
using Mediator;
namespace Baya.Application.Features.Role.Queries.GetAllRolesQuery;
public record GetAllRolesQuery():IRequest<OperationResult<List<GetAllRolesQueryResponse>>>;
@@ -1,8 +1,8 @@
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Mediator;
namespace CleanArc.Application.Features.Role.Queries.GetAuthorizableRoutesQuery
namespace Baya.Application.Features.Role.Queries.GetAuthorizableRoutesQuery
{
internal class GetAuthorizableRoutesQueryHandler(IRoleManagerService roleManagerService)
: IRequestHandler<GetAuthorizableRoutesQuery, OperationResult<List<GetAuthorizableRoutesQueryResponse>>>
@@ -1,3 +1,3 @@
namespace CleanArc.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
namespace Baya.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
public record GetAuthorizableRoutesQueryResponse(string RouteKey,string AreaName,string ControllerName,string ActionName,string ControllerDescription);
@@ -1,6 +1,6 @@
using CleanArc.Application.Models.Common;
using Baya.Application.Models.Common;
using Mediator;
namespace CleanArc.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
namespace Baya.Application.Features.Role.Queries.GetAuthorizableRoutesQuery;
public record GetAuthorizableRoutesQuery():IRequest<OperationResult<List<GetAuthorizableRoutesQueryResponse>>>;
@@ -1,11 +1,11 @@
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using CleanArc.Domain.Entities.User;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Baya.Domain.Entities.User;
using MapsterMapper;
using Mediator;
using Microsoft.Extensions.Logging;
namespace CleanArc.Application.Features.Users.Commands.Create;
namespace Baya.Application.Features.Users.Commands.Create;
internal class UserCreateCommandHandler(
IAppUserManager userManager,
@@ -1,4 +1,4 @@
namespace CleanArc.Application.Features.Users.Commands.Create;
namespace Baya.Application.Features.Users.Commands.Create;
public class UserCreateCommandResult
{
@@ -1,12 +1,12 @@
using System.Text.RegularExpressions;
using CleanArc.Application.Models.Common;
using CleanArc.Domain.Entities.User;
using CleanArc.SharedKernel.ValidationBase;
using CleanArc.SharedKernel.ValidationBase.Contracts;
using Baya.Application.Models.Common;
using Baya.Domain.Entities.User;
using Baya.SharedKernel.ValidationBase;
using Baya.SharedKernel.ValidationBase.Contracts;
using FluentValidation;
using Mediator;
namespace CleanArc.Application.Features.Users.Commands.Create;
namespace Baya.Application.Features.Users.Commands.Create;
public record UserCreateCommand
(string UserName, string Name, string FamilyName, string PhoneNumber,string Password,string RepeatPassword)
@@ -1,9 +1,9 @@
using CleanArc.Application.Contracts;
using CleanArc.Application.Models.Common;
using CleanArc.Application.Models.Jwt;
using Baya.Application.Contracts;
using Baya.Application.Models.Common;
using Baya.Application.Models.Jwt;
using Mediator;
namespace CleanArc.Application.Features.Users.Commands.RefreshUserTokenCommand
namespace Baya.Application.Features.Users.Commands.RefreshUserTokenCommand
{
internal class RefreshUserTokenCommandHandler(IJwtService jwtService)
: IRequestHandler<RefreshUserTokenCommand, OperationResult<AccessToken>>
@@ -1,11 +1,11 @@
using CleanArc.Application.Models.Common;
using CleanArc.Application.Models.Jwt;
using CleanArc.SharedKernel.ValidationBase;
using CleanArc.SharedKernel.ValidationBase.Contracts;
using Baya.Application.Models.Common;
using Baya.Application.Models.Jwt;
using Baya.SharedKernel.ValidationBase;
using Baya.SharedKernel.ValidationBase.Contracts;
using FluentValidation;
using Mediator;
namespace CleanArc.Application.Features.Users.Commands.RefreshUserTokenCommand;
namespace Baya.Application.Features.Users.Commands.RefreshUserTokenCommand;
public record RefreshUserTokenCommand(Guid RefreshToken) : IRequest<OperationResult<AccessToken>>,
IValidatableModel<RefreshUserTokenCommand>
@@ -1,8 +1,8 @@
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Mediator;
namespace CleanArc.Application.Features.Users.Commands.RequestLogout
namespace Baya.Application.Features.Users.Commands.RequestLogout
{
internal class RequestLogoutCommandHandler(IAppUserManager userManager)
: IRequestHandler<RequestLogoutCommand, OperationResult<bool>>
@@ -0,0 +1,6 @@
using Baya.Application.Models.Common;
using Mediator;
namespace Baya.Application.Features.Users.Commands.RequestLogout;
public record RequestLogoutCommand(int UserId):IRequest<OperationResult<bool>>;
@@ -1,11 +1,11 @@
using CleanArc.Application.Contracts;
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using CleanArc.Application.Models.Jwt;
using CleanArc.SharedKernel.Extensions;
using Baya.Application.Contracts;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Baya.Application.Models.Jwt;
using Baya.SharedKernel.Extensions;
using Mediator;
namespace CleanArc.Application.Features.Users.Queries.GenerateUserToken;
namespace Baya.Application.Features.Users.Queries.GenerateUserToken;
internal class GenerateUserTokenQueryHandler(IJwtService jwtService, IAppUserManager userManager)
: IRequestHandler<GenerateUserTokenQuery, OperationResult<AccessToken>>
@@ -1,11 +1,11 @@
using CleanArc.Application.Models.Common;
using CleanArc.Application.Models.Jwt;
using CleanArc.SharedKernel.ValidationBase;
using CleanArc.SharedKernel.ValidationBase.Contracts;
using Baya.Application.Models.Common;
using Baya.Application.Models.Jwt;
using Baya.SharedKernel.ValidationBase;
using Baya.SharedKernel.ValidationBase.Contracts;
using FluentValidation;
using Mediator;
namespace CleanArc.Application.Features.Users.Queries.GenerateUserToken;
namespace Baya.Application.Features.Users.Queries.GenerateUserToken;
public record GenerateUserTokenQuery(string UserKey, string Code) : IRequest<OperationResult<AccessToken>>,
IValidatableModel<GenerateUserTokenQuery>
@@ -1,10 +1,10 @@
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using CleanArc.Domain.Entities.User;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Baya.Domain.Entities.User;
using MapsterMapper;
using Mediator;
namespace CleanArc.Application.Features.Users.Queries.GetUsers;
namespace Baya.Application.Features.Users.Queries.GetUsers;
internal class GetUsersQueryHandler(IAppUserManager userManager, IMapper mapper)
: IRequestHandler<GetUsersQuery, OperationResult<List<GetUsersQueryResponse>>>
@@ -1,7 +1,7 @@

using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
namespace CleanArc.Application.Features.Users.Queries.GetUsers;
namespace Baya.Application.Features.Users.Queries.GetUsers;
public record GetUsersQueryResponse
{
@@ -0,0 +1,6 @@
using Baya.Application.Models.Common;
using Mediator;
namespace Baya.Application.Features.Users.Queries.GetUsers;
public record GetUsersQuery : IRequest<OperationResult<List<GetUsersQueryResponse>>>;
@@ -1,10 +1,10 @@
using CleanArc.Application.Contracts;
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using CleanArc.Application.Models.Jwt;
using Baya.Application.Contracts;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Baya.Application.Models.Jwt;
using Mediator;
namespace CleanArc.Application.Features.Users.Queries.TokenRequest;
namespace Baya.Application.Features.Users.Queries.TokenRequest;
public class PasswordUserTokenRequestQueryResult
(IAppUserManager userManager,IJwtService jwtService)
@@ -1,11 +1,11 @@
using CleanArc.Application.Models.Common;
using CleanArc.Application.Models.Jwt;
using CleanArc.SharedKernel.ValidationBase;
using CleanArc.SharedKernel.ValidationBase.Contracts;
using Baya.Application.Models.Common;
using Baya.Application.Models.Jwt;
using Baya.SharedKernel.ValidationBase;
using Baya.SharedKernel.ValidationBase.Contracts;
using FluentValidation;
using Mediator;
namespace CleanArc.Application.Features.Users.Queries.TokenRequest;
namespace Baya.Application.Features.Users.Queries.TokenRequest;
public record PasswordUserTokenRequestQuery
(string UserName,string Password)
@@ -1,9 +1,9 @@
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Common;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Common;
using Mediator;
using Microsoft.Extensions.Logging;
namespace CleanArc.Application.Features.Users.Queries.TokenRequest;
namespace Baya.Application.Features.Users.Queries.TokenRequest;
public class UserTokenRequestQueryHandler(
IAppUserManager userManager,
@@ -1,4 +1,4 @@
namespace CleanArc.Application.Features.Users.Queries.TokenRequest;
namespace Baya.Application.Features.Users.Queries.TokenRequest;
public class UserTokenRequestQueryResponse
{
@@ -1,11 +1,11 @@
using CleanArc.Application.Models.Common;
using CleanArc.SharedKernel.ValidationBase;
using CleanArc.SharedKernel.ValidationBase.Contracts;
using Baya.Application.Models.Common;
using Baya.SharedKernel.ValidationBase;
using Baya.SharedKernel.ValidationBase.Contracts;
using FluentValidation;
using Mediator;
using System.Text.RegularExpressions;
namespace CleanArc.Application.Features.Users.Queries.TokenRequest;
namespace Baya.Application.Features.Users.Queries.TokenRequest;
public record UserTokenRequestQuery(string UserPhoneNumber) : IRequest<OperationResult<UserTokenRequestQueryResponse>>,
IValidatableModel<UserTokenRequestQuery>

Some files were not shown because too many files have changed in this diff Show More