mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +00:00
- Created contact-form.json defining the structure and validation for the contact form. - Added package.json for form_builder package with dependencies and exports. - Implemented functions.json for form field handlers and validation functions. - Configured storybook for form_builder with various form field stories. - Established style tokens for form fields including colors and spacing. - Defined validation patterns and functions for form fields in validators.json. feat(notification_center): introduce notification components and event handling - Added ui.json for notification components including summary, toast, and list. - Created schema.json for Notification entity with fields and relations. - Implemented event handlers for notification events in handlers.json. - Established package.json for notification_center with components and scripts. - Developed functions.json for notification management and display functions. - Configured storybook for notification_center with various notification stories. - Defined style tokens for notifications including colors and spacing.
116 lines
3.0 KiB
JSON
116 lines
3.0 KiB
JSON
{
|
|
"$schema": "https://metabuilder.dev/schemas/entities.schema.json",
|
|
"schemaVersion": "2.0.0",
|
|
"entities": [
|
|
{
|
|
"name": "Notification",
|
|
"version": "1.0",
|
|
"description": "User notification for alerts, messages, and system events",
|
|
"primaryKey": "id",
|
|
"timestamps": false,
|
|
"softDelete": false,
|
|
"fields": {
|
|
"id": {
|
|
"type": "string",
|
|
"generated": true,
|
|
"description": "Unique identifier (CUID)"
|
|
},
|
|
"tenantId": {
|
|
"type": "string",
|
|
"required": true,
|
|
"index": true,
|
|
"description": "Tenant identifier"
|
|
},
|
|
"userId": {
|
|
"type": "string",
|
|
"required": true,
|
|
"index": true,
|
|
"description": "User who receives this notification"
|
|
},
|
|
"type": {
|
|
"type": "enum",
|
|
"required": true,
|
|
"enum": ["info", "warning", "success", "error", "mention", "reply", "follow", "like", "system"],
|
|
"description": "Notification type/severity"
|
|
},
|
|
"title": {
|
|
"type": "string",
|
|
"required": true,
|
|
"maxLength": 200,
|
|
"description": "Notification title"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "Notification message body"
|
|
},
|
|
"icon": {
|
|
"type": "string",
|
|
"nullable": true,
|
|
"description": "Icon name for display"
|
|
},
|
|
"read": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"index": true,
|
|
"description": "Whether notification has been read"
|
|
},
|
|
"data": {
|
|
"type": "text",
|
|
"nullable": true,
|
|
"description": "JSON: action URLs, entity references, etc."
|
|
},
|
|
"createdAt": {
|
|
"type": "bigint",
|
|
"required": true,
|
|
"index": true,
|
|
"description": "Creation timestamp in milliseconds"
|
|
},
|
|
"expiresAt": {
|
|
"type": "bigint",
|
|
"nullable": true,
|
|
"index": true,
|
|
"description": "Expiration timestamp in milliseconds"
|
|
}
|
|
},
|
|
"indexes": [
|
|
{
|
|
"fields": ["tenantId"],
|
|
"name": "idx_notification_tenant"
|
|
},
|
|
{
|
|
"fields": ["userId", "read"],
|
|
"name": "idx_notification_user_read"
|
|
},
|
|
{
|
|
"fields": ["createdAt"],
|
|
"name": "idx_notification_created"
|
|
}
|
|
],
|
|
"relations": [
|
|
{
|
|
"name": "tenant",
|
|
"type": "belongsTo",
|
|
"entity": "Tenant",
|
|
"field": "tenantId",
|
|
"onDelete": "Cascade"
|
|
},
|
|
{
|
|
"name": "user",
|
|
"type": "belongsTo",
|
|
"entity": "User",
|
|
"field": "userId",
|
|
"onDelete": "Cascade"
|
|
}
|
|
],
|
|
"acl": {
|
|
"create": ["system", "admin"],
|
|
"read": ["self"],
|
|
"update": ["self"],
|
|
"delete": ["self"],
|
|
"rowLevel": "userId = currentUser.id"
|
|
}
|
|
}
|
|
]
|
|
}
|