feat(csv-parser): Implement CSV import functionality with mapping and type conversion
- Added permissions for editing and deleting CSV field mappings. - Created type converter for CSV cells to handle various data types. - Implemented database migrations for CSV field mappings and import logs. - Seeded initial system templates for nutrition and activity data imports. - Developed admin endpoints for managing system CSV templates. - Introduced user endpoints for CSV import analysis and mapping retrieval. - Added tests for core CSV parser functionalities, including delimiter detection and value conversion.
This commit is contained in:
1 parent
73963e7140
commit
4a771f6a83
16 files changed
+3252
-1
No files matched your search
@@ -0,0 +1,19 @@
|
||||
"""Zugriffsregeln für csv_field_mappings (Issue #21)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Mapping
|
||||
|
||||
|
||||
def user_may_edit_mapping_row(row: Mapping[str, Any], session: Mapping[str, Any]) -> bool:
|
||||
if session.get("role") == "admin":
|
||||
return True
|
||||
if row.get("is_system"):
|
||||
return False
|
||||
return str(row.get("profile_id")) == str(session.get("profile_id"))
|
||||
|
||||
|
||||
def user_may_delete_mapping(row: Mapping[str, Any], session: Mapping[str, Any]) -> bool:
|
||||
if row.get("is_system"):
|
||||
return False
|
||||
return str(row.get("profile_id")) == str(session.get("profile_id"))
|
||||
Reference in new issue
Block a user