Adds article retrieval and taxonomy path APIs
Implements endpoints to fetch article details and associated taxonomy paths by slug, enhancing content discovery and structure. Introduces response DTOs and updates data models to support richer metadata and timestamp fields for improved API consistency.
This commit is contained in:
1 parent
9d65fbd235
commit
f77f5f9543
5 files changed
+218
-8
No files matched your search
@@ -1,6 +1,11 @@
|
||||
import mongoose, { Schema, Document } from 'mongoose';
|
||||
import { ModelDefinition } from './types';
|
||||
|
||||
export interface MongooseTimestamps {
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface Metadata {
|
||||
key: string;
|
||||
value: string | any[] | null;
|
||||
@@ -16,7 +21,9 @@ export interface TaxonomyChildItem {
|
||||
children?: TaxonomyChildItem[];
|
||||
}
|
||||
|
||||
export interface Taxonomy extends Document {
|
||||
export interface Taxonomy
|
||||
extends Document<mongoose.Types.ObjectId>,
|
||||
MongooseTimestamps {
|
||||
label: string;
|
||||
items: TaxonomyChildItem[];
|
||||
metadatas: Metadata[];
|
||||
@@ -27,13 +34,17 @@ export interface ContentSection {
|
||||
taxonomies: mongoose.Types.ObjectId[];
|
||||
}
|
||||
|
||||
export interface Content extends Document {
|
||||
export interface Content
|
||||
extends Document<mongoose.Types.ObjectId>,
|
||||
MongooseTimestamps {
|
||||
key: string;
|
||||
label: string;
|
||||
sections: ContentSection[];
|
||||
}
|
||||
|
||||
export interface Article extends Document {
|
||||
export interface Article
|
||||
extends Document<mongoose.Types.ObjectId>,
|
||||
MongooseTimestamps {
|
||||
title: string;
|
||||
slug: string;
|
||||
content: string;
|
||||
|
||||
Reference in new issue
Block a user