30
packages/application/src/ports/action-events.repository.ts
Normal file
30
packages/application/src/ports/action-events.repository.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
export type ActionEventRecord = {
|
||||
id: string;
|
||||
userId: string;
|
||||
actionType: string;
|
||||
entityType: string;
|
||||
entityId: string;
|
||||
summary: string;
|
||||
beforeState: Record<string, unknown>;
|
||||
afterState: Record<string, unknown>;
|
||||
metadata: Record<string, unknown> | null;
|
||||
createdAt: Date;
|
||||
undoneAt: Date | null;
|
||||
};
|
||||
|
||||
export type RecordActionInput = {
|
||||
userId: string;
|
||||
actionType: string;
|
||||
entityType: string;
|
||||
entityId: string;
|
||||
summary: string;
|
||||
beforeState: Record<string, unknown>;
|
||||
afterState: Record<string, unknown>;
|
||||
metadata?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export interface ActionEventsRepository {
|
||||
recordAction(input: RecordActionInput): Promise<ActionEventRecord>;
|
||||
getActionEvent(id: string, userId: string): Promise<ActionEventRecord | null>;
|
||||
markUndone(id: string): Promise<void>;
|
||||
}
|
||||
Reference in New Issue
Block a user