Duplicate Check API Endpoint
Component Detail
Infrastructure
low complexity
backend
1
Dependencies
1
Dependents
0
Entities
0
Integrations
Description
Next.js REST API endpoint at /api/v1/activities/duplicate-check that exposes the duplicate detection service to the Flutter mobile client. Accepts the candidate activity parameters, delegates to the detection service, and returns a structured JSON response with the conflict flag and optional conflicting activity ID. Must respond with minimal latency to avoid disrupting the wizard UX.
duplicate-check-api-endpoint
Responsibilities
- Expose duplicate check as a versioned REST endpoint
- Validate incoming request parameters before delegating to service
- Return structured response with isDuplicate flag and conflictingActivityId
- Enforce authentication and local_association_id scoping on the request
Interfaces
POST /api/v1/activities/duplicate-check
validateRequestParams(body: DuplicateCheckRequest): ValidationResult
formatResponse(result: DuplicateCheckResult): ApiResponse