Scheduling infrastructure for absolutely everyone.
fix: currency for event types (#10792)
alannnc053da1ec32ce
diff --git a/apps/web/pages/booking/[uid].tsx b/apps/web/pages/booking/[uid].tsxindex bfe6d748bee..c651cc0685f 100644--- a/apps/web/pages/booking/[uid].tsx+++ b/apps/web/pages/booking/[uid].tsx@@ -93,7 +93,7 @@ const querySchema = z.object({});export default function Success(props: SuccessProps) {- const { t } = useLocale();+ const { t, i18n } = useLocale();const router = useRouter();const routerQuery = useRouterQuery();const pathname = usePathname();@@ -478,6 +478,21 @@ export default function Success(props: SuccessProps) {</div></>)}+ {props.paymentStatus && (+ <>+ <div className="mt-3 font-medium">+ {props.paymentStatus.paymentOption === "HOLD"+ ? t("complete_your_booking")+ : t("payment")}+ </div>+ <div className="col-span-2 mb-2 mt-3">+ {new Intl.NumberFormat(i18n.language, {+ style: "currency",+ currency: props.paymentStatus.currency,+ }).format(props.paymentStatus.amount / 100.0)}+ </div>+ </>+ )}{bookingInfo?.description && (<><div className="mt-9 font-medium">{t("additional_notes")}</div>@@ -1115,6 +1130,9 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {select: {success: true,refunded: true,+ currency: true,+ amount: true,+ paymentOption: true,},});diff --git a/packages/app-store/_utils/getEventTypeAppData.ts b/packages/app-store/_utils/getEventTypeAppData.tsindex 9d387d74172..e556e1ac6cf 100644--- a/packages/app-store/_utils/getEventTypeAppData.ts+++ b/packages/app-store/_utils/getEventTypeAppData.ts@@ -18,12 +18,14 @@ export const getEventTypeAppData = <T extends EventTypeAppsList>(return allowDataGet? {...appMetadata,+ // We should favor eventType's price and currency over appMetadata's price and currency+ price: eventType.price || appMetadata.price,+ currency: eventType.currency || appMetadata.currency,// trackingId is legacy way to store value for TRACKING_ID. So, we need to support both.TRACKING_ID: appMetadata.TRACKING_ID || appMetadata.trackingId,}: null;}-// Backward compatibility for existing event types.// TODO: After the new AppStore EventType App flow is stable, write a migration to migrate metadata to new format which will let us remove this compatibility code// Migration isn't being done right now, to allow a revert if neededdiff --git a/packages/lib/getEventTypeById.ts b/packages/lib/getEventTypeById.tsindex 99e3ecb0e0b..b9a232c410d 100644--- a/packages/lib/getEventTypeById.ts+++ b/packages/lib/getEventTypeById.ts@@ -227,7 +227,7 @@ export default async function getEventTypeById({app: {enabled: true,categories: {- hasSome: [AppCategories.conferencing, AppCategories.video],+ hasSome: [AppCategories.conferencing, AppCategories.video, AppCategories.payment],},},},