package public

import (
	"context"

	//"github.com/Gleipnir-Technology/bob"
	"source.gleipnir.technology/Gleipnir/nidus-sync/db"
	//"source.gleipnir.technology/Gleipnir/nidus-sync/db/gen/nidus-sync/public/enum"
	"github.com/Gleipnir-Technology/jet/postgres"
	"source.gleipnir.technology/Gleipnir/nidus-sync/db/gen/nidus-sync/public/model"
	"source.gleipnir.technology/Gleipnir/nidus-sync/db/gen/nidus-sync/public/table"
)

func UsersFromOrganizationID(ctx context.Context, txn db.Ex, org_id int64) ([]model.User, error) {
	statement := table.User.SELECT(
		table.User.AllColumns,
	).FROM(table.User).
		WHERE(table.User.OrganizationID.EQ(postgres.Int(org_id)))
	return db.ExecuteManyTx[model.User](ctx, txn, statement)
}
