feat(inventory): edit and delete existing lots

Lots could only be created; now they can be edited and removed:
- Repository: updateLot (LWW) + softDeleteLot (tombstone).
- Cubit: updateLot / deleteLot.
- The add-lot sheet is now a shared add/edit sheet — tapping a lot opens it
  prefilled (type, year, quantity), with a trash action to delete. The reactive
  detail view refreshes on save/delete.

Tests: repo updateLot/softDeleteLot + widget edit-lot and delete-lot. 42 green.
This commit is contained in:
vjrj 2026-07-08 11:10:43 +02:00
parent 7e92410728
commit f8d4d9a778
10 changed files with 192 additions and 16 deletions

View file

@ -62,6 +62,20 @@ class VarietyDetailCubit extends Cubit<VarietyDetailState> {
quantity: quantity,
);
Future<void> updateLot({
required String lotId,
required LotType type,
int? year,
Quantity? quantity,
}) => _repo.updateLot(
lotId: lotId,
type: type,
harvestYear: year,
quantity: quantity,
);
Future<void> deleteLot(String lotId) => _repo.softDeleteLot(lotId);
Future<void> linkSpecies(String speciesId) =>
_repo.linkSpecies(varietyId, speciesId);