Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go
845 B
Raw Blame
// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.31.1
// source: member_delegation.sql

package db

import (
	"context"

	"github.com/jackc/pgx/v5/pgtype"
)

const recordMemberDelegationDay = `-- name: RecordMemberDelegationDay :exec
INSERT INTO member_delegation_day (user_id, activity_date)
VALUES (
    $1,
    (COALESCE($2::timestamptz, CURRENT_TIMESTAMP) AT TIME ZONE 'UTC')::date
)
ON CONFLICT DO NOTHING
`

type RecordMemberDelegationDayParams struct {
	UserID  pgtype.UUID        `json:"user_id"`
	ActedAt pgtype.Timestamptz `json:"acted_at"`
}

// Idempotent: one row per member per UTC day. acted_at NULL means now.
func (q *Queries) RecordMemberDelegationDay(ctx context.Context, arg RecordMemberDelegationDayParams) error {
	_, err := q.db.Exec(ctx, recordMemberDelegationDay, arg.UserID, arg.ActedAt)
	return err
}