add payment, trust badge, handle race condition, fix booking schema

This commit is contained in:
arifal
2026-04-20 23:57:31 +07:00
parent ba5f64ae0e
commit fcdca34460
33 changed files with 1781 additions and 138 deletions
+4
View File
@@ -9,6 +9,10 @@ export const LIMITS = {
MAX_MOUNTAIN_LENGTH: 100,
MAX_LOCATION_LENGTH: 120,
MAX_DESCRIPTION_LENGTH: 5000,
/** Meeting point & tiap blok include/exclude */
MAX_MEETING_POINT_LENGTH: 500,
MAX_TRIP_ITINERARY_LENGTH: 8000,
MAX_TRIP_BULLET_SECTION_LENGTH: 4000,
MAX_REVIEW_COMMENT: 500,
MAX_IMAGE_URLS: 5,
MAX_URL_LENGTH: 2048,
+27
View File
@@ -81,3 +81,30 @@ export function isPastTripLastDayForReview(
);
return Date.now() > endMs;
}
/**
* Tampilkan tanggal trip untuk UI: pakai **kalender UTC** (sama dengan
* `tripStoredInstantFromYmd` & filter Open Trip), supaya tidak bergeser
* karena timezone runtime (server vs browser).
*/
export function formatTripCalendarDateLong(
d: Date | string,
locale = "id-ID"
): string {
const date = typeof d === "string" ? new Date(d) : d;
return new Intl.DateTimeFormat(locale, {
dateStyle: "long",
timeZone: "UTC",
}).format(date);
}
export function formatTripCalendarDateRangeLong(
start: Date | string,
end?: Date | string | null,
locale = "id-ID"
): string {
const startStr = formatTripCalendarDateLong(start, locale);
if (!end) return startStr;
const endStr = formatTripCalendarDateLong(end, locale);
return `${startStr}${endStr}`;
}
+2
View File
@@ -0,0 +1,2 @@
/** Minimal trip sebagai organizer untuk badge "Trip leader" (heuristik MVP). */
export const TRIP_LEADER_MIN_TRIPS = 2;