feat: add donations feature with one-time payments - M6 (refs #55)
This commit is contained in:
26
backend/src/features/subscriptions/api/donations.routes.ts
Normal file
26
backend/src/features/subscriptions/api/donations.routes.ts
Normal 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),
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user