feat: Initial commit of backend services and AGENTS.md
This commit is contained in:
45
backend/models/User.js
Normal file
45
backend/models/User.js
Normal file
@@ -0,0 +1,45 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
const UserSchema = new mongoose.Schema(
|
||||
{
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
email: {
|
||||
type: String,
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
password: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
isPremium: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
points: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
adoptedStreets: [
|
||||
{
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: "Street",
|
||||
},
|
||||
],
|
||||
completedTasks: [
|
||||
{
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: "Task",
|
||||
},
|
||||
],
|
||||
badges: [String],
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
},
|
||||
);
|
||||
|
||||
module.exports = mongoose.model("User", UserSchema);
|
||||
Reference in New Issue
Block a user