2023-12-29 20:11:07 -05:00
|
|
|
import { Schema, PopulatedDoc } 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;
|
2024-04-20 19:17:43 -04:00
|
|
|
index: number;
|
2023-09-25 19:19:32 -04:00
|
|
|
words?: number;
|
|
|
|
notes: string;
|
|
|
|
genre: string[];
|
2023-12-30 00:46:11 -05:00
|
|
|
bands: PopulatedDoc<IBand & Document>[];
|
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
|
|
|
},
|
2024-04-20 19:17:43 -04:00
|
|
|
index: {
|
|
|
|
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(),
|
|
|
|
},
|
|
|
|
});
|