Skip to content

Documentation


Documentation / @kizami/db / insertPunchEvent

Function: insertPunchEvent()

insertPunchEvent(db, event): 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; }>

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

punch_events へ1件追記する。id を渡さなければ UUIDv7 を生成する。 トランザクション内(修正申請の承認反映等)からも呼べるよう Database | Transaction を受け取る。

Parameters

db

Database | SQLiteTransaction<"async", ResultSet, schema, ExtractTablesWithRelations<schema>>

event

NewPunchEvent

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; }>