feat: improve attendance scheduling and API validation

This commit is contained in:
2026-07-14 23:12:14 +08:00
parent c75a08affe
commit e45da7f998
33 changed files with 869 additions and 297 deletions

View File

@@ -2,7 +2,7 @@ import { DepositsService } from './deposits.service';
import { Deposit } from '../entities/deposit.entity';
describe('DepositsService — direct refund', () => {
it('stores the refund result on the main status and renamed audit fields', async () => {
it('refunds the full available balance and stores audit fields', async () => {
const deposit = {
id: 1,
amount: 500,
@@ -16,20 +16,16 @@ describe('DepositsService — direct refund', () => {
const result = await service.refund(
1,
{
refundDate: '2026-07-13',
deductionAmount: 100,
deductionReason: '物品损坏',
},
{ refundDate: '2026-07-13', notes: '退还剩余押金' },
42,
);
expect(result).toMatchObject({
refundDate: '2026-07-13',
refundAmount: 400,
deductionAmount: 100,
deductionReason: '物品损坏',
status: 'partial_refund',
amount: 0,
refundAmount: 500,
notes: '退还剩余押金',
status: 'refunded',
refundedBy: 42,
});
expect(result.refundedAt).toBeInstanceOf(Date);