Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #42 from dcsil/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ztjdavid authored Mar 7, 2023
2 parents 4536911 + acb3f48 commit 034de6a
Show file tree
Hide file tree
Showing 4 changed files with 250 additions and 0 deletions.
55 changes: 55 additions & 0 deletions server/dbschema/Calendar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const { mongoose } = require('../../mongoose');

const CalendarSchema = new mongoose.Schema({
user: {
type: mongoose.Schema.Types.ObjectId,
},
created_time: {
type: Date
},
days: {
type: [mongoose.Schema.Types.ObjectId],
}
});

const Day = new mongoose.Schema({
date: {
type: Date,
},
occasions: {
type: [mongoose.Schema.Types.ObjectId],
},
planned_outfits: {
type: [mongoose.Schema.Types.ObjectId],
},
weather: {
type: mongoose.Schema.Types.Mixed,
}
});

const OccasionSchema = new mongoose.Schema({
user: {
type: mongoose.Schema.Types.ObjectId,
},
name: {
type: String,
required: true,
},
date: {
type: Date,
},
planned_outfits: {
type: [mongoose.Schema.Types.ObjectId],
},
place: {
type: String,
}

});

module.exports = {
Calendar: mongoose.model('Calendar', CalendarSchema),
Day: mongoose.model('Day', Day),
Occasion: mongoose.model('Occasion', OccasionSchema)
}

96 changes: 96 additions & 0 deletions server/dbschema/Outfit/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
const { mongoose } = require('../../mongoose');

const OutfitCollectionSchema = new mongoose.Schema({
name: {
type: String,
required: true,
unique: true
},
owner: {
type: mongoose.Schema.Types.ObjectId,
required: true,
},
created_time: {
type: Date,
},
is_private: {
type: Boolean,
},
occasion: {
type: String,
},
season: {
type: String,
},
style: {
type: String,
},
color: {
type: String,
},
outfits: {
type: [mongoose.Schema.Types.ObjectId],
}
});

const OutfitSchema = new mongoose.Schema({
creator: {
type: mongoose.Schema.Types.ObjectId,
required: true,
},
created_time: {
type: Date,
},
is_private: {
type: Boolean,
},
occasion: {
type: String,
},
season: {
type: String,
},
style: {
type: String,
},
color: {
type: String,
},
Budget: {
type: String,
},
items: {
type: [mongoose.Schema.Types.ObjectId],
},
is_AI: {
type: Boolean,
},
Is_missing: {
type: Boolean,
},
is_favorite: {
type: Boolean,
},
is_worn: {
type: Boolean,
},
is_deleted: {
type: Boolean,
},
is_archived: {
type: Boolean,
},
is_shared: {
type: Boolean,
},

});

module.exports = {
Outfit: mongoose.model('Outfit', OutfitSchema),
OutfitCollection: mongoose.model('OutfitCollection', OutfitCollectionSchema)

}



38 changes: 38 additions & 0 deletions server/dbschema/User/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const { mongoose } = require('../../mongoose');

const UserSchema = new mongoose.Schema({
email: {
type: String,
required: false
},
password: {
type: String,
required: true
},
name: {
type: String,
required: true
},
calendar: {
type: mongoose.Schema.Types.ObjectId,
},
wardrobe: {
type: mongoose.Schema.Types.ObjectId,
},
outfits: {
type: [mongoose.Schema.Types.ObjectId],
},
friends: {
type: [mongoose.Schema.Types.ObjectId],
},
subscription: {
type: [mongoose.Schema.Types.ObjectId],
},
preference_tags: {
type: mongoose.Schema.Types.Mixed,
}
});

module.exports = {
User: mongoose.model('User', UserSchema)
}
61 changes: 61 additions & 0 deletions server/dbschema/Wardrobe/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
const { mongoose } = require('../../mongoose');

const WardrobeSchema = new mongoose.Schema({
user: {
type: mongoose.Schema.Types.ObjectId,
required: true
},
created_time: {
type: Date
},
items: {
type: [mongoose.Schema.Types.ObjectId],
},
outfits: {
type: [mongoose.Schema.Types.ObjectId],
}
});

const ItemSchema = new mongoose.Schema({
name: {
type: String,
},
user: {
type: mongoose.Schema.Types.ObjectId,
required: true,
},
created_time: {
type: Date,
},
type: {
type: String,
},
color: {
type: String,
},
season: {
type: String,
},
style: {
type: String,
},
occasion: {
type: String,
},
budget: {
type: String,
},
brand: {
type: String,
},
size: {
type: String,
},


});

module.exports = {
Wardrobe: mongoose.model('Wardrobe', WardrobeSchema),
Item: mongoose.model('Item', ItemSchema)
}

0 comments on commit 034de6a

Please sign in to comment.