Initial commit
This commit is contained in:
27
packages/core-dsr/src/in-memory-data-delete.ts
Normal file
27
packages/core-dsr/src/in-memory-data-delete.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { IDataDelete } from "./data-delete.interface";
|
||||
import type { DeletionMode, DeletionCertificate } from "./dsr-types";
|
||||
|
||||
/**
|
||||
* Volatile in-memory IDataDelete. Returns a well-shaped DeletionCertificate
|
||||
* without touching any persistence layer.
|
||||
*
|
||||
* Used in dev-seed and storybook contexts where Payload is unavailable.
|
||||
* Not a recording double — use RecordingDataDelete from @repo/core-testing for
|
||||
* call-assertion in unit tests.
|
||||
*/
|
||||
export class InMemoryDataDelete implements IDataDelete {
|
||||
async deleteSubjectData(
|
||||
subjectId: string,
|
||||
mode: DeletionMode,
|
||||
): Promise<DeletionCertificate> {
|
||||
return {
|
||||
subjectId,
|
||||
mode,
|
||||
timestamp: new Date().toISOString(),
|
||||
reason: "art-17-request",
|
||||
affected: [],
|
||||
auditEntryId: randomUUID(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user