Services Controllers.prompt
# Phase 2 — Services and controllers
## Context to read before starting
- `.cursorrules`
- `context/01-architecture.md`
- `context/03-business-rules.md`
- `context/04-errors.md`
- `context/05-hcm-contract.md`
Phase 1 is complete. Entities, enums, filters, and base modules already exist.
---
## Task
Implement all business logic, services, and controllers in this exact order.
---
## Implementation order
### 1. HcmClientModule
File: `src/hcm-client/hcm-client.service.ts`
Implement the three methods from `context/01-architecture.md`:
- `getBalance()` — with `HCM_TIMEOUT_MS` timeout, throw `HcmTimeoutException` on failure
- `submitRequest()` — with retry policy from `context/05-hcm-contract.md`
- `verifyWebhookSignature()` — HMAC-SHA256 using `crypto.timingSafeEqual`
Create `HcmTimeoutException` and `HcmUnavailableException` as custom exceptions.
---
### 2. AuditModule
File: `src/audit/audit.service.ts`
Single method:when to use it
Community prompt sourced from the open-source GitHub repo JuniRanger/time-off-microservice (no explicit license). A "Services Controllers.prompt" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
productivitycommunitydeveloper
source
JuniRanger/time-off-microservice · no explicit license
more in Productivity
Productivity✓ tested
Summarize a doc into decisions & actions
chief of staff who extracts what to DO, not just what was said
Productivity✓ tested
Draft a reply to a hard email
calm, direct communicator who de-escalates without caving
Productivity✓ tested
Turn a brain-dump into a weekly plan
planning coach who protects your focus, not just your calendar