Restructure backend into modular API layers with admin/organizador/invitados routes, add role-based middleware, flatten module models, and update build scripts
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { EntitySchema } from '@mikro-orm/core';
|
||||
import { BaseEntity } from './base.entity';
|
||||
|
||||
export class NotificationRule extends BaseEntity {
|
||||
module!: string; // e.g. 'guest', 'gift', 'todo'
|
||||
|
||||
event!: string; // e.g. 'guest.invited', 'todo.completed'
|
||||
|
||||
channels!: Array<'email' | 'whatsapp' | 'sms' | 'custom'>;
|
||||
|
||||
conditions?: Record<string, any>;
|
||||
}
|
||||
|
||||
export const NotificationRuleSchema = new EntitySchema<NotificationRule>({
|
||||
class: NotificationRule,
|
||||
tableName: 'notification_rules',
|
||||
properties: {
|
||||
id: { primary: true, type: 'uuid', defaultRaw: 'uuid_generate_v4()' },
|
||||
tenantId: { type: 'string' },
|
||||
metadata: { type: 'json', nullable: true },
|
||||
createdAt: { type: 'date', defaultRaw: 'now()' },
|
||||
updatedAt: { type: 'date', defaultRaw: 'now()' },
|
||||
|
||||
module: { type: 'string' },
|
||||
event: { type: 'string' },
|
||||
channels: { type: 'json' },
|
||||
conditions: { type: 'json', nullable: true },
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user