Implement strict backend CV template placeholder endpoints and replacement flow with TDD coverage#36
Conversation
vitorhugo-java
left a comment
There was a problem hiding this comment.
Implement features specificed on Issue. Using TDD. @copilot
Implemented the issue feature with TDD in commit |
|
@copilot Act as a senior Java/Spring backend engineer. You are working on the backend-only implementation for CV template placeholders. Current PR problem: The implementation expanded the backend scope too much and started handling behaviors that belong to the frontend flow. This PR must ONLY provide the backend capabilities required for the future frontend implementation. Do NOT implement frontend logic assumptions inside the backend. Requirements to fix:
The official placeholder format is STRICTLY: {{PLACEHOLDER}} Examples: {{SUMMARY}} Do not support additional syntaxes beyond whitespace normalization if truly necessary.
Current implementation:
This is over-engineered for the intended feature. Expected behavior:
Keep the implementation simple and deterministic.
Backend should NOT:
This endpoint is valid: Purpose:
Do not mix detection responsibilities with replacement flow.
Expected structure: ResumeGenerationService
SdkGoogleDriveApiClient
Keep methods small and explicit.
The backend contract should be predictable and strict.
Keep only tests that validate:
Remove tests validating unnecessary compatibility behavior.
|
Updated in commit 2d3a6b7. Changes now keep backend scope strict and deterministic: template generation directly replaces only |
|
@copilot Act as a senior Java 21 + Spring Boot backend engineer. The current PR is wrong because it only changed service/client/test layers and did NOT expose the feature through API endpoints. Your task is to implement the backend endpoints for CV template placeholders, keeping the frontend for a later issue. STRICT SCOPE:
OFFICIAL PLACEHOLDER CONTRACT: Examples: REQUIRED ENDPOINTS:
Request: Response: Purpose:
Request: Response: IMPLEMENTATION REQUIREMENTS:
SERVICE REQUIREMENTS:
GOOGLE DRIVE CLIENT REQUIREMENTS:
TESTS: Add integration tests for:
Add unit tests for:
ACCEPTANCE CRITERIA:
|
Addressed in commit Implemented and exposed the backend endpoints with explicit contracts:
Also refactored service wiring to explicit methods ( |
This issue requires backend support for strict
{{PLACEHOLDER}}template CV generation while keeping the base resume flow unchanged and API-compatible.This PR includes the backend endpoint exposure, strict replacement implementation, and focused TDD coverage for placeholder detection/replacement in template mode, with backend scope kept explicit and deterministic.
Template placeholder detection endpoint contract
POST /api/v1/google-drive/resume-placeholders.{ "baseResumeId": "uuid" }{ "baseResumeId": "uuid", "placeholders": ["SUMMARY", "SKILLS"] }Template generation endpoint contract
POST /api/v1/google-drive/applications/{applicationId}/generated-resumes.applicationId,baseResumeId,copiedFileId,pdfFileId,documentUrl,pdfUrl,values,placeholders,generatedAt.Template generation implementation
valueskeys directly.{{PLACEHOLDER}}(key-based input likeSUMMARYbecomes{{SUMMARY}}during replacement).Service structure clarity
ResumeGenerationServiceexposes explicit methods for:Google Drive API behavior
SdkGoogleDriveApiClientreplacement remains strict token replacement using{{KEY}}.Google Drive test double behavior
FakeGoogleDriveApiClientsimulates stateful document text and strict placeholder replacement.{ "baseResumeId": "<resume-id>", "values": { "SUMMARY": "Senior Java Engineer", "SKILLS": "Spring Boot, PostgreSQL" } }