Skip to content

[FEAT]: Phase - 1 Issue 1A: User Registration System #6

@ayussh-2

Description

@ayussh-2

Description

Implement a comprehensive user registration system with Firebase authentication and payment processing capabilities.
NOTE: THE USER REGISTERATION PAGE IS NOT THE PROJECT-XANGOES FRONTEND, YOU CAN USE POSTMAN TO MIMIC THE FRONTEND CALLS

Requirements

Backend Implementation:

  • Create POST /register endpoint

User Table Schema:

users {
  email: varchar(255) NOT NULL UNIQUE,
  name: varchar(255),
  photo: text,
  gender: enum('male', 'female', 'other'),
  dob: timestamp,
  state: varchar(100), // lowercase
  city: varchar(100), // lowercase  
  college: varchar(255), // References institute.id
  idCard: text, // Cloudinary photo URL
  mobile: varchar(20) NOT NULL UNIQUE,
  festID: text, // fest ID
  rollNumber: varchar(50),
  firebaseId: varchar(255) NOT NULL UNIQUE,
  hasPaid: boolean DEFAULT false,
  receipt: text,
  transactionID: varchar(255),
  hall: varchar(100), // lowercase
  createdAt: timestamp DEFAULT now(),
  updatedAt: timestamp DEFAULT now()
}

Transaction Flow:

  1. User signs up with Firebase Google Auth
  2. Registration details sent to backend
  3. Payment Gateway Flow: // SKIP THE PAYMENT GATEWAY INTEGRATION FOR NOW JUST CREATE A CALLBACK ENDPOINT FOR THE PAYMENT GATEWAY THAT SENDS THE TRANSACTION DETAILS TO THE DB
    • Initial registration with basic details
    • Payment gateway callback to POST /complete-transaction?via=payment-gateway.
  4. Manual Payment Flow: POST /complete-transaction?via=manual
    • Payment screenshot uploaded directly
    • Transaction details stored in transaction table
      NOTE: IN BOTH CASES USER WOULD BE IDENTIFIED BY BACKEND USING THE FIREBASE ADMIN UID. THE USER ID TOKEN SHOULD BE SENT IN THE BEARER TOKEN IN AUTH HEADER

Acceptance Criteria:

  • /register endpoint functional for registering basic details
  • /complete-transaction endpoint for both payment gateway and manual flow
  • Follow the codebase pattern

Additional Information

No response

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions