import type { BillingType, GroupAudience, OnboardingGroupDto, WeekDay } from '@gruperly/shared'; type PriceLike = { toString(): string }; export type OnboardingGroupRecord = { id: string; name: string; description: string | null; createdById: string; createdAt: Date; updatedAt: Date; days: WeekDay[] | null; time: string | null; capacity: number | null; price: PriceLike | number | null; billingType: BillingType | null; dueDay: number | null; autoPaymentReminders?: boolean; autoReengagement?: boolean; audience?: GroupAudience; }; export function toOnboardingGroupDto(record: OnboardingGroupRecord): OnboardingGroupDto { return { id: record.id, name: record.name, description: record.description, createdById: record.createdById, createdAt: record.createdAt.toISOString(), updatedAt: record.updatedAt.toISOString(), days: record.days, time: record.time, capacity: record.capacity, price: record.price == null ? null : Number(record.price.toString()), billingType: record.billingType, dueDay: record.dueDay, autoPaymentReminders: record.autoPaymentReminders ?? false, autoReengagement: record.autoReengagement ?? false, audience: record.audience ?? 'ADULTS', }; }