Skip to content

Documentation


Documentation / @kizami/db / getValidPunchEvent

Function: getValidPunchEvent()

getValidPunchEvent(db, params): Promise<{ actorId: string; correctionRequestId: string | null; id: string; kind: string; metaGpsLat: number | null; metaGpsLng: number | null; metaIp: string | null; metaUa: string | null; note: string | null; occurredAt: number; recordedAt: number; source: string; supersedesId: string | null; tenantId: string; userId: string; } | null>

Defined in: packages/db/src/queries/punches.ts:88

(tenantId, userId) にスコープした「有効打刻」を id 指定で1件取得する。 存在しない・他人のもの・既に無効化(supersede/void)済みのいずれかなら null。 修正申請の作成時、target_event_id が「自分の有効打刻」であることの検証に使う。

Parameters

db

Database

params

GetValidPunchEventParams

Returns

Promise<{ actorId: string; correctionRequestId: string | null; id: string; kind: string; metaGpsLat: number | null; metaGpsLng: number | null; metaIp: string | null; metaUa: string | null; note: string | null; occurredAt: number; recordedAt: number; source: string; supersedesId: string | null; tenantId: string; userId: string; } | null>