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,3 +1,5 @@
import type { Instant } from '@household/domain'
export type AnonymousFeedbackModerationStatus = 'accepted' | 'posted' | 'rejected' | 'failed'
export type AnonymousFeedbackRejectionReason =
@@ -16,7 +18,8 @@ export interface AnonymousFeedbackMemberRecord {
export interface AnonymousFeedbackRateLimitSnapshot {
acceptedCountSince: number
lastAcceptedAt: Date | null
earliestAcceptedAtSince: Instant | null
lastAcceptedAt: Instant | null
}
export interface AnonymousFeedbackSubmissionRecord {
@@ -28,7 +31,7 @@ export interface AnonymousFeedbackRepository {
getMemberByTelegramUserId(telegramUserId: string): Promise<AnonymousFeedbackMemberRecord | null>
getRateLimitSnapshot(
memberId: string,
acceptedSince: Date
acceptedSince: Instant
): Promise<AnonymousFeedbackRateLimitSnapshot>
createSubmission(input: {
submittedByMemberId: string
@@ -45,7 +48,7 @@ export interface AnonymousFeedbackRepository {
postedChatId: string
postedThreadId: string
postedMessageId: string
postedAt: Date
postedAt: Instant
}): Promise<void>
markFailed(submissionId: string, failureReason: string): Promise<void>
}