refactor( iam ): replace prisma.user joins with batch IAM fetch in bookings, tickets, and payments e2e

This commit is contained in:
Abubeker Yasin
2026-06-09 13:54:38 +03:00
parent 5ae6d9600a
commit 431b1c4f3c
3 changed files with 100 additions and 65 deletions

View File

@@ -21,11 +21,7 @@ describe('Payments E2E', () => {
prisma = app.get<PrismaService>(PrismaService);
const testUser = await prisma.user.create({
data: { email: 'payment-test@example.com', phone: '+251911111112', fullName: 'Payment Test User', passwordHash: '$2b$10$abcdefghijklmnopqrstuvwxyz', role: 'PASSENGER' },
});
const passenger = await prisma.passenger.create({ data: { userId: testUser.id } });
const passenger = await prisma.passenger.create({ data: { iamUserId: 'test-iam-payments-user' } });
await prisma.walletAccount.create({ data: { passengerId: passenger.id, balanceMinor: 100000, currency: 'ETB' } });
@@ -77,7 +73,6 @@ describe('Payments E2E', () => {
prisma.walletLedgerEntry.deleteMany(),
prisma.walletAccount.deleteMany(),
prisma.passenger.deleteMany(),
prisma.user.deleteMany({ where: { email: 'payment-test@example.com' } }),
]);
await app.close();
});