group events

This commit is contained in:
Bastian Wagner
2025-12-19 13:14:04 +01:00
parent 5a08e2319f
commit e05ab13d0d
16 changed files with 442 additions and 101 deletions

View File

@@ -0,0 +1,29 @@
import { Entity, PrimaryColumn, Column, CreateDateColumn, Index } from 'typeorm';
export type GroupEventType =
| 'GROUP_CREATED'
| 'GROUP_RENAMED'
| 'GROUP_INVITE_ROTATED'
| 'GROUP_DELETED';
@Entity('group_events')
@Index(['groupId', 'createdAt'])
export class GroupEventEntity {
@PrimaryColumn()
id: string; // ULID oder UUID, kommt vom Server oder Client
@Column()
groupId: string;
@Column({ type: 'varchar', length: 64 })
type: GroupEventType;
@Column({ type: 'json' })
payload: any;
@Column({ nullable: true })
actorId?: string;
@CreateDateColumn()
createdAt: Date;
}