mirror of
https://github.com/PretendoNetwork/BOSS.git
synced 2026-10-22 15:31:34 -05:00
BOSS 2.0 - Full TS and microservice rewrite. Still pulls from local until admin panel updates
This commit is contained in:
31
src/models/file.ts
Normal file
31
src/models/file.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import mongoose from 'mongoose';
|
||||
import { AutoIncrementID } from '@typegoose/auto-increment';
|
||||
import { IFile, IFileMethods, FileModel } from '@/types/mongoose/file';
|
||||
|
||||
const FileSchema = new mongoose.Schema<IFile, FileModel, IFileMethods>({
|
||||
deleted: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
data_id: Number, // TODO - Wait until https://github.com/typegoose/auto-increment/pull/21 is merged and then change this to BigInt
|
||||
task_id: String,
|
||||
boss_app_id: String,
|
||||
supported_countries: [String],
|
||||
supported_languages: [String],
|
||||
creator_pid: Number,
|
||||
name: String,
|
||||
type: String,
|
||||
hash: String,
|
||||
size: BigInt,
|
||||
notify_on_new: [String],
|
||||
notify_led: Boolean,
|
||||
created: BigInt,
|
||||
updated: BigInt
|
||||
}, { id: false });
|
||||
|
||||
FileSchema.plugin(AutoIncrementID, {
|
||||
startAt: 50000, // * Start very high to avoid conflicts with Nintendo Data IDs
|
||||
field: 'data_id'
|
||||
});
|
||||
|
||||
export const File: FileModel = mongoose.model<IFile, FileModel>('File', FileSchema);
|
||||
22
src/models/task.ts
Normal file
22
src/models/task.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import mongoose from 'mongoose';
|
||||
import { ITask, ITaskMethods, TaskModel } from '@/types/mongoose/task';
|
||||
|
||||
const TaskSchema = new mongoose.Schema<ITask, TaskModel, ITaskMethods>({
|
||||
deleted: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
id: String,
|
||||
boss_app_id: String,
|
||||
creator_pid: Number,
|
||||
status: {
|
||||
type: String,
|
||||
enum : ['open'] // TODO - What else is there?
|
||||
},
|
||||
title_id: String,
|
||||
description: Number,
|
||||
created: BigInt,
|
||||
updated: BigInt
|
||||
}, { id: false });
|
||||
|
||||
export const Task: TaskModel = mongoose.model<ITask, TaskModel>('Task', TaskSchema);
|
||||
Reference in New Issue
Block a user