add player model

This commit is contained in:
Lee 2023-11-20 15:14:01 +00:00
parent 0430186f7e
commit fef36b8210

View File

@ -0,0 +1,41 @@
import mongoose, { Model } from "mongoose";
const { Schema } = mongoose;
const schema = new Schema({
/**
* The ID of the player
*/
_id: String,
scoresaber: {
name: String,
profilePicture: String,
country: String,
pp: Number,
rank: Number,
countryRank: Number,
role: String,
badges: [
{
image: String,
description: String,
},
],
histories: String,
scoreStats: {
totalScore: Number,
totalRankedScore: Number,
averageRankedAccuracy: Number,
totalPlayCount: Number,
rankedPlayCount: Number,
replaysWatched: Number,
},
permissions: Number,
banned: Boolean,
inactive: Boolean,
},
});
export const PlayerSchema =
(mongoose.models.Player as Model<typeof schema>) ||
mongoose.model("Player", schema);