[PROP-CORE-004] feat: Register payment-terminals module in app
- Added PaymentTerminalsModule to module imports - Added entities to getAllEntities() - Added paymentTerminals to ModuleOptions - Registered module in initializeModules() - Updated health check with paymentTerminals status Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
289b4eb466
commit
45ef7f4607
@ -11,6 +11,7 @@ import { DataSource } from 'typeorm';
|
||||
import { PatientsModule } from './modules/patients';
|
||||
import { AppointmentsModule } from './modules/appointments';
|
||||
import { ConsultationsModule } from './modules/consultations';
|
||||
import { PaymentTerminalsModule } from './modules/payment-terminals';
|
||||
|
||||
// Import entities from all modules for TypeORM
|
||||
import { Patient } from './modules/patients/entities';
|
||||
@ -22,6 +23,11 @@ import {
|
||||
PrescriptionItem,
|
||||
VitalSignsRecord,
|
||||
} from './modules/consultations/entities';
|
||||
import {
|
||||
TenantTerminalConfig,
|
||||
TerminalPayment,
|
||||
TerminalWebhookEvent,
|
||||
} from './modules/payment-terminals/entities';
|
||||
|
||||
/**
|
||||
* Get all entities for TypeORM configuration
|
||||
@ -41,6 +47,10 @@ export function getAllEntities() {
|
||||
Prescription,
|
||||
PrescriptionItem,
|
||||
VitalSignsRecord,
|
||||
// Payment Terminals
|
||||
TenantTerminalConfig,
|
||||
TerminalPayment,
|
||||
TerminalWebhookEvent,
|
||||
];
|
||||
}
|
||||
|
||||
@ -51,6 +61,7 @@ export interface ModuleOptions {
|
||||
patients?: { enabled: boolean; basePath?: string };
|
||||
appointments?: { enabled: boolean; basePath?: string };
|
||||
consultations?: { enabled: boolean; basePath?: string };
|
||||
paymentTerminals?: { enabled: boolean; basePath?: string };
|
||||
}
|
||||
|
||||
/**
|
||||
@ -60,6 +71,7 @@ const defaultModuleOptions: ModuleOptions = {
|
||||
patients: { enabled: true, basePath: '/api' },
|
||||
appointments: { enabled: true, basePath: '/api' },
|
||||
consultations: { enabled: true, basePath: '/api' },
|
||||
paymentTerminals: { enabled: true, basePath: '/api' },
|
||||
};
|
||||
|
||||
/**
|
||||
@ -101,6 +113,17 @@ export function initializeModules(
|
||||
app.use(consultationsModule.router);
|
||||
console.log('✅ Consultations module initialized (CL-004)');
|
||||
}
|
||||
|
||||
// Initialize Payment Terminals Module
|
||||
if (config.paymentTerminals?.enabled) {
|
||||
const paymentTerminalsModule = new PaymentTerminalsModule({
|
||||
dataSource,
|
||||
basePath: config.paymentTerminals.basePath,
|
||||
});
|
||||
app.use(paymentTerminalsModule.router);
|
||||
app.use('/webhooks', paymentTerminalsModule.webhookRouter);
|
||||
console.log('✅ Payment Terminals module initialized');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -171,6 +194,7 @@ export async function createApplication(dataSourceConfig: any): Promise<Express>
|
||||
patients: true,
|
||||
appointments: true,
|
||||
consultations: true,
|
||||
paymentTerminals: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user