diff --git a/src/docs/module.doc.yml b/src/docs/module.doc.yml index c19c0fc..f61e645 100644 --- a/src/docs/module.doc.yml +++ b/src/docs/module.doc.yml @@ -20,9 +20,15 @@ paths: - hivemind - violationDetection - dynamicNft + - communityInsights + - communityHealth + - announcements community: type: string format: objectId + activated: + type: boolean + description: Activation status of the module. Determines whether the module is enabled. responses: '201': description: Module created successfully. @@ -52,6 +58,9 @@ paths: - hivemind - violationDetection - dynamicNft + - communityInsights + - communityHealth + - announcements - in: query name: community schema: @@ -263,6 +272,9 @@ paths: tokenId: type: string description: Metadata for the dynamicNft. + activated: + type: boolean + description: Activation status of the module. Required for all modules. minProperties: 1 responses: '200': @@ -300,3 +312,40 @@ paths: '404': description: NotFound $ref: '#/components/responses/NotFound' + +components: + schemas: + Module: + type: object + properties: + id: + type: string + description: Unique identifier for the module + name: + type: string + enum: + - hivemind + - violationDetection + - dynamicNft + - communityInsights + - communityHealth + - announcements + description: Name of the module + community: + type: string + format: objectId + description: ID of the community the module belongs to + options: + type: object + description: Module-specific configuration options, varies by module type + activated: + type: boolean + description: Indicates whether the module is currently activated + createdAt: + type: string + format: date-time + description: Date and time when the module was created + updatedAt: + type: string + format: date-time + description: Date and time when the module was last updated diff --git a/src/validations/module.validation.ts b/src/validations/module.validation.ts index 9b9b86a..127d395 100644 --- a/src/validations/module.validation.ts +++ b/src/validations/module.validation.ts @@ -230,6 +230,15 @@ const dynamicModuleUpdate = (req: any) => { }), }; break; + case ModuleNames.CommunityInsights: + case ModuleNames.CommunityHealth: + case ModuleNames.Announcements: + bodyOption = { + body: Joi.object().required().keys({ + activated: Joi.boolean(), + }), + }; + break; default: req.allowInput = false; return {};