feat(invitations): accept invitations with C4 consent and contact grants; share the E0 quota across holdings
This commit is contained in:
1 parent
a5990d3fc6
commit
676b3c6e24
59 files changed
+4926
-194
No files matched your search
@@ -0,0 +1,53 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.31.1
|
||||
// source: holdings.sql
|
||||
|
||||
package sqlc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
const getHoldingIDByFounder = `-- name: GetHoldingIDByFounder :one
|
||||
SELECT id
|
||||
FROM holdings
|
||||
WHERE founder_account_id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) GetHoldingIDByFounder(ctx context.Context, founderAccountID pgtype.UUID) (pgtype.UUID, error) {
|
||||
row := q.db.QueryRow(ctx, getHoldingIDByFounder, founderAccountID)
|
||||
var id pgtype.UUID
|
||||
err := row.Scan(&id)
|
||||
return id, err
|
||||
}
|
||||
|
||||
const insertHoldingIfAbsent = `-- name: InsertHoldingIfAbsent :exec
|
||||
INSERT INTO holdings (
|
||||
id,
|
||||
founder_account_id,
|
||||
created_at
|
||||
) VALUES (
|
||||
$1,
|
||||
$2,
|
||||
$3
|
||||
)
|
||||
ON CONFLICT (founder_account_id) DO NOTHING
|
||||
`
|
||||
|
||||
type InsertHoldingIfAbsentParams struct {
|
||||
ID pgtype.UUID
|
||||
FounderAccountID pgtype.UUID
|
||||
CreatedAt pgtype.Timestamptz
|
||||
}
|
||||
|
||||
// Stores the holding of a founder account unless the account already has one.
|
||||
// A concurrent creation of the same account waits on the founder key until the
|
||||
// other transaction ends; then this insert does nothing, and the caller reads
|
||||
// the stored holding with GetHoldingIDByFounder.
|
||||
func (q *Queries) InsertHoldingIfAbsent(ctx context.Context, arg InsertHoldingIfAbsentParams) error {
|
||||
_, err := q.db.Exec(ctx, insertHoldingIfAbsent, arg.ID, arg.FounderAccountID, arg.CreatedAt)
|
||||
return err
|
||||
}
|
||||
Reference in new issue
Block a user