feat: aggregate rows on import feature

This commit is contained in:
Ahmed Bouhuolia
2024-04-04 05:01:09 +02:00
parent b9651f30d5
commit 3851d34ba4
32 changed files with 1115 additions and 298 deletions

View File

@@ -1,9 +1,10 @@
import { IModelMetaField } from '@/interfaces';
import { IModelMetaField, IModelMetaField2 } from '@/interfaces';
import Import from '@/models/Import';
export interface ImportMappingAttr {
from: string;
to: string;
group?: string;
dateFormat?: string;
}
@@ -13,7 +14,7 @@ export interface ImportValidationError {
constraints: Record<string, string>;
}
export type ResourceMetaFieldsMap = { [key: string]: IModelMetaField };
export type ResourceMetaFieldsMap = { [key: string]: IModelMetaField2 };
export interface ImportInsertError {
rowNumber: number;
@@ -61,16 +62,15 @@ export interface ImportOperError {
error: ImportInsertError[];
index: number;
}
export interface ImportableContext {
import: Import,
import: Import;
rowIndex: number;
}
export const ImportDateFormats = [
'yyyy-MM-dd',
'dd.MM.yy',
'MM/dd/yy',
'dd/MMM/yyyy'
]
'dd/MMM/yyyy',
];