import { ModelDefinition } from '@nestjs/mongoose'; import { Document } from 'mongoose'; import { HubResource } from '../../hub-resource.enum'; /** * Module options for configuring and dynamically registering the CommentsModule. * * This allows developers to specify the resource model that supports "commenting" * and optionally provide a custom route suffix. The modular design ensures * consistent, reusable comment functionality across multiple resource types * (e.g. News, Events, Demos). */ export type CommentsModuleOptions = { /** * The enum value identifying the resource type this comment module relates to. * Used internally for routing and tagging. */ resource: HubResource; /** * Mongoose model definition representing the resource type * that can receive comments. */ model: ModelDefinition; /** * Suffix used to customize the controller route. * For example, setting this to "news" will expose routes comment `/comment/news/:id`. */ routeSuffix: string; version: string; /** * Field name on the resource document representing a single owner's ID. * Enables access control and filtering of comments by ownership. */ ownerIdField?: keyof Omit; /** * Field name on the resource document representing multiple owner IDs. * Useful for shared or collaborative resource ownership models. */ ownerIdsField?: keyof Omit; };