Files
setrip/lib/trip-pricing.ts
2026-05-08 20:43:14 +07:00

13 lines
335 B
TypeScript

/**
* Pricing helpers untuk trip. Single source of truth — semua gate "trip gratis"
* harus lewat sini, jangan compare `price === 0` inline.
*/
export function isFreeTrip(trip: { price: number }): boolean {
return trip.price <= 0;
}
export function isPaidTrip(trip: { price: number }): boolean {
return !isFreeTrip(trip);
}