2023-10-03 01:14:20 -04:00
|
|
|
import mongoose, { Schema, PopulatedDoc, Document, Model } from "mongoose";
|
|
|
|
import { IBand } from "~/models/band";
|
2023-09-25 19:19:32 -04:00
|
|
|
export interface IChapter {
|
|
|
|
title: string;
|
|
|
|
summary: string;
|
|
|
|
id?: number;
|
|
|
|
// index: number;
|
|
|
|
words?: number;
|
|
|
|
notes: string;
|
|
|
|
genre: string[];
|
|
|
|
bands: PopulatedDoc<IBand & Document>[];
|
|
|
|
characters: string[];
|
|
|
|
relationships: string[][];
|
|
|
|
nsfw: boolean;
|
|
|
|
loggedInOnly: boolean;
|
|
|
|
hidden: boolean;
|
2023-10-03 01:14:20 -04:00
|
|
|
posted?: Date;
|
2023-09-25 19:19:32 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export const Chapter = new mongoose.Schema<IChapter>({
|
|
|
|
title: {
|
|
|
|
type: String,
|
2023-10-03 01:14:20 -04:00
|
|
|
default: "",
|
2023-09-25 19:19:32 -04:00
|
|
|
},
|
|
|
|
id: {
|
2023-10-03 01:14:20 -04:00
|
|
|
type: Number,
|
2023-09-25 19:19:32 -04:00
|
|
|
},
|
|
|
|
summary: {
|
2023-10-03 01:14:20 -04:00
|
|
|
type: String,
|
2023-09-25 19:19:32 -04:00
|
|
|
},
|
|
|
|
words: {
|
2023-10-03 01:14:20 -04:00
|
|
|
type: Number,
|
2023-09-25 19:19:32 -04:00
|
|
|
},
|
|
|
|
notes: {
|
2023-10-03 01:14:20 -04:00
|
|
|
type: String,
|
2023-09-25 19:19:32 -04:00
|
|
|
},
|
2023-10-03 01:14:20 -04:00
|
|
|
genre: [
|
|
|
|
{
|
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
bands: [
|
|
|
|
{
|
|
|
|
type: Number,
|
|
|
|
ref: "Band",
|
|
|
|
},
|
|
|
|
],
|
2023-09-25 19:19:32 -04:00
|
|
|
characters: [{ type: String }],
|
2023-10-03 01:14:20 -04:00
|
|
|
relationships: [[{ type: String }]],
|
2023-09-25 19:19:32 -04:00
|
|
|
nsfw: {
|
2023-10-03 01:14:20 -04:00
|
|
|
type: Boolean,
|
2023-09-25 19:19:32 -04:00
|
|
|
},
|
|
|
|
loggedInOnly: {
|
|
|
|
type: Boolean,
|
2023-10-03 01:14:20 -04:00
|
|
|
default: true,
|
2023-09-25 19:19:32 -04:00
|
|
|
},
|
|
|
|
hidden: {
|
|
|
|
type: Boolean,
|
2023-10-03 01:14:20 -04:00
|
|
|
default: false,
|
2023-09-25 19:19:32 -04:00
|
|
|
},
|
|
|
|
posted: {
|
|
|
|
type: Date,
|
2023-10-03 01:14:20 -04:00
|
|
|
default: new Date(),
|
|
|
|
},
|
|
|
|
});
|