2025-05-14 21:45:16 +02:00

47 lines
2.8 KiB
TypeScript

import { Resolver, Authorized, Ctx } from 'type-graphql';
import { Mutation, Arg } from 'type-graphql';
import { ApolloContext } from '@seed/interfaces/context';
// From Module
import { OrderEngineSchema } from '../functions/orders/schemas/order.schema';
import { CheckoutEngineInput } from '../functions/orders/schemas/order.schema.input';
// From SRC
// EXAMPLES
// @Resolver(OrderModel)
// export default class CheckoutEngineResolver {
// /*
// ██████╗ ██╗ ██╗███████╗██████╗ ██╗ ██╗
// ██╔═══██╗██║ ██║██╔════╝██╔══██╗╚██╗ ██╔╝
// ██║ ██║██║ ██║█████╗ ██████╔╝ ╚████╔╝
// ██║▄▄ ██║██║ ██║██╔══╝ ██╔══██╗ ╚██╔╝
// ╚██████╔╝╚██████╔╝███████╗██║ ██║ ██║
// ╚══▀▀═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝
// */
// /*
// ███╗ ███╗██╗ ██╗████████╗ █████╗ ████████╗ ██████╗ ██████╗ ███████╗
// ████╗ ████║██║ ██║╚══██╔══╝██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗██╔════╝
// ██╔████╔██║██║ ██║ ██║ ███████║ ██║ ██║ ██║██████╔╝███████╗
// ██║╚██╔╝██║██║ ██║ ██║ ██╔══██║ ██║ ██║ ██║██╔══██╗╚════██║
// ██║ ╚═╝ ██║╚██████╔╝ ██║ ██║ ██║ ██║ ╚██████╔╝██║ ██║███████║
// ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
// */
// async cartsCheckout(
// @Arg('input') input: CheckoutEngineInput,
// @Arg('paymentType', { nullable: true }) paymentType: PaymentProvider,
// @Ctx() ctx: ApolloContext,
// ): Promise<OrderEngineSchema> {
// try {
// const pt = paymentType || 'stripe';
// return await createCheckout({ payment: pt, contactInfo: input, input, ctx });
// } catch (error) {
// throw error;
// }
// }
// }