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
+1
View File
@@ -1,3 +1,4 @@
export declare class CreatePantryItemDto {
productId: number;
location?: string;
}
+6
View File
@@ -19,4 +19,10 @@ __decorate([
(0, class_validator_1.IsPositive)(),
__metadata("design:type", Number)
], CreatePantryItemDto.prototype, "productId", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
(0, class_validator_1.MaxLength)(50),
__metadata("design:type", String)
], CreatePantryItemDto.prototype, "location", void 0);
//# sourceMappingURL=create-pantry-item.dto.js.map
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"create-pantry-item.dto.js","sourceRoot":"","sources":["../../../src/pantry/dto/create-pantry-item.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoD;AAEpD,MAAa,mBAAmB;CAI/B;AAJD,kDAIC;AADC;IAFC,IAAA,uBAAK,GAAE;IACP,IAAA,4BAAU,GAAE;;sDACK"}
{"version":3,"file":"create-pantry-item.dto.js","sourceRoot":"","sources":["../../../src/pantry/dto/create-pantry-item.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAqF;AAErF,MAAa,mBAAmB;CAS/B;AATD,kDASC;AANC;IAFC,IAAA,uBAAK,GAAE;IACP,IAAA,4BAAU,GAAE;;sDACK;AAKlB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,EAAE,CAAC;;qDACI"}