Invoice Monitor - Project Overview
Solution Structure
| Project |
Type |
Framework |
Description |
| TELS.BillingInvoiceMonitor |
Console App (Batch) |
.NET 8.0 |
Nomad batch job — monitors MDID invoice posting and updates work item billing status |
| TELS.BillingInvoiceMonitor.Testing |
NUnit/xUnit (.NET 8.0) |
.NET 8.0 |
Unit tests (Moq) |
Architecture
Purpose
Invoice Monitor is a Nomad batch processing job that monitors MDID invoice posting and automatically marks associated work items/tickets as "Invoicing Completed". It is a satellite service to the main Billing system.
How It Works
- Queries the TELS database via stored procedure
BuildingServices.LoadJobsWithOrderNumberEntered_S for jobs with order numbers entered
- For each job, calls the Building Services API
ComputeUpdatedBillingStatusPipeline endpoint
- The Building Services API determines if invoicing is complete and updates the work item status accordingly
- Failures are logged; processing continues for remaining jobs
Data Access
- SQL Server:
SQL-DSHE-E-TRAN (production), SQL-DSHE-DE-TRAN (dev)
- Database: TELS
- ORM: Dapper 2.1.44 + System.Data.SqlClient 4.9.0
- Stored Procedure:
BuildingServices.LoadJobsWithOrderNumberEntered_S
- Credentials: Vault-managed (
databases/creds/SQL-DSHE-E-TRAN-DSIAPP_DSLS)
Key Technology Stack
| Category |
Technology |
| Runtime |
.NET 8.0 |
| Orchestration |
Nomad (Platypus framework) |
| Data Access |
Dapper 2.1.44 + System.Data.SqlClient 4.9.0 |
| Auth |
JWT token refresh via Auth Service |
| HTTP |
TELS.WebServiceClients 4.8.0 |
| Configuration |
Vault (secrets) + Consul (config) via envconsul |
| Logging |
JSON to AWS CloudWatch (platypus log group) |
| Testing |
NUnit 4.3.2, xUnit 2.9.2, Moq 4.20.72 |
External Dependencies
| Integration |
Mechanism |
Description |
| Building Services API |
HTTP (TELS.WebServiceClients.BuildingServices.V1 5.1.1) |
Compute updated billing status for work items |
| Auth Service |
HTTP (TELS.WebServiceClients.Auth.V1 1.1.0) |
JWT token refresh for API authentication |
| TELS Database |
SQL Server (Dapper) |
Query jobs with order numbers entered |
Deployment
Nomad Configuration
| Setting |
Value |
| Job Name |
tels-billing-invoice-monitor |
| Module |
nomad-batch v1 |
| Lifespan |
Permanent |
| Overlap |
Prohibited |
| Container |
registry.directsupply.cloud/.../platypus/batch:net8.0-alpine |
| Line of Business |
TELS |
Environments
| Environment |
Database |
Building Services Endpoint |
| DEV |
SQL-DSHE-DE-TRAN |
https://devservices.tels.net/BuildingServices |
| QA |
SQL-DSHE-E-TRAN |
https://qaservices.tels.net/BuildingServices |
| PROD |
SQL-DSHE-E-TRAN |
https://services.tels.net/BuildingServices |
CI/CD Pipeline
- Parent pipeline includes child pipeline from
platypus/ci-scripts v3 nomad-deploy.yml
- Job variable:
JOB_NAME: "tels-billing-invoice-monitor"
- Docker build → Nomad deploy (no manual intervention needed)
Configuration Management
Envconsul injects secrets and config:
- Vault path: secrets/tels/billing-invoice-monitor
- Consul path: tels/billing-invoice-monitor
- Database credentials: databases/creds/SQL-DSHE-E-TRAN-DSIAPP_DSLS
Monitoring
- CloudWatch log group:
platypus
- Log stream:
tels/{env}/billing-invoice-monitor
- Nomad UI dashboards per environment
Notes
- Service-oriented: Calls Building Services API for status computation rather than direct database modification.
- Stored procedure pattern: Uses SQL stored procedures for data extraction, HTTP APIs for business logic.
- Error handling: Per-item error handling with continuation on failures — individual job failures don't stop the batch.
- No MQ, no API, no BusProxy: Simple batch pattern — database query → API calls.