Tasks Service - Project Overview
Solution Structure
The solution (Tasks.sln) contains 10 projects organized in a layered architecture:
Application Projects
| Project |
Type |
Framework |
Description |
| TELS.Tasks.Api |
ASP.NET Core Web API |
.NET 8.0 |
Main REST API service |
| TELS.Tasks.MQServices |
Worker Service |
.NET 8.0 |
RabbitMQ message consumer service |
| TELS.Tasks.Contracts |
Class Library |
.NET Standard 2.1 |
Shared DTOs and event contracts (strongly named) |
Database Projects
| Project |
Type |
Framework |
Description |
| Tasks.DbUp |
Console App |
.NET 8.0 |
SQL Server schema migrations (DbUp) |
| Tasks.PostgresDbUp |
Console App |
.NET 8.0 |
PostgreSQL schema migrations (Quartz persistence) |
Test Projects
| Project |
Type |
Description |
| TELS.Tasks.Api.Tests |
Unit Tests |
Controller and service tests (MSTest + NUnit) |
| TELS.Tasks.MQServices.Tests |
Unit Tests |
Consumer handler tests |
| TELS.Tasks.Testing.Integration |
Integration Tests |
Full-stack tests with real database |
| TELS.Tasks.Testing.Acceptance |
Acceptance Tests |
End-to-end API contract tests (RestSharp) |
| TELS.Tasks.LoadTest |
Load Tests |
Performance testing |
Architecture
Layering Pattern
┌─────────────────────────────────────────────┐
│ API Controllers (18) │
│ Controllers/Version1/*.cs │
├─────────────────────────────────────────────┤
│ Business Logic / Services │
│ Logic/*.cs │
│ Logic/Validators/*.cs │
├─────────────────────────────────────────────┤
│ Repository / Data Access Layer │
│ DAL/*.cs │
│ DAL/Interfaces/*.cs │
│ DAL/Models/*.cs │
├─────────────────────────────────────────────┤
│ External Service Wrappers │
│ ServiceWrappers/*.cs │
├─────────────────────────────────────────────┤
│ SQL Server (Dapper) │
│ 234+ Stored Procedures │
└─────────────────────────────────────────────┘
Data Access
- ORM: Dapper (micro-ORM) - no Entity Framework
- Pattern: Repository pattern with interface segregation
- Queries: Primarily stored procedures (234+)
- Migrations: DbUp (47 SQL Server scripts, PostgreSQL scripts for Quartz)
Message Queue Integration
- Broker: RabbitMQ via MassTransit 8.2.5
- Pattern: Pub/Sub consumers in
TELS.Tasks.MQServices
- Scheduling: Quartz.NET with PostgreSQL persistent store
- Consumers: 6 message consumer handlers
- Resilience: BusProxy client with S3 and SQL fallback strategies
- Retry: 5s, 30s, 1m, 3m, 5m intervals
External Integrations
| Integration |
Mechanism |
Description |
| TELS Assets |
NuGet contracts (DSE.TELS.Assets.Contracts) |
Asset data contracts |
| TELS Customers |
NuGet contracts + events (DSE.TELS.Customers.*) |
Customer/facility data |
| TELS Scheduling |
Events (TELS.Scheduling.Events) |
Schedule coordination |
| Notifications |
NuGet (Unity.Notifications.Messaging) |
Push notifications |
| Auth Service |
JWT Bearer + contracts (TELS.WebServices.Auth.Contracts) |
Authentication |
| Various TELS Services |
HTTP via TELS.WebServiceClients.* |
Service-to-service calls |
| CONTACT database |
Cross-database SQL references |
Contact/person data |
API Surface
18 controllers in Controllers/Version1/ exposing versioned REST endpoints.
Authentication & Authorization
- JWT Bearer token validation
- Custom claims-based authorization
- Persona-based access control (
DirectSupplyPartner policy)
CustomAuthorizationAttribute for fine-grained permissions
API Documentation
- Swagger/OpenAPI via Swashbuckle
- API versioning via
Microsoft.AspNetCore.Mvc.Versioning
Key Technology Stack
| Category |
Technology |
| Runtime |
.NET 8.0 |
| Web Framework |
ASP.NET Core 8.0 |
| Data Access |
Dapper 2.1.44 |
| Database |
SQL Server (primary), PostgreSQL (Quartz) |
| Messaging |
RabbitMQ + MassTransit 8.2.5 |
| Scheduling |
Quartz.NET 3.13.0 |
| Resilience |
Polly 8.4.2 |
| Logging |
NLog 5.3.4 |
| Monitoring |
New Relic |
| Serialization |
Newtonsoft.Json 13.0.3, System.Text.Json 9.0.4 |
| Auth |
JWT Bearer (System.IdentityModel.Tokens.Jwt 8.1.0) |
| Testing |
MSTest, NUnit, Moq, MbDotNet, RestSharp |
| Containerization |
Docker |
| CI/CD |
GitLab CI (20+ stages) |
| Infrastructure |
Terraform, AWS ECS |
| Secrets |
HashiCorp Vault |
Deployment
Docker Containers
- TELS.Tasks.Api - REST API container
- TELS.Tasks.MQServices - Message consumer container
- Supporting containers for local dev (RabbitMQ, SQL Server, etc.)
CI/CD Pipeline (GitLab CI)
build → test → push → aqua_scan →
plan_ecs → apply_ecs →
plan_rds → apply_rds →
plan_api_and_subscriber → apply_api_and_subscriber →
plan_sql_dbup → apply_sql_dbup →
plan_postgres_dbup → apply_postgres_dbup
- Container versioning:
2.0.${CI_PIPELINE_ID}
- Security scanning: Aqua, Checkmarx
- Code coverage: Cobertura
- Multi-environment: DEV, QA, PROD
Infrastructure
- AWS ECS (Fargate/EC2)
- Terraform-managed
- RDS for databases
- Vault for secrets management
Configuration
Configuration is managed through Options classes:
| Options Class |
Purpose |
| Database connection strings |
SQL Server and PostgreSQL connections |
| RabbitMQ settings |
Broker host, credentials, queue names |
| Auth settings |
Signing keys, token validation |
| External service URLs |
TELS service endpoints |
| Polly policies |
Retry/circuit breaker configuration |
| New Relic |
APM agent configuration |
Environment-specific settings are provided via environment variables and Vault secrets in deployed environments.