home/productivity/services-controllers-prompt

Services Controllers.prompt

GPTClaudeDeepSeek··1,189 copies·updated 2026-07-14
services-controllers-prompt.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