13 lines
335 B
TypeScript
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);
|
|
}
|