feat(sync): add converters from Hiboutik DTOs to Prisma inputs

Includes helpers for Hiboutik dates ("0000-00-00" is ignored) and optional prices ("0.00" means no value).
This commit is contained in:
MastersGame
2026-11-05 23:00:48 +01:00
parent 2424a086e0
commit db699822f9
12 changed files with 294 additions and 0 deletions

11
src/utils/price.spec.ts Normal file
View File

@@ -0,0 +1,11 @@
import { parseOptionalHiboutikPrice } from './price';
describe('parseOptionalHiboutikPrice', () => {
it('keeps a positive price', () => {
expect(parseOptionalHiboutikPrice('12.50')).toBe('12.50');
});
it.each(['0.00', '0', '', 'abc', '-1.00', null, undefined])('returns null for %p', (value) => {
expect(parseOptionalHiboutikPrice(value)).toBeNull();
});
});