import 'reflect-metadata';
import { validate } from 'class-validator';
import { CreateDepositDto } from './deposit.dto';

describe('CreateDepositDto boundaries', () => {
  it('removes inline installments because they are managed after deposit creation', async () => {
    const dto = Object.assign(new CreateDepositDto(), {
      studentId: 1,
      amount: 500,
      paidDate: '2026-07-13',
      installments: [{ amount: 250, dueDate: '2026-08-01' }],
    });

    await validate(dto, { whitelist: true });

    expect(dto).toMatchObject({ studentId: 1, amount: 500, paidDate: '2026-07-13' });
    expect(dto).not.toHaveProperty('installments');
  });
});
