feat(*): Add support for catch records to My Dex page

This commit is contained in:
Josh Creek
2024-07-12 14:19:44 +01:00
parent f5ae56f6a6
commit 8c5bc48802
6 changed files with 460 additions and 31 deletions
+24
View File
@@ -0,0 +1,24 @@
import mongoose, { Schema, Document, Types } from 'mongoose';
export interface CatchRecord extends Document {
userId: string;
pokedexEntryId: Types.ObjectId;
haveToEvolve: boolean;
caught: boolean;
inHome: boolean;
hasGigantamaxed: boolean;
personalNotes: string;
}
const catchRecordSchema = new Schema<CatchRecord>({
userId: String,
pokedexEntryId: { type: Schema.Types.ObjectId, ref: 'PokedexEntry', required: true },
haveToEvolve: { type: Boolean, default: false },
caught: { type: Boolean, default: false },
inHome: { type: Boolean, default: false },
hasGigantamaxed: { type: Boolean, default: false },
personalNotes: String
});
const CatchRecordModel = mongoose.model<CatchRecord>('CatchRecord', catchRecordSchema);
export default CatchRecordModel;