feat: Add user prompt preferences and favorites functionality

This commit is contained in:
Marco Beretta 2025-06-01 11:55:45 +02:00
parent f2f4bf87ca
commit 0e26df0390
No known key found for this signature in database
GPG key ID: D918033D8E74CC11
16 changed files with 788 additions and 54 deletions

View file

@ -129,6 +129,28 @@ const userSchema = new Schema<IUser>(
type: Boolean,
default: false,
},
promptFavorites: {
type: [Schema.Types.ObjectId],
ref: 'PromptGroup',
default: [],
},
promptRanking: {
type: [
{
promptGroupId: {
type: Schema.Types.ObjectId,
ref: 'PromptGroup',
required: true,
},
order: {
type: Number,
required: true,
},
},
],
default: [],
_id: false,
},
},
{ timestamps: true },
);

View file

@ -30,6 +30,11 @@ export interface IUser extends Document {
}>;
expiresAt?: Date;
termsAccepted?: boolean;
promptFavorites?: Types.ObjectId[];
promptRanking?: Array<{
promptGroupId: Types.ObjectId;
order: number;
}>;
createdAt?: Date;
updatedAt?: Date;
}