add player model
This commit is contained in:
parent
0430186f7e
commit
fef36b8210
41
src/database/models/player.ts
Normal file
41
src/database/models/player.ts
Normal 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);
|
Loading…
Reference in New Issue
Block a user