feat: add unit mapping functionality
Test Suite / test (24.15.0) (push) Has been cancelled

- Added new API path for unit mappings in `api_paths.dart`.
- Implemented `upsertUnitMapping` method in `ImportRepository` to handle unit mapping creation.
- Updated `ReceiptImportTab` to learn and save unit mappings during receipt import.
- Created DTO for unit mapping with validation in `create-unit-mapping.dto.ts`.
- Added SQL migration for `UnitMapping` table creation with necessary constraints.
This commit is contained in:
Nils-Johan Gynther
2026-05-07 10:00:42 +02:00
parent 26823fbf35
commit a68a0ca86f
35 changed files with 558 additions and 24 deletions
+72
View File
@@ -7,6 +7,24 @@ export declare class InventoryController {
constructor(inventoryService: InventoryService);
consume(id: number, body: ConsumeInventoryDto): Promise<{
product: {
categoryRef: ({
parent: ({
parent: {
name: string;
id: number;
parentId: number | null;
} | null;
} & {
name: string;
id: number;
parentId: number | null;
}) | null;
} & {
name: string;
id: number;
parentId: number | null;
}) | null;
} & {
name: string;
category: string | null;
status: string;
@@ -50,6 +68,24 @@ export declare class InventoryController {
}[]>;
findAll(location?: string, sort?: string): Promise<({
product: {
categoryRef: ({
parent: ({
parent: {
name: string;
id: number;
parentId: number | null;
} | null;
} & {
name: string;
id: number;
parentId: number | null;
}) | null;
} & {
name: string;
id: number;
parentId: number | null;
}) | null;
} & {
name: string;
category: string | null;
status: string;
@@ -116,6 +152,24 @@ export declare class InventoryController {
})[]>;
create(body: CreateInventoryDto): Promise<{
product: {
categoryRef: ({
parent: ({
parent: {
name: string;
id: number;
parentId: number | null;
} | null;
} & {
name: string;
id: number;
parentId: number | null;
}) | null;
} & {
name: string;
id: number;
parentId: number | null;
}) | null;
} & {
name: string;
category: string | null;
status: string;
@@ -149,6 +203,24 @@ export declare class InventoryController {
}>;
update(id: number, body: UpdateInventoryDto): Promise<{
product: {
categoryRef: ({
parent: ({
parent: {
name: string;
id: number;
parentId: number | null;
} | null;
} & {
name: string;
id: number;
parentId: number | null;
}) | null;
} & {
name: string;
id: number;
parentId: number | null;
}) | null;
} & {
name: string;
category: string | null;
status: string;