diff --git a/apps/api/src/modules/profiles/lover.model.ts b/apps/api/src/modules/profiles/lover.model.ts new file mode 100644 index 0000000..6e317f7 --- /dev/null +++ b/apps/api/src/modules/profiles/lover.model.ts @@ -0,0 +1,43 @@ +import mongoose, { Document, Schema } from 'mongoose'; +import { DjGenre, ILoverProfile } from '@mixmatch/types'; + +export interface ILoverProfileDocument extends Omit, Document { + user: mongoose.Types.ObjectId; + followedDjs: mongoose.Types.ObjectId[]; + createdAt: Date; + updatedAt: Date; +} + +const LoverProfileSchema = new Schema( + { + user: { + type: Schema.Types.ObjectId, + ref: 'User', + required: [true, 'User reference is required'], + unique: true, + index: true, + immutable: true, + }, + favoriteGenres: { + type: [String], + enum: Object.values(DjGenre), + default: [], + }, + preferredVibes: { + type: [String], + default: [], + }, + followedDjs: { + type: [Schema.Types.ObjectId], + ref: 'DjProfile', + default: [], + }, + }, + { + timestamps: true, + }, +); +apps/api/src/modules/profiles/lover.model.ts +const LoverProfile = mongoose.model('LoverProfile', LoverProfileSchema); + +export default LoverProfile; diff --git a/apps/api/src/modules/profiles/planner.model.ts b/apps/api/src/modules/profiles/planner.model.ts new file mode 100644 index 0000000..69117f2 --- /dev/null +++ b/apps/api/src/modules/profiles/planner.model.ts @@ -0,0 +1,44 @@ +import mongoose, { Document, Schema } from 'mongoose'; +import { EventType, IPlannerProfile } from '@mixmatch/types'; + +export interface IPlannerProfileDocument extends Omit, Document { + user: mongoose.Types.ObjectId; + createdAt: Date; + updatedAt: Date; +} + +const PlannerProfileSchema = new Schema( + { + user: { + type: Schema.Types.ObjectId, + ref: 'User', + required: [true, 'User reference is required'], + unique: true, + index: true, + immutable: true, + }, + organizationName: { + type: String, + required: [true, 'Organization name is required'], + trim: true, + minlength: [2, 'Organization name must be at least 2 characters'], + maxlength: [200, 'Organization name cannot exceed 200 characters'], + }, + typicalEventTypes: { + type: [String], + enum: Object.values(EventType), + default: [], + }, + website: { + type: String, + trim: true, + }, + }, + { + timestamps: true, + }, +); + +const PlannerProfile = mongoose.model('PlannerProfile', PlannerProfileSchema); + +export default PlannerProfile; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index c3284eb..46f0916 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -27,6 +27,15 @@ export enum AvailabilityStatus { UNAVAILABLE = 'UNAVAILABLE', } +export enum EventType { + CLUB = 'CLUB', + CONCERT = 'CONCERT', + CORPORATE = 'CORPORATE', + FESTIVAL = 'FESTIVAL', + PRIVATE_PARTY = 'PRIVATE_PARTY', + WEDDING = 'WEDDING', +} + export interface IUser { id: string; name: string; @@ -69,3 +78,23 @@ export interface IDjProfile { createdAt: Date; updatedAt: Date; } + +export interface IPlannerProfile { + id: string; + user: string; + organizationName: string; + typicalEventTypes: EventType[]; + website?: string; + createdAt: Date; + updatedAt: Date; +} + +export interface ILoverProfile { + id: string; + user: string; + favoriteGenres: DjGenre[]; + preferredVibes: string[]; + followedDjs: string[]; + createdAt: Date; + updatedAt: Date; +}