feat: add sample document data array with typed document structure

- Define Doc type representing documents with id, name, and binary data
 - Export sample documents array with example PDF, DOCX, and XLSX files
 - Use Uint8Array to simulate file binary content in-memory
This commit is contained in:
tekh 2025-07-09 11:50:05 +02:00
parent e47bb4f35c
commit 480393743f
2 changed files with 41 additions and 0 deletions

View File

@ -1,3 +1,5 @@
import { Doc } from 'src/api/document-service';
import { Product } from 'src/api/product-service';
import { Filter } from 'src/api/attribute-service';
@ -212,6 +214,8 @@ export const _notifications = [
},
];
// ----------------------------------------------------------------------
export const _products: Product[] = [
{
id: '1',
@ -225,6 +229,8 @@ export const _products: Product[] = [
}
];
// ----------------------------------------------------------------------
export const _filters: Filter[] = [
{ id: 1, label: 'Rechnungsnummer', name: 'invoiceNumber', type: 'VARCHAR' },
{ id: 2, label: 'Kundenname', name: 'customerName', type: 'INTEGER' },
@ -238,4 +244,34 @@ export const _filters: Filter[] = [
{ id: 10, label: 'Erstellungsdatum', name: 'createdAt', type: 'DATE' },
{ id: 11, label: 'Lieferzeit', name: 'deliveryTime', type: 'TIME' },
{ id: 12, label: 'Letzte Aktualisierung', name: 'lastUpdated', type: 'DATETIME' }
];
// ----------------------------------------------------------------------
export const documents: Doc[] = [
{
id: 1,
name: "example1.pdf",
data: new Uint8Array([37, 80, 68, 70, 45])
},
{
id: 2,
name: "example2.pdf",
data: new Uint8Array([37, 80, 68, 70, 45, 49, 46])
},
{
id: 3,
name: "document1.docx",
data: new Uint8Array([80, 75, 3, 4, 20])
},
{
id: 4,
name: "spreadsheet1.xlsx",
data: new Uint8Array([80, 75, 3, 4, 20])
},
{
id: 5,
name: "report.docx",
data: new Uint8Array([80, 75, 3, 4, 20, 0, 6])
},
];

View File

@ -0,0 +1,5 @@
export type Doc = {
id: number,
name: string,
data: Uint8Array
}