2023-12-28 20:01:49 -05:00
|
|
|
import { Schema, PopulatedDoc, Document, Model } from "mongoose";
|
2023-12-20 17:23:31 -05:00
|
|
|
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[];
|
2023-12-29 19:06:55 -05:00
|
|
|
bands: PopulatedDoc<IBand>[];
|
2023-09-25 19:19:32 -04:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-12-28 20:01:49 -05:00
|
|
|
export const Chapter = new Schema<IChapter>({
|
2023-09-25 19:19:32 -04:00
|
|
|
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(),
|
|
|
|
},
|
|
|
|
});
|