21 lines
735 B
TypeScript
21 lines
735 B
TypeScript
import db from './src/database/models/index.js';
|
|
|
|
async function check() {
|
|
const app = await db.Application.findOne({ where: { applicationId: 'APP-TEST-001' } });
|
|
if (!app) {
|
|
console.log('Application APP-TEST-001 not found');
|
|
return;
|
|
}
|
|
const deposits = await db.SecurityDeposit.findAll({
|
|
where: { applicationId: app.id },
|
|
include: [{ model: db.User, as: 'verifier', attributes: ['fullName'] }]
|
|
});
|
|
console.log('--- Security Deposits for APP-TEST-001 ---');
|
|
deposits.forEach(d => {
|
|
console.log(`ID: ${d.id}, Type: ${d.depositType}, Status: ${d.status}, Ref: ${d.paymentReference}, Verifier: ${d.verifier?.fullName || 'N/A'}`);
|
|
});
|
|
process.exit(0);
|
|
}
|
|
|
|
check();
|