feat: add donations feature with one-time payments - M6 (refs #55)

This commit is contained in:
Eric Gullickson
2026-01-18 16:51:20 -06:00
parent 6c1a100eb9
commit 56da99de36
14 changed files with 815 additions and 4 deletions

View File

@@ -0,0 +1,26 @@
/**
* @ai-summary Donations HTTP routes
* @ai-context Defines donation endpoints with authentication
*/
import { FastifyInstance, FastifyPluginAsync, FastifyPluginOptions } from 'fastify';
import { DonationsController } from './donations.controller';
export const donationsRoutes: FastifyPluginAsync = async (
fastify: FastifyInstance,
_opts: FastifyPluginOptions
) => {
const controller = new DonationsController();
// POST /api/donations - Create donation
fastify.post('/donations', {
preHandler: [fastify.authenticate],
handler: controller.createDonation.bind(controller),
});
// GET /api/donations - Get donation history
fastify.get('/donations', {
preHandler: [fastify.authenticate],
handler: controller.getDonations.bind(controller),
});
};