SaranshBangar / Daneizo

Why buy when you can rent it!
https://daneizo.vercel.app/
MIT License
24 stars 43 forks source link

[Feature Request]: Add schema for user and seller using prisma and postgres #156

Closed ShivanshPlays closed 2 weeks ago

ShivanshPlays commented 1 month ago

Is there an existing issue for this?

Feature Description

Add Prisma Schema for User and Seller Models

Description

Create and implement the Prisma schema for the user and seller models to store data in PostgreSQL. These models are essential for a website offering rental services for daily-use items. The schema should define the structure for both user and seller data, ensuring efficient and scalable storage.

Requirements

  1. User Model:

    • Basic user information (e.g., id, name, email, password).
    • Address or location field.
    • Contact number.
    • Role: User.
  2. Seller Model:

    • Basic seller information (e.g., id, name, email, password).
    • Business details like storeName.
    • Location/address field.
    • Role: Seller.
    • Ratings/feedback (optional for future improvements).
  3. Common Considerations:

    • Use PostgreSQL as the database.
    • Use id as the primary key with UUID type for uniqueness.
    • Add createdAt and updatedAt timestamps for both models.
    • Ensure the schema aligns with Prisma ORM conventions.

Example Schema (Suggested)


model User {
  id        String   @id @default(uuid())
  name      String
  email     String   @unique
  password  String
  address   String?
  contact   String?
  role      String   @default("user")
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}

model Seller {
  id         String   @id @default(uuid())
  name       String
  email      String   @unique
  password   String
  storeName  String
  location   String?
  contact    String?
  role       String   @default("seller")
  createdAt  DateTime @default(now())
  updatedAt  DateTime @updatedAt
}

### Use Case

Base will be formed for auth functionality

### Benefits

_No response_

### Priority

High

### Record

- [X] I agree to follow this project's Code of Conduct
- [X] I'm a GSSOC contributor
- [X] I want to work on this issue
- [X] I'm willing to provide further clarification or assistance if needed.