Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions apps/api/src/modules/profiles/lover.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import mongoose, { Document, Schema } from 'mongoose';
import { DjGenre, ILoverProfile } from '@mixmatch/types';

export interface ILoverProfileDocument extends Omit<ILoverProfile, 'id' | 'createdAt' | 'updatedAt'>, Document {
user: mongoose.Types.ObjectId;
followedDjs: mongoose.Types.ObjectId[];
createdAt: Date;
updatedAt: Date;
}

const LoverProfileSchema = new Schema<ILoverProfileDocument>(
{
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<ILoverProfileDocument>('LoverProfile', LoverProfileSchema);

export default LoverProfile;
44 changes: 44 additions & 0 deletions apps/api/src/modules/profiles/planner.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import mongoose, { Document, Schema } from 'mongoose';
import { EventType, IPlannerProfile } from '@mixmatch/types';

export interface IPlannerProfileDocument extends Omit<IPlannerProfile, 'id' | 'createdAt' | 'updatedAt'>, Document {
user: mongoose.Types.ObjectId;
createdAt: Date;
updatedAt: Date;
}

const PlannerProfileSchema = new Schema<IPlannerProfileDocument>(
{
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<IPlannerProfileDocument>('PlannerProfile', PlannerProfileSchema);

export default PlannerProfile;
29 changes: 29 additions & 0 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Loading