refactor(time): migrate runtime time handling to Temporal

This commit is contained in:
2026-03-09 07:18:09 +04:00
parent fa8fa7fe23
commit 29f6d788e7
25 changed files with 353 additions and 104 deletions

View File

@@ -1,5 +1,6 @@
import { describe, expect, test } from 'bun:test'
import { instantFromIso, type Instant } from '@household/domain'
import type {
FinanceCycleRecord,
FinanceMemberRecord,
@@ -26,7 +27,7 @@ class FinanceRepositoryStub implements FinanceRepository {
amountMinor: bigint
currency: 'USD' | 'GEL'
createdByMemberId: string | null
createdAt: Date
createdAt: Instant
}[] = []
lastSavedRentRule: {
@@ -180,7 +181,7 @@ describe('createFinanceCommandService', () => {
amountMinor: 12000n,
currency: 'USD',
createdByMemberId: 'alice',
createdAt: new Date('2026-03-12T12:00:00.000Z')
createdAt: instantFromIso('2026-03-12T12:00:00.000Z')
}
]
repository.purchases = [
@@ -189,7 +190,7 @@ describe('createFinanceCommandService', () => {
payerMemberId: 'alice',
amountMinor: 3000n,
description: 'Soap',
occurredAt: new Date('2026-03-12T11:00:00.000Z')
occurredAt: instantFromIso('2026-03-12T11:00:00.000Z')
}
]