Add Terms & Conditions agreement checkbox to user signup #4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Add a required Terms & Conditions checkbox to the signup form with comprehensive legal audit trail.
Requirements
Frontend
Backend/Database
Store comprehensive legal audit record with the following fields:
user_id: Reference to the created useragreed_at: Timestamp in UTCip_address: Client IP address (check X-Forwarded-For for proxy scenarios)user_agent: Browser/client user agent stringterms_version: Extract from filename (e.g., "v2026-01-03")terms_url: Full URL path to the PDF (e.g., "/docs/v2026-01-03.pdf")terms_content_hash: SHA-256 hash of the PDF file contentsAcceptance Criteria
Frontend:
Backend/Database:
terms_agreementstable with all required columnsFiles
frontend/public/docs/v2026-01-03.pdf.claude/plans/cryptic-swimming-clock.mdScope
Plan: Terms & Conditions Checkbox
Phase: Planning | Agent: Planner | Status: AWAITING_REVIEW
Overview
Add a required Terms & Conditions checkbox to the signup form with comprehensive legal audit trail. Creates a new
terms-agreementfeature capsule following the project's established architecture pattern. The checkbox blocks form submission until accepted, links to the existing PDF, and records all required audit fields (IP, user agent, timestamp, content hash) atomically with user creation.Planning Context
Decision Log
Rejected Alternatives
Constraints & Assumptions
frontend/public/docs/v2026-01-03.pdf(verified, 13573 bytes)Known Risks
Invisible Knowledge
Architecture
Data Flow
{email, password, termsAccepted: true}X-Forwarded-For || request.ip), User-AgentInvariants
user_profileshas exactly one record interms_agreementsterms_agreements.agreed_atis always UTCterms_content_hashmatches SHA-256 of PDF at signup timeMilestones
Milestone 1: Database Layer
Files:
backend/src/features/terms-agreement/migrations/001_create_terms_agreements.sqlRequirements:
terms_agreementstable with columns: id (UUID), user_id (VARCHAR, FK concept), agreed_at (TIMESTAMPTZ), ip_address (VARCHAR), user_agent (TEXT), terms_version (VARCHAR), terms_url (VARCHAR), terms_content_hash (VARCHAR)Acceptance Criteria:
Code Changes:
Milestone 2: Backend Feature Capsule
Files:
backend/src/features/terms-agreement/data/terms-agreement.repository.tsbackend/src/features/terms-agreement/domain/terms-agreement.types.tsbackend/src/features/terms-agreement/index.tsbackend/src/features/auth/domain/auth.service.ts(modify)backend/src/features/auth/api/auth.validation.ts(modify)backend/src/features/auth/api/auth.controller.ts(modify)backend/src/_system/migrations/run-all.ts(modify)Requirements:
Acceptance Criteria:
Tests:
backend/src/features/terms-agreement/tests/integration/terms-agreement.integration.test.tsMilestone 3: Frontend Integration
Files:
frontend/src/features/auth/components/SignupForm.tsx(modify)frontend/src/features/auth/types/auth.types.ts(modify)frontend/src/features/auth/api/auth.api.ts(modify)Requirements:
Acceptance Criteria:
Code Changes (SignupForm.tsx, insert before submit button div):
Milestone 4: Documentation
Files:
backend/src/features/terms-agreement/README.mdbackend/src/features/CLAUDE.md(update index)Requirements:
Acceptance Criteria:
Milestone Dependencies
Sequential dependencies - each milestone depends on the previous.
Verdict: AWAITING_REVIEW | Next: Quality review of plan