Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/Web.Api/bin/Debug/net8.0/Web.Api.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Web.Api",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
"uriFormat": "%s/swagger"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_URLS": "https://localhost:7001;http://localhost:5001"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
81 changes: 81 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/Web.Api/Web.Api.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/src/Web.Api/Web.Api.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/src/Web.Api/Web.Api.csproj"
],
"problemMatcher": "$msCompile",
"isBackground": true
},
{
"label": "clean",
"command": "dotnet",
"type": "process",
"args": [
"clean",
"${workspaceFolder}/src/Web.Api/Web.Api.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "restore",
"command": "dotnet",
"type": "process",
"args": [
"restore",
"${workspaceFolder}/LegalAssistant.AppService.sln"
],
"problemMatcher": "$msCompile"
},
{
"label": "build-solution",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/LegalAssistant.AppService.sln",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile",
"group": "build"
}
]
}
210 changes: 210 additions & 0 deletions file_tree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# File Tree: LegalAssistant.AppService

Generated on: 10/9/2025, 6:02:16 PM
Root path: `d:\School\5thYear\1stSemester\Chatbot\LegalAssistant.AppService`

```
├── 📁 .containers/ 🚫 (auto-hidden)
├── 📁 .git/ 🚫 (auto-hidden)
├── 📁 .github/
│ ├── 📁 workflows/
│ │ └── ⚙️ build.yml
│ └── ⚙️ dependabot.yml
├── 📁 docs/
│ ├── 📝 AGGREGATE_EXPLAINED.md
│ ├── 📝 ARCHITECTURE_OVERVIEW.md
│ ├── 📝 BEHAVIORS_GUIDE.md
│ ├── 📝 CI_CD_EXPLAINED.md
│ ├── 📝 COMMANDS.md
│ ├── 📝 DI_BEHAVIORS_EXAMPLE.md
│ ├── 📝 EVENT_HANDLER_FLOW.md
│ ├── 📝 EXCEPTION_GUIDELINES.md
│ ├── 📝 NAMING_CONVENTIONS.md
│ └── 📖 README.md
├── 📁 src/
│ ├── 📁 Application/
│ │ ├── 📁 Common/
│ │ │ ├── 📁 Behaviors/
│ │ │ │ ├── 🟣 AuthorizationBehavior.cs
│ │ │ │ ├── 🟣 CachingBehavior.cs
│ │ │ │ ├── 🟣 DomainEventBehavior.cs
│ │ │ │ ├── 🟣 LoggingBehavior.cs
│ │ │ │ ├── 🟣 PerformanceBehavior.cs
│ │ │ │ ├── 🟣 TransactionBehavior.cs
│ │ │ │ └── 🟣 ValidationBehavior.cs
│ │ │ ├── 📁 Exceptions/
│ │ │ │ ├── 🟣 ApplicationException.cs
│ │ │ │ ├── 🟣 BusinessRuleException.cs
│ │ │ │ ├── 🟣 ConflictException.cs
│ │ │ │ ├── 🟣 ExternalServiceException.cs
│ │ │ │ ├── 🟣 ForbiddenException.cs
│ │ │ │ ├── 🟣 NotFoundException.cs
│ │ │ │ ├── 🟣 RequestProcessingException.cs
│ │ │ │ ├── 🟣 UnauthorizedException.cs
│ │ │ │ └── 🟣 ValidationException.cs
│ │ │ ├── 📁 Models/
│ │ │ │ ├── 🟣 AuditableEntity.cs
│ │ │ │ ├── 🟣 PaginatedResult.cs
│ │ │ │ ├── 🟣 PaginationRequest.cs
│ │ │ │ └── 🟣 SortOrder.cs
│ │ │ ├── 🟣 ICommand.cs
│ │ │ ├── 🟣 ICommandHandler.cs
│ │ │ ├── 🟣 IDomainEventDispatcher.cs
│ │ │ ├── 🟣 IDomainEventHandler.cs
│ │ │ ├── 🟣 IQuery.cs
│ │ │ └── 🟣 IQueryHandler.cs
│ │ ├── 📁 EventHandlers/
│ │ │ ├── 🟣 UserCreatedEventHandler.cs
│ │ │ ├── 🟣 UserDeactivatedEventHandler.cs
│ │ │ └── 🟣 UserUpdatedEventHandler.cs
│ │ ├── 📁 Features/
│ │ │ ├── 📁 Auth/
│ │ │ │ ├── 📁 GetProfile/
│ │ │ │ │ ├── 🟣 GetProfileQuery.cs
│ │ │ │ │ └── 🟣 GetProfileQueryHandler.cs
│ │ │ │ ├── 📁 Login/
│ │ │ │ │ ├── 🟣 LoginCommand.cs
│ │ │ │ │ ├── 🟣 LoginCommandHandler.cs
│ │ │ │ │ └── 🟣 LoginCommandValidator.cs
│ │ │ │ └── 📁 Logout/
│ │ │ │ ├── 🟣 LogoutCommand.cs
│ │ │ │ ├── 🟣 LogoutCommandHandler.cs
│ │ │ │ └── 🟣 LogoutCommandValidator.cs
│ │ │ ├── 📁 Conversation/
│ │ │ │ └── 📁 CreateConversation/
│ │ │ │ └── 🟣 CreateConversationCommand.cs
│ │ │ └── 📁 User/
│ │ │ ├── 📁 CreateUser/
│ │ │ │ ├── 🟣 CreateUserCommand.cs
│ │ │ │ ├── 🟣 CreateUserCommandHandler.cs
│ │ │ │ └── 🟣 CreateUserCommandValidator.cs
│ │ │ └── 📁 GetUsers/
│ │ │ └── 🟣 GetUsersQuery.cs
│ │ ├── 📁 Interfaces/
│ │ │ ├── 🟣 IPasswordHasher.cs
│ │ │ ├── 🟣 ITokenService.cs
│ │ │ └── 🟣 IUserRepository.cs
│ │ ├── 📁 bin/ 🚫 (auto-hidden)
│ │ ├── 📁 obj/ 🚫 (auto-hidden)
│ │ ├── 🟣 Application.csproj
│ │ └── 📖 README.md
│ ├── 📁 Domain/
│ │ ├── 📁 Aggregates/
│ │ │ ├── 📁 Conversation/
│ │ │ │ └── 🟣 ConversationAggregate.cs
│ │ │ └── 📁 User/
│ │ │ └── 🟣 UserAggregate.cs
│ │ ├── 📁 Common/
│ │ │ ├── 🟣 BaseAggregateRoot.cs
│ │ │ ├── 🟣 BaseEntity.cs
│ │ │ ├── 🟣 Error.cs
│ │ │ ├── 🟣 ErrorType.cs
│ │ │ ├── 🟣 IDomainEvent.cs
│ │ │ ├── 🟣 Result.cs
│ │ │ └── 🟣 ValidationError.cs
│ │ ├── 📁 Constants/
│ │ │ └── 🟣 UserRoles.cs
│ │ ├── 📁 Entities/
│ │ │ ├── 🟣 Conversation.cs
│ │ │ ├── 🟣 Message.cs
│ │ │ └── 🟣 User.cs
│ │ ├── 📁 Events/
│ │ │ ├── 📁 Conversation/
│ │ │ │ └── 🟣 ConversationCreatedEvent.cs
│ │ │ ├── 📁 Examples/
│ │ │ │ └── 🟣 DomainEventsUsageExamples.cs
│ │ │ └── 📁 User/
│ │ │ ├── 🟣 UserCreatedEvent.cs
│ │ │ ├── 🟣 UserDeactivatedEvent.cs
│ │ │ └── 🟣 UserUpdatedEvent.cs
│ │ ├── 📁 Services/
│ │ │ ├── 🟣 ConversationDomainService.cs
│ │ │ └── 🟣 UserDomainService.cs
│ │ ├── 📁 Specifications/
│ │ │ ├── 📁 Examples/
│ │ │ │ └── 🟣 SpecificationUsageExamples.cs
│ │ │ ├── 🟣 CompositeSpecifications.cs
│ │ │ ├── 🟣 ConversationSpecifications.cs
│ │ │ ├── 🟣 ISpecification.cs
│ │ │ └── 🟣 UserSpecifications.cs
│ │ ├── 📁 ValueObjects/
│ │ │ ├── 🟣 Email.cs
│ │ │ └── 🟣 Password.cs
│ │ ├── 📁 bin/ 🚫 (auto-hidden)
│ │ ├── 📁 obj/ 🚫 (auto-hidden)
│ │ ├── 🟣 Domain.csproj
│ │ ├── 🟣 GlobalSuppressions.cs
│ │ └── 📖 README.md
│ ├── 📁 Infrastructure/
│ │ ├── 📁 Configuration/
│ │ │ ├── 🟣 EmailSettings.cs
│ │ │ ├── 🟣 FileStorageSettings.cs
│ │ │ └── 🟣 JwtSettings.cs
│ │ ├── 📁 Data/
│ │ │ ├── 📁 Configurations/
│ │ │ │ └── 🟣 BaseEntityConfiguration.cs
│ │ │ └── 📁 Contexts/
│ │ │ ├── 🟣 DataContext.cs
│ │ │ ├── 🟣 IDataContext.cs
│ │ │ └── 🟣 Schemas.cs
│ │ ├── 📁 Exceptions/
│ │ │ └── 🟣 DomainEventDispatchException.cs
│ │ ├── 📁 Extensions/
│ │ │ └── 🟣 ServiceCollectionExtensions.cs
│ │ ├── 📁 Repositories/
│ │ │ └── 🟣 UserRepository.cs
│ │ ├── 📁 Services/
│ │ │ ├── 📁 Email/
│ │ │ │ └── 📄 .gitkeep
│ │ │ ├── 🟣 DomainEventDispatcher.cs
│ │ │ ├── 🟣 PasswordHasher.cs
│ │ │ └── 🟣 TokenService.cs
│ │ ├── 📁 bin/ 🚫 (auto-hidden)
│ │ ├── 📁 obj/ 🚫 (auto-hidden)
│ │ ├── 🟣 Infrastructure.csproj
│ │ └── 📖 README.md
│ └── 📁 Web.Api/
│ ├── 📁 Configurations/
│ │ └── 📁 Options/
│ │ └── 🟣 JwtOptions.cs
│ ├── 📁 Controllers/
│ │ └── 📁 V1/
│ │ ├── 🟣 AuthController.cs
│ │ ├── 🟣 BaseController.cs
│ │ ├── 🟣 HealthController.cs
│ │ └── 🟣 UsersController.cs
│ ├── 📁 Extensions/
│ │ ├── 🟣 ApplicationServiceExtensions.cs
│ │ └── 🟣 ServiceCollectionExtensions.cs
│ ├── 📁 Filters/
│ │ └── 🟣 ValidateModelFilter.cs
│ ├── 📁 Middleware/
│ │ └── 🟣 GlobalExceptionMiddleware.cs
│ ├── 📁 Models/
│ │ └── 📁 Responses/
│ │ └── 🟣 ApiResponse.cs
│ ├── 📁 Properties/
│ │ └── 📄 launchSettings.json
│ ├── 📁 Services/
│ │ └── 🟣 CurrentUserService.cs
│ ├── 📁 bin/ 🚫 (auto-hidden)
│ ├── 📁 obj/ 🚫 (auto-hidden)
│ ├── 🐳 Dockerfile
│ ├── 🟣 Program.cs
│ ├── 📖 README.md
│ ├── 🟣 Web.Api.csproj
│ ├── 📄 Web.Api.http
│ ├── 📄 appsettings.Development.json
│ └── 📄 appsettings.json
├── 📄 .cursorrules
├── 📄 .dockerignore
├── 📄 .editorconfig
├── 🚫 .gitignore
├── 📝 BUILD_SCRIPTS.md
├── 📄 Directory.Build.props
├── 🟣 LegalAssistant.AppService.sln
├── 📖 README.md
└── ⚙️ docker-compose.yml
```

---
8 changes: 7 additions & 1 deletion src/Application/Common/Behaviors/LoggingBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ public async Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TRe
logger.LogError(ex, "Request {RequestName} failed after {ElapsedMilliseconds}ms",
requestName, stopwatch.ElapsedMilliseconds);

// Re-throw with additional context
// Don't wrap application exceptions - let them bubble up with their original type
if (ex is Exceptions.ApplicationException)
{
throw;
}

// Only wrap unexpected exceptions
throw new RequestProcessingException($"Request {requestName} failed after {stopwatch.ElapsedMilliseconds}ms", ex);
}
}
Expand Down
Loading