Skip to content

[server] - Create User Profile API: Update Phone, Settings, and KYC Status #74

Description

@dark-sarge

Location: server/src/routes/profile.ts

Description

No profile management endpoints exist beyond the implicit user creation during OTP signup. Users need to be able to retrieve and update their own profile data, and the system needs a KYC status field to support future regulatory compliance.

Acceptance Criteria

  • GET /api/profile (authenticated) returns the authenticated user's profile: masked phone, registration date, role, trade count, KYC status, virtual account number, and Stellar public key.
  • PATCH /api/profile (authenticated) accepts optional fields: alias (string, max 30 chars, alphanumeric), notificationsEnabled (boolean). Validates and updates the user record.
  • GET /api/profile/trades (authenticated) returns the user's own trade history with pagination (?page, ?limit, ?status filter).
  • A kyc_status enum column (unverified, pending, verified) is added to the users table via migration.
  • PATCH /api/admin/users/:id/kyc (admin only) updates a user's KYC status.
  • All profile endpoints apply the authenticate middleware; the KYC update endpoint also applies authorize("admin").

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions