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:
parent
e47bb4f35c
commit
480393743f
@ -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' },
|
||||
@ -239,3 +245,33 @@ export const _filters: Filter[] = [
|
||||
{ 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])
|
||||
},
|
||||
];
|
||||
5
src/client/dd-hub-react/src/api/document-service.ts
Normal file
5
src/client/dd-hub-react/src/api/document-service.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export type Doc = {
|
||||
id: number,
|
||||
name: string,
|
||||
data: Uint8Array
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user