feat(offers): add gated phase three public catalogue in QA

This commit is contained in:
2026-11-14 16:49:58 +02:00
parent 91c1857368
commit 7691cab3bc
18 changed files with 1153 additions and 6 deletions
+22
View File
@@ -0,0 +1,22 @@
export type PublicOffer = {
id: number;
title: string;
summary: string;
category: string;
location: { id: string; name: string; level: string }[];
price: {
mode: 'amount' | 'negotiable';
amount: string | null;
currency: string | null;
};
status: 'published';
published_at: string;
revision: number;
url: string;
};
/** Display exact decimal text, including large amounts; never converts currency. */
export function offerPrice(price: PublicOffer['price']): string {
if (price.mode === 'negotiable') return 'A negociar';
const [whole, fraction = ''] = (price.amount ?? '').split('.');
return `${whole.replace(/\B(?=(\d{3})+(?!\d))/g, ' ')}${fraction ? `,${fraction.padEnd(2, '0')}` : ',00'} ${price.currency ?? ''}`;
}