mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* app initialization * btcpay-calcom payment * include logo and images * resolve comments * include USD and webhook cleaning * currency display * fix type error * payment service create error * type error fix * icon update * bot feedback update * Remove console * Remove currency suffix in price * fix coderRabbit comment * resolve extra comments * Use repositories and declarative installation ocode for app * use PrismaBookingPaymentRepository as well as fix UI view * Avoid fetching booking just for title which is already passed to create fn in handlePayment * fix type issues * return 200 if payment is already processed --------- Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Hariom Balhara <[email protected]> Co-authored-by: Omar López <[email protected]>
37 lines
930 B
TypeScript
37 lines
930 B
TypeScript
import { z } from "zod";
|
|
|
|
import { eventTypeAppCardZod } from "@calcom/app-store/eventTypeAppCardZod";
|
|
|
|
const paymentOptionSchema = z.object({
|
|
label: z.string(),
|
|
value: z.string(),
|
|
});
|
|
|
|
export const paymentOptionsSchema = z.array(paymentOptionSchema);
|
|
|
|
export const BTCPayPaymentOptions = [
|
|
{
|
|
label: "on_booking_option",
|
|
value: "ON_BOOKING",
|
|
},
|
|
];
|
|
|
|
type PaymentOption = (typeof BTCPayPaymentOptions)[number]["value"];
|
|
const VALUES: [PaymentOption, ...PaymentOption[]] = [
|
|
BTCPayPaymentOptions[0].value,
|
|
...BTCPayPaymentOptions.slice(1).map((option) => option.value),
|
|
];
|
|
export const paymentOptionEnum = z.enum(VALUES);
|
|
|
|
export const appDataSchema = eventTypeAppCardZod.merge(
|
|
z.object({
|
|
price: z.number(),
|
|
currency: z.string(),
|
|
paymentOption: z.string().optional(),
|
|
enabled: z.boolean().optional(),
|
|
credentialId: z.number().optional(),
|
|
})
|
|
);
|
|
|
|
export const appKeysSchema = z.object({});
|