Add filter functionality and async retrieval
Introduce a new `_filters` constant in `_data.ts` that defines various filter objects for invoices and related data. Update `filter-service.ts` to import `_filters` and define the `Filter` type. Implement `getFiltersAsync` function to asynchronously retrieve the filter data.
This commit is contained in:
parent
3fd7553ce8
commit
b0c6cdcd13
@ -1,3 +1,5 @@
|
||||
import { Filter } from 'src/api/filter-service';
|
||||
|
||||
import {
|
||||
_id,
|
||||
_price,
|
||||
@ -208,3 +210,16 @@ export const _notifications = [
|
||||
isUnRead: false,
|
||||
},
|
||||
];
|
||||
|
||||
export const _filters: Filter[] = [
|
||||
{ id: 1, label: 'Rechnungsnummer', name: 'invoiceNumber', type: 'VARCHAR' },
|
||||
{ id: 2, label: 'Kundenname', name: 'customerName', type: 'VARCHAR' },
|
||||
{ id: 3, label: 'Startdatum', name: 'startDate', type: 'DATE' },
|
||||
{ id: 4, label: 'Enddatum', name: 'endDate', type: 'DATE' },
|
||||
{ id: 5, label: 'Status der Rechnung', name: 'status', type: 'VARCHAR' },
|
||||
{ id: 6, label: 'Mindestbetrag', name: 'minAmount', type: 'DECIMAL' },
|
||||
{ id: 7, label: 'Höchstbetrag', name: 'maxAmount', type: 'DECIMAL' },
|
||||
{ id: 8, label: 'Steuer inbegriffen?', name: 'taxIncluded', type: 'BOOLEAN' },
|
||||
{ id: 9, label: 'Währung', name: 'currency', type: 'VARCHAR' },
|
||||
{ id: 10, label: 'Erstellungsdatum', name: 'createdAt', type: 'DATE' }
|
||||
];
|
||||
@ -1,3 +1,5 @@
|
||||
import { _filters } from 'src/_mock/_data';
|
||||
|
||||
export type Type = 'BOOLEAN' | 'DATE' | 'VARCHAR' | 'INTEGER' | 'DECIMAL';
|
||||
|
||||
export type Filter = {
|
||||
@ -5,4 +7,8 @@ export type Filter = {
|
||||
label: string;
|
||||
name: string;
|
||||
type: Type;
|
||||
};
|
||||
};
|
||||
|
||||
export function getFiltersAsync(): Promise<Filter[]> {
|
||||
return Promise.resolve(_filters);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user