Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions src/docs/module.doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -52,6 +58,9 @@ paths:
- hivemind
- violationDetection
- dynamicNft
- communityInsights
- communityHealth
- announcements
- in: query
name: community
schema:
Expand Down Expand Up @@ -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':
Expand Down Expand Up @@ -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
9 changes: 9 additions & 0 deletions src/validations/module.validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down