Preskoči na sadržaj

E1-F1: User Registration API

Epic: E1: User & Profile Management

Size: S (Small)

Problem / Outcome

Users need to create accounts with OIB verification to purchase tickets.

Scope

In-Scope:

  • POST /users/register endpoint
  • Email/password validation
  • OIB format validation
  • OIB checksum validation
  • Duplicate email check
  • Account creation

Out-of-Scope:

  • SSO registration
  • Email verification flow

Acceptance Criteria

  • AC1: Given valid email, password, and OIB, when user submits registration, then account is created with status "active"
  • AC2: Given invalid OIB checksum, when user submits registration, then error "Invalid OIB" is returned
  • AC3: Given duplicate email, when user submits registration, then error "Email already registered" is returned

Data Model Impact

User table:
- id (UUID, PK)
- email (VARCHAR, UNIQUE)
- password_hash (VARCHAR)
- oib (VARCHAR(11))
- status (ENUM: active, inactive)
- created_at (TIMESTAMP)
- updated_at (TIMESTAMP)

Permissions/Roles

  • Public (no auth required)

How to Verify

npm test -- --grep "user registration"

Expected: All registration tests pass, OIB checksum validation works.

Dependencies

  • None (foundational)

Implementation Tasks

See E1: User & Profile Tasks

Doc References


Last Updated: January 2026