group events
This commit is contained in:
29
costly-api/src/groups/persistence/group-event.entity.ts
Normal file
29
costly-api/src/groups/persistence/group-event.entity.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user