From d5f38cff857ffa805d18d364923d87c83d2a5fc2 Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 9 Jul 2025 13:51:22 +0200 Subject: [PATCH] refactor(Doc): Add addedWhen (Date), addedWho (string), changedWhen (Date) and changedWho (string) properties. --- src/client/dd-hub-react/src/_mock/_data.ts | 26 ++++++++++++++----- .../dd-hub-react/src/api/document-service.ts | 6 ++++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/client/dd-hub-react/src/_mock/_data.ts b/src/client/dd-hub-react/src/_mock/_data.ts index dd964ca..e8f9e2b 100644 --- a/src/client/dd-hub-react/src/_mock/_data.ts +++ b/src/client/dd-hub-react/src/_mock/_data.ts @@ -265,26 +265,40 @@ export const _documents: Doc[] = [ { id: 1, name: "example1.pdf", - data: base64ToUint8Array(_base64.example1_pdf) + data: base64ToUint8Array(_base64.example1_pdf), + addedWhen: new Date("2024-01-12T10:00:00Z"), + addedWho: "TekH" }, { id: 2, name: "example2.pdf", - data: base64ToUint8Array(_base64.example2_pdf) + data: base64ToUint8Array(_base64.example2_pdf), + addedWhen: new Date("2024-02-03T09:30:00Z"), + addedWho: "bob", + changedWhen: new Date("2024-03-15T12:00:00Z"), + changedWho: "KammM" }, { id: 3, name: "document1.docx", - data: base64ToUint8Array(_base64.document1_docx) + data: base64ToUint8Array(_base64.document1_docx), + addedWhen: new Date("2023-12-20T14:45:00Z"), + addedWho: "SchreiberM" }, { id: 4, name: "spreadsheet1.xlsx", - data: base64ToUint8Array(_base64.spreadsheet1_xlsx) + data: base64ToUint8Array(_base64.spreadsheet1_xlsx), + addedWhen: new Date("2024-05-01T08:15:00Z"), + addedWho: "KammM", + changedWhen: new Date("2024-06-10T16:20:00Z"), + changedWho: "OlgunR" }, { id: 5, name: "report.docx", - data: base64ToUint8Array(_base64.report_docx) - }, + data: base64ToUint8Array(_base64.report_docx), + addedWhen: new Date("2024-04-17T11:25:00Z"), + addedWho: "SchreiberM" + } ]; \ No newline at end of file diff --git a/src/client/dd-hub-react/src/api/document-service.ts b/src/client/dd-hub-react/src/api/document-service.ts index 199cb69..3b049e9 100644 --- a/src/client/dd-hub-react/src/api/document-service.ts +++ b/src/client/dd-hub-react/src/api/document-service.ts @@ -3,7 +3,11 @@ import { _documents } from "src/_mock" export type Doc = { id: number, name: string, - data: Uint8Array + data: Uint8Array, + addedWhen: Date, + addedWho: string, + changedWhen?: Date, + changedWho?: string } export type DocQuery = {