[PROP-CORE-004] feat: Register payment-terminals module in app
- Added PaymentTerminalsModule and entities imports - Added entities to TypeORM DataSource - Registered routes: /api/v1/payment-terminals, /api/v1/mercadopago, /api/v1/clip - Registered webhooks: /webhooks/mercadopago, /webhooks/clip - Updated API info with new endpoints Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
db63fd17c9
commit
669c0c2911
21
src/main.ts
21
src/main.ts
@ -24,6 +24,9 @@ import { createPartController } from './modules/parts-management/controllers/par
|
||||
import { createSupplierController } from './modules/parts-management/controllers/supplier.controller';
|
||||
import { createCustomersRouter } from './modules/customers/controllers/customers.controller';
|
||||
|
||||
// Payment Terminals Module
|
||||
import { PaymentTerminalsModule } from './modules/payment-terminals';
|
||||
|
||||
// Entities - Auth
|
||||
import { User } from './modules/auth/entities/user.entity';
|
||||
import { RefreshToken } from './modules/auth/entities/refresh-token.entity';
|
||||
@ -49,6 +52,11 @@ import { WarehouseLocation } from './modules/parts-management/entities/warehouse
|
||||
// Entities - Customers
|
||||
import { Customer } from './modules/customers/entities/customer.entity';
|
||||
|
||||
// Entities - Payment Terminals
|
||||
import { TenantTerminalConfig } from './modules/payment-terminals/entities/tenant-terminal-config.entity';
|
||||
import { TerminalPayment } from './modules/payment-terminals/entities/terminal-payment.entity';
|
||||
import { TerminalWebhookEvent } from './modules/payment-terminals/entities/terminal-webhook-event.entity';
|
||||
|
||||
// Load environment variables
|
||||
config();
|
||||
|
||||
@ -89,6 +97,10 @@ const AppDataSource = new DataSource({
|
||||
WarehouseLocation,
|
||||
// Customers
|
||||
Customer,
|
||||
// Payment Terminals
|
||||
TenantTerminalConfig,
|
||||
TerminalPayment,
|
||||
TerminalWebhookEvent,
|
||||
],
|
||||
synchronize: process.env.NODE_ENV === 'development',
|
||||
logging: process.env.NODE_ENV === 'development',
|
||||
@ -135,6 +147,12 @@ async function bootstrap() {
|
||||
app.use('/api/v1/suppliers', createSupplierController(AppDataSource));
|
||||
app.use('/api/v1/customers', createCustomersRouter(AppDataSource));
|
||||
|
||||
// Payment Terminals Module
|
||||
const paymentTerminals = new PaymentTerminalsModule({ dataSource: AppDataSource });
|
||||
app.use('/api/v1', paymentTerminals.router);
|
||||
app.use('/webhooks', paymentTerminals.webhookRouter);
|
||||
console.log('💳 Payment Terminals module initialized');
|
||||
|
||||
// API documentation endpoint
|
||||
app.get('/api/v1', (_req, res) => {
|
||||
res.json({
|
||||
@ -151,6 +169,9 @@ async function bootstrap() {
|
||||
fleets: '/api/v1/fleets',
|
||||
parts: '/api/v1/parts',
|
||||
suppliers: '/api/v1/suppliers',
|
||||
paymentTerminals: '/api/v1/payment-terminals',
|
||||
mercadopago: '/api/v1/mercadopago',
|
||||
clip: '/api/v1/clip',
|
||||
},
|
||||
documentation: '/api/v1/docs',
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user