import { createTRPCRouter } from "$lib/trpc/t";
import { publicProcedure } from "$lib/server/trpc/t";
import { CurrencyController } from "./controller";
import { CurrencyRepository } from "../data/repository";
import { getRedisInstance } from "$lib/server/redis";

export const currencyRouter = createTRPCRouter({
	getCurrencies: publicProcedure.query(async ({ input, ctx }) => {
		const cc = new CurrencyController(
			new CurrencyRepository(getRedisInstance()),
		);
		return cc.getCurrencies();
	}),
});
