fix: export/import missing refill history, prescription, and bottle fields (#227)

- Add refill history export/import with medication reference mapping
- Include totalPills (bottle type capacity) in inventory export
- Include dismissedUntil field for past dose dismissal state
- Add expiryWarningDays and shareStockStatus to settings export
- Bump export version to 1.1
- Add refill count to import result reporting
- Update i18n import success details to include refill count

Closes #224
This commit is contained in:
Daniel Volz
2026-02-16 21:51:39 +01:00
committed by GitHub
parent ff100dfea5
commit 871e6066ec
5 changed files with 102 additions and 12 deletions
@@ -256,7 +256,7 @@ describe("useAppContext", () => {
(global.fetch as ReturnType<typeof vi.fn>).mockResolvedValue({
ok: true,
json: () => Promise.resolve({}),
text: () => Promise.resolve('{"imported":{"medications":1,"doseHistory":2,"shareLinks":3}}'),
text: () => Promise.resolve('{"imported":{"medications":1,"doseHistory":2,"refillHistory":4,"shareLinks":3}}'),
});
});
@@ -364,7 +364,7 @@ describe("useAppContext", () => {
expect(mockUseMedications().loadMeds).toHaveBeenCalled();
expect(mockUseSettings().loadSettings).toHaveBeenCalled();
expect(mockUseDoses().loadTakenDoses).toHaveBeenCalled();
expect(result.current.importResult).toEqual({ medications: 1, doses: 2, shares: 3 });
expect(result.current.importResult).toEqual({ medications: 1, doses: 2, refills: 4, shares: 3 });
});
it("exports data and triggers JSON download", async () => {