package dbsetup
import (
"context"
"fmt"
"reflect"
"github.com/uptrace/bun"
)
// om de reflectie code te bewaren. maar wordt niet gebruikt
func RegisterRelativeIDTriggerUsingReflection(ctx context.Context, db *bun.DB, model interface{}) error {
// 1. Haal metadata op via Bun
typ := reflect.TypeOf(model)
if typ.Kind() == reflect.Ptr {
typ = typ.Elem()
}
table := db.Table(typ)
// 2. Validatie: We verwachten minimaal 2 PK's
if len(table.PKs) < 2 {
return fmt.Errorf("tabel %s heeft %d PK's, maar er zijn er minstens 2 nodig", table.Name, len(table.PKs))
}
// We nemen aan: de eerste PK is de parent (A_ID), de tweede de relatieve (ID)
parentCol := table.PKs[0].Name
relativeCol := table.PKs[1].Name
tableName := table.Name
// Call RegisterRelativeIDTrigger with the extracted metadata
return RegisterRelativeIDTrigger(ctx, db, model, tableName, parentCol, relativeCol)
}
func RegisterRelativeIDTrigger(ctx context.Context, db *bun.DB, model interface{},
tableName string, parentCol string, relativeCol string) error {
// 3. De SQL (Idempotent: kan veilig vaker gedraaid worden)
sql := fmt.Sprintf(`
CREATE OR REPLACE FUNCTION fn_rel_id_%[1]s() RETURNS TRIGGER AS $$
BEGIN
IF NEW."%[3]s" IS NULL OR NEW."%[3]s" = 0 THEN
SELECT COALESCE(MAX("%[3]s"), 0) + 1 INTO NEW."%[3]s"
FROM "%[1]s" WHERE "%[2]s" = NEW."%[2]s";
END IF;
RETURN NEW;
END; $$ LANGUAGE plpgsql;
DROP TRIGGER IF EXISTS trg_rel_id_%[1]s ON "%[1]s";
CREATE TRIGGER trg_rel_id_%[1]s
BEFORE INSERT ON "%[1]s"
FOR EACH ROW EXECUTE FUNCTION fn_rel_id_%[1]s();
`, tableName, parentCol, relativeCol)
_, err := db.ExecContext(ctx, sql)
return err
}
package dbsetup
/*
TODO: omschrijven naar een meer generieke aanpak,
waarbij de tabellen automatisch worden gemaakt op basis van
- de metadata in model/metamodel.go en
- de structuren in model/models.go
*/
import (
"context"
"fmt"
"sort"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/uptrace/bun"
)
func createModelTables(ctx context.Context, db *bun.DB) error {
createOrder := []model.Metatype{
model.MetatypeEntiteit,
model.MetatypeRelatie,
model.MetatypeGegevenselement,
}
for _, metatype := range createOrder {
typeNames := make([]string, 0)
for typeName, meta := range model.MetaRegistry {
if meta.Metatype == metatype {
typeNames = append(typeNames, typeName)
}
}
sort.Strings(typeNames)
for _, typeName := range typeNames {
meta, ok := model.MetaRegistry.GetTypeMeta(typeName)
if !ok {
return fmt.Errorf("type ontbreekt in metaregistry: %s", typeName)
}
if meta.DBFactory == nil {
return fmt.Errorf("DBFactory ontbreekt voor type: %s", typeName)
}
dbModel := meta.DBFactory()
_, err := db.NewCreateTable().
Model(dbModel).
WithForeignKeys(). //maak de FK constraints aan op basis van de struct tags in de model structs
IfNotExists().Exec(ctx)
if err != nil {
return fmt.Errorf("create table mislukt voor %s (%s): %w", typeName, meta.Tabelnaam, err)
}
// maak de triggerfuncties aan voor autoincrement van relatieve ID's,
// indien nodig
// dit kan alleen voor gegevenselementen en relaties,
// en alleen als ze een PFK hebben (dus een FK naar een parent entiteit)
if (meta.Metatype == model.MetatypeGegevenselement || meta.Metatype == model.MetatypeRelatie) && meta.HeeftPFK && meta.RelatieveAutoincrement {
if err := RegisterRelativeIDTrigger(ctx, db,
dbModel, meta.Tabelnaam, meta.EntiteitIDKolom, meta.IDKolom); err != nil {
return fmt.Errorf("kon trigger voor relatieve ID's niet aanmaken voor %s (%s): %w", typeName, meta.Tabelnaam, err)
}
}
}
}
return nil
}
package dbsetup
import (
"context"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/uptrace/bun"
)
func CreateTables(db *bun.DB) error {
ctx := context.Background()
// tasks en tests tabellen zijn er puur voor de demo,
// die kunnen we later weer verwijderen,
// maar ze zijn handig om snel wat data in de DB te kunnen zetten en te testen
// Create the "tasks" table in the database if it doesn't exist
_, err := db.NewCreateTable().Model((*model.Task)(nil)).IfNotExists().Exec(ctx)
if err != nil {
return err
}
// Create the "tests" table in the database if it doesn't exist
_, err = db.NewCreateTable().Model((*model.Test)(nil)).IfNotExists().Exec(ctx)
if err != nil {
return err
}
/*
Maak de tabellen voor de model representaties aan,
dus de entiteiten, relaties en gegevenselementen, typisch voor dit register.
Deze worden gespecificeerd in:
- model/metamodel.go (map)
- model/models.go (structs)
*/
err = createModelTables(ctx, db)
if err != nil {
return err
}
//Bitemporal core tables
// Wijziging table
_, err = db.NewCreateTable().Model((*model.Wijziging)(nil)).IfNotExists().Exec(ctx)
if err != nil {
return err
}
// Registratie table
_, err = db.NewCreateTable().Model((*model.Registratie)(nil)).IfNotExists().Exec(ctx)
if err != nil {
return err
}
// Indexen voor formele tijdreisquery's
err = createFormeleTijdIndexes(ctx, db)
if err != nil {
return err
}
// Views voor formele tijdreisquery's
err = createFormeleTijdViews(ctx, db)
if err != nil {
return err
}
return nil
}
package dbsetup
import (
"context"
"github.com/uptrace/bun"
)
// createFormeleTijdIndexes maakt indexen aan die de formele tijdreis-functie ondersteunen.
// Alle statements zijn idempotent via IF NOT EXISTS.
func createFormeleTijdIndexes(ctx context.Context, db *bun.DB) error {
statements := []string{
`CREATE INDEX IF NOT EXISTS idx_wijziging_formele_lookup
ON wijziging (entiteitnaam, entiteit_id, (COALESCE(representatienaam, '')), (COALESCE(representatie_id, '')), registratie_id, id DESC);`,
`CREATE INDEX IF NOT EXISTS idx_wijziging_registratie_id
ON wijziging (registratie_id, id DESC);`,
`CREATE INDEX IF NOT EXISTS idx_registratie_ongedaan_peil
ON registratie (maakt_ongedaan_registratie_id, tijdstip);`,
`CREATE INDEX IF NOT EXISTS idx_registratie_tijdstip
ON registratie (tijdstip, id DESC);`,
}
for _, stmt := range statements {
if _, err := db.ExecContext(ctx, stmt); err != nil {
return err
}
}
return nil
}
// createFormeleTijdViews maakt de basisviews aan voor formele tijdreisquery's.
// Deze view is bewust "basis": peiltijdstip blijft een runtime-parameter in de SELECTs.
func createFormeleTijdViews(ctx context.Context, db *bun.DB) error {
const createBasisView = `
CREATE OR REPLACE VIEW vw_formele_wijziging_basis AS
SELECT
w.id AS wijziging_id,
w.wijzigingstype,
w.registratie_id,
reg.tijdstip AS registratie_tijdstip,
w.entiteitnaam,
w.entiteit_id,
COALESCE(w.representatienaam, '') AS representatienaam,
COALESCE(w.representatie_id, '') AS representatie_id
FROM wijziging AS w
JOIN registratie AS reg ON reg.id = w.registratie_id;
`
const createPeilFunction = `
CREATE OR REPLACE FUNCTION f_formele_wijziging_op_peil(p_peiltijdstip timestamptz)
RETURNS TABLE (
wijziging_id bigint,
wijzigingstype text,
registratie_id bigint,
registratie_tijdstip timestamptz,
entiteitnaam text,
entiteit_id text,
representatienaam text,
representatie_id text
)
LANGUAGE SQL
STABLE
AS $$
SELECT
v.wijziging_id,
v.wijzigingstype::text,
v.registratie_id,
v.registratie_tijdstip,
v.entiteitnaam,
v.entiteit_id,
v.representatienaam,
v.representatie_id
FROM vw_formele_wijziging_basis AS v
WHERE v.registratie_tijdstip <= p_peiltijdstip
AND NOT EXISTS (
SELECT 1
FROM registratie AS om
WHERE om.maakt_ongedaan_registratie_id = v.registratie_id
AND om.tijdstip <= p_peiltijdstip
);
$$;
`
if _, err := db.ExecContext(ctx, createBasisView); err != nil {
return err
}
if _, err := db.ExecContext(ctx, createPeilFunction); err != nil {
return err
}
return nil
}
package dbsetup
import (
"context"
"fmt"
"sort"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/uptrace/bun"
)
func DeleteTables(db *bun.DB) error {
ctx := context.Background()
// Deze twee tabellen zijn 'plumbing' voor elk register,
// dus niet model-afhankelijk
_, err := db.NewDropTable().Model((*model.Registratie)(nil)).IfExists().Cascade().Exec(ctx)
if err != nil {
return err
}
_, err = db.NewDropTable().Model((*model.Wijziging)(nil)).IfExists().Cascade().Exec(ctx)
if err != nil {
return err
}
err = dropModelTables(ctx, db)
if err != nil {
return err
}
/*
// TEST EN TASK LAAT IK EVEN IN STAND, DIE HEBBEN WE NODIG VOOR DE DEMO,
// EN ZIJN NIET ESSENTIEEL VOOR HET MODEL,
// DIE KUNNEN WE LATER WEER VERWIJDEREN
_, err = db.NewDropTable().Model((*model.Test)(nil)).IfExists().Cascade().Exec(ctx)
if err != nil {
return err
}
_, err = db.NewDropTable().Model((*model.Task)(nil)).IfExists().Cascade().Exec(ctx)
if err != nil {
return err
}
*/
return nil
}
/*
Dropt de door het model gedefineerde tabellen, in de juiste volgorde:
(relaties eerst, dan entiteiten, anders krijgen we problemen met foreign keys)
*/
func dropModelTables(ctx context.Context, db *bun.DB) error {
dropOrder := []model.Metatype{
model.MetatypeGegevenselement,
model.MetatypeRelatie,
model.MetatypeEntiteit,
}
for _, metatype := range dropOrder {
typeNames := make([]string, 0)
for typeName, meta := range model.MetaRegistry {
if meta.Metatype == metatype {
typeNames = append(typeNames, typeName)
}
}
sort.Sort(sort.Reverse(sort.StringSlice(typeNames)))
for _, typeName := range typeNames {
meta, ok := model.MetaRegistry.GetTypeMeta(typeName)
if !ok {
return fmt.Errorf("type ontbreekt in metaregistry: %s", typeName)
}
if meta.DBFactory == nil {
return fmt.Errorf("DBFactory ontbreekt voor type: %s", typeName)
}
dbModel := meta.DBFactory()
_, err := db.NewDropTable().Model(dbModel).IfExists().Cascade().Exec(ctx)
if err != nil {
return fmt.Errorf("drop table mislukt voor %s (%s): %w", typeName, meta.Tabelnaam, err)
}
}
}
return nil
}
package graph
import (
"fmt"
"time"
)
// MarshalDateTime marshals a time.Time to a string for GraphQL
func MarshalDateTime(t time.Time) string {
return t.Format(time.RFC3339)
}
// UnmarshalDateTime unmarshals a string to a time.Time from GraphQL
func UnmarshalDateTime(v interface{}) (time.Time, error) {
switch v := v.(type) {
case string:
return time.Parse(time.RFC3339, v)
default:
return time.Time{}, fmt.Errorf("invalid DateTime value: %v", v)
}
}
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package graph
import (
"bytes"
"context"
"embed"
"errors"
"fmt"
"strconv"
"sync"
"sync/atomic"
"github.com/99designs/gqlgen/graphql"
"github.com/99designs/gqlgen/graphql/introspection"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/graph/model"
gqlparser "github.com/vektah/gqlparser/v2"
"github.com/vektah/gqlparser/v2/ast"
)
// region ************************** generated!.gotpl **************************
// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema {
return &executableSchema{
schema: cfg.Schema,
resolvers: cfg.Resolvers,
directives: cfg.Directives,
complexity: cfg.Complexity,
}
}
type Config struct {
Schema *ast.Schema
Resolvers ResolverRoot
Directives DirectiveRoot
Complexity ComplexityRoot
}
type ResolverRoot interface {
Mutation() MutationResolver
Query() QueryResolver
}
type DirectiveRoot struct {
}
type ComplexityRoot struct {
Change struct {
ChangeType func(childComplexity int) int
ID func(childComplexity int) int
Registration func(childComplexity int) int
RegistrationID func(childComplexity int) int
RepresentationID func(childComplexity int) int
RepresentationName func(childComplexity int) int
Timestamp func(childComplexity int) int
}
DataElementAU struct {
AID func(childComplexity int) int
Aaa func(childComplexity int) int
Bbb func(childComplexity int) int
RelID func(childComplexity int) int
}
DataElementAV struct {
AID func(childComplexity int) int
Ccc func(childComplexity int) int
RelID func(childComplexity int) int
}
DataElementBX struct {
BID func(childComplexity int) int
Fff func(childComplexity int) int
Ggg func(childComplexity int) int
RelID func(childComplexity int) int
}
DataElementBY struct {
BID func(childComplexity int) int
Hhh func(childComplexity int) int
RelID func(childComplexity int) int
}
EntityA struct {
Afvoer func(childComplexity int) int
DataElementAu func(childComplexity int) int
DataElementsAv func(childComplexity int) int
ID func(childComplexity int) int
Opvoer func(childComplexity int) int
Relations func(childComplexity int) int
}
EntityB struct {
Afvoer func(childComplexity int) int
DataElementBx func(childComplexity int) int
DataElementBy func(childComplexity int) int
ID func(childComplexity int) int
Opvoer func(childComplexity int) int
Relations func(childComplexity int) int
}
Mutation struct {
CreateDataElementAu func(childComplexity int, input model.CreateDataElementAUInput) int
CreateDataElementAv func(childComplexity int, input model.CreateDataElementAVInput) int
CreateDataElementBx func(childComplexity int, input model.CreateDataElementBXInput) int
CreateDataElementBy func(childComplexity int, input model.CreateDataElementBYInput) int
CreateEntityA func(childComplexity int, input model.CreateEntityAInput) int
CreateEntityB func(childComplexity int, input model.CreateEntityBInput) int
CreateRelationAb func(childComplexity int, input model.CreateRelationABInput) int
CreateTask func(childComplexity int, input model.CreateTaskInput) int
DeleteEntityA func(childComplexity int, id string) int
DeleteEntityB func(childComplexity int, id string) int
DeleteRelationAb func(childComplexity int, id string) int
DeleteTask func(childComplexity int, id string) int
UpdateDataElementAu func(childComplexity int, relID string, input model.UpdateDataElementAUInput) int
UpdateEntityA func(childComplexity int, id string, input model.UpdateEntityAInput) int
UpdateEntityB func(childComplexity int, id string, input model.UpdateEntityBInput) int
UpdateTask func(childComplexity int, id string, input model.UpdateTaskInput) int
}
Query struct {
AllChanges func(childComplexity int, limit *int32, offset *int32) int
AllEntitiesA func(childComplexity int, limit *int32, offset *int32) int
AllEntitiesB func(childComplexity int, limit *int32, offset *int32) int
AllRegistrations func(childComplexity int, limit *int32, offset *int32) int
AllRelationsAb func(childComplexity int, limit *int32, offset *int32) int
AllTasks func(childComplexity int, limit *int32, offset *int32) int
Change func(childComplexity int, id string) int
DataElementAu func(childComplexity int, relID string) int
DataElementAv func(childComplexity int, relID string) int
DataElementBx func(childComplexity int, relID string) int
DataElementBy func(childComplexity int, relID string) int
DataElementsAu func(childComplexity int, aID string) int
DataElementsAv func(childComplexity int, aID string) int
EntityA func(childComplexity int, id string) int
EntityB func(childComplexity int, id string) int
Registration func(childComplexity int, id string) int
RelationAb func(childComplexity int, id string) int
Task func(childComplexity int, id string) int
}
Registration struct {
Changes func(childComplexity int) int
CorrectsRegistrationID func(childComplexity int) int
ID func(childComplexity int) int
RegistrationType func(childComplexity int) int
Remark func(childComplexity int) int
Timestamp func(childComplexity int) int
UndoesRegistrationID func(childComplexity int) int
}
RelationAB struct {
AID func(childComplexity int) int
BID func(childComplexity int) int
EntityA func(childComplexity int) int
EntityB func(childComplexity int) int
ID func(childComplexity int) int
}
Task struct {
Description func(childComplexity int) int
DueDate func(childComplexity int) int
ID func(childComplexity int) int
Status func(childComplexity int) int
Title func(childComplexity int) int
}
}
type MutationResolver interface {
CreateEntityA(ctx context.Context, input model.CreateEntityAInput) (*model.EntityA, error)
UpdateEntityA(ctx context.Context, id string, input model.UpdateEntityAInput) (*model.EntityA, error)
DeleteEntityA(ctx context.Context, id string) (bool, error)
CreateEntityB(ctx context.Context, input model.CreateEntityBInput) (*model.EntityB, error)
UpdateEntityB(ctx context.Context, id string, input model.UpdateEntityBInput) (*model.EntityB, error)
DeleteEntityB(ctx context.Context, id string) (bool, error)
CreateRelationAb(ctx context.Context, input model.CreateRelationABInput) (*model.RelationAb, error)
DeleteRelationAb(ctx context.Context, id string) (bool, error)
CreateDataElementAu(ctx context.Context, input model.CreateDataElementAUInput) (*model.DataElementAu, error)
UpdateDataElementAu(ctx context.Context, relID string, input model.UpdateDataElementAUInput) (*model.DataElementAu, error)
CreateDataElementAv(ctx context.Context, input model.CreateDataElementAVInput) (*model.DataElementAv, error)
CreateDataElementBx(ctx context.Context, input model.CreateDataElementBXInput) (*model.DataElementBx, error)
CreateDataElementBy(ctx context.Context, input model.CreateDataElementBYInput) (*model.DataElementBy, error)
CreateTask(ctx context.Context, input model.CreateTaskInput) (*model.Task, error)
UpdateTask(ctx context.Context, id string, input model.UpdateTaskInput) (*model.Task, error)
DeleteTask(ctx context.Context, id string) (bool, error)
}
type QueryResolver interface {
EntityA(ctx context.Context, id string) (*model.EntityA, error)
AllEntitiesA(ctx context.Context, limit *int32, offset *int32) ([]*model.EntityA, error)
EntityB(ctx context.Context, id string) (*model.EntityB, error)
AllEntitiesB(ctx context.Context, limit *int32, offset *int32) ([]*model.EntityB, error)
RelationAb(ctx context.Context, id string) (*model.RelationAb, error)
AllRelationsAb(ctx context.Context, limit *int32, offset *int32) ([]*model.RelationAb, error)
DataElementAu(ctx context.Context, relID string) (*model.DataElementAu, error)
DataElementsAu(ctx context.Context, aID string) ([]*model.DataElementAu, error)
DataElementAv(ctx context.Context, relID string) (*model.DataElementAv, error)
DataElementsAv(ctx context.Context, aID string) ([]*model.DataElementAv, error)
DataElementBx(ctx context.Context, relID string) (*model.DataElementBx, error)
DataElementBy(ctx context.Context, relID string) (*model.DataElementBy, error)
Registration(ctx context.Context, id string) (*model.Registration, error)
AllRegistrations(ctx context.Context, limit *int32, offset *int32) ([]*model.Registration, error)
Change(ctx context.Context, id string) (*model.Change, error)
AllChanges(ctx context.Context, limit *int32, offset *int32) ([]*model.Change, error)
Task(ctx context.Context, id string) (*model.Task, error)
AllTasks(ctx context.Context, limit *int32, offset *int32) ([]*model.Task, error)
}
type executableSchema struct {
schema *ast.Schema
resolvers ResolverRoot
directives DirectiveRoot
complexity ComplexityRoot
}
func (e *executableSchema) Schema() *ast.Schema {
if e.schema != nil {
return e.schema
}
return parsedSchema
}
func (e *executableSchema) Complexity(ctx context.Context, typeName, field string, childComplexity int, rawArgs map[string]any) (int, bool) {
ec := executionContext{nil, e, 0, 0, nil}
_ = ec
switch typeName + "." + field {
case "Change.changeType":
if e.complexity.Change.ChangeType == nil {
break
}
return e.complexity.Change.ChangeType(childComplexity), true
case "Change.id":
if e.complexity.Change.ID == nil {
break
}
return e.complexity.Change.ID(childComplexity), true
case "Change.registration":
if e.complexity.Change.Registration == nil {
break
}
return e.complexity.Change.Registration(childComplexity), true
case "Change.registrationId":
if e.complexity.Change.RegistrationID == nil {
break
}
return e.complexity.Change.RegistrationID(childComplexity), true
case "Change.representationId":
if e.complexity.Change.RepresentationID == nil {
break
}
return e.complexity.Change.RepresentationID(childComplexity), true
case "Change.representationName":
if e.complexity.Change.RepresentationName == nil {
break
}
return e.complexity.Change.RepresentationName(childComplexity), true
case "Change.timestamp":
if e.complexity.Change.Timestamp == nil {
break
}
return e.complexity.Change.Timestamp(childComplexity), true
case "DataElementAU.aId":
if e.complexity.DataElementAU.AID == nil {
break
}
return e.complexity.DataElementAU.AID(childComplexity), true
case "DataElementAU.aaa":
if e.complexity.DataElementAU.Aaa == nil {
break
}
return e.complexity.DataElementAU.Aaa(childComplexity), true
case "DataElementAU.bbb":
if e.complexity.DataElementAU.Bbb == nil {
break
}
return e.complexity.DataElementAU.Bbb(childComplexity), true
case "DataElementAU.relId":
if e.complexity.DataElementAU.RelID == nil {
break
}
return e.complexity.DataElementAU.RelID(childComplexity), true
case "DataElementAV.aId":
if e.complexity.DataElementAV.AID == nil {
break
}
return e.complexity.DataElementAV.AID(childComplexity), true
case "DataElementAV.ccc":
if e.complexity.DataElementAV.Ccc == nil {
break
}
return e.complexity.DataElementAV.Ccc(childComplexity), true
case "DataElementAV.relId":
if e.complexity.DataElementAV.RelID == nil {
break
}
return e.complexity.DataElementAV.RelID(childComplexity), true
case "DataElementBX.bId":
if e.complexity.DataElementBX.BID == nil {
break
}
return e.complexity.DataElementBX.BID(childComplexity), true
case "DataElementBX.fff":
if e.complexity.DataElementBX.Fff == nil {
break
}
return e.complexity.DataElementBX.Fff(childComplexity), true
case "DataElementBX.ggg":
if e.complexity.DataElementBX.Ggg == nil {
break
}
return e.complexity.DataElementBX.Ggg(childComplexity), true
case "DataElementBX.relId":
if e.complexity.DataElementBX.RelID == nil {
break
}
return e.complexity.DataElementBX.RelID(childComplexity), true
case "DataElementBY.bId":
if e.complexity.DataElementBY.BID == nil {
break
}
return e.complexity.DataElementBY.BID(childComplexity), true
case "DataElementBY.hhh":
if e.complexity.DataElementBY.Hhh == nil {
break
}
return e.complexity.DataElementBY.Hhh(childComplexity), true
case "DataElementBY.relId":
if e.complexity.DataElementBY.RelID == nil {
break
}
return e.complexity.DataElementBY.RelID(childComplexity), true
case "EntityA.afvoer":
if e.complexity.EntityA.Afvoer == nil {
break
}
return e.complexity.EntityA.Afvoer(childComplexity), true
case "EntityA.dataElementAU":
if e.complexity.EntityA.DataElementAu == nil {
break
}
return e.complexity.EntityA.DataElementAu(childComplexity), true
case "EntityA.dataElementsAV":
if e.complexity.EntityA.DataElementsAv == nil {
break
}
return e.complexity.EntityA.DataElementsAv(childComplexity), true
case "EntityA.id":
if e.complexity.EntityA.ID == nil {
break
}
return e.complexity.EntityA.ID(childComplexity), true
case "EntityA.opvoer":
if e.complexity.EntityA.Opvoer == nil {
break
}
return e.complexity.EntityA.Opvoer(childComplexity), true
case "EntityA.relations":
if e.complexity.EntityA.Relations == nil {
break
}
return e.complexity.EntityA.Relations(childComplexity), true
case "EntityB.afvoer":
if e.complexity.EntityB.Afvoer == nil {
break
}
return e.complexity.EntityB.Afvoer(childComplexity), true
case "EntityB.dataElementBX":
if e.complexity.EntityB.DataElementBx == nil {
break
}
return e.complexity.EntityB.DataElementBx(childComplexity), true
case "EntityB.dataElementBY":
if e.complexity.EntityB.DataElementBy == nil {
break
}
return e.complexity.EntityB.DataElementBy(childComplexity), true
case "EntityB.id":
if e.complexity.EntityB.ID == nil {
break
}
return e.complexity.EntityB.ID(childComplexity), true
case "EntityB.opvoer":
if e.complexity.EntityB.Opvoer == nil {
break
}
return e.complexity.EntityB.Opvoer(childComplexity), true
case "EntityB.relations":
if e.complexity.EntityB.Relations == nil {
break
}
return e.complexity.EntityB.Relations(childComplexity), true
case "Mutation.createDataElementAU":
if e.complexity.Mutation.CreateDataElementAu == nil {
break
}
args, err := ec.field_Mutation_createDataElementAU_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateDataElementAu(childComplexity, args["input"].(model.CreateDataElementAUInput)), true
case "Mutation.createDataElementAV":
if e.complexity.Mutation.CreateDataElementAv == nil {
break
}
args, err := ec.field_Mutation_createDataElementAV_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateDataElementAv(childComplexity, args["input"].(model.CreateDataElementAVInput)), true
case "Mutation.createDataElementBX":
if e.complexity.Mutation.CreateDataElementBx == nil {
break
}
args, err := ec.field_Mutation_createDataElementBX_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateDataElementBx(childComplexity, args["input"].(model.CreateDataElementBXInput)), true
case "Mutation.createDataElementBY":
if e.complexity.Mutation.CreateDataElementBy == nil {
break
}
args, err := ec.field_Mutation_createDataElementBY_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateDataElementBy(childComplexity, args["input"].(model.CreateDataElementBYInput)), true
case "Mutation.createEntityA":
if e.complexity.Mutation.CreateEntityA == nil {
break
}
args, err := ec.field_Mutation_createEntityA_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateEntityA(childComplexity, args["input"].(model.CreateEntityAInput)), true
case "Mutation.createEntityB":
if e.complexity.Mutation.CreateEntityB == nil {
break
}
args, err := ec.field_Mutation_createEntityB_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateEntityB(childComplexity, args["input"].(model.CreateEntityBInput)), true
case "Mutation.createRelationAB":
if e.complexity.Mutation.CreateRelationAb == nil {
break
}
args, err := ec.field_Mutation_createRelationAB_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateRelationAb(childComplexity, args["input"].(model.CreateRelationABInput)), true
case "Mutation.createTask":
if e.complexity.Mutation.CreateTask == nil {
break
}
args, err := ec.field_Mutation_createTask_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateTask(childComplexity, args["input"].(model.CreateTaskInput)), true
case "Mutation.deleteEntityA":
if e.complexity.Mutation.DeleteEntityA == nil {
break
}
args, err := ec.field_Mutation_deleteEntityA_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.DeleteEntityA(childComplexity, args["id"].(string)), true
case "Mutation.deleteEntityB":
if e.complexity.Mutation.DeleteEntityB == nil {
break
}
args, err := ec.field_Mutation_deleteEntityB_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.DeleteEntityB(childComplexity, args["id"].(string)), true
case "Mutation.deleteRelationAB":
if e.complexity.Mutation.DeleteRelationAb == nil {
break
}
args, err := ec.field_Mutation_deleteRelationAB_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.DeleteRelationAb(childComplexity, args["id"].(string)), true
case "Mutation.deleteTask":
if e.complexity.Mutation.DeleteTask == nil {
break
}
args, err := ec.field_Mutation_deleteTask_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.DeleteTask(childComplexity, args["id"].(string)), true
case "Mutation.updateDataElementAU":
if e.complexity.Mutation.UpdateDataElementAu == nil {
break
}
args, err := ec.field_Mutation_updateDataElementAU_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.UpdateDataElementAu(childComplexity, args["relId"].(string), args["input"].(model.UpdateDataElementAUInput)), true
case "Mutation.updateEntityA":
if e.complexity.Mutation.UpdateEntityA == nil {
break
}
args, err := ec.field_Mutation_updateEntityA_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.UpdateEntityA(childComplexity, args["id"].(string), args["input"].(model.UpdateEntityAInput)), true
case "Mutation.updateEntityB":
if e.complexity.Mutation.UpdateEntityB == nil {
break
}
args, err := ec.field_Mutation_updateEntityB_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.UpdateEntityB(childComplexity, args["id"].(string), args["input"].(model.UpdateEntityBInput)), true
case "Mutation.updateTask":
if e.complexity.Mutation.UpdateTask == nil {
break
}
args, err := ec.field_Mutation_updateTask_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.UpdateTask(childComplexity, args["id"].(string), args["input"].(model.UpdateTaskInput)), true
case "Query.allChanges":
if e.complexity.Query.AllChanges == nil {
break
}
args, err := ec.field_Query_allChanges_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.AllChanges(childComplexity, args["limit"].(*int32), args["offset"].(*int32)), true
case "Query.allEntitiesA":
if e.complexity.Query.AllEntitiesA == nil {
break
}
args, err := ec.field_Query_allEntitiesA_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.AllEntitiesA(childComplexity, args["limit"].(*int32), args["offset"].(*int32)), true
case "Query.allEntitiesB":
if e.complexity.Query.AllEntitiesB == nil {
break
}
args, err := ec.field_Query_allEntitiesB_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.AllEntitiesB(childComplexity, args["limit"].(*int32), args["offset"].(*int32)), true
case "Query.allRegistrations":
if e.complexity.Query.AllRegistrations == nil {
break
}
args, err := ec.field_Query_allRegistrations_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.AllRegistrations(childComplexity, args["limit"].(*int32), args["offset"].(*int32)), true
case "Query.allRelationsAB":
if e.complexity.Query.AllRelationsAb == nil {
break
}
args, err := ec.field_Query_allRelationsAB_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.AllRelationsAb(childComplexity, args["limit"].(*int32), args["offset"].(*int32)), true
case "Query.allTasks":
if e.complexity.Query.AllTasks == nil {
break
}
args, err := ec.field_Query_allTasks_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.AllTasks(childComplexity, args["limit"].(*int32), args["offset"].(*int32)), true
case "Query.change":
if e.complexity.Query.Change == nil {
break
}
args, err := ec.field_Query_change_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.Change(childComplexity, args["id"].(string)), true
case "Query.dataElementAU":
if e.complexity.Query.DataElementAu == nil {
break
}
args, err := ec.field_Query_dataElementAU_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.DataElementAu(childComplexity, args["relId"].(string)), true
case "Query.dataElementAV":
if e.complexity.Query.DataElementAv == nil {
break
}
args, err := ec.field_Query_dataElementAV_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.DataElementAv(childComplexity, args["relId"].(string)), true
case "Query.dataElementBX":
if e.complexity.Query.DataElementBx == nil {
break
}
args, err := ec.field_Query_dataElementBX_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.DataElementBx(childComplexity, args["relId"].(string)), true
case "Query.dataElementBY":
if e.complexity.Query.DataElementBy == nil {
break
}
args, err := ec.field_Query_dataElementBY_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.DataElementBy(childComplexity, args["relId"].(string)), true
case "Query.dataElementsAU":
if e.complexity.Query.DataElementsAu == nil {
break
}
args, err := ec.field_Query_dataElementsAU_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.DataElementsAu(childComplexity, args["aId"].(string)), true
case "Query.dataElementsAV":
if e.complexity.Query.DataElementsAv == nil {
break
}
args, err := ec.field_Query_dataElementsAV_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.DataElementsAv(childComplexity, args["aId"].(string)), true
case "Query.entityA":
if e.complexity.Query.EntityA == nil {
break
}
args, err := ec.field_Query_entityA_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.EntityA(childComplexity, args["id"].(string)), true
case "Query.entityB":
if e.complexity.Query.EntityB == nil {
break
}
args, err := ec.field_Query_entityB_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.EntityB(childComplexity, args["id"].(string)), true
case "Query.registration":
if e.complexity.Query.Registration == nil {
break
}
args, err := ec.field_Query_registration_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.Registration(childComplexity, args["id"].(string)), true
case "Query.relationAB":
if e.complexity.Query.RelationAb == nil {
break
}
args, err := ec.field_Query_relationAB_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.RelationAb(childComplexity, args["id"].(string)), true
case "Query.task":
if e.complexity.Query.Task == nil {
break
}
args, err := ec.field_Query_task_args(ctx, rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.Task(childComplexity, args["id"].(string)), true
case "Registration.changes":
if e.complexity.Registration.Changes == nil {
break
}
return e.complexity.Registration.Changes(childComplexity), true
case "Registration.correctsRegistrationId":
if e.complexity.Registration.CorrectsRegistrationID == nil {
break
}
return e.complexity.Registration.CorrectsRegistrationID(childComplexity), true
case "Registration.id":
if e.complexity.Registration.ID == nil {
break
}
return e.complexity.Registration.ID(childComplexity), true
case "Registration.registrationType":
if e.complexity.Registration.RegistrationType == nil {
break
}
return e.complexity.Registration.RegistrationType(childComplexity), true
case "Registration.remark":
if e.complexity.Registration.Remark == nil {
break
}
return e.complexity.Registration.Remark(childComplexity), true
case "Registration.timestamp":
if e.complexity.Registration.Timestamp == nil {
break
}
return e.complexity.Registration.Timestamp(childComplexity), true
case "Registration.undoesRegistrationId":
if e.complexity.Registration.UndoesRegistrationID == nil {
break
}
return e.complexity.Registration.UndoesRegistrationID(childComplexity), true
case "RelationAB.aId":
if e.complexity.RelationAB.AID == nil {
break
}
return e.complexity.RelationAB.AID(childComplexity), true
case "RelationAB.bId":
if e.complexity.RelationAB.BID == nil {
break
}
return e.complexity.RelationAB.BID(childComplexity), true
case "RelationAB.entityA":
if e.complexity.RelationAB.EntityA == nil {
break
}
return e.complexity.RelationAB.EntityA(childComplexity), true
case "RelationAB.entityB":
if e.complexity.RelationAB.EntityB == nil {
break
}
return e.complexity.RelationAB.EntityB(childComplexity), true
case "RelationAB.id":
if e.complexity.RelationAB.ID == nil {
break
}
return e.complexity.RelationAB.ID(childComplexity), true
case "Task.description":
if e.complexity.Task.Description == nil {
break
}
return e.complexity.Task.Description(childComplexity), true
case "Task.dueDate":
if e.complexity.Task.DueDate == nil {
break
}
return e.complexity.Task.DueDate(childComplexity), true
case "Task.id":
if e.complexity.Task.ID == nil {
break
}
return e.complexity.Task.ID(childComplexity), true
case "Task.status":
if e.complexity.Task.Status == nil {
break
}
return e.complexity.Task.Status(childComplexity), true
case "Task.title":
if e.complexity.Task.Title == nil {
break
}
return e.complexity.Task.Title(childComplexity), true
}
return 0, false
}
func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
opCtx := graphql.GetOperationContext(ctx)
ec := executionContext{opCtx, e, 0, 0, make(chan graphql.DeferredResult)}
inputUnmarshalMap := graphql.BuildUnmarshalerMap(
ec.unmarshalInputCreateDataElementAUInput,
ec.unmarshalInputCreateDataElementAVInput,
ec.unmarshalInputCreateDataElementBXInput,
ec.unmarshalInputCreateDataElementBYInput,
ec.unmarshalInputCreateEntityAInput,
ec.unmarshalInputCreateEntityBInput,
ec.unmarshalInputCreateRelationABInput,
ec.unmarshalInputCreateTaskInput,
ec.unmarshalInputUpdateDataElementAUInput,
ec.unmarshalInputUpdateEntityAInput,
ec.unmarshalInputUpdateEntityBInput,
ec.unmarshalInputUpdateTaskInput,
)
first := true
switch opCtx.Operation.Operation {
case ast.Query:
return func(ctx context.Context) *graphql.Response {
var response graphql.Response
var data graphql.Marshaler
if first {
first = false
ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap)
data = ec._Query(ctx, opCtx.Operation.SelectionSet)
} else {
if atomic.LoadInt32(&ec.pendingDeferred) > 0 {
result := <-ec.deferredResults
atomic.AddInt32(&ec.pendingDeferred, -1)
data = result.Result
response.Path = result.Path
response.Label = result.Label
response.Errors = result.Errors
} else {
return nil
}
}
var buf bytes.Buffer
data.MarshalGQL(&buf)
response.Data = buf.Bytes()
if atomic.LoadInt32(&ec.deferred) > 0 {
hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0
response.HasNext = &hasNext
}
return &response
}
case ast.Mutation:
return func(ctx context.Context) *graphql.Response {
if !first {
return nil
}
first = false
ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap)
data := ec._Mutation(ctx, opCtx.Operation.SelectionSet)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return &graphql.Response{
Data: buf.Bytes(),
}
}
default:
return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation"))
}
}
type executionContext struct {
*graphql.OperationContext
*executableSchema
deferred int32
pendingDeferred int32
deferredResults chan graphql.DeferredResult
}
func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) {
atomic.AddInt32(&ec.pendingDeferred, 1)
go func() {
ctx := graphql.WithFreshResponseContext(dg.Context)
dg.FieldSet.Dispatch(ctx)
ds := graphql.DeferredResult{
Path: dg.Path,
Label: dg.Label,
Result: dg.FieldSet,
Errors: graphql.GetErrors(ctx),
}
// null fields should bubble up
if dg.FieldSet.Invalids > 0 {
ds.Result = graphql.Null
}
ec.deferredResults <- ds
}()
}
func (ec *executionContext) introspectSchema() (*introspection.Schema, error) {
if ec.DisableIntrospection {
return nil, errors.New("introspection disabled")
}
return introspection.WrapSchema(ec.Schema()), nil
}
func (ec *executionContext) introspectType(name string) (*introspection.Type, error) {
if ec.DisableIntrospection {
return nil, errors.New("introspection disabled")
}
return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil
}
//go:embed "schema.graphqls"
var sourcesFS embed.FS
func sourceData(filename string) string {
data, err := sourcesFS.ReadFile(filename)
if err != nil {
panic(fmt.Sprintf("codegen problem: %s not available", filename))
}
return string(data)
}
var sources = []*ast.Source{
{Name: "schema.graphqls", Input: sourceData("schema.graphqls"), BuiltIn: false},
}
var parsedSchema = gqlparser.MustLoadSchema(sources...)
// endregion ************************** generated!.gotpl **************************
// region ***************************** args.gotpl *****************************
func (ec *executionContext) field_Mutation_createDataElementAU_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNCreateDataElementAUInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateDataElementAUInput)
if err != nil {
return nil, err
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_createDataElementAV_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNCreateDataElementAVInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateDataElementAVInput)
if err != nil {
return nil, err
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_createDataElementBX_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNCreateDataElementBXInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateDataElementBXInput)
if err != nil {
return nil, err
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_createDataElementBY_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNCreateDataElementBYInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateDataElementBYInput)
if err != nil {
return nil, err
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_createEntityA_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNCreateEntityAInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateEntityAInput)
if err != nil {
return nil, err
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_createEntityB_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNCreateEntityBInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateEntityBInput)
if err != nil {
return nil, err
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_createRelationAB_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNCreateRelationABInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateRelationABInput)
if err != nil {
return nil, err
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_createTask_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNCreateTaskInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateTaskInput)
if err != nil {
return nil, err
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_deleteEntityA_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_deleteEntityB_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_deleteRelationAB_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_deleteTask_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_updateDataElementAU_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "relId", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["relId"] = arg0
arg1, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNUpdateDataElementAUInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐUpdateDataElementAUInput)
if err != nil {
return nil, err
}
args["input"] = arg1
return args, nil
}
func (ec *executionContext) field_Mutation_updateEntityA_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
arg1, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNUpdateEntityAInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐUpdateEntityAInput)
if err != nil {
return nil, err
}
args["input"] = arg1
return args, nil
}
func (ec *executionContext) field_Mutation_updateEntityB_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
arg1, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNUpdateEntityBInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐUpdateEntityBInput)
if err != nil {
return nil, err
}
args["input"] = arg1
return args, nil
}
func (ec *executionContext) field_Mutation_updateTask_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
arg1, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNUpdateTaskInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐUpdateTaskInput)
if err != nil {
return nil, err
}
args["input"] = arg1
return args, nil
}
func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "name", ec.unmarshalNString2string)
if err != nil {
return nil, err
}
args["name"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_allChanges_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "limit", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["limit"] = arg0
arg1, err := graphql.ProcessArgField(ctx, rawArgs, "offset", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["offset"] = arg1
return args, nil
}
func (ec *executionContext) field_Query_allEntitiesA_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "limit", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["limit"] = arg0
arg1, err := graphql.ProcessArgField(ctx, rawArgs, "offset", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["offset"] = arg1
return args, nil
}
func (ec *executionContext) field_Query_allEntitiesB_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "limit", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["limit"] = arg0
arg1, err := graphql.ProcessArgField(ctx, rawArgs, "offset", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["offset"] = arg1
return args, nil
}
func (ec *executionContext) field_Query_allRegistrations_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "limit", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["limit"] = arg0
arg1, err := graphql.ProcessArgField(ctx, rawArgs, "offset", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["offset"] = arg1
return args, nil
}
func (ec *executionContext) field_Query_allRelationsAB_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "limit", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["limit"] = arg0
arg1, err := graphql.ProcessArgField(ctx, rawArgs, "offset", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["offset"] = arg1
return args, nil
}
func (ec *executionContext) field_Query_allTasks_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "limit", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["limit"] = arg0
arg1, err := graphql.ProcessArgField(ctx, rawArgs, "offset", ec.unmarshalOInt2ᚖint32)
if err != nil {
return nil, err
}
args["offset"] = arg1
return args, nil
}
func (ec *executionContext) field_Query_change_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_dataElementAU_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "relId", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["relId"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_dataElementAV_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "relId", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["relId"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_dataElementBX_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "relId", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["relId"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_dataElementBY_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "relId", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["relId"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_dataElementsAU_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "aId", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["aId"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_dataElementsAV_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "aId", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["aId"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_entityA_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_entityB_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_registration_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_relationAB_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field_Query_task_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "id", ec.unmarshalNID2string)
if err != nil {
return nil, err
}
args["id"] = arg0
return args, nil
}
func (ec *executionContext) field___Directive_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "includeDeprecated", ec.unmarshalOBoolean2ᚖbool)
if err != nil {
return nil, err
}
args["includeDeprecated"] = arg0
return args, nil
}
func (ec *executionContext) field___Field_args_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "includeDeprecated", ec.unmarshalOBoolean2ᚖbool)
if err != nil {
return nil, err
}
args["includeDeprecated"] = arg0
return args, nil
}
func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "includeDeprecated", ec.unmarshalOBoolean2bool)
if err != nil {
return nil, err
}
args["includeDeprecated"] = arg0
return args, nil
}
func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) {
var err error
args := map[string]any{}
arg0, err := graphql.ProcessArgField(ctx, rawArgs, "includeDeprecated", ec.unmarshalOBoolean2bool)
if err != nil {
return nil, err
}
args["includeDeprecated"] = arg0
return args, nil
}
// endregion ***************************** args.gotpl *****************************
// region ************************** directives.gotpl **************************
// endregion ************************** directives.gotpl **************************
// region **************************** field.gotpl *****************************
func (ec *executionContext) _Change_id(ctx context.Context, field graphql.CollectedField, obj *model.Change) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Change_id,
func(ctx context.Context) (any, error) {
return obj.ID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Change_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Change",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Change_changeType(ctx context.Context, field graphql.CollectedField, obj *model.Change) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Change_changeType,
func(ctx context.Context) (any, error) {
return obj.ChangeType, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Change_changeType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Change",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Change_registrationId(ctx context.Context, field graphql.CollectedField, obj *model.Change) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Change_registrationId,
func(ctx context.Context) (any, error) {
return obj.RegistrationID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Change_registrationId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Change",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Change_representationName(ctx context.Context, field graphql.CollectedField, obj *model.Change) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Change_representationName,
func(ctx context.Context) (any, error) {
return obj.RepresentationName, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Change_representationName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Change",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Change_representationId(ctx context.Context, field graphql.CollectedField, obj *model.Change) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Change_representationId,
func(ctx context.Context) (any, error) {
return obj.RepresentationID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Change_representationId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Change",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Change_timestamp(ctx context.Context, field graphql.CollectedField, obj *model.Change) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Change_timestamp,
func(ctx context.Context) (any, error) {
return obj.Timestamp, nil
},
nil,
ec.marshalNDateTime2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Change_timestamp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Change",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type DateTime does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Change_registration(ctx context.Context, field graphql.CollectedField, obj *model.Change) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Change_registration,
func(ctx context.Context) (any, error) {
return obj.Registration, nil
},
nil,
ec.marshalNRegistration2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRegistration,
true,
true,
)
}
func (ec *executionContext) fieldContext_Change_registration(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Change",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Registration_id(ctx, field)
case "registrationType":
return ec.fieldContext_Registration_registrationType(ctx, field)
case "timestamp":
return ec.fieldContext_Registration_timestamp(ctx, field)
case "remark":
return ec.fieldContext_Registration_remark(ctx, field)
case "correctsRegistrationId":
return ec.fieldContext_Registration_correctsRegistrationId(ctx, field)
case "undoesRegistrationId":
return ec.fieldContext_Registration_undoesRegistrationId(ctx, field)
case "changes":
return ec.fieldContext_Registration_changes(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Registration", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _DataElementAU_relId(ctx context.Context, field graphql.CollectedField, obj *model.DataElementAu) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementAU_relId,
func(ctx context.Context) (any, error) {
return obj.RelID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementAU_relId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementAU",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementAU_aId(ctx context.Context, field graphql.CollectedField, obj *model.DataElementAu) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementAU_aId,
func(ctx context.Context) (any, error) {
return obj.AID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementAU_aId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementAU",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementAU_aaa(ctx context.Context, field graphql.CollectedField, obj *model.DataElementAu) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementAU_aaa,
func(ctx context.Context) (any, error) {
return obj.Aaa, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementAU_aaa(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementAU",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementAU_bbb(ctx context.Context, field graphql.CollectedField, obj *model.DataElementAu) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementAU_bbb,
func(ctx context.Context) (any, error) {
return obj.Bbb, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementAU_bbb(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementAU",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementAV_relId(ctx context.Context, field graphql.CollectedField, obj *model.DataElementAv) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementAV_relId,
func(ctx context.Context) (any, error) {
return obj.RelID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementAV_relId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementAV",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementAV_aId(ctx context.Context, field graphql.CollectedField, obj *model.DataElementAv) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementAV_aId,
func(ctx context.Context) (any, error) {
return obj.AID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementAV_aId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementAV",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementAV_ccc(ctx context.Context, field graphql.CollectedField, obj *model.DataElementAv) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementAV_ccc,
func(ctx context.Context) (any, error) {
return obj.Ccc, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementAV_ccc(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementAV",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementBX_relId(ctx context.Context, field graphql.CollectedField, obj *model.DataElementBx) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementBX_relId,
func(ctx context.Context) (any, error) {
return obj.RelID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementBX_relId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementBX",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementBX_bId(ctx context.Context, field graphql.CollectedField, obj *model.DataElementBx) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementBX_bId,
func(ctx context.Context) (any, error) {
return obj.BID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementBX_bId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementBX",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementBX_fff(ctx context.Context, field graphql.CollectedField, obj *model.DataElementBx) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementBX_fff,
func(ctx context.Context) (any, error) {
return obj.Fff, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementBX_fff(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementBX",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementBX_ggg(ctx context.Context, field graphql.CollectedField, obj *model.DataElementBx) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementBX_ggg,
func(ctx context.Context) (any, error) {
return obj.Ggg, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementBX_ggg(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementBX",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementBY_relId(ctx context.Context, field graphql.CollectedField, obj *model.DataElementBy) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementBY_relId,
func(ctx context.Context) (any, error) {
return obj.RelID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementBY_relId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementBY",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementBY_bId(ctx context.Context, field graphql.CollectedField, obj *model.DataElementBy) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementBY_bId,
func(ctx context.Context) (any, error) {
return obj.BID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementBY_bId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementBY",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _DataElementBY_hhh(ctx context.Context, field graphql.CollectedField, obj *model.DataElementBy) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_DataElementBY_hhh,
func(ctx context.Context) (any, error) {
return obj.Hhh, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_DataElementBY_hhh(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "DataElementBY",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _EntityA_id(ctx context.Context, field graphql.CollectedField, obj *model.EntityA) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityA_id,
func(ctx context.Context) (any, error) {
return obj.ID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_EntityA_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityA",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _EntityA_opvoer(ctx context.Context, field graphql.CollectedField, obj *model.EntityA) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityA_opvoer,
func(ctx context.Context) (any, error) {
return obj.Opvoer, nil
},
nil,
ec.marshalODateTime2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext_EntityA_opvoer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityA",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type DateTime does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _EntityA_afvoer(ctx context.Context, field graphql.CollectedField, obj *model.EntityA) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityA_afvoer,
func(ctx context.Context) (any, error) {
return obj.Afvoer, nil
},
nil,
ec.marshalODateTime2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext_EntityA_afvoer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityA",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type DateTime does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _EntityA_dataElementAU(ctx context.Context, field graphql.CollectedField, obj *model.EntityA) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityA_dataElementAU,
func(ctx context.Context) (any, error) {
return obj.DataElementAu, nil
},
nil,
ec.marshalODataElementAU2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAu,
true,
false,
)
}
func (ec *executionContext) fieldContext_EntityA_dataElementAU(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityA",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementAU_relId(ctx, field)
case "aId":
return ec.fieldContext_DataElementAU_aId(ctx, field)
case "aaa":
return ec.fieldContext_DataElementAU_aaa(ctx, field)
case "bbb":
return ec.fieldContext_DataElementAU_bbb(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementAU", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _EntityA_dataElementsAV(ctx context.Context, field graphql.CollectedField, obj *model.EntityA) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityA_dataElementsAV,
func(ctx context.Context) (any, error) {
return obj.DataElementsAv, nil
},
nil,
ec.marshalNDataElementAV2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAvᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_EntityA_dataElementsAV(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityA",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementAV_relId(ctx, field)
case "aId":
return ec.fieldContext_DataElementAV_aId(ctx, field)
case "ccc":
return ec.fieldContext_DataElementAV_ccc(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementAV", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _EntityA_relations(ctx context.Context, field graphql.CollectedField, obj *model.EntityA) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityA_relations,
func(ctx context.Context) (any, error) {
return obj.Relations, nil
},
nil,
ec.marshalNRelationAB2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRelationAbᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_EntityA_relations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityA",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_RelationAB_id(ctx, field)
case "aId":
return ec.fieldContext_RelationAB_aId(ctx, field)
case "bId":
return ec.fieldContext_RelationAB_bId(ctx, field)
case "entityA":
return ec.fieldContext_RelationAB_entityA(ctx, field)
case "entityB":
return ec.fieldContext_RelationAB_entityB(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type RelationAB", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _EntityB_id(ctx context.Context, field graphql.CollectedField, obj *model.EntityB) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityB_id,
func(ctx context.Context) (any, error) {
return obj.ID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_EntityB_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityB",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _EntityB_opvoer(ctx context.Context, field graphql.CollectedField, obj *model.EntityB) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityB_opvoer,
func(ctx context.Context) (any, error) {
return obj.Opvoer, nil
},
nil,
ec.marshalODateTime2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext_EntityB_opvoer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityB",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type DateTime does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _EntityB_afvoer(ctx context.Context, field graphql.CollectedField, obj *model.EntityB) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityB_afvoer,
func(ctx context.Context) (any, error) {
return obj.Afvoer, nil
},
nil,
ec.marshalODateTime2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext_EntityB_afvoer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityB",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type DateTime does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _EntityB_dataElementBX(ctx context.Context, field graphql.CollectedField, obj *model.EntityB) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityB_dataElementBX,
func(ctx context.Context) (any, error) {
return obj.DataElementBx, nil
},
nil,
ec.marshalODataElementBX2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBx,
true,
false,
)
}
func (ec *executionContext) fieldContext_EntityB_dataElementBX(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityB",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementBX_relId(ctx, field)
case "bId":
return ec.fieldContext_DataElementBX_bId(ctx, field)
case "fff":
return ec.fieldContext_DataElementBX_fff(ctx, field)
case "ggg":
return ec.fieldContext_DataElementBX_ggg(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementBX", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _EntityB_dataElementBY(ctx context.Context, field graphql.CollectedField, obj *model.EntityB) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityB_dataElementBY,
func(ctx context.Context) (any, error) {
return obj.DataElementBy, nil
},
nil,
ec.marshalODataElementBY2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBy,
true,
false,
)
}
func (ec *executionContext) fieldContext_EntityB_dataElementBY(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityB",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementBY_relId(ctx, field)
case "bId":
return ec.fieldContext_DataElementBY_bId(ctx, field)
case "hhh":
return ec.fieldContext_DataElementBY_hhh(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementBY", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _EntityB_relations(ctx context.Context, field graphql.CollectedField, obj *model.EntityB) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_EntityB_relations,
func(ctx context.Context) (any, error) {
return obj.Relations, nil
},
nil,
ec.marshalNRelationAB2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRelationAbᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_EntityB_relations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "EntityB",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_RelationAB_id(ctx, field)
case "aId":
return ec.fieldContext_RelationAB_aId(ctx, field)
case "bId":
return ec.fieldContext_RelationAB_bId(ctx, field)
case "entityA":
return ec.fieldContext_RelationAB_entityA(ctx, field)
case "entityB":
return ec.fieldContext_RelationAB_entityB(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type RelationAB", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _Mutation_createEntityA(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_createEntityA,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().CreateEntityA(ctx, fc.Args["input"].(model.CreateEntityAInput))
},
nil,
ec.marshalNEntityA2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityA,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_createEntityA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_EntityA_id(ctx, field)
case "opvoer":
return ec.fieldContext_EntityA_opvoer(ctx, field)
case "afvoer":
return ec.fieldContext_EntityA_afvoer(ctx, field)
case "dataElementAU":
return ec.fieldContext_EntityA_dataElementAU(ctx, field)
case "dataElementsAV":
return ec.fieldContext_EntityA_dataElementsAV(ctx, field)
case "relations":
return ec.fieldContext_EntityA_relations(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type EntityA", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_createEntityA_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_updateEntityA(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_updateEntityA,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().UpdateEntityA(ctx, fc.Args["id"].(string), fc.Args["input"].(model.UpdateEntityAInput))
},
nil,
ec.marshalNEntityA2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityA,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_updateEntityA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_EntityA_id(ctx, field)
case "opvoer":
return ec.fieldContext_EntityA_opvoer(ctx, field)
case "afvoer":
return ec.fieldContext_EntityA_afvoer(ctx, field)
case "dataElementAU":
return ec.fieldContext_EntityA_dataElementAU(ctx, field)
case "dataElementsAV":
return ec.fieldContext_EntityA_dataElementsAV(ctx, field)
case "relations":
return ec.fieldContext_EntityA_relations(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type EntityA", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_updateEntityA_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_deleteEntityA(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_deleteEntityA,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().DeleteEntityA(ctx, fc.Args["id"].(string))
},
nil,
ec.marshalNBoolean2bool,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_deleteEntityA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type Boolean does not have child fields")
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_deleteEntityA_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_createEntityB(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_createEntityB,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().CreateEntityB(ctx, fc.Args["input"].(model.CreateEntityBInput))
},
nil,
ec.marshalNEntityB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityB,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_createEntityB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_EntityB_id(ctx, field)
case "opvoer":
return ec.fieldContext_EntityB_opvoer(ctx, field)
case "afvoer":
return ec.fieldContext_EntityB_afvoer(ctx, field)
case "dataElementBX":
return ec.fieldContext_EntityB_dataElementBX(ctx, field)
case "dataElementBY":
return ec.fieldContext_EntityB_dataElementBY(ctx, field)
case "relations":
return ec.fieldContext_EntityB_relations(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type EntityB", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_createEntityB_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_updateEntityB(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_updateEntityB,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().UpdateEntityB(ctx, fc.Args["id"].(string), fc.Args["input"].(model.UpdateEntityBInput))
},
nil,
ec.marshalNEntityB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityB,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_updateEntityB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_EntityB_id(ctx, field)
case "opvoer":
return ec.fieldContext_EntityB_opvoer(ctx, field)
case "afvoer":
return ec.fieldContext_EntityB_afvoer(ctx, field)
case "dataElementBX":
return ec.fieldContext_EntityB_dataElementBX(ctx, field)
case "dataElementBY":
return ec.fieldContext_EntityB_dataElementBY(ctx, field)
case "relations":
return ec.fieldContext_EntityB_relations(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type EntityB", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_updateEntityB_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_deleteEntityB(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_deleteEntityB,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().DeleteEntityB(ctx, fc.Args["id"].(string))
},
nil,
ec.marshalNBoolean2bool,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_deleteEntityB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type Boolean does not have child fields")
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_deleteEntityB_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_createRelationAB(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_createRelationAB,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().CreateRelationAb(ctx, fc.Args["input"].(model.CreateRelationABInput))
},
nil,
ec.marshalNRelationAB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRelationAb,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_createRelationAB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_RelationAB_id(ctx, field)
case "aId":
return ec.fieldContext_RelationAB_aId(ctx, field)
case "bId":
return ec.fieldContext_RelationAB_bId(ctx, field)
case "entityA":
return ec.fieldContext_RelationAB_entityA(ctx, field)
case "entityB":
return ec.fieldContext_RelationAB_entityB(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type RelationAB", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_createRelationAB_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_deleteRelationAB(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_deleteRelationAB,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().DeleteRelationAb(ctx, fc.Args["id"].(string))
},
nil,
ec.marshalNBoolean2bool,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_deleteRelationAB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type Boolean does not have child fields")
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_deleteRelationAB_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_createDataElementAU(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_createDataElementAU,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().CreateDataElementAu(ctx, fc.Args["input"].(model.CreateDataElementAUInput))
},
nil,
ec.marshalNDataElementAU2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAu,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_createDataElementAU(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementAU_relId(ctx, field)
case "aId":
return ec.fieldContext_DataElementAU_aId(ctx, field)
case "aaa":
return ec.fieldContext_DataElementAU_aaa(ctx, field)
case "bbb":
return ec.fieldContext_DataElementAU_bbb(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementAU", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_createDataElementAU_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_updateDataElementAU(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_updateDataElementAU,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().UpdateDataElementAu(ctx, fc.Args["relId"].(string), fc.Args["input"].(model.UpdateDataElementAUInput))
},
nil,
ec.marshalNDataElementAU2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAu,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_updateDataElementAU(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementAU_relId(ctx, field)
case "aId":
return ec.fieldContext_DataElementAU_aId(ctx, field)
case "aaa":
return ec.fieldContext_DataElementAU_aaa(ctx, field)
case "bbb":
return ec.fieldContext_DataElementAU_bbb(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementAU", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_updateDataElementAU_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_createDataElementAV(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_createDataElementAV,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().CreateDataElementAv(ctx, fc.Args["input"].(model.CreateDataElementAVInput))
},
nil,
ec.marshalNDataElementAV2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAv,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_createDataElementAV(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementAV_relId(ctx, field)
case "aId":
return ec.fieldContext_DataElementAV_aId(ctx, field)
case "ccc":
return ec.fieldContext_DataElementAV_ccc(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementAV", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_createDataElementAV_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_createDataElementBX(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_createDataElementBX,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().CreateDataElementBx(ctx, fc.Args["input"].(model.CreateDataElementBXInput))
},
nil,
ec.marshalNDataElementBX2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBx,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_createDataElementBX(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementBX_relId(ctx, field)
case "bId":
return ec.fieldContext_DataElementBX_bId(ctx, field)
case "fff":
return ec.fieldContext_DataElementBX_fff(ctx, field)
case "ggg":
return ec.fieldContext_DataElementBX_ggg(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementBX", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_createDataElementBX_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_createDataElementBY(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_createDataElementBY,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().CreateDataElementBy(ctx, fc.Args["input"].(model.CreateDataElementBYInput))
},
nil,
ec.marshalNDataElementBY2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBy,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_createDataElementBY(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementBY_relId(ctx, field)
case "bId":
return ec.fieldContext_DataElementBY_bId(ctx, field)
case "hhh":
return ec.fieldContext_DataElementBY_hhh(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementBY", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_createDataElementBY_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_createTask(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_createTask,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().CreateTask(ctx, fc.Args["input"].(model.CreateTaskInput))
},
nil,
ec.marshalNTask2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐTask,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_createTask(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Task_id(ctx, field)
case "title":
return ec.fieldContext_Task_title(ctx, field)
case "description":
return ec.fieldContext_Task_description(ctx, field)
case "dueDate":
return ec.fieldContext_Task_dueDate(ctx, field)
case "status":
return ec.fieldContext_Task_status(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Task", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_createTask_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_updateTask(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_updateTask,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().UpdateTask(ctx, fc.Args["id"].(string), fc.Args["input"].(model.UpdateTaskInput))
},
nil,
ec.marshalNTask2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐTask,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_updateTask(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Task_id(ctx, field)
case "title":
return ec.fieldContext_Task_title(ctx, field)
case "description":
return ec.fieldContext_Task_description(ctx, field)
case "dueDate":
return ec.fieldContext_Task_dueDate(ctx, field)
case "status":
return ec.fieldContext_Task_status(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Task", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_updateTask_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Mutation_deleteTask(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Mutation_deleteTask,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Mutation().DeleteTask(ctx, fc.Args["id"].(string))
},
nil,
ec.marshalNBoolean2bool,
true,
true,
)
}
func (ec *executionContext) fieldContext_Mutation_deleteTask(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Mutation",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type Boolean does not have child fields")
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Mutation_deleteTask_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_entityA(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_entityA,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().EntityA(ctx, fc.Args["id"].(string))
},
nil,
ec.marshalOEntityA2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityA,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query_entityA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_EntityA_id(ctx, field)
case "opvoer":
return ec.fieldContext_EntityA_opvoer(ctx, field)
case "afvoer":
return ec.fieldContext_EntityA_afvoer(ctx, field)
case "dataElementAU":
return ec.fieldContext_EntityA_dataElementAU(ctx, field)
case "dataElementsAV":
return ec.fieldContext_EntityA_dataElementsAV(ctx, field)
case "relations":
return ec.fieldContext_EntityA_relations(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type EntityA", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_entityA_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_allEntitiesA(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_allEntitiesA,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().AllEntitiesA(ctx, fc.Args["limit"].(*int32), fc.Args["offset"].(*int32))
},
nil,
ec.marshalNEntityA2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityAᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_Query_allEntitiesA(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_EntityA_id(ctx, field)
case "opvoer":
return ec.fieldContext_EntityA_opvoer(ctx, field)
case "afvoer":
return ec.fieldContext_EntityA_afvoer(ctx, field)
case "dataElementAU":
return ec.fieldContext_EntityA_dataElementAU(ctx, field)
case "dataElementsAV":
return ec.fieldContext_EntityA_dataElementsAV(ctx, field)
case "relations":
return ec.fieldContext_EntityA_relations(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type EntityA", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_allEntitiesA_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_entityB(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_entityB,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().EntityB(ctx, fc.Args["id"].(string))
},
nil,
ec.marshalOEntityB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityB,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query_entityB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_EntityB_id(ctx, field)
case "opvoer":
return ec.fieldContext_EntityB_opvoer(ctx, field)
case "afvoer":
return ec.fieldContext_EntityB_afvoer(ctx, field)
case "dataElementBX":
return ec.fieldContext_EntityB_dataElementBX(ctx, field)
case "dataElementBY":
return ec.fieldContext_EntityB_dataElementBY(ctx, field)
case "relations":
return ec.fieldContext_EntityB_relations(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type EntityB", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_entityB_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_allEntitiesB(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_allEntitiesB,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().AllEntitiesB(ctx, fc.Args["limit"].(*int32), fc.Args["offset"].(*int32))
},
nil,
ec.marshalNEntityB2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityBᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_Query_allEntitiesB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_EntityB_id(ctx, field)
case "opvoer":
return ec.fieldContext_EntityB_opvoer(ctx, field)
case "afvoer":
return ec.fieldContext_EntityB_afvoer(ctx, field)
case "dataElementBX":
return ec.fieldContext_EntityB_dataElementBX(ctx, field)
case "dataElementBY":
return ec.fieldContext_EntityB_dataElementBY(ctx, field)
case "relations":
return ec.fieldContext_EntityB_relations(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type EntityB", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_allEntitiesB_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_relationAB(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_relationAB,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().RelationAb(ctx, fc.Args["id"].(string))
},
nil,
ec.marshalORelationAB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRelationAb,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query_relationAB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_RelationAB_id(ctx, field)
case "aId":
return ec.fieldContext_RelationAB_aId(ctx, field)
case "bId":
return ec.fieldContext_RelationAB_bId(ctx, field)
case "entityA":
return ec.fieldContext_RelationAB_entityA(ctx, field)
case "entityB":
return ec.fieldContext_RelationAB_entityB(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type RelationAB", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_relationAB_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_allRelationsAB(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_allRelationsAB,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().AllRelationsAb(ctx, fc.Args["limit"].(*int32), fc.Args["offset"].(*int32))
},
nil,
ec.marshalNRelationAB2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRelationAbᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_Query_allRelationsAB(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_RelationAB_id(ctx, field)
case "aId":
return ec.fieldContext_RelationAB_aId(ctx, field)
case "bId":
return ec.fieldContext_RelationAB_bId(ctx, field)
case "entityA":
return ec.fieldContext_RelationAB_entityA(ctx, field)
case "entityB":
return ec.fieldContext_RelationAB_entityB(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type RelationAB", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_allRelationsAB_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_dataElementAU(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_dataElementAU,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().DataElementAu(ctx, fc.Args["relId"].(string))
},
nil,
ec.marshalODataElementAU2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAu,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query_dataElementAU(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementAU_relId(ctx, field)
case "aId":
return ec.fieldContext_DataElementAU_aId(ctx, field)
case "aaa":
return ec.fieldContext_DataElementAU_aaa(ctx, field)
case "bbb":
return ec.fieldContext_DataElementAU_bbb(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementAU", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_dataElementAU_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_dataElementsAU(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_dataElementsAU,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().DataElementsAu(ctx, fc.Args["aId"].(string))
},
nil,
ec.marshalNDataElementAU2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAuᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_Query_dataElementsAU(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementAU_relId(ctx, field)
case "aId":
return ec.fieldContext_DataElementAU_aId(ctx, field)
case "aaa":
return ec.fieldContext_DataElementAU_aaa(ctx, field)
case "bbb":
return ec.fieldContext_DataElementAU_bbb(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementAU", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_dataElementsAU_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_dataElementAV(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_dataElementAV,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().DataElementAv(ctx, fc.Args["relId"].(string))
},
nil,
ec.marshalODataElementAV2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAv,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query_dataElementAV(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementAV_relId(ctx, field)
case "aId":
return ec.fieldContext_DataElementAV_aId(ctx, field)
case "ccc":
return ec.fieldContext_DataElementAV_ccc(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementAV", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_dataElementAV_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_dataElementsAV(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_dataElementsAV,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().DataElementsAv(ctx, fc.Args["aId"].(string))
},
nil,
ec.marshalNDataElementAV2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAvᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_Query_dataElementsAV(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementAV_relId(ctx, field)
case "aId":
return ec.fieldContext_DataElementAV_aId(ctx, field)
case "ccc":
return ec.fieldContext_DataElementAV_ccc(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementAV", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_dataElementsAV_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_dataElementBX(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_dataElementBX,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().DataElementBx(ctx, fc.Args["relId"].(string))
},
nil,
ec.marshalODataElementBX2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBx,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query_dataElementBX(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementBX_relId(ctx, field)
case "bId":
return ec.fieldContext_DataElementBX_bId(ctx, field)
case "fff":
return ec.fieldContext_DataElementBX_fff(ctx, field)
case "ggg":
return ec.fieldContext_DataElementBX_ggg(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementBX", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_dataElementBX_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_dataElementBY(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_dataElementBY,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().DataElementBy(ctx, fc.Args["relId"].(string))
},
nil,
ec.marshalODataElementBY2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBy,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query_dataElementBY(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "relId":
return ec.fieldContext_DataElementBY_relId(ctx, field)
case "bId":
return ec.fieldContext_DataElementBY_bId(ctx, field)
case "hhh":
return ec.fieldContext_DataElementBY_hhh(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type DataElementBY", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_dataElementBY_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_registration(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_registration,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().Registration(ctx, fc.Args["id"].(string))
},
nil,
ec.marshalORegistration2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRegistration,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query_registration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Registration_id(ctx, field)
case "registrationType":
return ec.fieldContext_Registration_registrationType(ctx, field)
case "timestamp":
return ec.fieldContext_Registration_timestamp(ctx, field)
case "remark":
return ec.fieldContext_Registration_remark(ctx, field)
case "correctsRegistrationId":
return ec.fieldContext_Registration_correctsRegistrationId(ctx, field)
case "undoesRegistrationId":
return ec.fieldContext_Registration_undoesRegistrationId(ctx, field)
case "changes":
return ec.fieldContext_Registration_changes(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Registration", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_registration_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_allRegistrations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_allRegistrations,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().AllRegistrations(ctx, fc.Args["limit"].(*int32), fc.Args["offset"].(*int32))
},
nil,
ec.marshalNRegistration2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRegistrationᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_Query_allRegistrations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Registration_id(ctx, field)
case "registrationType":
return ec.fieldContext_Registration_registrationType(ctx, field)
case "timestamp":
return ec.fieldContext_Registration_timestamp(ctx, field)
case "remark":
return ec.fieldContext_Registration_remark(ctx, field)
case "correctsRegistrationId":
return ec.fieldContext_Registration_correctsRegistrationId(ctx, field)
case "undoesRegistrationId":
return ec.fieldContext_Registration_undoesRegistrationId(ctx, field)
case "changes":
return ec.fieldContext_Registration_changes(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Registration", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_allRegistrations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_change(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_change,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().Change(ctx, fc.Args["id"].(string))
},
nil,
ec.marshalOChange2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐChange,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query_change(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Change_id(ctx, field)
case "changeType":
return ec.fieldContext_Change_changeType(ctx, field)
case "registrationId":
return ec.fieldContext_Change_registrationId(ctx, field)
case "representationName":
return ec.fieldContext_Change_representationName(ctx, field)
case "representationId":
return ec.fieldContext_Change_representationId(ctx, field)
case "timestamp":
return ec.fieldContext_Change_timestamp(ctx, field)
case "registration":
return ec.fieldContext_Change_registration(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Change", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_change_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_allChanges(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_allChanges,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().AllChanges(ctx, fc.Args["limit"].(*int32), fc.Args["offset"].(*int32))
},
nil,
ec.marshalNChange2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐChangeᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_Query_allChanges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Change_id(ctx, field)
case "changeType":
return ec.fieldContext_Change_changeType(ctx, field)
case "registrationId":
return ec.fieldContext_Change_registrationId(ctx, field)
case "representationName":
return ec.fieldContext_Change_representationName(ctx, field)
case "representationId":
return ec.fieldContext_Change_representationId(ctx, field)
case "timestamp":
return ec.fieldContext_Change_timestamp(ctx, field)
case "registration":
return ec.fieldContext_Change_registration(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Change", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_allChanges_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_task(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_task,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().Task(ctx, fc.Args["id"].(string))
},
nil,
ec.marshalOTask2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐTask,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query_task(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Task_id(ctx, field)
case "title":
return ec.fieldContext_Task_title(ctx, field)
case "description":
return ec.fieldContext_Task_description(ctx, field)
case "dueDate":
return ec.fieldContext_Task_dueDate(ctx, field)
case "status":
return ec.fieldContext_Task_status(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Task", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_task_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query_allTasks(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query_allTasks,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.resolvers.Query().AllTasks(ctx, fc.Args["limit"].(*int32), fc.Args["offset"].(*int32))
},
nil,
ec.marshalNTask2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐTaskᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_Query_allTasks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Task_id(ctx, field)
case "title":
return ec.fieldContext_Task_title(ctx, field)
case "description":
return ec.fieldContext_Task_description(ctx, field)
case "dueDate":
return ec.fieldContext_Task_dueDate(ctx, field)
case "status":
return ec.fieldContext_Task_status(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Task", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query_allTasks_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query___type,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return ec.introspectType(fc.Args["name"].(string))
},
nil,
ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "kind":
return ec.fieldContext___Type_kind(ctx, field)
case "name":
return ec.fieldContext___Type_name(ctx, field)
case "description":
return ec.fieldContext___Type_description(ctx, field)
case "specifiedByURL":
return ec.fieldContext___Type_specifiedByURL(ctx, field)
case "fields":
return ec.fieldContext___Type_fields(ctx, field)
case "interfaces":
return ec.fieldContext___Type_interfaces(ctx, field)
case "possibleTypes":
return ec.fieldContext___Type_possibleTypes(ctx, field)
case "enumValues":
return ec.fieldContext___Type_enumValues(ctx, field)
case "inputFields":
return ec.fieldContext___Type_inputFields(ctx, field)
case "ofType":
return ec.fieldContext___Type_ofType(ctx, field)
case "isOneOf":
return ec.fieldContext___Type_isOneOf(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Query___schema,
func(ctx context.Context) (any, error) {
return ec.introspectSchema()
},
nil,
ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema,
true,
false,
)
}
func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "description":
return ec.fieldContext___Schema_description(ctx, field)
case "types":
return ec.fieldContext___Schema_types(ctx, field)
case "queryType":
return ec.fieldContext___Schema_queryType(ctx, field)
case "mutationType":
return ec.fieldContext___Schema_mutationType(ctx, field)
case "subscriptionType":
return ec.fieldContext___Schema_subscriptionType(ctx, field)
case "directives":
return ec.fieldContext___Schema_directives(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _Registration_id(ctx context.Context, field graphql.CollectedField, obj *model.Registration) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Registration_id,
func(ctx context.Context) (any, error) {
return obj.ID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Registration_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Registration",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Registration_registrationType(ctx context.Context, field graphql.CollectedField, obj *model.Registration) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Registration_registrationType,
func(ctx context.Context) (any, error) {
return obj.RegistrationType, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Registration_registrationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Registration",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Registration_timestamp(ctx context.Context, field graphql.CollectedField, obj *model.Registration) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Registration_timestamp,
func(ctx context.Context) (any, error) {
return obj.Timestamp, nil
},
nil,
ec.marshalNDateTime2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Registration_timestamp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Registration",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type DateTime does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Registration_remark(ctx context.Context, field graphql.CollectedField, obj *model.Registration) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Registration_remark,
func(ctx context.Context) (any, error) {
return obj.Remark, nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext_Registration_remark(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Registration",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Registration_correctsRegistrationId(ctx context.Context, field graphql.CollectedField, obj *model.Registration) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Registration_correctsRegistrationId,
func(ctx context.Context) (any, error) {
return obj.CorrectsRegistrationID, nil
},
nil,
ec.marshalOID2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext_Registration_correctsRegistrationId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Registration",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Registration_undoesRegistrationId(ctx context.Context, field graphql.CollectedField, obj *model.Registration) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Registration_undoesRegistrationId,
func(ctx context.Context) (any, error) {
return obj.UndoesRegistrationID, nil
},
nil,
ec.marshalOID2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext_Registration_undoesRegistrationId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Registration",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Registration_changes(ctx context.Context, field graphql.CollectedField, obj *model.Registration) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Registration_changes,
func(ctx context.Context) (any, error) {
return obj.Changes, nil
},
nil,
ec.marshalNChange2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐChangeᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext_Registration_changes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Registration",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Change_id(ctx, field)
case "changeType":
return ec.fieldContext_Change_changeType(ctx, field)
case "registrationId":
return ec.fieldContext_Change_registrationId(ctx, field)
case "representationName":
return ec.fieldContext_Change_representationName(ctx, field)
case "representationId":
return ec.fieldContext_Change_representationId(ctx, field)
case "timestamp":
return ec.fieldContext_Change_timestamp(ctx, field)
case "registration":
return ec.fieldContext_Change_registration(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Change", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _RelationAB_id(ctx context.Context, field graphql.CollectedField, obj *model.RelationAb) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_RelationAB_id,
func(ctx context.Context) (any, error) {
return obj.ID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_RelationAB_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "RelationAB",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _RelationAB_aId(ctx context.Context, field graphql.CollectedField, obj *model.RelationAb) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_RelationAB_aId,
func(ctx context.Context) (any, error) {
return obj.AID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_RelationAB_aId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "RelationAB",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _RelationAB_bId(ctx context.Context, field graphql.CollectedField, obj *model.RelationAb) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_RelationAB_bId,
func(ctx context.Context) (any, error) {
return obj.BID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_RelationAB_bId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "RelationAB",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _RelationAB_entityA(ctx context.Context, field graphql.CollectedField, obj *model.RelationAb) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_RelationAB_entityA,
func(ctx context.Context) (any, error) {
return obj.EntityA, nil
},
nil,
ec.marshalNEntityA2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityA,
true,
true,
)
}
func (ec *executionContext) fieldContext_RelationAB_entityA(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "RelationAB",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_EntityA_id(ctx, field)
case "opvoer":
return ec.fieldContext_EntityA_opvoer(ctx, field)
case "afvoer":
return ec.fieldContext_EntityA_afvoer(ctx, field)
case "dataElementAU":
return ec.fieldContext_EntityA_dataElementAU(ctx, field)
case "dataElementsAV":
return ec.fieldContext_EntityA_dataElementsAV(ctx, field)
case "relations":
return ec.fieldContext_EntityA_relations(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type EntityA", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _RelationAB_entityB(ctx context.Context, field graphql.CollectedField, obj *model.RelationAb) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_RelationAB_entityB,
func(ctx context.Context) (any, error) {
return obj.EntityB, nil
},
nil,
ec.marshalNEntityB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityB,
true,
true,
)
}
func (ec *executionContext) fieldContext_RelationAB_entityB(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "RelationAB",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_EntityB_id(ctx, field)
case "opvoer":
return ec.fieldContext_EntityB_opvoer(ctx, field)
case "afvoer":
return ec.fieldContext_EntityB_afvoer(ctx, field)
case "dataElementBX":
return ec.fieldContext_EntityB_dataElementBX(ctx, field)
case "dataElementBY":
return ec.fieldContext_EntityB_dataElementBY(ctx, field)
case "relations":
return ec.fieldContext_EntityB_relations(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type EntityB", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _Task_id(ctx context.Context, field graphql.CollectedField, obj *model.Task) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Task_id,
func(ctx context.Context) (any, error) {
return obj.ID, nil
},
nil,
ec.marshalNID2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Task_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Task",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Task_title(ctx context.Context, field graphql.CollectedField, obj *model.Task) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Task_title,
func(ctx context.Context) (any, error) {
return obj.Title, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Task_title(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Task",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Task_description(ctx context.Context, field graphql.CollectedField, obj *model.Task) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Task_description,
func(ctx context.Context) (any, error) {
return obj.Description, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Task_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Task",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Task_dueDate(ctx context.Context, field graphql.CollectedField, obj *model.Task) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Task_dueDate,
func(ctx context.Context) (any, error) {
return obj.DueDate, nil
},
nil,
ec.marshalNDateTime2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Task_dueDate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Task",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type DateTime does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Task_status(ctx context.Context, field graphql.CollectedField, obj *model.Task) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext_Task_status,
func(ctx context.Context) (any, error) {
return obj.Status, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext_Task_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Task",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Directive_name,
func(ctx context.Context) (any, error) {
return obj.Name, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Directive",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Directive_description,
func(ctx context.Context) (any, error) {
return obj.Description(), nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Directive",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Directive_isRepeatable,
func(ctx context.Context) (any, error) {
return obj.IsRepeatable, nil
},
nil,
ec.marshalNBoolean2bool,
true,
true,
)
}
func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Directive",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type Boolean does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Directive_locations,
func(ctx context.Context) (any, error) {
return obj.Locations, nil
},
nil,
ec.marshalN__DirectiveLocation2ᚕstringᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Directive",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type __DirectiveLocation does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Directive_args,
func(ctx context.Context) (any, error) {
return obj.Args, nil
},
nil,
ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Directive",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "name":
return ec.fieldContext___InputValue_name(ctx, field)
case "description":
return ec.fieldContext___InputValue_description(ctx, field)
case "type":
return ec.fieldContext___InputValue_type(ctx, field)
case "defaultValue":
return ec.fieldContext___InputValue_defaultValue(ctx, field)
case "isDeprecated":
return ec.fieldContext___InputValue_isDeprecated(ctx, field)
case "deprecationReason":
return ec.fieldContext___InputValue_deprecationReason(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field___Directive_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___EnumValue_name,
func(ctx context.Context) (any, error) {
return obj.Name, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__EnumValue",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___EnumValue_description,
func(ctx context.Context) (any, error) {
return obj.Description(), nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__EnumValue",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___EnumValue_isDeprecated,
func(ctx context.Context) (any, error) {
return obj.IsDeprecated(), nil
},
nil,
ec.marshalNBoolean2bool,
true,
true,
)
}
func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__EnumValue",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type Boolean does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___EnumValue_deprecationReason,
func(ctx context.Context) (any, error) {
return obj.DeprecationReason(), nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__EnumValue",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Field_name,
func(ctx context.Context) (any, error) {
return obj.Name, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Field",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Field_description,
func(ctx context.Context) (any, error) {
return obj.Description(), nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Field",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Field_args,
func(ctx context.Context) (any, error) {
return obj.Args, nil
},
nil,
ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Field",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "name":
return ec.fieldContext___InputValue_name(ctx, field)
case "description":
return ec.fieldContext___InputValue_description(ctx, field)
case "type":
return ec.fieldContext___InputValue_type(ctx, field)
case "defaultValue":
return ec.fieldContext___InputValue_defaultValue(ctx, field)
case "isDeprecated":
return ec.fieldContext___InputValue_isDeprecated(ctx, field)
case "deprecationReason":
return ec.fieldContext___InputValue_deprecationReason(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field___Field_args_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Field_type,
func(ctx context.Context) (any, error) {
return obj.Type, nil
},
nil,
ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType,
true,
true,
)
}
func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Field",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "kind":
return ec.fieldContext___Type_kind(ctx, field)
case "name":
return ec.fieldContext___Type_name(ctx, field)
case "description":
return ec.fieldContext___Type_description(ctx, field)
case "specifiedByURL":
return ec.fieldContext___Type_specifiedByURL(ctx, field)
case "fields":
return ec.fieldContext___Type_fields(ctx, field)
case "interfaces":
return ec.fieldContext___Type_interfaces(ctx, field)
case "possibleTypes":
return ec.fieldContext___Type_possibleTypes(ctx, field)
case "enumValues":
return ec.fieldContext___Type_enumValues(ctx, field)
case "inputFields":
return ec.fieldContext___Type_inputFields(ctx, field)
case "ofType":
return ec.fieldContext___Type_ofType(ctx, field)
case "isOneOf":
return ec.fieldContext___Type_isOneOf(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Field_isDeprecated,
func(ctx context.Context) (any, error) {
return obj.IsDeprecated(), nil
},
nil,
ec.marshalNBoolean2bool,
true,
true,
)
}
func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Field",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type Boolean does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Field_deprecationReason,
func(ctx context.Context) (any, error) {
return obj.DeprecationReason(), nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Field",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___InputValue_name,
func(ctx context.Context) (any, error) {
return obj.Name, nil
},
nil,
ec.marshalNString2string,
true,
true,
)
}
func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__InputValue",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___InputValue_description,
func(ctx context.Context) (any, error) {
return obj.Description(), nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__InputValue",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___InputValue_type,
func(ctx context.Context) (any, error) {
return obj.Type, nil
},
nil,
ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType,
true,
true,
)
}
func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__InputValue",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "kind":
return ec.fieldContext___Type_kind(ctx, field)
case "name":
return ec.fieldContext___Type_name(ctx, field)
case "description":
return ec.fieldContext___Type_description(ctx, field)
case "specifiedByURL":
return ec.fieldContext___Type_specifiedByURL(ctx, field)
case "fields":
return ec.fieldContext___Type_fields(ctx, field)
case "interfaces":
return ec.fieldContext___Type_interfaces(ctx, field)
case "possibleTypes":
return ec.fieldContext___Type_possibleTypes(ctx, field)
case "enumValues":
return ec.fieldContext___Type_enumValues(ctx, field)
case "inputFields":
return ec.fieldContext___Type_inputFields(ctx, field)
case "ofType":
return ec.fieldContext___Type_ofType(ctx, field)
case "isOneOf":
return ec.fieldContext___Type_isOneOf(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___InputValue_defaultValue,
func(ctx context.Context) (any, error) {
return obj.DefaultValue, nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__InputValue",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___InputValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___InputValue_isDeprecated,
func(ctx context.Context) (any, error) {
return obj.IsDeprecated(), nil
},
nil,
ec.marshalNBoolean2bool,
true,
true,
)
}
func (ec *executionContext) fieldContext___InputValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__InputValue",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type Boolean does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___InputValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___InputValue_deprecationReason,
func(ctx context.Context) (any, error) {
return obj.DeprecationReason(), nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___InputValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__InputValue",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Schema_description,
func(ctx context.Context) (any, error) {
return obj.Description(), nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Schema",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Schema_types,
func(ctx context.Context) (any, error) {
return obj.Types(), nil
},
nil,
ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Schema",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "kind":
return ec.fieldContext___Type_kind(ctx, field)
case "name":
return ec.fieldContext___Type_name(ctx, field)
case "description":
return ec.fieldContext___Type_description(ctx, field)
case "specifiedByURL":
return ec.fieldContext___Type_specifiedByURL(ctx, field)
case "fields":
return ec.fieldContext___Type_fields(ctx, field)
case "interfaces":
return ec.fieldContext___Type_interfaces(ctx, field)
case "possibleTypes":
return ec.fieldContext___Type_possibleTypes(ctx, field)
case "enumValues":
return ec.fieldContext___Type_enumValues(ctx, field)
case "inputFields":
return ec.fieldContext___Type_inputFields(ctx, field)
case "ofType":
return ec.fieldContext___Type_ofType(ctx, field)
case "isOneOf":
return ec.fieldContext___Type_isOneOf(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Schema_queryType,
func(ctx context.Context) (any, error) {
return obj.QueryType(), nil
},
nil,
ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType,
true,
true,
)
}
func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Schema",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "kind":
return ec.fieldContext___Type_kind(ctx, field)
case "name":
return ec.fieldContext___Type_name(ctx, field)
case "description":
return ec.fieldContext___Type_description(ctx, field)
case "specifiedByURL":
return ec.fieldContext___Type_specifiedByURL(ctx, field)
case "fields":
return ec.fieldContext___Type_fields(ctx, field)
case "interfaces":
return ec.fieldContext___Type_interfaces(ctx, field)
case "possibleTypes":
return ec.fieldContext___Type_possibleTypes(ctx, field)
case "enumValues":
return ec.fieldContext___Type_enumValues(ctx, field)
case "inputFields":
return ec.fieldContext___Type_inputFields(ctx, field)
case "ofType":
return ec.fieldContext___Type_ofType(ctx, field)
case "isOneOf":
return ec.fieldContext___Type_isOneOf(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Schema_mutationType,
func(ctx context.Context) (any, error) {
return obj.MutationType(), nil
},
nil,
ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType,
true,
false,
)
}
func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Schema",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "kind":
return ec.fieldContext___Type_kind(ctx, field)
case "name":
return ec.fieldContext___Type_name(ctx, field)
case "description":
return ec.fieldContext___Type_description(ctx, field)
case "specifiedByURL":
return ec.fieldContext___Type_specifiedByURL(ctx, field)
case "fields":
return ec.fieldContext___Type_fields(ctx, field)
case "interfaces":
return ec.fieldContext___Type_interfaces(ctx, field)
case "possibleTypes":
return ec.fieldContext___Type_possibleTypes(ctx, field)
case "enumValues":
return ec.fieldContext___Type_enumValues(ctx, field)
case "inputFields":
return ec.fieldContext___Type_inputFields(ctx, field)
case "ofType":
return ec.fieldContext___Type_ofType(ctx, field)
case "isOneOf":
return ec.fieldContext___Type_isOneOf(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Schema_subscriptionType,
func(ctx context.Context) (any, error) {
return obj.SubscriptionType(), nil
},
nil,
ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType,
true,
false,
)
}
func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Schema",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "kind":
return ec.fieldContext___Type_kind(ctx, field)
case "name":
return ec.fieldContext___Type_name(ctx, field)
case "description":
return ec.fieldContext___Type_description(ctx, field)
case "specifiedByURL":
return ec.fieldContext___Type_specifiedByURL(ctx, field)
case "fields":
return ec.fieldContext___Type_fields(ctx, field)
case "interfaces":
return ec.fieldContext___Type_interfaces(ctx, field)
case "possibleTypes":
return ec.fieldContext___Type_possibleTypes(ctx, field)
case "enumValues":
return ec.fieldContext___Type_enumValues(ctx, field)
case "inputFields":
return ec.fieldContext___Type_inputFields(ctx, field)
case "ofType":
return ec.fieldContext___Type_ofType(ctx, field)
case "isOneOf":
return ec.fieldContext___Type_isOneOf(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Schema_directives,
func(ctx context.Context) (any, error) {
return obj.Directives(), nil
},
nil,
ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ,
true,
true,
)
}
func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Schema",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "name":
return ec.fieldContext___Directive_name(ctx, field)
case "description":
return ec.fieldContext___Directive_description(ctx, field)
case "isRepeatable":
return ec.fieldContext___Directive_isRepeatable(ctx, field)
case "locations":
return ec.fieldContext___Directive_locations(ctx, field)
case "args":
return ec.fieldContext___Directive_args(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Type_kind,
func(ctx context.Context) (any, error) {
return obj.Kind(), nil
},
nil,
ec.marshalN__TypeKind2string,
true,
true,
)
}
func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Type",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type __TypeKind does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Type_name,
func(ctx context.Context) (any, error) {
return obj.Name(), nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Type",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Type_description,
func(ctx context.Context) (any, error) {
return obj.Description(), nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Type",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Type_specifiedByURL,
func(ctx context.Context) (any, error) {
return obj.SpecifiedByURL(), nil
},
nil,
ec.marshalOString2ᚖstring,
true,
false,
)
}
func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Type",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Type_fields,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil
},
nil,
ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ,
true,
false,
)
}
func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Type",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "name":
return ec.fieldContext___Field_name(ctx, field)
case "description":
return ec.fieldContext___Field_description(ctx, field)
case "args":
return ec.fieldContext___Field_args(ctx, field)
case "type":
return ec.fieldContext___Field_type(ctx, field)
case "isDeprecated":
return ec.fieldContext___Field_isDeprecated(ctx, field)
case "deprecationReason":
return ec.fieldContext___Field_deprecationReason(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Type_interfaces,
func(ctx context.Context) (any, error) {
return obj.Interfaces(), nil
},
nil,
ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ,
true,
false,
)
}
func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Type",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "kind":
return ec.fieldContext___Type_kind(ctx, field)
case "name":
return ec.fieldContext___Type_name(ctx, field)
case "description":
return ec.fieldContext___Type_description(ctx, field)
case "specifiedByURL":
return ec.fieldContext___Type_specifiedByURL(ctx, field)
case "fields":
return ec.fieldContext___Type_fields(ctx, field)
case "interfaces":
return ec.fieldContext___Type_interfaces(ctx, field)
case "possibleTypes":
return ec.fieldContext___Type_possibleTypes(ctx, field)
case "enumValues":
return ec.fieldContext___Type_enumValues(ctx, field)
case "inputFields":
return ec.fieldContext___Type_inputFields(ctx, field)
case "ofType":
return ec.fieldContext___Type_ofType(ctx, field)
case "isOneOf":
return ec.fieldContext___Type_isOneOf(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Type_possibleTypes,
func(ctx context.Context) (any, error) {
return obj.PossibleTypes(), nil
},
nil,
ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ,
true,
false,
)
}
func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Type",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "kind":
return ec.fieldContext___Type_kind(ctx, field)
case "name":
return ec.fieldContext___Type_name(ctx, field)
case "description":
return ec.fieldContext___Type_description(ctx, field)
case "specifiedByURL":
return ec.fieldContext___Type_specifiedByURL(ctx, field)
case "fields":
return ec.fieldContext___Type_fields(ctx, field)
case "interfaces":
return ec.fieldContext___Type_interfaces(ctx, field)
case "possibleTypes":
return ec.fieldContext___Type_possibleTypes(ctx, field)
case "enumValues":
return ec.fieldContext___Type_enumValues(ctx, field)
case "inputFields":
return ec.fieldContext___Type_inputFields(ctx, field)
case "ofType":
return ec.fieldContext___Type_ofType(ctx, field)
case "isOneOf":
return ec.fieldContext___Type_isOneOf(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Type_enumValues,
func(ctx context.Context) (any, error) {
fc := graphql.GetFieldContext(ctx)
return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil
},
nil,
ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ,
true,
false,
)
}
func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Type",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "name":
return ec.fieldContext___EnumValue_name(ctx, field)
case "description":
return ec.fieldContext___EnumValue_description(ctx, field)
case "isDeprecated":
return ec.fieldContext___EnumValue_isDeprecated(ctx, field)
case "deprecationReason":
return ec.fieldContext___EnumValue_deprecationReason(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name)
},
}
defer func() {
if r := recover(); r != nil {
err = ec.Recover(ctx, r)
ec.Error(ctx, err)
}
}()
ctx = graphql.WithFieldContext(ctx, fc)
if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
ec.Error(ctx, err)
return fc, err
}
return fc, nil
}
func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Type_inputFields,
func(ctx context.Context) (any, error) {
return obj.InputFields(), nil
},
nil,
ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ,
true,
false,
)
}
func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Type",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "name":
return ec.fieldContext___InputValue_name(ctx, field)
case "description":
return ec.fieldContext___InputValue_description(ctx, field)
case "type":
return ec.fieldContext___InputValue_type(ctx, field)
case "defaultValue":
return ec.fieldContext___InputValue_defaultValue(ctx, field)
case "isDeprecated":
return ec.fieldContext___InputValue_isDeprecated(ctx, field)
case "deprecationReason":
return ec.fieldContext___InputValue_deprecationReason(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Type_ofType,
func(ctx context.Context) (any, error) {
return obj.OfType(), nil
},
nil,
ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType,
true,
false,
)
}
func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Type",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "kind":
return ec.fieldContext___Type_kind(ctx, field)
case "name":
return ec.fieldContext___Type_name(ctx, field)
case "description":
return ec.fieldContext___Type_description(ctx, field)
case "specifiedByURL":
return ec.fieldContext___Type_specifiedByURL(ctx, field)
case "fields":
return ec.fieldContext___Type_fields(ctx, field)
case "interfaces":
return ec.fieldContext___Type_interfaces(ctx, field)
case "possibleTypes":
return ec.fieldContext___Type_possibleTypes(ctx, field)
case "enumValues":
return ec.fieldContext___Type_enumValues(ctx, field)
case "inputFields":
return ec.fieldContext___Type_inputFields(ctx, field)
case "ofType":
return ec.fieldContext___Type_ofType(ctx, field)
case "isOneOf":
return ec.fieldContext___Type_isOneOf(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___Type_isOneOf(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
return graphql.ResolveField(
ctx,
ec.OperationContext,
field,
ec.fieldContext___Type_isOneOf,
func(ctx context.Context) (any, error) {
return obj.IsOneOf(), nil
},
nil,
ec.marshalOBoolean2bool,
true,
false,
)
}
func (ec *executionContext) fieldContext___Type_isOneOf(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "__Type",
Field: field,
IsMethod: true,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type Boolean does not have child fields")
},
}
return fc, nil
}
// endregion **************************** field.gotpl *****************************
// region **************************** input.gotpl *****************************
func (ec *executionContext) unmarshalInputCreateDataElementAUInput(ctx context.Context, obj any) (model.CreateDataElementAUInput, error) {
var it model.CreateDataElementAUInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"aId", "aaa", "bbb"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "aId":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("aId"))
data, err := ec.unmarshalNID2string(ctx, v)
if err != nil {
return it, err
}
it.AID = data
case "aaa":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("aaa"))
data, err := ec.unmarshalNString2string(ctx, v)
if err != nil {
return it, err
}
it.Aaa = data
case "bbb":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bbb"))
data, err := ec.unmarshalNString2string(ctx, v)
if err != nil {
return it, err
}
it.Bbb = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputCreateDataElementAVInput(ctx context.Context, obj any) (model.CreateDataElementAVInput, error) {
var it model.CreateDataElementAVInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"aId", "ccc"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "aId":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("aId"))
data, err := ec.unmarshalNID2string(ctx, v)
if err != nil {
return it, err
}
it.AID = data
case "ccc":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ccc"))
data, err := ec.unmarshalNString2string(ctx, v)
if err != nil {
return it, err
}
it.Ccc = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputCreateDataElementBXInput(ctx context.Context, obj any) (model.CreateDataElementBXInput, error) {
var it model.CreateDataElementBXInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"bId", "fff", "ggg"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "bId":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bId"))
data, err := ec.unmarshalNID2string(ctx, v)
if err != nil {
return it, err
}
it.BID = data
case "fff":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fff"))
data, err := ec.unmarshalNString2string(ctx, v)
if err != nil {
return it, err
}
it.Fff = data
case "ggg":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ggg"))
data, err := ec.unmarshalNString2string(ctx, v)
if err != nil {
return it, err
}
it.Ggg = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputCreateDataElementBYInput(ctx context.Context, obj any) (model.CreateDataElementBYInput, error) {
var it model.CreateDataElementBYInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"bId", "hhh"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "bId":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bId"))
data, err := ec.unmarshalNID2string(ctx, v)
if err != nil {
return it, err
}
it.BID = data
case "hhh":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hhh"))
data, err := ec.unmarshalNString2string(ctx, v)
if err != nil {
return it, err
}
it.Hhh = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputCreateEntityAInput(ctx context.Context, obj any) (model.CreateEntityAInput, error) {
var it model.CreateEntityAInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"id"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "id":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
data, err := ec.unmarshalNID2string(ctx, v)
if err != nil {
return it, err
}
it.ID = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputCreateEntityBInput(ctx context.Context, obj any) (model.CreateEntityBInput, error) {
var it model.CreateEntityBInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"id"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "id":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
data, err := ec.unmarshalNID2string(ctx, v)
if err != nil {
return it, err
}
it.ID = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputCreateRelationABInput(ctx context.Context, obj any) (model.CreateRelationABInput, error) {
var it model.CreateRelationABInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"aId", "bId"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "aId":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("aId"))
data, err := ec.unmarshalNID2string(ctx, v)
if err != nil {
return it, err
}
it.AID = data
case "bId":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bId"))
data, err := ec.unmarshalNID2string(ctx, v)
if err != nil {
return it, err
}
it.BID = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputCreateTaskInput(ctx context.Context, obj any) (model.CreateTaskInput, error) {
var it model.CreateTaskInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"id", "title", "description", "dueDate", "status"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "id":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id"))
data, err := ec.unmarshalNID2string(ctx, v)
if err != nil {
return it, err
}
it.ID = data
case "title":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title"))
data, err := ec.unmarshalNString2string(ctx, v)
if err != nil {
return it, err
}
it.Title = data
case "description":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description"))
data, err := ec.unmarshalNString2string(ctx, v)
if err != nil {
return it, err
}
it.Description = data
case "dueDate":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dueDate"))
data, err := ec.unmarshalNDateTime2string(ctx, v)
if err != nil {
return it, err
}
it.DueDate = data
case "status":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status"))
data, err := ec.unmarshalNString2string(ctx, v)
if err != nil {
return it, err
}
it.Status = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputUpdateDataElementAUInput(ctx context.Context, obj any) (model.UpdateDataElementAUInput, error) {
var it model.UpdateDataElementAUInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"aaa", "bbb"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "aaa":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("aaa"))
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}
it.Aaa = data
case "bbb":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bbb"))
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}
it.Bbb = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputUpdateEntityAInput(ctx context.Context, obj any) (model.UpdateEntityAInput, error) {
var it model.UpdateEntityAInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"opvoer", "afvoer"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "opvoer":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("opvoer"))
data, err := ec.unmarshalODateTime2ᚖstring(ctx, v)
if err != nil {
return it, err
}
it.Opvoer = data
case "afvoer":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("afvoer"))
data, err := ec.unmarshalODateTime2ᚖstring(ctx, v)
if err != nil {
return it, err
}
it.Afvoer = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputUpdateEntityBInput(ctx context.Context, obj any) (model.UpdateEntityBInput, error) {
var it model.UpdateEntityBInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"opvoer", "afvoer"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "opvoer":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("opvoer"))
data, err := ec.unmarshalODateTime2ᚖstring(ctx, v)
if err != nil {
return it, err
}
it.Opvoer = data
case "afvoer":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("afvoer"))
data, err := ec.unmarshalODateTime2ᚖstring(ctx, v)
if err != nil {
return it, err
}
it.Afvoer = data
}
}
return it, nil
}
func (ec *executionContext) unmarshalInputUpdateTaskInput(ctx context.Context, obj any) (model.UpdateTaskInput, error) {
var it model.UpdateTaskInput
asMap := map[string]any{}
for k, v := range obj.(map[string]any) {
asMap[k] = v
}
fieldsInOrder := [...]string{"title", "description", "dueDate", "status"}
for _, k := range fieldsInOrder {
v, ok := asMap[k]
if !ok {
continue
}
switch k {
case "title":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title"))
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}
it.Title = data
case "description":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description"))
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}
it.Description = data
case "dueDate":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("dueDate"))
data, err := ec.unmarshalODateTime2ᚖstring(ctx, v)
if err != nil {
return it, err
}
it.DueDate = data
case "status":
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status"))
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
if err != nil {
return it, err
}
it.Status = data
}
}
return it, nil
}
// endregion **************************** input.gotpl *****************************
// region ************************** interface.gotpl ***************************
// endregion ************************** interface.gotpl ***************************
// region **************************** object.gotpl ****************************
var changeImplementors = []string{"Change"}
func (ec *executionContext) _Change(ctx context.Context, sel ast.SelectionSet, obj *model.Change) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, changeImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("Change")
case "id":
out.Values[i] = ec._Change_id(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "changeType":
out.Values[i] = ec._Change_changeType(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "registrationId":
out.Values[i] = ec._Change_registrationId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "representationName":
out.Values[i] = ec._Change_representationName(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "representationId":
out.Values[i] = ec._Change_representationId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "timestamp":
out.Values[i] = ec._Change_timestamp(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "registration":
out.Values[i] = ec._Change_registration(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var dataElementAUImplementors = []string{"DataElementAU"}
func (ec *executionContext) _DataElementAU(ctx context.Context, sel ast.SelectionSet, obj *model.DataElementAu) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, dataElementAUImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("DataElementAU")
case "relId":
out.Values[i] = ec._DataElementAU_relId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "aId":
out.Values[i] = ec._DataElementAU_aId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "aaa":
out.Values[i] = ec._DataElementAU_aaa(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "bbb":
out.Values[i] = ec._DataElementAU_bbb(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var dataElementAVImplementors = []string{"DataElementAV"}
func (ec *executionContext) _DataElementAV(ctx context.Context, sel ast.SelectionSet, obj *model.DataElementAv) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, dataElementAVImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("DataElementAV")
case "relId":
out.Values[i] = ec._DataElementAV_relId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "aId":
out.Values[i] = ec._DataElementAV_aId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "ccc":
out.Values[i] = ec._DataElementAV_ccc(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var dataElementBXImplementors = []string{"DataElementBX"}
func (ec *executionContext) _DataElementBX(ctx context.Context, sel ast.SelectionSet, obj *model.DataElementBx) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, dataElementBXImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("DataElementBX")
case "relId":
out.Values[i] = ec._DataElementBX_relId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "bId":
out.Values[i] = ec._DataElementBX_bId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "fff":
out.Values[i] = ec._DataElementBX_fff(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "ggg":
out.Values[i] = ec._DataElementBX_ggg(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var dataElementBYImplementors = []string{"DataElementBY"}
func (ec *executionContext) _DataElementBY(ctx context.Context, sel ast.SelectionSet, obj *model.DataElementBy) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, dataElementBYImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("DataElementBY")
case "relId":
out.Values[i] = ec._DataElementBY_relId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "bId":
out.Values[i] = ec._DataElementBY_bId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "hhh":
out.Values[i] = ec._DataElementBY_hhh(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var entityAImplementors = []string{"EntityA"}
func (ec *executionContext) _EntityA(ctx context.Context, sel ast.SelectionSet, obj *model.EntityA) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, entityAImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("EntityA")
case "id":
out.Values[i] = ec._EntityA_id(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "opvoer":
out.Values[i] = ec._EntityA_opvoer(ctx, field, obj)
case "afvoer":
out.Values[i] = ec._EntityA_afvoer(ctx, field, obj)
case "dataElementAU":
out.Values[i] = ec._EntityA_dataElementAU(ctx, field, obj)
case "dataElementsAV":
out.Values[i] = ec._EntityA_dataElementsAV(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "relations":
out.Values[i] = ec._EntityA_relations(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var entityBImplementors = []string{"EntityB"}
func (ec *executionContext) _EntityB(ctx context.Context, sel ast.SelectionSet, obj *model.EntityB) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, entityBImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("EntityB")
case "id":
out.Values[i] = ec._EntityB_id(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "opvoer":
out.Values[i] = ec._EntityB_opvoer(ctx, field, obj)
case "afvoer":
out.Values[i] = ec._EntityB_afvoer(ctx, field, obj)
case "dataElementBX":
out.Values[i] = ec._EntityB_dataElementBX(ctx, field, obj)
case "dataElementBY":
out.Values[i] = ec._EntityB_dataElementBY(ctx, field, obj)
case "relations":
out.Values[i] = ec._EntityB_relations(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var mutationImplementors = []string{"Mutation"}
func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors)
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
Object: "Mutation",
})
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{
Object: field.Name,
Field: field,
})
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("Mutation")
case "createEntityA":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_createEntityA(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "updateEntityA":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_updateEntityA(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "deleteEntityA":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_deleteEntityA(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "createEntityB":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_createEntityB(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "updateEntityB":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_updateEntityB(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "deleteEntityB":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_deleteEntityB(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "createRelationAB":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_createRelationAB(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "deleteRelationAB":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_deleteRelationAB(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "createDataElementAU":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_createDataElementAU(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "updateDataElementAU":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_updateDataElementAU(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "createDataElementAV":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_createDataElementAV(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "createDataElementBX":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_createDataElementBX(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "createDataElementBY":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_createDataElementBY(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "createTask":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_createTask(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "updateTask":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_updateTask(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "deleteTask":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Mutation_deleteTask(ctx, field)
})
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var queryImplementors = []string{"Query"}
func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
Object: "Query",
})
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{
Object: field.Name,
Field: field,
})
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("Query")
case "entityA":
field := field
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_entityA(ctx, field)
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "allEntitiesA":
field := field
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_allEntitiesA(ctx, field)
if res == graphql.Null {
atomic.AddUint32(&fs.Invalids, 1)
}
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "entityB":
field := field
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_entityB(ctx, field)
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "allEntitiesB":
field := field
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_allEntitiesB(ctx, field)
if res == graphql.Null {
atomic.AddUint32(&fs.Invalids, 1)
}
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "relationAB":
field := field
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_relationAB(ctx, field)
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "allRelationsAB":
field := field
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_allRelationsAB(ctx, field)
if res == graphql.Null {
atomic.AddUint32(&fs.Invalids, 1)
}
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "dataElementAU":
field := field
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_dataElementAU(ctx, field)
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "dataElementsAU":
field := field
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_dataElementsAU(ctx, field)
if res == graphql.Null {
atomic.AddUint32(&fs.Invalids, 1)
}
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "dataElementAV":
field := field
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_dataElementAV(ctx, field)
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "dataElementsAV":
field := field
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_dataElementsAV(ctx, field)
if res == graphql.Null {
atomic.AddUint32(&fs.Invalids, 1)
}
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "dataElementBX":
field := field
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_dataElementBX(ctx, field)
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "dataElementBY":
field := field
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_dataElementBY(ctx, field)
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "registration":
field := field
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_registration(ctx, field)
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "allRegistrations":
field := field
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_allRegistrations(ctx, field)
if res == graphql.Null {
atomic.AddUint32(&fs.Invalids, 1)
}
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "change":
field := field
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_change(ctx, field)
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "allChanges":
field := field
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_allChanges(ctx, field)
if res == graphql.Null {
atomic.AddUint32(&fs.Invalids, 1)
}
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "task":
field := field
innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_task(ctx, field)
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "allTasks":
field := field
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
}
}()
res = ec._Query_allTasks(ctx, field)
if res == graphql.Null {
atomic.AddUint32(&fs.Invalids, 1)
}
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "__type":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Query___type(ctx, field)
})
case "__schema":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
return ec._Query___schema(ctx, field)
})
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var registrationImplementors = []string{"Registration"}
func (ec *executionContext) _Registration(ctx context.Context, sel ast.SelectionSet, obj *model.Registration) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, registrationImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("Registration")
case "id":
out.Values[i] = ec._Registration_id(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "registrationType":
out.Values[i] = ec._Registration_registrationType(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "timestamp":
out.Values[i] = ec._Registration_timestamp(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "remark":
out.Values[i] = ec._Registration_remark(ctx, field, obj)
case "correctsRegistrationId":
out.Values[i] = ec._Registration_correctsRegistrationId(ctx, field, obj)
case "undoesRegistrationId":
out.Values[i] = ec._Registration_undoesRegistrationId(ctx, field, obj)
case "changes":
out.Values[i] = ec._Registration_changes(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var relationABImplementors = []string{"RelationAB"}
func (ec *executionContext) _RelationAB(ctx context.Context, sel ast.SelectionSet, obj *model.RelationAb) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, relationABImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("RelationAB")
case "id":
out.Values[i] = ec._RelationAB_id(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "aId":
out.Values[i] = ec._RelationAB_aId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "bId":
out.Values[i] = ec._RelationAB_bId(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "entityA":
out.Values[i] = ec._RelationAB_entityA(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "entityB":
out.Values[i] = ec._RelationAB_entityB(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var taskImplementors = []string{"Task"}
func (ec *executionContext) _Task(ctx context.Context, sel ast.SelectionSet, obj *model.Task) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, taskImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("Task")
case "id":
out.Values[i] = ec._Task_id(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "title":
out.Values[i] = ec._Task_title(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "description":
out.Values[i] = ec._Task_description(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "dueDate":
out.Values[i] = ec._Task_dueDate(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "status":
out.Values[i] = ec._Task_status(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var __DirectiveImplementors = []string{"__Directive"}
func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("__Directive")
case "name":
out.Values[i] = ec.___Directive_name(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "description":
out.Values[i] = ec.___Directive_description(ctx, field, obj)
case "isRepeatable":
out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "locations":
out.Values[i] = ec.___Directive_locations(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "args":
out.Values[i] = ec.___Directive_args(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var __EnumValueImplementors = []string{"__EnumValue"}
func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("__EnumValue")
case "name":
out.Values[i] = ec.___EnumValue_name(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "description":
out.Values[i] = ec.___EnumValue_description(ctx, field, obj)
case "isDeprecated":
out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "deprecationReason":
out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj)
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var __FieldImplementors = []string{"__Field"}
func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("__Field")
case "name":
out.Values[i] = ec.___Field_name(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "description":
out.Values[i] = ec.___Field_description(ctx, field, obj)
case "args":
out.Values[i] = ec.___Field_args(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "type":
out.Values[i] = ec.___Field_type(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "isDeprecated":
out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "deprecationReason":
out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj)
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var __InputValueImplementors = []string{"__InputValue"}
func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("__InputValue")
case "name":
out.Values[i] = ec.___InputValue_name(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "description":
out.Values[i] = ec.___InputValue_description(ctx, field, obj)
case "type":
out.Values[i] = ec.___InputValue_type(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "defaultValue":
out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj)
case "isDeprecated":
out.Values[i] = ec.___InputValue_isDeprecated(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "deprecationReason":
out.Values[i] = ec.___InputValue_deprecationReason(ctx, field, obj)
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var __SchemaImplementors = []string{"__Schema"}
func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("__Schema")
case "description":
out.Values[i] = ec.___Schema_description(ctx, field, obj)
case "types":
out.Values[i] = ec.___Schema_types(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "queryType":
out.Values[i] = ec.___Schema_queryType(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "mutationType":
out.Values[i] = ec.___Schema_mutationType(ctx, field, obj)
case "subscriptionType":
out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj)
case "directives":
out.Values[i] = ec.___Schema_directives(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var __TypeImplementors = []string{"__Type"}
func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("__Type")
case "kind":
out.Values[i] = ec.___Type_kind(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "name":
out.Values[i] = ec.___Type_name(ctx, field, obj)
case "description":
out.Values[i] = ec.___Type_description(ctx, field, obj)
case "specifiedByURL":
out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj)
case "fields":
out.Values[i] = ec.___Type_fields(ctx, field, obj)
case "interfaces":
out.Values[i] = ec.___Type_interfaces(ctx, field, obj)
case "possibleTypes":
out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj)
case "enumValues":
out.Values[i] = ec.___Type_enumValues(ctx, field, obj)
case "inputFields":
out.Values[i] = ec.___Type_inputFields(ctx, field, obj)
case "ofType":
out.Values[i] = ec.___Type_ofType(ctx, field, obj)
case "isOneOf":
out.Values[i] = ec.___Type_isOneOf(ctx, field, obj)
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
// endregion **************************** object.gotpl ****************************
// region ***************************** type.gotpl *****************************
func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v any) (bool, error) {
res, err := graphql.UnmarshalBoolean(v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
_ = sel
res := graphql.MarshalBoolean(v)
if res == graphql.Null {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
}
return res
}
func (ec *executionContext) marshalNChange2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐChangeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Change) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalNChange2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐChange(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalNChange2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐChange(ctx context.Context, sel ast.SelectionSet, v *model.Change) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._Change(ctx, sel, v)
}
func (ec *executionContext) unmarshalNCreateDataElementAUInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateDataElementAUInput(ctx context.Context, v any) (model.CreateDataElementAUInput, error) {
res, err := ec.unmarshalInputCreateDataElementAUInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalNCreateDataElementAVInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateDataElementAVInput(ctx context.Context, v any) (model.CreateDataElementAVInput, error) {
res, err := ec.unmarshalInputCreateDataElementAVInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalNCreateDataElementBXInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateDataElementBXInput(ctx context.Context, v any) (model.CreateDataElementBXInput, error) {
res, err := ec.unmarshalInputCreateDataElementBXInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalNCreateDataElementBYInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateDataElementBYInput(ctx context.Context, v any) (model.CreateDataElementBYInput, error) {
res, err := ec.unmarshalInputCreateDataElementBYInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalNCreateEntityAInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateEntityAInput(ctx context.Context, v any) (model.CreateEntityAInput, error) {
res, err := ec.unmarshalInputCreateEntityAInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalNCreateEntityBInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateEntityBInput(ctx context.Context, v any) (model.CreateEntityBInput, error) {
res, err := ec.unmarshalInputCreateEntityBInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalNCreateRelationABInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateRelationABInput(ctx context.Context, v any) (model.CreateRelationABInput, error) {
res, err := ec.unmarshalInputCreateRelationABInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalNCreateTaskInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐCreateTaskInput(ctx context.Context, v any) (model.CreateTaskInput, error) {
res, err := ec.unmarshalInputCreateTaskInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalNDataElementAU2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAu(ctx context.Context, sel ast.SelectionSet, v model.DataElementAu) graphql.Marshaler {
return ec._DataElementAU(ctx, sel, &v)
}
func (ec *executionContext) marshalNDataElementAU2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAuᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.DataElementAu) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalNDataElementAU2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAu(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalNDataElementAU2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAu(ctx context.Context, sel ast.SelectionSet, v *model.DataElementAu) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._DataElementAU(ctx, sel, v)
}
func (ec *executionContext) marshalNDataElementAV2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAv(ctx context.Context, sel ast.SelectionSet, v model.DataElementAv) graphql.Marshaler {
return ec._DataElementAV(ctx, sel, &v)
}
func (ec *executionContext) marshalNDataElementAV2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAvᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.DataElementAv) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalNDataElementAV2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAv(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalNDataElementAV2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAv(ctx context.Context, sel ast.SelectionSet, v *model.DataElementAv) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._DataElementAV(ctx, sel, v)
}
func (ec *executionContext) marshalNDataElementBX2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBx(ctx context.Context, sel ast.SelectionSet, v model.DataElementBx) graphql.Marshaler {
return ec._DataElementBX(ctx, sel, &v)
}
func (ec *executionContext) marshalNDataElementBX2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBx(ctx context.Context, sel ast.SelectionSet, v *model.DataElementBx) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._DataElementBX(ctx, sel, v)
}
func (ec *executionContext) marshalNDataElementBY2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBy(ctx context.Context, sel ast.SelectionSet, v model.DataElementBy) graphql.Marshaler {
return ec._DataElementBY(ctx, sel, &v)
}
func (ec *executionContext) marshalNDataElementBY2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBy(ctx context.Context, sel ast.SelectionSet, v *model.DataElementBy) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._DataElementBY(ctx, sel, v)
}
func (ec *executionContext) unmarshalNDateTime2string(ctx context.Context, v any) (string, error) {
res, err := graphql.UnmarshalString(v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalNDateTime2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
_ = sel
res := graphql.MarshalString(v)
if res == graphql.Null {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
}
return res
}
func (ec *executionContext) marshalNEntityA2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityA(ctx context.Context, sel ast.SelectionSet, v model.EntityA) graphql.Marshaler {
return ec._EntityA(ctx, sel, &v)
}
func (ec *executionContext) marshalNEntityA2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityAᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.EntityA) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalNEntityA2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityA(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalNEntityA2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityA(ctx context.Context, sel ast.SelectionSet, v *model.EntityA) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._EntityA(ctx, sel, v)
}
func (ec *executionContext) marshalNEntityB2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityB(ctx context.Context, sel ast.SelectionSet, v model.EntityB) graphql.Marshaler {
return ec._EntityB(ctx, sel, &v)
}
func (ec *executionContext) marshalNEntityB2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityBᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.EntityB) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalNEntityB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityB(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalNEntityB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityB(ctx context.Context, sel ast.SelectionSet, v *model.EntityB) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._EntityB(ctx, sel, v)
}
func (ec *executionContext) unmarshalNID2string(ctx context.Context, v any) (string, error) {
res, err := graphql.UnmarshalID(v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
_ = sel
res := graphql.MarshalID(v)
if res == graphql.Null {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
}
return res
}
func (ec *executionContext) marshalNRegistration2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRegistrationᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Registration) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalNRegistration2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRegistration(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalNRegistration2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRegistration(ctx context.Context, sel ast.SelectionSet, v *model.Registration) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._Registration(ctx, sel, v)
}
func (ec *executionContext) marshalNRelationAB2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRelationAb(ctx context.Context, sel ast.SelectionSet, v model.RelationAb) graphql.Marshaler {
return ec._RelationAB(ctx, sel, &v)
}
func (ec *executionContext) marshalNRelationAB2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRelationAbᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RelationAb) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalNRelationAB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRelationAb(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalNRelationAB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRelationAb(ctx context.Context, sel ast.SelectionSet, v *model.RelationAb) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._RelationAB(ctx, sel, v)
}
func (ec *executionContext) unmarshalNString2string(ctx context.Context, v any) (string, error) {
res, err := graphql.UnmarshalString(v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
_ = sel
res := graphql.MarshalString(v)
if res == graphql.Null {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
}
return res
}
func (ec *executionContext) marshalNTask2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐTask(ctx context.Context, sel ast.SelectionSet, v model.Task) graphql.Marshaler {
return ec._Task(ctx, sel, &v)
}
func (ec *executionContext) marshalNTask2ᚕᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐTaskᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Task) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalNTask2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐTask(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalNTask2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐTask(ctx context.Context, sel ast.SelectionSet, v *model.Task) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._Task(ctx, sel, v)
}
func (ec *executionContext) unmarshalNUpdateDataElementAUInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐUpdateDataElementAUInput(ctx context.Context, v any) (model.UpdateDataElementAUInput, error) {
res, err := ec.unmarshalInputUpdateDataElementAUInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalNUpdateEntityAInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐUpdateEntityAInput(ctx context.Context, v any) (model.UpdateEntityAInput, error) {
res, err := ec.unmarshalInputUpdateEntityAInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalNUpdateEntityBInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐUpdateEntityBInput(ctx context.Context, v any) (model.UpdateEntityBInput, error) {
res, err := ec.unmarshalInputUpdateEntityBInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) unmarshalNUpdateTaskInput2githubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐUpdateTaskInput(ctx context.Context, v any) (model.UpdateTaskInput, error) {
res, err := ec.unmarshalInputUpdateTaskInput(ctx, v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler {
return ec.___Directive(ctx, sel, &v)
}
func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v any) (string, error) {
res, err := graphql.UnmarshalString(v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
_ = sel
res := graphql.MarshalString(v)
if res == graphql.Null {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
}
return res
}
func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v any) ([]string, error) {
var vSlice []any
vSlice = graphql.CoerceList(v)
var err error
res := make([]string, len(vSlice))
for i := range vSlice {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i])
if err != nil {
return nil, err
}
}
return res, nil
}
func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler {
return ec.___EnumValue(ctx, sel, &v)
}
func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler {
return ec.___Field(ctx, sel, &v)
}
func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler {
return ec.___InputValue(ctx, sel, &v)
}
func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler {
return ec.___Type(ctx, sel, &v)
}
func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler {
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec.___Type(ctx, sel, v)
}
func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v any) (string, error) {
res, err := graphql.UnmarshalString(v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
_ = sel
res := graphql.MarshalString(v)
if res == graphql.Null {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow")
}
}
return res
}
func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v any) (bool, error) {
res, err := graphql.UnmarshalBoolean(v)
return res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
_ = sel
_ = ctx
res := graphql.MarshalBoolean(v)
return res
}
func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v any) (*bool, error) {
if v == nil {
return nil, nil
}
res, err := graphql.UnmarshalBoolean(v)
return &res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler {
if v == nil {
return graphql.Null
}
_ = sel
_ = ctx
res := graphql.MarshalBoolean(*v)
return res
}
func (ec *executionContext) marshalOChange2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐChange(ctx context.Context, sel ast.SelectionSet, v *model.Change) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec._Change(ctx, sel, v)
}
func (ec *executionContext) marshalODataElementAU2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAu(ctx context.Context, sel ast.SelectionSet, v *model.DataElementAu) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec._DataElementAU(ctx, sel, v)
}
func (ec *executionContext) marshalODataElementAV2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementAv(ctx context.Context, sel ast.SelectionSet, v *model.DataElementAv) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec._DataElementAV(ctx, sel, v)
}
func (ec *executionContext) marshalODataElementBX2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBx(ctx context.Context, sel ast.SelectionSet, v *model.DataElementBx) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec._DataElementBX(ctx, sel, v)
}
func (ec *executionContext) marshalODataElementBY2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐDataElementBy(ctx context.Context, sel ast.SelectionSet, v *model.DataElementBy) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec._DataElementBY(ctx, sel, v)
}
func (ec *executionContext) unmarshalODateTime2ᚖstring(ctx context.Context, v any) (*string, error) {
if v == nil {
return nil, nil
}
res, err := graphql.UnmarshalString(v)
return &res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalODateTime2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler {
if v == nil {
return graphql.Null
}
_ = sel
_ = ctx
res := graphql.MarshalString(*v)
return res
}
func (ec *executionContext) marshalOEntityA2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityA(ctx context.Context, sel ast.SelectionSet, v *model.EntityA) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec._EntityA(ctx, sel, v)
}
func (ec *executionContext) marshalOEntityB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐEntityB(ctx context.Context, sel ast.SelectionSet, v *model.EntityB) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec._EntityB(ctx, sel, v)
}
func (ec *executionContext) unmarshalOID2ᚖstring(ctx context.Context, v any) (*string, error) {
if v == nil {
return nil, nil
}
res, err := graphql.UnmarshalID(v)
return &res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalOID2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler {
if v == nil {
return graphql.Null
}
_ = sel
_ = ctx
res := graphql.MarshalID(*v)
return res
}
func (ec *executionContext) unmarshalOInt2ᚖint32(ctx context.Context, v any) (*int32, error) {
if v == nil {
return nil, nil
}
res, err := graphql.UnmarshalInt32(v)
return &res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalOInt2ᚖint32(ctx context.Context, sel ast.SelectionSet, v *int32) graphql.Marshaler {
if v == nil {
return graphql.Null
}
_ = sel
_ = ctx
res := graphql.MarshalInt32(*v)
return res
}
func (ec *executionContext) marshalORegistration2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRegistration(ctx context.Context, sel ast.SelectionSet, v *model.Registration) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec._Registration(ctx, sel, v)
}
func (ec *executionContext) marshalORelationAB2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐRelationAb(ctx context.Context, sel ast.SelectionSet, v *model.RelationAb) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec._RelationAB(ctx, sel, v)
}
func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) {
if v == nil {
return nil, nil
}
res, err := graphql.UnmarshalString(v)
return &res, graphql.ErrorOnPath(ctx, err)
}
func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler {
if v == nil {
return graphql.Null
}
_ = sel
_ = ctx
res := graphql.MarshalString(*v)
return res
}
func (ec *executionContext) marshalOTask2ᚖgithubᚗcomᚋMarkWestbroekᚋBitemporal_2026ᚋbitemporal_go_API_v05ᚋgraphᚋmodelᚐTask(ctx context.Context, sel ast.SelectionSet, v *model.Task) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec._Task(ctx, sel, v)
}
func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler {
if v == nil {
return graphql.Null
}
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler {
if v == nil {
return graphql.Null
}
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler {
if v == nil {
return graphql.Null
}
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec.___Schema(ctx, sel, v)
}
func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler {
if v == nil {
return graphql.Null
}
ret := make(graphql.Array, len(v))
var wg sync.WaitGroup
isLen1 := len(v) == 1
if !isLen1 {
wg.Add(len(v))
}
for i := range v {
i := i
fc := &graphql.FieldContext{
Index: &i,
Result: &v[i],
}
ctx := graphql.WithFieldContext(ctx, fc)
f := func(i int) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = nil
}
}()
if !isLen1 {
defer wg.Done()
}
ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i])
}
if isLen1 {
f(i)
} else {
go f(i)
}
}
wg.Wait()
for _, e := range ret {
if e == graphql.Null {
return graphql.Null
}
}
return ret
}
func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {
if v == nil {
return graphql.Null
}
return ec.___Type(ctx, sel, v)
}
// endregion ***************************** type.gotpl *****************************
package graph
// This file will be automatically regenerated based on the schema, any resolver
// implementations
// will be copied through when generating and any unknown code will be moved to the end.
// Code generated by github.com/99designs/gqlgen version v0.17.86
import (
"context"
"fmt"
"strconv"
"time"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/graph/model"
model_db "github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
)
// CreateEntityA is the resolver for the createEntityA field.
func (r *mutationResolver) CreateEntityA(ctx context.Context, input model.CreateEntityAInput) (*model.EntityA, error) {
now := time.Now()
entityID, err := strconv.Atoi(input.ID)
if err != nil {
return nil, fmt.Errorf("invalid entity A id: %w", err)
}
dbEntity := model_db.A_basis{
ID: entityID,
Opvoer: &now,
}
_, err = r.DB.NewInsert().Model(&dbEntity).Exec(ctx)
if err != nil {
return nil, fmt.Errorf("failed to create entity A: %w", err)
}
var opvoer, afvoer *string
if dbEntity.Opvoer != nil {
formatted := dbEntity.Opvoer.Format(time.RFC3339)
opvoer = &formatted
}
if dbEntity.Afvoer != nil {
formatted := dbEntity.Afvoer.Format(time.RFC3339)
afvoer = &formatted
}
return &model.EntityA{
ID: strconv.Itoa(dbEntity.ID),
Opvoer: opvoer,
Afvoer: afvoer,
}, nil
}
// UpdateEntityA is the resolver for the updateEntityA field.
func (r *mutationResolver) UpdateEntityA(ctx context.Context, id string, input model.UpdateEntityAInput) (*model.EntityA, error) {
panic(fmt.Errorf("not implemented: UpdateEntityA - updateEntityA"))
}
// DeleteEntityA is the resolver for the deleteEntityA field.
func (r *mutationResolver) DeleteEntityA(ctx context.Context, id string) (bool, error) {
panic(fmt.Errorf("not implemented: DeleteEntityA - deleteEntityA"))
}
// CreateEntityB is the resolver for the createEntityB field.
func (r *mutationResolver) CreateEntityB(ctx context.Context, input model.CreateEntityBInput) (*model.EntityB, error) {
panic(fmt.Errorf("not implemented: CreateEntityB - createEntityB"))
}
// UpdateEntityB is the resolver for the updateEntityB field.
func (r *mutationResolver) UpdateEntityB(ctx context.Context, id string, input model.UpdateEntityBInput) (*model.EntityB, error) {
panic(fmt.Errorf("not implemented: UpdateEntityB - updateEntityB"))
}
// DeleteEntityB is the resolver for the deleteEntityB field.
func (r *mutationResolver) DeleteEntityB(ctx context.Context, id string) (bool, error) {
panic(fmt.Errorf("not implemented: DeleteEntityB - deleteEntityB"))
}
// CreateRelationAb is the resolver for the createRelationAB field.
func (r *mutationResolver) CreateRelationAb(ctx context.Context, input model.CreateRelationABInput) (*model.RelationAb, error) {
panic(fmt.Errorf("not implemented: CreateRelationAb - createRelationAB"))
}
// DeleteRelationAb is the resolver for the deleteRelationAB field.
func (r *mutationResolver) DeleteRelationAb(ctx context.Context, id string) (bool, error) {
panic(fmt.Errorf("not implemented: DeleteRelationAb - deleteRelationAB"))
}
// CreateDataElementAu is the resolver for the createDataElementAU field.
func (r *mutationResolver) CreateDataElementAu(ctx context.Context, input model.CreateDataElementAUInput) (*model.DataElementAu, error) {
panic(fmt.Errorf("not implemented: CreateDataElementAu - createDataElementAU"))
}
// UpdateDataElementAu is the resolver for the updateDataElementAU field.
func (r *mutationResolver) UpdateDataElementAu(ctx context.Context, relID string, input model.UpdateDataElementAUInput) (*model.DataElementAu, error) {
panic(fmt.Errorf("not implemented: UpdateDataElementAu - updateDataElementAU"))
}
// CreateDataElementAv is the resolver for the createDataElementAV field.
func (r *mutationResolver) CreateDataElementAv(ctx context.Context, input model.CreateDataElementAVInput) (*model.DataElementAv, error) {
panic(fmt.Errorf("not implemented: CreateDataElementAv - createDataElementAV"))
}
// CreateDataElementBx is the resolver for the createDataElementBX field.
func (r *mutationResolver) CreateDataElementBx(ctx context.Context, input model.CreateDataElementBXInput) (*model.DataElementBx, error) {
panic(fmt.Errorf("not implemented: CreateDataElementBx - createDataElementBX"))
}
// CreateDataElementBy is the resolver for the createDataElementBY field.
func (r *mutationResolver) CreateDataElementBy(ctx context.Context, input model.CreateDataElementBYInput) (*model.DataElementBy, error) {
panic(fmt.Errorf("not implemented: CreateDataElementBy - createDataElementBY"))
}
// CreateTask is the resolver for the createTask field.
func (r *mutationResolver) CreateTask(ctx context.Context, input model.CreateTaskInput) (*model.Task, error) {
// Parse the DueDate from string format
dueDate, err := time.Parse(time.RFC3339, input.DueDate)
if err != nil {
dueDate = time.Now()
}
dbTask := model_db.Task{
ID: input.ID,
Title: input.Title,
Description: input.Description,
DueDate: dueDate,
Status: input.Status,
}
_, err = r.DB.NewInsert().Model(&dbTask).Exec(ctx)
if err != nil {
return nil, fmt.Errorf("failed to create task: %w", err)
}
return &model.Task{
ID: dbTask.ID,
Title: dbTask.Title,
Description: dbTask.Description,
DueDate: dbTask.DueDate.Format(time.RFC3339),
Status: dbTask.Status,
}, nil
}
// UpdateTask is the resolver for the updateTask field.
func (r *mutationResolver) UpdateTask(ctx context.Context, id string, input model.UpdateTaskInput) (*model.Task, error) {
// Fetch the existing task
dbTask := model_db.Task{ID: id}
err := r.DB.NewSelect().Model(&dbTask).Where("id = ?", id).Scan(ctx)
if err != nil {
return nil, err
}
// Update fields if provided
if input.Title != nil {
dbTask.Title = *input.Title
}
if input.Description != nil {
dbTask.Description = *input.Description
}
if input.DueDate != nil {
dbTask.DueDate = time.Now() // Parse from input if needed
}
if input.Status != nil {
dbTask.Status = *input.Status
}
_, err = r.DB.NewUpdate().Model(&dbTask).WherePK().Exec(ctx)
if err != nil {
return nil, err
}
return &model.Task{
ID: dbTask.ID,
Title: dbTask.Title,
Description: dbTask.Description,
DueDate: dbTask.DueDate.Format(time.RFC3339),
Status: dbTask.Status,
}, nil
}
// DeleteTask is the resolver for the deleteTask field.
func (r *mutationResolver) DeleteTask(ctx context.Context, id string) (bool, error) {
result, err := r.DB.NewDelete().Model(&model_db.Task{}).Where("id = ?", id).Exec(ctx)
if err != nil {
return false, err
}
rowsAffected, err := result.RowsAffected()
if err != nil {
return false, err
}
return rowsAffected > 0, nil
}
// EntityA is the resolver for the entityA field.
func (r *queryResolver) EntityA(ctx context.Context, id string) (*model.EntityA, error) {
var dbEntity model_db.A_basis
err := r.DB.NewSelect().Model(&dbEntity).Where("id = ?", id).Scan(ctx)
if err != nil {
return nil, err
}
// Convert DB model to GraphQL model
var opvoer, afvoer *string
if dbEntity.Opvoer != nil {
formatted := dbEntity.Opvoer.Format(time.RFC3339)
opvoer = &formatted
}
if dbEntity.Afvoer != nil {
formatted := dbEntity.Afvoer.Format(time.RFC3339)
afvoer = &formatted
}
return &model.EntityA{
ID: strconv.Itoa(dbEntity.ID),
Opvoer: opvoer,
Afvoer: afvoer,
}, nil
}
// AllEntitiesA is the resolver for the allEntitiesA field.
func (r *queryResolver) AllEntitiesA(ctx context.Context, limit *int32, offset *int32) ([]*model.EntityA, error) {
panic(fmt.Errorf("not implemented: AllEntitiesA - allEntitiesA"))
}
// EntityB is the resolver for the entityB field.
func (r *queryResolver) EntityB(ctx context.Context, id string) (*model.EntityB, error) {
panic(fmt.Errorf("not implemented: EntityB - entityB"))
}
// AllEntitiesB is the resolver for the allEntitiesB field.
func (r *queryResolver) AllEntitiesB(ctx context.Context, limit *int32, offset *int32) ([]*model.EntityB, error) {
panic(fmt.Errorf("not implemented: AllEntitiesB - allEntitiesB"))
}
// RelationAb is the resolver for the relationAB field.
func (r *queryResolver) RelationAb(ctx context.Context, id string) (*model.RelationAb, error) {
panic(fmt.Errorf("not implemented: RelationAb - relationAB"))
}
// AllRelationsAb is the resolver for the allRelationsAB field.
func (r *queryResolver) AllRelationsAb(ctx context.Context, limit *int32, offset *int32) ([]*model.RelationAb, error) {
panic(fmt.Errorf("not implemented: AllRelationsAb - allRelationsAB"))
}
// DataElementAu is the resolver for the dataElementAU field.
func (r *queryResolver) DataElementAu(ctx context.Context, relID string) (*model.DataElementAu, error) {
panic(fmt.Errorf("not implemented: DataElementAu - dataElementAU"))
}
// DataElementsAu is the resolver for the dataElementsAU field.
func (r *queryResolver) DataElementsAu(ctx context.Context, aID string) ([]*model.DataElementAu, error) {
panic(fmt.Errorf("not implemented: DataElementsAu - dataElementsAU"))
}
// DataElementAv is the resolver for the dataElementAV field.
func (r *queryResolver) DataElementAv(ctx context.Context, relID string) (*model.DataElementAv, error) {
panic(fmt.Errorf("not implemented: DataElementAv - dataElementAV"))
}
// DataElementsAv is the resolver for the dataElementsAV field.
func (r *queryResolver) DataElementsAv(ctx context.Context, aID string) ([]*model.DataElementAv, error) {
panic(fmt.Errorf("not implemented: DataElementsAv - dataElementsAV"))
}
// DataElementBx is the resolver for the dataElementBX field.
func (r *queryResolver) DataElementBx(ctx context.Context, relID string) (*model.DataElementBx, error) {
panic(fmt.Errorf("not implemented: DataElementBx - dataElementBX"))
}
// DataElementBy is the resolver for the dataElementBY field.
func (r *queryResolver) DataElementBy(ctx context.Context, relID string) (*model.DataElementBy, error) {
panic(fmt.Errorf("not implemented: DataElementBy - dataElementBY"))
}
// Registration is the resolver for the registration field.
func (r *queryResolver) Registration(ctx context.Context, id string) (*model.Registration, error) {
panic(fmt.Errorf("not implemented: Registration - registration"))
}
// AllRegistrations is the resolver for the allRegistrations field.
func (r *queryResolver) AllRegistrations(ctx context.Context, limit *int32, offset *int32) ([]*model.Registration, error) {
panic(fmt.Errorf("not implemented: AllRegistrations - allRegistrations"))
}
// Change is the resolver for the change field.
func (r *queryResolver) Change(ctx context.Context, id string) (*model.Change, error) {
panic(fmt.Errorf("not implemented: Change - change"))
}
// AllChanges is the resolver for the allChanges field.
func (r *queryResolver) AllChanges(ctx context.Context, limit *int32, offset *int32) ([]*model.Change, error) {
panic(fmt.Errorf("not implemented: AllChanges - allChanges"))
}
// Task is the resolver for the task field.
func (r *queryResolver) Task(ctx context.Context, id string) (*model.Task, error) {
var dbTask model_db.Task
err := r.DB.NewSelect().Model(&dbTask).Where("id = ?", id).Scan(ctx)
if err != nil {
return nil, err
}
return &model.Task{
ID: dbTask.ID,
Title: dbTask.Title,
Description: dbTask.Description,
DueDate: dbTask.DueDate.Format(time.RFC3339),
Status: dbTask.Status,
}, nil
}
// AllTasks is the resolver for the allTasks field.
func (r *queryResolver) AllTasks(ctx context.Context, limit *int32, offset *int32) ([]*model.Task, error) {
var dbTasks []model_db.Task
query := r.DB.NewSelect().Model(&dbTasks)
if offset != nil && *offset > 0 {
query = query.Offset(int(*offset))
}
if limit != nil && *limit > 0 {
query = query.Limit(int(*limit))
}
err := query.Scan(ctx)
if err != nil {
return nil, err
}
tasks := make([]*model.Task, len(dbTasks))
for i, t := range dbTasks {
tasks[i] = &model.Task{
ID: t.ID,
Title: t.Title,
Description: t.Description,
DueDate: t.DueDate.Format(time.RFC3339),
Status: t.Status,
}
}
return tasks, nil
}
// Mutation returns MutationResolver implementation.
func (r *Resolver) Mutation() MutationResolver { return &mutationResolver{r} }
// Query returns QueryResolver implementation.
func (r *Resolver) Query() QueryResolver { return &queryResolver{r} }
type mutationResolver struct{ *Resolver }
type queryResolver struct{ *Resolver }
package handlers
import (
"net/http"
"os"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/dbsetup"
"github.com/gin-gonic/gin"
)
const defaultAdminDropTablesPassword = "1234"
func isDropTablesAllowed() bool {
return os.Getenv("ALLOW_DROP_TABLES") == "true"
}
func getAdminDropTablesPassword() string {
password := os.Getenv("ADMIN_DROP_PASSWORD")
if password == "" {
return defaultAdminDropTablesPassword
}
return password
}
func DropTables(c *gin.Context) {
password := c.Param("password")
if !isDropTablesAllowed() {
c.JSON(http.StatusForbidden, gin.H{"error": "drop tables is disabled"})
return
}
if password != getAdminDropTablesPassword() {
c.JSON(http.StatusUnauthorized, gin.H{"error": "invalid password"})
return
}
if DB == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "database not initialized"})
return
}
err := dbsetup.DeleteTables(DB)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, gin.H{"message": "Tables dropped successfully"})
}
// handler voor het aanmaken van tabellen, alleen toegankelijk via admin route, zonder authenticatie (beveiliging via obscurity)
func CreateTables(c *gin.Context) {
if DB == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "database not initialized"})
return
}
err := dbsetup.CreateTables(DB)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, gin.H{"message": "Tables created successfully (or they already existed)"})
}
package handlers
import (
"net/http"
"strconv"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/gin-gonic/gin"
)
// TODO: full entity get and post to include all fields, not just ID.
// This will require changes to the model structs and the handlers
// to bind JSON to the full struct instead of just an ID field.
// The current implementation is a simplified version for demonstration purposes.
/*
Updated MakeGetEntitiesHandler in core_handlers.go to:
-Parse query params page (default 1) and size (default 20, capped at 100).
-Validate parameters (respond 400 on invalid values).
-Apply Limit(size) and Offset((page-1)*size) to the Bun query.
-Return JSON with the entities and pagination metadata:
- page, size, has_more (true if returned count == page size).
Why this approach
-Uses simple offset pagination which is easy to consume and implement with Bun.
-Returning has_more avoids an extra COUNT query and is efficient for common use cases.
*/
// MakeAddEntityHandler returns a gin.HandlerFunc that creates a fresh zero-value entity
// for each request and inserts it into the DB after binding JSON.
func MakeAddEntityHandler[T model.HasID](entity_name string) gin.HandlerFunc {
return func(c *gin.Context) {
var newEntity T
if err := c.ShouldBindJSON(&newEntity); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
/*
NewInsert is a convenience method on baseQuery that creates and returns a
new *InsertQuery already bound to the baseQuery's database handle and connection.
Internally it calls NewInsertQuery(q.db) to create the query and then .Conn(q.conn)
to attach the same connection/transaction context.
The returned InsertQuery is intended for fluent chaining (e.g.,
NewInsert().Model(m).Exec(ctx)).
Model(...) sets the payload on the InsertQuery and Exec(...) uses scanOrExec to
either scan results into provided destinations or execute the insert, depending on whether dest args are present.
Gotchas: NewInsert does not set a model — you must call Model
before Exec if you expect data to be inserted/scanned. If q.conn is nil,
Conn(nil) behavior depends on its implementation (it may fall back to using the DB directly).
Exec delegates to scanOrExec, so check that function for how destination presence,
errors, and result/scan semantics are handled.
*/
_, err := DB.NewInsert().Model(&newEntity).Exec(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusCreated, gin.H{"message": entity_name + " created"})
}
}
// MakeGetEntitiesHandler returns a gin.HandlerFunc that retrieves entities of type T with pagination
func MakeGetEntitiesHandler[T any](entity_name string) gin.HandlerFunc {
return func(c *gin.Context) {
const (
defaultPage = 1
defaultSize = 20
maxSize = 100
)
page := defaultPage
size := defaultSize
if p := c.Query("page"); p != "" {
v, err := strconv.Atoi(p)
if err != nil || v <= 0 {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid 'page' parameter"})
return
}
page = v
}
if s := c.Query("size"); s != "" {
v, err := strconv.Atoi(s)
if err != nil || v <= 0 {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid 'size' parameter"})
return
}
if v > maxSize {
size = maxSize
} else {
size = v
}
}
offset := (page - 1) * size
var entities []T
err := DB.NewSelect().
Model(&entities). // laadt alleen de entiteiten, zonder gerelateerde gegevenselementen
Limit(size).
Offset(offset).
Scan(c.Request.
Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
hasMore := len(entities) == size
c.JSON(http.StatusOK, gin.H{
entity_name: entities,
"page": page,
"size": size,
"has_more": hasMore,
})
}
}
// MakeGetEntityHandler returns a gin.HandlerFunc that retrieves a single entity by id
func MakeGetEntityHandler[T model.HasID](entity_name string) gin.HandlerFunc {
return func(c *gin.Context) {
entityID := c.Param("id")
if entityID == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "ID must be present"})
return
}
var entity T
err := DB.NewSelect().Model(&entity).Where("id = ?", entityID).Scan(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
if isZeroID(entity.GetID()) {
c.JSON(http.StatusNotFound, gin.H{"message": entity_name + " not found"})
return
}
c.JSON(http.StatusOK, entity)
}
}
// MakeGetEntitiesByMetaHandler returns a gin.HandlerFunc that retrieves entities defined by TypeMeta.DBFactory with pagination.
func MakeGetEntitiesByMetaHandler(meta model.TypeMeta) gin.HandlerFunc {
return func(c *gin.Context) {
const (
defaultPage = 1
defaultSize = 20
maxSize = 100
)
if meta.DBFactory == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "DBFactory ontbreekt voor type " + meta.Typenaam})
return
}
if meta.DBSliceFactory == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "DBSliceFactory ontbreekt voor type " + meta.Typenaam})
return
}
page := defaultPage
size := defaultSize
if p := c.Query("page"); p != "" {
v, err := strconv.Atoi(p)
if err != nil || v <= 0 {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid 'page' parameter"})
return
}
page = v
}
if s := c.Query("size"); s != "" {
v, err := strconv.Atoi(s)
if err != nil || v <= 0 {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid 'size' parameter"})
return
}
if v > maxSize {
size = maxSize
} else {
size = v
}
}
offset := (page - 1) * size
entities := meta.DBSliceFactory()
err := DB.NewSelect().
Model(entities).
Limit(size).
Offset(offset).
Scan(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
total, err := DB.NewSelect().Model(meta.DBFactory()).Count(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
hasMore := offset+size < total
c.JSON(http.StatusOK, gin.H{
meta.Typenaam + "s": entities,
"page": page,
"size": size,
"has_more": hasMore,
})
}
}
// MakeGetEntityByMetaHandler returns a gin.HandlerFunc that retrieves a single entity by meta.IDKolom.
func MakeGetEntityByMetaHandler(meta model.TypeMeta) gin.HandlerFunc {
return func(c *gin.Context) {
if meta.DBFactory == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "DBFactory ontbreekt voor type " + meta.Typenaam})
return
}
if meta.IDKolom == "" {
c.JSON(http.StatusInternalServerError, gin.H{"error": "IDKolom ontbreekt voor type " + meta.Typenaam})
return
}
entityID := c.Param("id")
if entityID == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "ID must be present"})
return
}
entity := meta.DBFactory()
err := DB.NewSelect().
Model(entity).
Where(meta.IDKolom+" = ?", entityID).
Scan(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
if isZeroID(entity.GetID()) {
c.JSON(http.StatusNotFound, gin.H{"message": meta.Typenaam + " not found"})
return
}
c.JSON(http.StatusOK, entity)
}
}
// MakeAddEntityByMetaHandler returns a gin.HandlerFunc that inserts an entity created by TypeMeta.DBFactory.
func MakeAddEntityByMetaHandler(meta model.TypeMeta) gin.HandlerFunc {
return func(c *gin.Context) {
if meta.DBFactory == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "DBFactory ontbreekt voor type " + meta.Typenaam})
return
}
newEntity := meta.DBFactory()
if err := c.ShouldBindJSON(newEntity); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
_, err := DB.NewInsert().Model(newEntity).Exec(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusCreated, gin.H{"message": meta.Typenaam + " created"})
}
}
package handlers
import (
"os"
"strings"
)
func debugLogsEnabled() bool {
v := strings.ToLower(strings.TrimSpace(os.Getenv("APP_DEBUG_LOGS")))
return v == "1" || v == "true" || v == "yes" || v == "on"
}
package handlers
import (
"bytes"
"encoding/json"
"fmt"
"io"
"github.com/gin-gonic/gin"
)
// LogRequestBodyAsJSON reads the request body, prints it as pretty JSON,
// and resets the body so it can still be used by ShouldBindJSON
func LogRequestBodyAsJSON(ctx *gin.Context) {
if !debugLogsEnabled() {
return
}
// Read the request body
body, err := io.ReadAll(ctx.Request.Body)
if err != nil {
fmt.Println("Error reading body:", err)
return
}
// Reset the body for subsequent reads
ctx.Request.Body = io.NopCloser(bytes.NewBuffer(body))
// Parse as JSON
var jsonData interface{}
err = json.Unmarshal(body, &jsonData)
if err != nil {
fmt.Println("Error parsing JSON:", err)
return
}
// Pretty print
jsonBytes, _ := json.MarshalIndent(jsonData, "", " ")
fmt.Println("Request body (pretty JSON):")
fmt.Println(string(jsonBytes))
}
package handlers
import (
"bytes"
"html/template"
"io/fs"
"net/http"
"os"
"path"
"path/filepath"
"sort"
"strings"
"sync"
"github.com/gin-gonic/gin"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/extension"
goldmarkhtml "github.com/yuin/goldmark/renderer/html"
)
var (
docsRootOnce sync.Once
docsRootPath string
)
func DocsIndex(ctx *gin.Context) {
root := getDocsRootPath()
relativeFiles := collectMarkdownFiles(root)
entries := make([]docsEntry, 0, len(relativeFiles))
for _, rel := range relativeFiles {
entries = append(entries, docsEntry{
Path: rel,
URL: "/docs/" + path.Clean(strings.TrimPrefix(filepath.ToSlash(rel), "/")),
})
}
ctx.Header("Content-Type", "text/html; charset=utf-8")
if err := docsIndexTemplate.Execute(ctx.Writer, gin.H{
"Title": "Markdown docs",
"RootPath": root,
"Entries": entries,
}); err != nil {
ctx.String(http.StatusInternalServerError, "Failed to render docs index")
return
}
}
func DocsPage(ctx *gin.Context) {
requested := strings.TrimPrefix(ctx.Param("filepath"), "/")
requested = path.Clean(requested)
if requested == "." || requested == "" {
DocsIndex(ctx)
return
}
if strings.HasPrefix(requested, "../") || strings.Contains(requested, "/../") {
ctx.String(http.StatusBadRequest, "Invalid path")
return
}
if strings.ToLower(path.Ext(requested)) != ".md" {
ctx.String(http.StatusBadRequest, "Only .md files are supported")
return
}
root := getDocsRootPath()
relPath := filepath.FromSlash(requested)
fullPath := filepath.Join(root, relPath)
rootAbs, err := filepath.Abs(root)
if err != nil {
ctx.String(http.StatusInternalServerError, "Failed to resolve docs root")
return
}
fileAbs, err := filepath.Abs(fullPath)
if err != nil {
ctx.String(http.StatusBadRequest, "Invalid file path")
return
}
if fileAbs != rootAbs && !strings.HasPrefix(fileAbs, rootAbs+string(os.PathSeparator)) {
ctx.String(http.StatusBadRequest, "Path escapes project root")
return
}
content, err := os.ReadFile(fileAbs)
if err != nil {
if os.IsNotExist(err) {
ctx.String(http.StatusNotFound, "Markdown file not found")
return
}
ctx.String(http.StatusInternalServerError, "Failed to read markdown file")
return
}
md := goldmark.New(
goldmark.WithExtensions(
extension.GFM,
extension.Table,
extension.Strikethrough,
extension.TaskList,
),
goldmark.WithRendererOptions(
goldmarkhtml.WithUnsafe(),
),
)
var rendered bytes.Buffer
if err := md.Convert(content, &rendered); err != nil {
ctx.String(http.StatusInternalServerError, "Failed to render markdown")
return
}
ctx.Header("Content-Type", "text/html; charset=utf-8")
if err := docsPageTemplate.Execute(ctx.Writer, gin.H{
"Title": filepath.ToSlash(relPath),
"FilePath": filepath.ToSlash(relPath),
"HTMLContent": template.HTML(rendered.String()),
}); err != nil {
ctx.String(http.StatusInternalServerError, "Failed to render docs page")
return
}
}
func getDocsRootPath() string {
docsRootOnce.Do(func() {
wd, err := os.Getwd()
if err != nil {
docsRootPath = "."
return
}
docsRootPath = findProjectRoot(wd)
})
return docsRootPath
}
func findProjectRoot(start string) string {
current, err := filepath.Abs(start)
if err != nil {
return "."
}
for {
gitPath := filepath.Join(current, ".git")
if stat, err := os.Stat(gitPath); err == nil && stat.IsDir() {
return current
}
parent := filepath.Dir(current)
if parent == current {
return start
}
current = parent
}
}
func collectMarkdownFiles(root string) []string {
relativeFiles := make([]string, 0, 64)
_ = filepath.WalkDir(root, func(current string, d fs.DirEntry, err error) error {
if err != nil {
return nil
}
if d.IsDir() {
name := d.Name()
switch name {
case ".git", "node_modules", "vendor", ".idea", ".vscode":
return filepath.SkipDir
}
return nil
}
if strings.ToLower(filepath.Ext(d.Name())) != ".md" {
return nil
}
rel, err := filepath.Rel(root, current)
if err != nil {
return nil
}
relativeFiles = append(relativeFiles, filepath.ToSlash(rel))
return nil
})
sort.Strings(relativeFiles)
return relativeFiles
}
type docsEntry struct {
Path string
URL string
}
var docsIndexTemplate = template.Must(template.New("docs-index").Parse(`<!doctype html>
<html lang="nl">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ .Title }}</title>
<style>
:root {
--bg: #f8fafc;
--card: #ffffff;
--line: #d0d7de;
--text: #1f2328;
--muted: #59636e;
--link: #0969da;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: "Segoe UI", "Noto Sans", sans-serif;
background: linear-gradient(180deg, #eef6ff 0%, var(--bg) 220px);
color: var(--text);
}
main {
width: min(980px, calc(100vw - 24px));
margin: 18px auto 32px;
}
.card {
background: var(--card);
border: 1px solid var(--line);
border-radius: 14px;
padding: 18px;
}
h1 {
margin: 0 0 8px;
font-size: clamp(22px, 2.8vw, 30px);
}
p { color: var(--muted); }
ul {
margin: 0;
padding-left: 18px;
columns: 2;
column-gap: 22px;
}
li { margin: 6px 0; break-inside: avoid; }
a { color: var(--link); text-underline-offset: 2px; }
.toplinks {
margin-top: 10px;
display: flex;
gap: 10px;
flex-wrap: wrap;
}
@media (max-width: 860px) {
ul { columns: 1; }
}
</style>
</head>
<body>
<main>
<section class="card">
<h1>Markdown documenten</h1>
<p>Gevonden vanaf projectroot: {{ .RootPath }}</p>
<div class="toplinks">
<a href="/">Naar startpagina</a>
<a href="/viz/">Naar viz</a>
</div>
</section>
<section class="card" style="margin-top: 12px">
<ul>
{{ range .Entries }}
<li><a href="{{ .URL }}">{{ .Path }}</a></li>
{{ else }}
<li>Geen markdown bestanden gevonden.</li>
{{ end }}
</ul>
</section>
</main>
</body>
</html>`))
var docsPageTemplate = template.Must(template.New("docs-page").Parse(`<!doctype html>
<html lang="nl">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ .Title }}</title>
<style>
:root {
--bg: #f6f8fa;
--paper: #ffffff;
--line: #d0d7de;
--text: #1f2328;
--muted: #59636e;
--link: #0969da;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
background: linear-gradient(180deg, #eef6ff 0%, var(--bg) 160px);
color: var(--text);
}
.wrap {
width: min(1100px, calc(100vw - 24px));
margin: 18px auto 32px;
}
.card {
background: var(--paper);
border: 1px solid var(--line);
border-radius: 12px;
}
.topbar {
padding: 12px 16px;
display: flex;
justify-content: space-between;
gap: 10px;
align-items: baseline;
flex-wrap: wrap;
}
.crumb {
color: var(--muted);
font-size: 14px;
}
.links {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.links a {
color: var(--link);
text-decoration: none;
}
.links a:hover {
text-decoration: underline;
}
article.markdown-body {
padding: 24px;
line-height: 1.6;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
margin-top: 1.3em;
margin-bottom: 0.5em;
}
.markdown-body code,
.markdown-body pre {
font-family: Consolas, "Cascadia Code", Menlo, monospace;
}
.markdown-body pre {
background: #f6f8fa;
border: 1px solid #d8dee4;
border-radius: 8px;
overflow: auto;
padding: 12px;
}
.markdown-body code {
background: #f6f8fa;
border-radius: 6px;
padding: 0.1em 0.35em;
}
.markdown-body pre code {
background: transparent;
border-radius: 0;
padding: 0;
}
.markdown-body table {
border-collapse: collapse;
width: 100%;
margin: 14px 0;
}
.markdown-body table th,
.markdown-body table td {
border: 1px solid #d0d7de;
padding: 6px 10px;
text-align: left;
}
.markdown-body blockquote {
margin: 1em 0;
padding: 0.2em 1em;
border-left: 4px solid #d0d7de;
color: #57606a;
}
.markdown-body a {
color: var(--link);
}
.markdown-body img {
max-width: 100%;
}
</style>
</head>
<body>
<main class="wrap">
<section class="card topbar">
<span class="crumb">Bestand: {{ .FilePath }}</span>
<nav class="links" aria-label="Navigatie">
<a href="/docs">Alle docs</a>
<a href="/">Startpagina</a>
<a href="/viz/">Viz</a>
</nav>
</section>
<section class="card" style="margin-top: 12px">
<article class="markdown-body">
{{ .HTMLContent }}
</article>
</section>
</main>
</body>
</html>`))
package handlers
import (
"database/sql"
"encoding/json"
"fmt"
"net/http"
"reflect"
"strconv"
"strings"
"time"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/gin-gonic/gin"
"github.com/uptrace/bun"
)
/* GENERAL TODO:
Full entity get and post to include all fields, not just ID.
This will require changes to the model structs and the handlers
to bind JSON to the full struct instead of just an ID field.
The current implementation is a simplified version for demonstration purposes.
*/
// (CoPilot made) parseBunRelationTag extracts the foreign key field name from a bun relation tag
// Expected format: bun:"rel:has-many,join:parent_field=child_field"
// Returns the child_field (FK field name) and parent_field (PK field name)
func parseBunRelationTag(tag string) (fkField string, pkField string, err error) {
// tag format example: "rel:has-many,join:id=a_id"
parts := strings.Split(tag, ",")
for _, part := range parts {
part = strings.TrimSpace(part)
if strings.HasPrefix(part, "join:") {
joinSpec := strings.TrimPrefix(part, "join:")
// joinSpec is now "id=a_id"
joinParts := strings.Split(joinSpec, "=")
if len(joinParts) == 2 {
pkField = strings.TrimSpace(joinParts[0]) // "id"
fkField = strings.TrimSpace(joinParts[1]) // "a_id"
return fkField, pkField, nil
}
}
}
return "", "", fmt.Errorf("join specification not found in bun tag")
}
// setForeignKeyOnRelatedEntity sets the FK field on a related entity to the parent ID
func setForeignKeyOnRelatedEntity(relatedEntity reflect.Value, fkFieldName string, parentID any) error {
// The fkFieldName is the column name (like "a_id"), we need to find the Go field
// Try direct field lookup first (if FK field is named exactly like fkFieldName)
elem := relatedEntity
if elem.Kind() == reflect.Ptr {
elem = elem.Elem()
}
structType := elem.Type()
// Search for a field with matching bun tag or json tag that corresponds to fkFieldName
for i := 0; i < elem.NumField(); i++ {
field := structType.Field(i)
// Check bun tag
if bunTag := field.Tag.Get("bun"); bunTag != "" {
// Extract the column name from bun tag (first part before comma)
bunParts := strings.Split(bunTag, ",")
columnName := bunParts[0]
if columnName == fkFieldName {
fieldValue := elem.Field(i)
if fieldValue.CanSet() {
switch fieldValue.Kind() {
case reflect.String:
if typedID, ok := parentID.(string); ok {
fieldValue.SetString(typedID)
return nil
}
return fmt.Errorf("cannot assign parentID type %T to string FK '%s'", parentID, fkFieldName)
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
parentValue := reflect.ValueOf(parentID)
if !parentValue.IsValid() || !parentValue.Type().ConvertibleTo(fieldValue.Type()) {
return fmt.Errorf("cannot assign parentID type %T to int FK '%s'", parentID, fkFieldName)
}
fieldValue.Set(parentValue.Convert(fieldValue.Type()))
return nil
default:
return fmt.Errorf("unsupported FK field kind '%s' for field '%s'", fieldValue.Kind(), fkFieldName)
}
}
}
}
// Check json tag
if jsonTag := field.Tag.Get("json"); jsonTag != "" {
jsonParts := strings.Split(jsonTag, ",")
jsonName := jsonParts[0]
if jsonName == fkFieldName {
fieldValue := elem.Field(i)
if fieldValue.CanSet() {
switch fieldValue.Kind() {
case reflect.String:
if typedID, ok := parentID.(string); ok {
fieldValue.SetString(typedID)
return nil
}
return fmt.Errorf("cannot assign parentID type %T to string FK '%s'", parentID, fkFieldName)
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
parentValue := reflect.ValueOf(parentID)
if !parentValue.IsValid() || !parentValue.Type().ConvertibleTo(fieldValue.Type()) {
return fmt.Errorf("cannot assign parentID type %T to int FK '%s'", parentID, fkFieldName)
}
fieldValue.Set(parentValue.Convert(fieldValue.Type()))
return nil
default:
return fmt.Errorf("unsupported FK field kind '%s' for field '%s'", fieldValue.Kind(), fkFieldName)
}
}
}
}
}
return fmt.Errorf("FK field '%s' not found or cannot be set", fkFieldName)
}
// parsePeiltijdstipUitQuerystring leest optionele querystring parameters voor formele tijd.
// Ondersteunt:
// - `peiltijdstip` in RFC3339/RFC3339Nano formaat
// - `t` als integer; die wordt vertaald naar hetzelfde patroon als in registratie:
// 2026-01-01T00:00:00Z + t uren + t microseconden.
//
// Als beide ontbreken, retourneert de functie (nil, nil) en wordt geen tijdsfilter toegepast.
// Als beide aanwezig zijn, krijgt `peiltijdstip` voorrang.
// Bij ongeldig formaat retourneert de functie een error die direct als 400-antwoord
// aan de client kan worden doorgegeven.
func parsePeiltijdstipUitQuerystring(c *gin.Context) (*time.Time, error) {
peiltijdstipRaw := c.Query("peiltijdstip")
if peiltijdstipRaw != "" {
peiltijdstip, err := time.Parse(time.RFC3339Nano, peiltijdstipRaw)
if err != nil {
return nil, fmt.Errorf("invalid 'peiltijdstip' parameter, expected RFC3339/RFC3339Nano")
}
if debugLogsEnabled() {
fmt.Printf("HANDLER (full): peiltijdstip (querystring) = %s\n", peiltijdstip.Format(time.RFC3339Nano))
}
return &peiltijdstip, nil
}
tRaw := c.Query("t")
if tRaw == "" {
return nil, nil
}
t, err := strconv.Atoi(tRaw)
if err != nil {
return nil, fmt.Errorf("invalid 't' parameter, expected integer")
}
peiltijdstip := tijdstipUitT(t)
if debugLogsEnabled() {
fmt.Printf("HANDLER (full): peiltijdstip (afgeleid uit t=%d) = %s\n", t, peiltijdstip.Format(time.RFC3339Nano))
}
return &peiltijdstip, nil
}
func tijdstipUitT(t int) time.Time {
return time.
Date(2026, 1, 1, 0, 0, 0, 0, time.UTC).
Add(time.Duration(t) * time.Hour).
Add(time.Microsecond * time.Duration(t))
}
// parseRegistratieIntervalUitQuerystring leest optionele interval-params ta/tb.
// - ta/tb zijn integers en worden met dezelfde t->tijdstip truc afgeleid.
// - interval is inclusief: tijdstip >= ta en tijdstip <= tb.
// - als slechts een van beide is gezet, wordt de andere grens open gelaten.
// - als geen van beide gezet is, returnt de functie (nil, nil, nil).
func parseRegistratieIntervalUitQuerystring(c *gin.Context) (*time.Time, *time.Time, error) {
taRaw := c.Query("ta")
tbRaw := c.Query("tb")
if taRaw == "" && tbRaw == "" {
return nil, nil, nil
}
var ta *time.Time
if taRaw != "" {
v, err := strconv.Atoi(taRaw)
if err != nil {
return nil, nil, fmt.Errorf("invalid 'ta' parameter, expected integer")
}
t := tijdstipUitT(v)
ta = &t
if debugLogsEnabled() {
fmt.Printf("HANDLER (full): interval ta (afgeleid uit ta=%d) = %s\n", v, t.Format(time.RFC3339Nano))
}
}
var tb *time.Time
if tbRaw != "" {
v, err := strconv.Atoi(tbRaw)
if err != nil {
return nil, nil, fmt.Errorf("invalid 'tb' parameter, expected integer")
}
t := tijdstipUitT(v)
tb = &t
if debugLogsEnabled() {
fmt.Printf("HANDLER (full): interval tb (afgeleid uit tb=%d) = %s\n", v, t.Format(time.RFC3339Nano))
}
}
if ta != nil && tb != nil && ta.After(*tb) {
return nil, nil, fmt.Errorf("invalid interval: ta must be <= tb")
}
return ta, tb, nil
}
func parseRegistratietypesUitQuerystring(c *gin.Context) ([]model.RegistratietypeEnum, error) {
rawValues := c.QueryArray("type")
if len(rawValues) == 0 {
return nil, nil
}
types := make([]model.RegistratietypeEnum, 0)
seen := make(map[model.RegistratietypeEnum]bool)
for _, raw := range rawValues {
for _, part := range strings.Split(raw, ",") {
value := strings.ToLower(strings.TrimSpace(part))
if value == "" {
continue
}
var t model.RegistratietypeEnum
switch value {
case string(model.RegistratietypeRegistratie):
t = model.RegistratietypeRegistratie
case string(model.RegistratietypeCorrectie):
t = model.RegistratietypeCorrectie
case string(model.RegistratietypeOngedaanmaking):
t = model.RegistratietypeOngedaanmaking
default:
return nil, fmt.Errorf("invalid 'type' parameter value: %s", value)
}
if !seen[t] {
types = append(types, t)
seen[t] = true
}
}
}
if len(types) == 0 {
return nil, nil
}
return types, nil
}
func toonAfvoerInResponse(c *gin.Context) bool {
return c.Query("toonafvoer") == "1"
}
func removeAfvoerKeys(v any) any {
switch t := v.(type) {
case map[string]any:
delete(t, "afvoer")
for k, child := range t {
t[k] = removeAfvoerKeys(child)
}
return t
case []any:
for i, child := range t {
t[i] = removeAfvoerKeys(child)
}
return t
default:
return v
}
}
func sanitizeResponseWithoutAfvoer(payload any) (any, error) {
b, err := json.Marshal(payload)
if err != nil {
return nil, err
}
var generic any
if err := json.Unmarshal(b, &generic); err != nil {
return nil, err
}
return removeAfvoerKeys(generic), nil
}
func structNaarMap(v any) (map[string]any, error) {
b, err := json.Marshal(v)
if err != nil {
return nil, err
}
result := make(map[string]any)
if err := json.Unmarshal(b, &result); err != nil {
return nil, err
}
return result, nil
}
func entiteitNaamNaarFullPathSegment(entiteitnaam string) (string, bool) {
meta, ok := model.MetaRegistry.GetTypeMeta(strings.TrimSpace(entiteitnaam))
if !ok || meta.Metatype != model.MetatypeEntiteit || meta.Padnaam == "" {
return "", false
}
return meta.Padnaam, true
}
func typeMetaVoorModelNaam(modelNaam string) (model.TypeMeta, bool) {
for _, meta := range model.MetaRegistry {
if meta.Typenaam == modelNaam {
return meta, true
}
if meta.Factory != nil {
factoryType := reflect.TypeOf(meta.Factory())
if factoryType != nil {
if factoryType.Kind() == reflect.Ptr {
factoryType = factoryType.Elem()
}
if factoryType.Name() == modelNaam {
return meta, true
}
}
}
if meta.DBFactory != nil {
dbType := reflect.TypeOf(meta.DBFactory())
if dbType != nil {
if dbType.Kind() == reflect.Ptr {
dbType = dbType.Elem()
}
if dbType.Name() == modelNaam {
return meta, true
}
}
}
}
return model.TypeMeta{}, false
}
type formeleTijdTarget struct {
Entiteitnaam string
EntiteitIDExpr string
Representatienaam string
RepresentatieIDExpr string
}
func formeleTijdTargetVoorModel(modelNaam string) (formeleTijdTarget, error) {
meta, ok := typeMetaVoorModelNaam(modelNaam)
if !ok {
return formeleTijdTarget{}, fmt.Errorf("geen metamap-entry gevonden voor model %s", modelNaam)
}
if meta.Tabelnaam == "" || meta.IDKolom == "" {
return formeleTijdTarget{}, fmt.Errorf("onvolledige metamap voor %s: tabel of idkolom ontbreekt", meta.Typenaam)
}
if meta.Metatype == model.MetatypeEntiteit {
return formeleTijdTarget{
Entiteitnaam: meta.Typenaam,
EntiteitIDExpr: fmt.Sprintf("%s.%s::text", meta.Tabelnaam, meta.IDKolom),
Representatienaam: "",
RepresentatieIDExpr: "''",
}, nil
}
bovenliggend, ok := model.MetaRegistry.GetBovenliggendeRelatieMeta(meta.Typenaam)
if !ok {
return formeleTijdTarget{}, fmt.Errorf("geen bovenliggende entiteit gevonden voor type %s", meta.Typenaam)
}
if meta.EntiteitIDKolom == "" {
return formeleTijdTarget{}, fmt.Errorf("entiteit FK ontbreekt in metamap voor type %s", meta.Typenaam)
}
return formeleTijdTarget{
Entiteitnaam: bovenliggend.ParentType.Typenaam,
EntiteitIDExpr: fmt.Sprintf("%s.%s::text", meta.Tabelnaam, meta.EntiteitIDKolom),
Representatienaam: meta.Typenaam,
RepresentatieIDExpr: fmt.Sprintf("%s.%s::text", meta.Tabelnaam, meta.IDKolom),
}, nil
}
func applyFormeleTijdFilterVoorModel(query *bun.SelectQuery, modelNaam string, peiltijdstip time.Time) *bun.SelectQuery {
const activeWijziging = string(model.WijzigingstypeOpvoer)
target, err := formeleTijdTargetVoorModel(modelNaam)
if err != nil {
if debugLogsEnabled() {
fmt.Printf("HANDLER (full): formele tijdfilter fallback voor model %s: %v\n", modelNaam, err)
}
return query.Where("opvoer <= ?", peiltijdstip).
Where("(afvoer IS NULL OR afvoer > ?)", peiltijdstip)
}
return query.Where(fmt.Sprintf(`
(
SELECT v.wijzigingstype
FROM f_formele_wijziging_op_peil(?) AS v
WHERE v.entiteitnaam = ?
AND v.entiteit_id = %s
AND v.representatienaam = ?
AND v.representatie_id = %s
ORDER BY v.registratie_tijdstip DESC, v.wijziging_id DESC
LIMIT 1
) = ?
`, target.EntiteitIDExpr, target.RepresentatieIDExpr), peiltijdstip, target.Entiteitnaam, target.Representatienaam, activeWijziging)
}
type laatsteWijzigingOpPeil struct {
Wijzigingstype model.WijzigingstypeEnum `bun:"wijzigingstype"`
RegistratieTijdstip time.Time `bun:"registratie_tijdstip"`
}
func haalLaatsteNietOngedaanGemaakteWijzigingOpPeil(
c *gin.Context,
entiteitnaam string,
entiteitID string,
representatienaam string,
representatieID string,
peiltijdstip time.Time,
) (*laatsteWijzigingOpPeil, error) {
row := new(laatsteWijzigingOpPeil)
err := DB.NewSelect().
TableExpr("f_formele_wijziging_op_peil(?) AS v", peiltijdstip).
ColumnExpr("v.wijzigingstype").
ColumnExpr("v.registratie_tijdstip").
Where("v.entiteitnaam = ?", entiteitnaam).
Where("v.entiteit_id = ?", entiteitID).
Where("v.representatienaam = ?", representatienaam).
Where("v.representatie_id = ?", representatieID).
OrderExpr("v.registratie_tijdstip DESC, v.wijziging_id DESC").
Limit(1).
Scan(c.Request.Context(), row)
if err != nil {
if err == sql.ErrNoRows {
return nil, nil
}
return nil, err
}
return row, nil
}
func zetAfgeleideFormeleTijdVoorRepresentatie(
c *gin.Context,
representatie model.HeeftOpvoerAfvoer,
entiteitnaam string,
entiteitID string,
representatienaam string,
representatieID string,
peiltijdstip time.Time,
) error {
wijziging, err := haalLaatsteNietOngedaanGemaakteWijzigingOpPeil(
c,
entiteitnaam,
entiteitID,
representatienaam,
representatieID,
peiltijdstip,
)
if err != nil {
return err
}
representatie.SetOpvoer(nil)
representatie.SetAfvoer(nil)
if wijziging == nil {
return nil
}
t := wijziging.RegistratieTijdstip
switch wijziging.Wijzigingstype {
case model.WijzigingstypeOpvoer:
representatie.SetOpvoer(&t)
case model.WijzigingstypeAfvoer:
representatie.SetAfvoer(&t)
}
return nil
}
// entiteitMetaVoorFullEntity bepaalt op basis van het concrete full-model de bijbehorende
// entiteit-meta uit de MetaRegistry. De functie verwacht een niet-nil pointer naar een full entiteit.
func entiteitMetaVoorFullEntity(entity any) (model.TypeMeta, error) {
v := reflect.ValueOf(entity)
if !v.IsValid() || v.Kind() != reflect.Ptr || v.IsNil() {
return model.TypeMeta{}, fmt.Errorf("full entity moet een niet-nil pointer zijn")
}
modelNaam := v.Elem().Type().Name()
meta, ok := typeMetaVoorModelNaam(modelNaam)
if !ok {
return model.TypeMeta{}, fmt.Errorf("geen metamap-entry gevonden voor full entity model %s", modelNaam)
}
if meta.Metatype != model.MetatypeEntiteit {
return model.TypeMeta{}, fmt.Errorf("type %s is geen entiteit", meta.Typenaam)
}
return meta, nil
}
// vulAfgeleideFormeleTijdVoorFullSlice verwerkt een volledige lijst van full entiteiten generiek.
// Dit vervangt hardcoded type-switches op Full_A/Full_B: elk slice-element wordt als pointer
// doorgegeven aan de generieke entity-routine hieronder.
func vulAfgeleideFormeleTijdVoorFullSlice(c *gin.Context, entities any, peiltijdstip time.Time) error {
v := reflect.ValueOf(entities)
if !v.IsValid() || v.Kind() != reflect.Ptr || v.IsNil() {
return fmt.Errorf("entities moet een niet-nil pointer naar slice zijn")
}
sliceValue := v.Elem()
if sliceValue.Kind() != reflect.Slice {
return fmt.Errorf("entities moet een pointer naar slice zijn")
}
for i := 0; i < sliceValue.Len(); i++ {
entityPtr := sliceValue.Index(i).Addr().Interface()
if err := vulAfgeleideFormeleTijdVoorFullEntity(c, entityPtr, peiltijdstip); err != nil {
return err
}
}
return nil
}
// vulAfgeleideFormeleTijdVoorFullEntity leidt opvoer/afvoer af voor een full entiteit en
// haar onderliggende representaties via interfaces i.p.v. concrete type-switches.
// Vereiste interfaces op de entiteit:
// - HasID: voor entiteit-ID
// - HeeftOpvoerAfvoer: voor opvoer/afvoer op entiteitsniveau
// - HeeftOnderliggendeGegevenselementen: voor iteratie over kind-representaties
func vulAfgeleideFormeleTijdVoorFullEntity(c *gin.Context, entity any, peiltijdstip time.Time) error {
meta, err := entiteitMetaVoorFullEntity(entity)
if err != nil {
return err
}
hasID, ok := entity.(model.HasID)
if !ok {
return fmt.Errorf("full entity %s implementeert HasID niet", meta.Typenaam)
}
formeleEntiteit, ok := entity.(model.HeeftOpvoerAfvoer)
if !ok {
return fmt.Errorf("full entity %s implementeert HeeftOpvoerAfvoer niet", meta.Typenaam)
}
entiteitID := fmt.Sprint(hasID.GetID())
if err := zetAfgeleideFormeleTijdVoorRepresentatie(c, formeleEntiteit, meta.Typenaam, entiteitID, "", "", peiltijdstip); err != nil {
return err
}
metKinderen, ok := entity.(model.HeeftOnderliggendeGegevenselementen)
if !ok {
return nil
}
for _, kind := range metKinderen.GeefOnderliggendeGegevenselementen() {
if kind.Representatie == nil {
continue
}
repID := fmt.Sprint(kind.Representatie.GetID())
if err := zetAfgeleideFormeleTijdVoorRepresentatie(c, kind.Representatie, meta.Typenaam, entiteitID, kind.Typenaam, repID, peiltijdstip); err != nil {
return err
}
}
return nil
}
func maakFullEntiteitLinksVoorRegistratie(reg model.Registratie) []map[string]string {
seen := make(map[string]bool)
links := make([]map[string]string, 0)
for _, wijziging := range reg.Wijzigingen {
if wijziging.Entiteitnaam == "" || wijziging.EntiteitID == "" {
continue
}
segment, ok := entiteitNaamNaarFullPathSegment(wijziging.Entiteitnaam)
if !ok {
continue
}
link := fmt.Sprintf("%s/%s", segment, wijziging.EntiteitID)
if !seen[link] {
seen[link] = true
links = append(links, map[string]string{"href": link})
}
}
return links
}
// MakeGetRegistratiesMetWijzigingenHandler returns registraties with child wijzigingen.
// Bij peiltijdstip-filter geldt voor beide: tijdstip <= peiltijdstip.
func MakeGetRegistratiesMetWijzigingenHandler() gin.HandlerFunc {
return func(c *gin.Context) {
const (
defaultPage = 1
defaultSize = 20
maxSize = 100
)
page := defaultPage
size := defaultSize
if p := c.Query("page"); p != "" {
v, err := strconv.Atoi(p)
if err != nil || v <= 0 {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid 'page' parameter"})
return
}
page = v
}
if s := c.Query("size"); s != "" {
v, err := strconv.Atoi(s)
if err != nil || v <= 0 {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid 'size' parameter"})
return
}
if v > maxSize {
size = maxSize
} else {
size = v
}
}
offset := (page - 1) * size
ta, tb, err := parseRegistratieIntervalUitQuerystring(c)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
typeFilter, err := parseRegistratietypesUitQuerystring(c)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
peiltijdstip, err := parsePeiltijdstipUitQuerystring(c)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
registraties := make([]model.Registratie, 0)
query := DB.NewSelect().Model(®istraties)
if len(typeFilter) > 0 {
query = query.Where("registratietype IN (?)", bun.In(typeFilter))
}
if ta != nil || tb != nil {
if ta != nil {
query = query.Where("tijdstip >= ?", *ta)
}
if tb != nil {
query = query.Where("tijdstip <= ?", *tb)
}
query = query.Relation("Wijzigingen", func(relQuery *bun.SelectQuery) *bun.SelectQuery {
if ta != nil {
relQuery = relQuery.Where("tijdstip >= ?", *ta)
}
if tb != nil {
relQuery = relQuery.Where("tijdstip <= ?", *tb)
}
return relQuery
})
} else if peiltijdstip != nil {
query = query.Where("tijdstip <= ?", *peiltijdstip)
query = query.Relation("Wijzigingen", func(relQuery *bun.SelectQuery) *bun.SelectQuery {
return relQuery.Where("tijdstip <= ?", *peiltijdstip)
})
} else {
query = query.Relation("Wijzigingen")
}
err = query.
Limit(size).
Offset(offset).
Scan(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
hasMore := len(registraties) == size
registratieResponses := make([]any, 0, len(registraties))
for _, reg := range registraties {
regMap, err := structNaarMap(reg)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to map registratie response: %v", err)})
return
}
regMap["full_entiteit_links"] = maakFullEntiteitLinksVoorRegistratie(reg)
registratieResponses = append(registratieResponses, regMap)
}
c.JSON(http.StatusOK, gin.H{
"Registraties": registratieResponses,
"page": page,
"size": size,
"has_more": hasMore,
})
}
}
// MakeGetRegistratieMetWijzigingenByIDHandler returns one registratie by id with child wijzigingen.
func MakeGetRegistratieMetWijzigingenByIDHandler() gin.HandlerFunc {
return func(c *gin.Context) {
idParam := c.Param("id")
if idParam == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "ID must be present"})
return
}
if _, err := strconv.Atoi(idParam); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid 'id' parameter"})
return
}
var reg model.Registratie
err := DB.NewSelect().
Model(®).
Where("id = ?", idParam).
Relation("Wijzigingen").
Scan(c.Request.Context())
if err != nil {
if err == sql.ErrNoRows {
c.JSON(http.StatusNotFound, gin.H{"message": "Registratie not found"})
return
}
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
regMap, err := structNaarMap(reg)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to map registratie response: %v", err)})
return
}
regMap["full_entiteit_links"] = maakFullEntiteitLinksVoorRegistratie(reg)
c.JSON(http.StatusOK, regMap)
}
}
// MakeGetFullEntitiesByMetaHandler returns a gin.HandlerFunc that retrieves full entities defined by TypeMeta.Factory.
func MakeGetFullEntitiesByMetaHandler(meta model.TypeMeta) gin.HandlerFunc {
return func(c *gin.Context) {
const (
defaultPage = 1
defaultSize = 20
maxSize = 100
)
if meta.Factory == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Factory ontbreekt voor type " + meta.Typenaam})
return
}
if meta.SliceFactory == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "SliceFactory ontbreekt voor type " + meta.Typenaam})
return
}
page := defaultPage
size := defaultSize
if p := c.Query("page"); p != "" {
v, err := strconv.Atoi(p)
if err != nil || v <= 0 {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid 'page' parameter"})
return
}
page = v
}
if s := c.Query("size"); s != "" {
v, err := strconv.Atoi(s)
if err != nil || v <= 0 {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid 'size' parameter"})
return
}
if v > maxSize {
size = maxSize
} else {
size = v
}
}
offset := (page - 1) * size
entities := meta.SliceFactory()
query := DB.NewSelect().Model(entities)
peiltijdstip, err := parsePeiltijdstipUitQuerystring(c)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
if peiltijdstip != nil {
query = applyFormeleTijdFilterVoorModel(query, meta.Typenaam, *peiltijdstip)
}
for _, rel := range meta.OnderliggendeGegevenselementen {
relatieNaam := rel.Rolnaam
doeltype := rel.Doeltype
if peiltijdstip != nil {
query = query.Relation(relatieNaam, func(relQuery *bun.SelectQuery) *bun.SelectQuery {
return applyFormeleTijdFilterVoorModel(relQuery, doeltype, *peiltijdstip)
})
} else {
query = query.Relation(relatieNaam)
}
}
err = query.
Limit(size).
Offset(offset).
Scan(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
if peiltijdstip != nil {
if err := vulAfgeleideFormeleTijdVoorFullSlice(c, entities, *peiltijdstip); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to derive formele tijdstippen: %v", err)})
return
}
}
total, err := DB.NewSelect().Model(meta.Factory()).Count(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
hasMore := offset+size < total
responseEntities := entities
if !toonAfvoerInResponse(c) {
responseEntities, err = sanitizeResponseWithoutAfvoer(entities)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to sanitize response: %v", err)})
return
}
}
c.JSON(http.StatusOK, gin.H{
meta.Typenaam + "s": responseEntities,
"page": page,
"size": size,
"has_more": hasMore,
})
}
}
// MakeGetFullEntityByMetaHandler returns a gin.HandlerFunc that retrieves one full entity by meta.IDKolom.
func MakeGetFullEntityByMetaHandler(meta model.TypeMeta) gin.HandlerFunc {
return func(c *gin.Context) {
if meta.Factory == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Factory ontbreekt voor type " + meta.Typenaam})
return
}
if meta.IDKolom == "" {
c.JSON(http.StatusInternalServerError, gin.H{"error": "IDKolom ontbreekt voor type " + meta.Typenaam})
return
}
entityID := c.Param("id")
if entityID == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "ID must be present"})
return
}
entity := meta.Factory()
hasID, ok := entity.(model.HasID)
if !ok {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Factory levert geen HasID voor type " + meta.Typenaam})
return
}
query := DB.NewSelect().Model(entity)
peiltijdstip, err := parsePeiltijdstipUitQuerystring(c)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
if peiltijdstip != nil {
query = applyFormeleTijdFilterVoorModel(query, meta.Typenaam, *peiltijdstip)
}
for _, rel := range meta.OnderliggendeGegevenselementen {
relatieNaam := rel.Rolnaam
doeltype := rel.Doeltype
if peiltijdstip != nil {
query = query.Relation(relatieNaam, func(relQuery *bun.SelectQuery) *bun.SelectQuery {
return applyFormeleTijdFilterVoorModel(relQuery, doeltype, *peiltijdstip)
})
} else {
query = query.Relation(relatieNaam)
}
}
err = query.
Where(meta.IDKolom+" = ?", entityID).
Scan(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
if peiltijdstip != nil {
if err := vulAfgeleideFormeleTijdVoorFullEntity(c, entity, *peiltijdstip); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to derive formele tijdstippen: %v", err)})
return
}
}
if isZeroID(hasID.GetID()) {
c.JSON(http.StatusNotFound, gin.H{"message": meta.Typenaam + " not found"})
return
}
var responseEntity any = entity
if !toonAfvoerInResponse(c) {
responseEntity, err = sanitizeResponseWithoutAfvoer(entity)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to sanitize response: %v", err)})
return
}
}
c.JSON(http.StatusOK, responseEntity)
}
}
// MakeAddFullEntityByMetaHandler returns a gin.HandlerFunc that inserts one full entity and its child relations defined in the metaregistry.
func MakeAddFullEntityByMetaHandler(meta model.TypeMeta) gin.HandlerFunc {
return func(c *gin.Context) {
if meta.Factory == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Factory ontbreekt voor type " + meta.Typenaam})
return
}
entity := meta.Factory()
hasID, ok := entity.(model.HasID)
if !ok {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Factory levert geen HasID voor type " + meta.Typenaam})
return
}
if err := c.ShouldBindJSON(entity); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
LogRequestBodyAsJSON(c)
_, err := DB.NewInsert().Model(entity).Exec(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
if len(meta.OnderliggendeGegevenselementen) > 0 {
entityValue := reflect.ValueOf(entity)
if entityValue.Kind() != reflect.Ptr || entityValue.IsNil() {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("Factory levert geen pointer voor type %s", meta.Typenaam)})
return
}
entityElem := entityValue.Elem()
entityType := entityElem.Type()
parentID := hasID.GetID()
for _, rel := range meta.OnderliggendeGegevenselementen {
relationName := rel.Rolnaam
relField, found := entityType.FieldByName(relationName)
if !found {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("relation field '%s' not found", relationName)})
return
}
bunTag := relField.Tag.Get("bun")
if bunTag == "" {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("bun tag not found on relation field '%s'", relationName)})
return
}
fkField, _, err := parseBunRelationTag(bunTag)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to parse bun tag: %v", err)})
return
}
relatedValue := entityElem.FieldByName(relationName)
if !relatedValue.IsValid() || relatedValue.IsZero() {
continue
}
if relatedValue.Kind() != reflect.Slice {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("relation field '%s' is not a slice", relationName)})
return
}
for i := 0; i < relatedValue.Len(); i++ {
relatedEntity := relatedValue.Index(i)
if err := setForeignKeyOnRelatedEntity(relatedEntity, fkField, parentID); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to set FK: %v", err)})
return
}
_, err := DB.NewInsert().Model(relatedEntity.Addr().Interface()).Exec(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
}
}
}
c.JSON(http.StatusCreated, gin.H{"message": meta.Typenaam + " created"})
}
}
package handlers
import (
"github.com/99designs/gqlgen/graphql/handler"
"github.com/99designs/gqlgen/graphql/handler/extension"
"github.com/99designs/gqlgen/graphql/handler/lru"
"github.com/99designs/gqlgen/graphql/handler/transport"
"github.com/99designs/gqlgen/graphql/playground"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/graph"
"github.com/gin-gonic/gin"
"github.com/vektah/gqlparser/v2/ast"
)
// GraphQLHandler returns the GraphQL handler configured with gqlgen
func GraphQLHandler() gin.HandlerFunc {
return func(c *gin.Context) {
// Create a new resolver with the database
resolver := &graph.Resolver{DB: DB}
// Initialize the GraphQL schema with the resolver
srv := handler.New(graph.NewExecutableSchema(graph.Config{Resolvers: resolver}))
// Add transports
srv.AddTransport(transport.Options{})
srv.AddTransport(transport.GET{})
srv.AddTransport(transport.POST{})
// Cache query documents
srv.SetQueryCache(lru.New[*ast.QueryDocument](1000))
// Add extensions
srv.Use(extension.Introspection{})
srv.Use(extension.AutomaticPersistedQuery{
Cache: lru.New[string](100),
})
srv.ServeHTTP(c.Writer, c.Request)
}
}
// PlaygroundHandler returns the GraphQL Playground handler
func PlaygroundHandler() gin.HandlerFunc {
h := playground.Handler("GraphQL Playground", "/graphql/query")
return func(c *gin.Context) {
h.ServeHTTP(c.Writer, c.Request)
}
}
package handlers
func isZeroID(id any) bool {
switch value := id.(type) {
case nil:
return true
case string:
return value == ""
case int:
return value == 0
case int8:
return value == 0
case int16:
return value == 0
case int32:
return value == 0
case int64:
return value == 0
case uint:
return value == 0
case uint8:
return value == 0
case uint16:
return value == 0
case uint32:
return value == 0
case uint64:
return value == 0
default:
return false
}
}
package handlers
import (
"encoding/json"
"fmt"
"net/http"
"time"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/gin-gonic/gin"
)
func RegistreerMetNieuweAanpak() gin.HandlerFunc {
return func(c *gin.Context) {
start := time.Now()
var request model.RegistreerRequest
if err := c.ShouldBindJSON(&request); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
requestBodyJSON, err := json.Marshal(request)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to serialize request body for audit: %v", err)})
return
}
requestPath := c.Request.URL.Path
requestMethod := c.Request.Method
request.Registratie.RequestBody = requestBodyJSON
request.Registratie.RequestPath = &requestPath
request.Registratie.RequestMethod = &requestMethod
// Output request body for debugging as pretty JSON
LogRequestBodyAsJSON(c)
// Start transaction
tx, err := DB.BeginTx(c.Request.Context(), nil)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to start transaction: %v", err)})
return
}
committed := false
defer func() {
if !committed {
_ = tx.Rollback()
}
}()
/*
tijdelijk voor testen: maak het registratietijdstip gelijk aan
een tijdstip oplopende met het registratienummer.
Dat vergt wel eerst een insert van de registratie zonder tijdstip,
en dan een update met het tijdstip.
*/
// Step 1: Insert Registratie and get ID + Tijdstip
_, err = tx.NewInsert().
Model(&request.Registratie).
Returning("id").
Exec(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to insert registratie: %v", err)})
return
}
// TIJDELIJK: overwrite registratietijdstip met een tijdstip gebaseerd op de registratie ID, zodat we oplopende tijdstippen hebben voor testdoeleinden
request.Registratie.Tijdstip = time.
Date(2026, 1, 1, 0, 0, 0, 0, time.UTC).
Add(time.Duration(request.Registratie.ID) * time.Hour).
Add(time.Microsecond * time.Duration(request.Registratie.ID)) //gimmick: laatste cijfer van de tijd is het ID van de registratie...
_, err = tx.NewUpdate().
Model(&request.Registratie).
Where("id = ?", request.Registratie.ID).
Exec(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to update registratie with tijdstip: %v", err)})
return
}
// set twee variabelen voor verder gebruik in de fuctie: registratieID en registratieTijdstip
registratieID := request.Registratie.ID
registratieTijdstip := request.Registratie.Tijdstip
/*
CORRECTIE / ONGEDAANMAKING scenario's
-------------------------------------
CORRECTIE VOORWAARDEN:
- Registratietype = Correctie
- CorrigeertRegistratieID != nil
- Het tijdstip van de correctie is later dan dat van de te corrigeren registratie.
- Een entiteit zelf kan niet gewijzigd worden,
-> BEHALVE de materiele tijden (aanvang, einde)
N.B.:
- een registratie kan nu meer dan één entiteit betreffen (niet strikt REST dus)
- op zich zou hetzelfde formaat gebruikt kunnen worden voor correctie, zoals hieronder.
-- het id van de entiteit betekent dan 'betreft entiteit met ID x'
-- een correctie kan niet een opvoer in een afvoer veranderen ofzo: daar is ongedaanmaking voor.
-- een correctie kan dus alleen een opvoer corrigeren naar een andere opvoer, of een afvoer naar een andere afvoer
-- een correctie hoeft niet alle elementen in een registratie te corrigeren
--> ISSUE? wat met verplichte velden in de structs? Hebben we andere structs nodig voor correcties?
RESULTAAT:
- er is minimaal één nieuwe wijziging bijgekomen voor dat wat gecorrigeerd is
- het gecorrigeerde gegevenselement is afgevoerd (met een wijziging record van type 'afvoer' en het tijdstip van de correctie)
- er is een nieuw gegevenselement opgevoerd met de gecorrigeerde data, maar met een nieuwe ID
- het nieuwe ID moet worden terugggegeven in de response
-> ISSUE: geven we dus de hele request ongeveer terug, maar met gegeneerde ID's?
-> ISSUE: hoe weten we welk gegevenselement welke is bij meerdere. Maar misschien maakt dat niet uit.
--- denkexperiment: DING bevat NAMEN. naam1, naam2, naam3.
--- We corrigeren naam2 naar naam2b. naam2 wordt afgevoerd,
--- en naam2b wordt opgevoerd met een nieuwe ID.
--- In de response geven we naam2b terug met het nieuwe ID.
Voorbeeld correctie request body:
{
"registratie": {
"registratietype": "correctie",
"tijdstip": "2026-01-12T11:00:00Z",
"opmerking": "Corrigeer U3 van entiteit A2",
"corrigeertRegistratieID": 1
},
"wijzigingen": [
{
"opvoer": {
"a": {
"id": 2,
"us": [
{
"rel_id": 3,
"aaa": "a2-correctie",
//"bbb": false // stel dat we alleen aaa corrigeren, en bbb niet. Dan corrigeren we alleen aaa in de opvoer, en laten we bbb weg in de opvoer. In de database blijft bbb dan gelijk aan wat het was.
}
]
}
}
}
]
}
RESPONSE:
{
"message": "De registratie 2 is succesvol verwerkt op 2026-01-12T11:00:00Z in 123 ms",
"wijzigingen": [
{
"opvoer": {
"a": {
"id": 2,
"us": [
{
"rel_id": 4, // nieuwe ID voor de opgevoerde U3
"aaa": "a2-correctie",
//"bbb": false // stel dat we alleen aaa corrigeren, en bbb niet. Dan corrigeren we alleen aaa in de opvoer, en laten we bbb weg in de opvoer. In de database blijft bbb dan gelijk aan wat het was.
}
]
}
}
}
]
}
- in dit voorbeeld corrigeert de wijziging het gegevenselement U3 (id=3) van entiteit A2 (id=2)
- de handler voor deze correctie moet dus:
1. U3 afvoeren (op dezelfde manier als bij een normale afvoer, dus inclusief wijziging record) met registratietijdstip
2. U3 opnieuw opvoeren met de gecorrigeerde data, maar met een nieuwe ID... Dat is nu even lastig zonder auto-increment ID,
maar we zouden in de handler een nieuwe ID kunnen genereren (bijv. max bestaande ID + 1) voordat we de opvoer uitvoeren.
Deze nieuwe ID wordt dan ook gebruikt in de wijziging record voor de opvoer.
Een andere oplossing zou zijn om UUID's te gebruiken in plaats van auto-increment IDs,
zodat we al een ID kunnen genereren voordat we de opvoer uitvoeren.
In principe wil je ook een afgevoerd gegeven nog kunnen corrigeren. Dat lijkt raar (StUF sluit het bijv. uit),
maar het kan als het materieel is iig wel. Voor alleen een formeel gegevens is het wel gek.
Verder: wat bij een niet complete correctie van het gegevenselement?
bijv. alleen het veld "aaa" van U3 corrigeren, en niet het veld "bbb"?
Dan moet je dus eigenlijk ook de bestaande waarde van "bbb" ophalen en
meenemen in de opvoer van U3.
RECURSIE:
- Een complexere correctie is eigenlijk een herhaling van zetten, maar dan
met meerdere gegevenselementen betreffende één of meerdere entiteiten.
ONGEDAANMAKING VOORWAARDEN:
- Registratietype = Ongedaanmaking
- MaaktOngedaanRegistratieID != nil
- Het tijdstip van de ongedaanmaking is later dan dat van de ongedaan te maken registratie.
ACTIES ONGEDAANMAKING:
- Bij ongedaanmaking maken we een nieuwe registratie aan met type "Ongedaanmaking"
en een verwijzing naar de te ongedaan maken registratie.
- In principe zou dat genoeg zijn,
maar we willen nog de afgeleide velden opvoer en afvoer in de ongedaangemaakte registratie opnieuw bepalen.
Hier zit wel complexiteit, omdat we dan feitelijk moeten tijdsreizen naar een tijdstip nèt voor de ongedaan gemaakte registratie,
en dan de toestand van opvoer/afvoer herstellen.
N.B.: het kan dus zijn dat de representatie in de ongedaan gemaakte registratie werd opgevoerd, en dus daarvoor niet bestond.
Dan moet gewoon de opvoer leeggemaakt worden.
Maar een ongedaanmaking van een ongedaanmaking of van een correctie is lastiger. Moet ik even over nadenken.
1 first things first: een ongedaanmaking van REG x:
- zoek de wijzigingen onder reg x op in de database
- voor elke wijziging: bepaal of het een opvoer of afvoer is, en welke representatie het betreft
- als het een opvoer is, dan moet het opvoertijdstip weer worden verwijderd uit het representatie record.
(let op: dit is NIET afvoeren, maar zoiets als ont-opvoeren!)
- als het een afvoer is, dan moet deze afvoer worden leeggemaakt in het representatie record (ont-afvoeren?)
(zo is het record weer geldig, of actueel geworden)
2 N.B. er moeten wel een paar checks gedaan worden
- check of de te ongedaan maken registratie niet al ongedaan is gemaakt. Dat kan geen twee keer. Indien zo: fout en transactie rollback.
- check of er tussen het oorspronkelijke registratiemoment en het ongedaanmakingsmoment geen correcties of andere wijzigingen
(correcties of een afvoer) zijn doorgevoerd op hetzelfde gegevenselement.
Dus de ongedaanmaking moet de laatste wijziging op dat gegevenselement zijn.
Als dat zo is: melden en rollback (ongedaanmaking wordt ook niet vastgelegd).
--> optie: een pacman-ongedaanmaking toestaan, waarbij alles wijzigingen na de te ongedaan maken registratie worden ongedaan gemaakt.
Dat is wel een stuk complexer, omdat je hele registraties ongedaan wilt maken. Dat wil je eigenlijk niet automatisch met allerlei zij-effecten.
- de registratie die ongedaan gemaakt wordt, is zelf een ongedaanmaking.
Dat is op zich te doen, want je doet dan gewoon weer het omgekeerde van de eerste ongedaanmaking. Een hergedaanmaking of zoiets :-).
Niet meteen bouwen.
*/
/* ====== ONGEDAANMAKING scenario ====== */
if request.Registratie.Registratietype == model.RegistratietypeOngedaanmaking {
// check of MaaktOngedaanRegistratieID is meegegeven
if request.Registratie.MaaktOngedaanRegistratieID == nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "De ongedaan te maken registratie moet worden meegegeven via 'maakt_ongedaan_registratie_id' (of alias 'MaaktOngedaanRegistratieID')"})
return
}
// check of de te ongedaan maken registratie bestaat
var ongedaanTeMakenRegistratie model.Registratie
err = DB.NewSelect().
Model(&ongedaanTeMakenRegistratie).
Where("id = ?", *request.Registratie.MaaktOngedaanRegistratieID).
Scan(c.Request.Context())
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("De te ongedaan maken registratie met ID %d bestaat niet", *request.Registratie.MaaktOngedaanRegistratieID)})
return
}
// check op afgeleid veld: deze registratie is al eerder ongedaan gemaakt.
if ongedaanTeMakenRegistratie.IsOngedaangemaakt {
c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("De te ongedaan maken registratie met ID %d is al ongedaan gemaakt", ongedaanTeMakenRegistratie.ID)})
return
}
/* check of er sinds de te ongedaan maken registratie latere wijzigingen zijn gedaan op exact dezelfde elementen.
Als dat zo is, dan is ongedaanmaking niet toegestaan omdat de te ongedaan maken registratie dan niet meer de laatste wijziging is.
*/
var wijzigingenOnderTeOngedaanMakenRegistratie []model.Wijziging
err = DB.NewSelect().
Model(&wijzigingenOnderTeOngedaanMakenRegistratie).
Where("registratie_id = ?", ongedaanTeMakenRegistratie.ID).
Scan(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("Fout bij ophalen wijzigingen onder te ongedaan maken registratie: %v", err)})
return
}
for _, doelWijziging := range wijzigingenOnderTeOngedaanMakenRegistratie {
var latereWijzigingen []model.Wijziging
err = DB.NewSelect().
Model(&latereWijzigingen).
Where("registratie_id <> ?", ongedaanTeMakenRegistratie.ID).
Where("tijdstip > ?", ongedaanTeMakenRegistratie.Tijdstip).
Where("tijdstip <= ?", request.Registratie.Tijdstip).
Where("COALESCE(entiteitnaam, '') = ?", doelWijziging.Entiteitnaam).
Where("COALESCE(entiteit_id, '') = ?", doelWijziging.EntiteitID).
Where("COALESCE(representatienaam, '') = ?", doelWijziging.Representatienaam).
Where("COALESCE(representatie_id, '') = ?", doelWijziging.RepresentatieID).
Scan(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("Fout bij controleren op latere wijzigingen na registratie %d: %v", ongedaanTeMakenRegistratie.ID, err)})
return
}
if len(latereWijzigingen) > 0 {
c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("Er zijn latere wijzigingen op hetzelfde gegevenselement; ongedaanmaking van registratie %d is daarom niet toegestaan. Doelwijziging: %v, latere wijzigingen: %v", ongedaanTeMakenRegistratie.ID, doelWijziging, latereWijzigingen)})
return
}
}
/* ### TODO ###
ONGEDAANMAKING VAN EEN ONGEDAANMAKING
- check of de te ongedaan maken registratie zelf een ongedaanmaking is
- dat is op zich te doen, want je doet dan gewoon weer het omgekeerde van de eerste ongedaanmaking. Een hergedaanmaking of zoiets :-).
- check of er wijzigingen zijn doorgevoerd sinds de ongedaanmaking die we nu willen ongedaan maken. Dat kan namelijk niet, want dan zou je een ongedaanmaking van een ongedaanmaking hebben die niet meer klopt.
*/
if ongedaanTeMakenRegistratie.IsOngedaanmaking() {
// voor nu: stop
c.JSON(http.StatusBadRequest, gin.H{"error": "Ongedaan maken van een ongedaanmaking is nog niet mogelijk"})
return
}
/* MAAK NU ONGEDAAN (het betreft een registratie of correctie, beide functioneel gelijk, denk ik)
zoek de wijzigingen onder reg x op in de database
- voor elke wijziging: bepaal of het een opvoer of afvoer is, en welke representatie het betreft
- als het een opvoer is, dan moet het opvoertijdstip weer worden verwijderd uit het representatie record.
(let op: dit is NIET afvoeren, maar zoiets als ont-opvoeren!)
- als het een afvoer is, dan moet deze afvoer worden leeggemaakt in het representatie record (ont-afvoeren?)
(zo is het record weer geldig, of actueel geworden)
*/
for _, wijziging := range wijzigingenOnderTeOngedaanMakenRegistratie {
// als opvoer, dan ont-opvoeren
switch wijziging.Wijzigingstype {
case model.WijzigingstypeOpvoer:
if err := handleRepresentatieOntOpvoer(c, tx, wijziging); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("Fout bij ont-opvoeren van representatie: %v", err)})
return
}
case model.WijzigingstypeAfvoer:
if err := handleRepresentatieOntAfvoer(c, tx, wijziging); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("Fout bij ont-afvoeren van representatie: %v", err)})
return
}
}
}
// Markeer de ongedaan gemaakte registratie en al haar wijzigingen als afgeleid "ongedaan gemaakt".
if _, err = tx.NewUpdate().
Table("registratie").
Set("is_ongedaan_gemaakt = ?", true).
Where("id = ?", ongedaanTeMakenRegistratie.ID).
Exec(c.Request.Context()); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("Fout bij markeren van registratie %d als ongedaan gemaakt: %v", ongedaanTeMakenRegistratie.ID, err)})
return
}
if _, err = tx.NewUpdate().
Table("wijziging").
Set("is_ongedaan_gemaakt = ?", true).
Where("registratie_id = ?", ongedaanTeMakenRegistratie.ID).
Exec(c.Request.Context()); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("Fout bij markeren van wijzigingen onder registratie %d als ongedaan gemaakt: %v", ongedaanTeMakenRegistratie.ID, err)})
return
}
}
/*
// Registratie, Correctie, Ongedaanmaking
type Registratie struct {
ID int64 `bun:"id,pk,autoincrement"` // auto-increment ID van de registratie
Registratietype RegistratietypeEnum // Registratie, Correctie, Ongedaanmaking
Tijdstip time.Time // Het tijdstip van de registratie, correctie of ongedaanmaking
Opmerking *string // optioneel veld voor extra informatie
CorrigeertRegistratieID *int64 // bij correcties: verwijzing naar de registratie die gecorrigeerd wordt
MaaktOngedaanRegistratieID *int64 // bij ongedaanmakings: verwijzing naar de registratie die ongedaan wordt gemaakt
}
*/
/* check of er een param "ID" is meegegeven in de URL
dit is dan de ID van de entiteit waarop de registratie betrekking heeft,
en die we kunnen gebruiken voor:
- Afvoer van de gehele entiteit (in dat geval is deze ID gelijk aan de ID van de entiteit in de opvoer)
- wijziging op een of meer van de gegevenselementen van de entiteit (in dat geval is deze ID ook gelijk aan de ID van de entiteit,
en waarnaar het gegevenselement verwijst via haar (bijv.) a_ID of B_ID veld.
In de database is dit de FK naar de entiteit-tabel.
- Bij correctie van een bestaande registratie (in dat geval is deze ID ook gelijk aan de ID van de entiteit).
*/
if c.Param("id") != "" {
// we slaan deze ID op in de context zodat we er later bij kunnen
c.Set("entiteitID", c.Param("id"))
}
// TODO: hier komt de nieuwe aanpak van registratie, waarbij we de registratie en wijziging(en) in één endpoint verwerken
// we kunnen hierbij gebruik maken van de "entiteitID" param in de URL (optioneel) en/of de IDs in de opvoer/afvoer van de wijziging(en)
// om te bepalen op welke entiteit en/of gegevenselementen de registratie betrekking heeft
// Step 2: Process each wijziging
for _, wijziging := range request.Wijzigingen {
var rep *model.RepresentatiePlusNaam
if wijziging.Opvoer != nil {
rep = wijziging.Opvoer // geen specifieke representatie verwacht; daar dealen we later wel mee
} else if wijziging.Afvoer != nil {
rep = wijziging.Afvoer // geen specifieke representatie verwacht; daar dealen we later wel mee
}
// TEST: print recursief de representatie, inclusief onderliggende gegevenselementen/relaties
if debugLogsEnabled() {
if rep != nil && rep.Representatie != nil {
fmt.Printf("HANDLER: representatienaam=%s veldnaam=%s\n%s", rep.Representatienaam, rep.Veldnaam, model.RepresentatieToString(rep.Representatie))
} else {
fmt.Println("HANDLER: geen representatie aanwezig in wijziging")
}
}
if rep == nil || rep.Representatie == nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "wijziging bevat geen representatie"})
return
}
temporalRep, ok := rep.Representatie.(model.FormeleRepresentatie)
if !ok {
c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("representatie %T ondersteunt geen opvoer/afvoer interface", rep.Representatie)})
return
}
// process de WIJZIGING
// kijk naar het metatype van de representatie
// als opvoer iets anders dan afvoer
// indien correctie of ongedaanmaking ook andere logica
// Handle REGISTRATIE / OPVOER scenario
switch true {
// OPVOER scenario's
case wijziging.Opvoer != nil:
if err := handleRepresentatieOpvoer(c, tx, request.Registratie,
"", "", rep.Representatienaam, temporalRep); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to handle opvoer van %s: %v", rep.Representatienaam, err)})
return
}
// AFVOER scenario's
case wijziging.Afvoer != nil:
if err := handleRepresentatieAfvoer(c, tx, registratieID, registratieTijdstip,
"", "", rep.Representatienaam, temporalRep); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to handle afvoer van %s: %v", rep.Representatienaam, err)})
return
}
}
}
elapsedMs := time.Since(start).Milliseconds()
responseStatus := http.StatusCreated
responsePayload := gin.H{
"message": fmt.Sprintf("De registratie %d is succesvol verwerkt op %s in %d ms", registratieID, registratieTijdstip, elapsedMs),
"registratie_id": registratieID,
"registratieId": registratieID,
"tijdstip": registratieTijdstip,
"wijzigingen": request.Wijzigingen,
}
responseBodyJSON, err := json.Marshal(responsePayload)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to serialize response body for audit: %v", err)})
return
}
request.Registratie.ResponseCode = &responseStatus
request.Registratie.ResponseBody = responseBodyJSON
request.Registratie.DurationMs = &elapsedMs
if _, err = tx.NewUpdate().
Model(&request.Registratie).
Column("response_code", "response_body", "duration_ms").
Where("id = ?", registratieID).
Exec(c.Request.Context()); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to update registratie audit fields: %v", err)})
return
}
// Commit transaction
if err := tx.Commit(); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Sprintf("failed to commit transaction: %v", err)})
return
}
committed = true
// Succes response inclusief de gewijzigde gegevens
c.JSON(responseStatus, responsePayload)
}
}
package handlers
import (
"database/sql"
"fmt"
"reflect"
"strconv"
"strings"
"time"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/gin-gonic/gin"
"github.com/uptrace/bun"
)
// handleRepresentatieOntOpvoer maakt een eerdere opvoer ongedaan door opvoer weer leeg te maken.
// De Wijziging bevat string-ID's; daarom converteren we ID-waarden eerst naar het kolomtype uit de metaregistry/DBFactory.
func handleRepresentatieOntOpvoer(c *gin.Context, tx bun.Tx, wijziging model.Wijziging) error {
typeName := wijziging.Representatienaam
targetIDRaw := wijziging.RepresentatieID
// Bij opvoer van een entiteit worden representatienaam/representatieID leeg opgeslagen;
// gebruik dan entiteitnaam/entiteitID als verwijzing naar het te herstellen record.
if typeName == "" {
typeName = wijziging.Entiteitnaam
targetIDRaw = wijziging.EntiteitID
}
if typeName == "" || targetIDRaw == "" {
return fmt.Errorf("HANDLER: ont-opvoer mist type of ID in wijziging %d", wijziging.ID)
}
meta, ok := model.MetaRegistry.GetTypeMeta(typeName)
if !ok {
return fmt.Errorf("HANDLER: onbekend type voor ont-opvoer: %s", typeName)
}
typedID, err := parseStringNaarKolomType(meta, meta.IDKolom, targetIDRaw)
if err != nil {
return fmt.Errorf("HANDLER: ongeldige ID voor ont-opvoer (%s.%s=%q): %v", meta.Tabelnaam, meta.IDKolom, targetIDRaw, err)
}
query := tx.NewUpdate().
Table(meta.Tabelnaam).
Set("opvoer = NULL").
Where(fmt.Sprintf("%s = ?", meta.IDKolom), typedID)
// Voor typen met PFK is de ID vaak alleen uniek binnen de bovenliggende entiteit.
if meta.HeeftPFK {
if meta.EntiteitIDKolom == "" {
return fmt.Errorf("HANDLER: type %s heeft PFK maar geen EntiteitIDKolom", meta.Typenaam)
}
if wijziging.EntiteitID == "" {
return fmt.Errorf("HANDLER: ont-opvoer voor %s vereist entiteitID in wijziging", meta.Typenaam)
}
typedEntiteitID, err := parseStringNaarKolomType(meta, meta.EntiteitIDKolom, wijziging.EntiteitID)
if err != nil {
return fmt.Errorf("HANDLER: ongeldige entiteitID voor ont-opvoer (%s.%s=%q): %v", meta.Tabelnaam, meta.EntiteitIDKolom, wijziging.EntiteitID, err)
}
query = query.Where(fmt.Sprintf("%s = ?", meta.EntiteitIDKolom), typedEntiteitID)
}
result, err := query.Exec(c.Request.Context())
if err != nil {
return fmt.Errorf("HANDLER: ont-opvoer update mislukt voor %s: %v", meta.Typenaam, err)
}
rows, err := result.RowsAffected()
if err == nil && rows == 0 {
return fmt.Errorf("HANDLER: ont-opvoer vond geen record voor %s met sleutel uit wijziging %d", meta.Typenaam, wijziging.ID)
}
return nil
}
// handleRepresentatieOntAfvoer maakt een eerdere afvoer ongedaan door afvoer weer leeg te maken.
func handleRepresentatieOntAfvoer(c *gin.Context, tx bun.Tx, wijziging model.Wijziging) error {
typeName := wijziging.Representatienaam
targetIDRaw := wijziging.RepresentatieID
if typeName == "" {
typeName = wijziging.Entiteitnaam
targetIDRaw = wijziging.EntiteitID
}
if typeName == "" || targetIDRaw == "" {
return fmt.Errorf("HANDLER: ont-afvoer mist type of ID in wijziging %d", wijziging.ID)
}
meta, ok := model.MetaRegistry.GetTypeMeta(typeName)
if !ok {
return fmt.Errorf("HANDLER: onbekend type voor ont-afvoer: %s", typeName)
}
typedID, err := parseStringNaarKolomType(meta, meta.IDKolom, targetIDRaw)
if err != nil {
return fmt.Errorf("HANDLER: ongeldige ID voor ont-afvoer (%s.%s=%q): %v", meta.Tabelnaam, meta.IDKolom, targetIDRaw, err)
}
query := tx.NewUpdate().
Table(meta.Tabelnaam).
Set("afvoer = NULL").
Where(fmt.Sprintf("%s = ?", meta.IDKolom), typedID)
if meta.HeeftPFK {
if meta.EntiteitIDKolom == "" {
return fmt.Errorf("HANDLER: type %s heeft PFK maar geen EntiteitIDKolom", meta.Typenaam)
}
if wijziging.EntiteitID == "" {
return fmt.Errorf("HANDLER: ont-afvoer voor %s vereist entiteitID in wijziging", meta.Typenaam)
}
typedEntiteitID, err := parseStringNaarKolomType(meta, meta.EntiteitIDKolom, wijziging.EntiteitID)
if err != nil {
return fmt.Errorf("HANDLER: ongeldige entiteitID voor ont-afvoer (%s.%s=%q): %v", meta.Tabelnaam, meta.EntiteitIDKolom, wijziging.EntiteitID, err)
}
query = query.Where(fmt.Sprintf("%s = ?", meta.EntiteitIDKolom), typedEntiteitID)
}
result, err := query.Exec(c.Request.Context())
if err != nil {
return fmt.Errorf("HANDLER: ont-afvoer update mislukt voor %s: %v", meta.Typenaam, err)
}
rows, err := result.RowsAffected()
if err == nil && rows == 0 {
return fmt.Errorf("HANDLER: ont-afvoer vond geen record voor %s met sleutel uit wijziging %d", meta.Typenaam, wijziging.ID)
}
return nil
}
/*
===================== GENERIEK===========================
*/
/*
==== STANDAARD OPVOER ROUTINE ======
handleRepresentatieOpvoer verwerkt opvoer via de metaregistry.
*/
func handleRepresentatieOpvoer(c *gin.Context, tx bun.Tx, registratie model.Registratie,
entiteitnaam string, entiteitID string, representatienaam string, representatie model.FormeleRepresentatie) error {
meta, ok := model.MetaRegistry.GetTypeMeta(representatienaam)
if !ok {
return fmt.Errorf("HANDLER: onbekend type voor opvoer: %s", representatienaam)
}
/*
Eerste check moet zijn of het een correctie betreft. (N.B> dit is de opvoer routine)
Indien correctie:
- Indien Entiteit: dan betekent dat dit de betreffende entiteit is,
waarvan onderliggende gegevenselementen/relaties worden gecorrigeerd,
maar die zelf niet wordt gecorrigeerd (m.u.v. materiele tijd, maar dat zit nog niet in deze versie)
- de gecorrigeeerde rep (altijd een GE of REL trouwens) opzoeken in de DB (op basis van ID in wijziging record)
- reeds afgevoerd? (want dan mag er niet meer gecorrigeerd worden) -> foutmelding en transactie afbreken
- de rep afvoeren en wijziging aanmaken voor de afvoer
- N.B.: de gecorrigeerde rep teruggeven in de response is lastig en doen we nu niet
- de nieuwe gecorrigeerde rep opvoeren (deze krijgt een nieuw ID!) en wijziging aanmaken voor de opvoer
- verhaal over enkelvoudige voorgangers gaat ook niet op bij correctie!
*/
if debugLogsEnabled() {
fmt.Printf("HANDLER (meta opvoer): registratietype: %s\n", registratie.Registratietype)
}
/* ==== CORRECTIE ---- */
if registratie.IsCorrectie() && meta.Metatype != model.MetatypeEntiteit {
// get huidige waarde van het gegevenselement op basis van ID in wijziging record
huidigeRep, err := haalRepresentatieUitDB(c, tx, meta, representatie.GetID())
if err != nil {
return err
}
if debugLogsEnabled() {
fmt.Printf("HANDLER (meta opvoer): correctie: opgehaalde te corrigeren representatie (type=%s, id=%v)\n%s", representatienaam, representatie.GetID(), model.RepresentatieToString(huidigeRep))
}
// indien al afgevoerd, dan mag er niet meer gecorrigeerd worden
if huidigeRep.GetAfvoer() != nil {
return fmt.Errorf("HANDLER: kan %s met ID %v niet corrigeren, want deze is al afgevoerd op %v", representatienaam, representatie.GetID(), huidigeRep.GetAfvoer())
}
// voer huidige representatie af en maak wijziging record aan
if err := handleRepresentatieAfvoer(c, tx, registratie.ID, registratie.Tijdstip, entiteitnaam, entiteitID, representatienaam, huidigeRep); err != nil {
return fmt.Errorf("HANDLER: failed to afvoer existing %s for correction: %v", representatienaam, err)
}
// voer nieuwe representatie op en maak wijziging record aan
// -->>> code verderop wordt gebruikt!!!
// maak wel eerst de ID leeg
representatie.ClearID() // zorg dat er een nieuwe ID wordt toegekend bij het opvoeren van de gecorrigeerde versie
}
/* ======== GEWONE WIJZIGING, GEEN CORRECTIE ===========
Indien geen entiteit:
- indien ENKELVOUDIG:
- zoek naar actieve (wel opvoer en geen afvoer) dezelfde gegevenselementen/relaties bij deze entiteit
(op basis van de ID van de entiteit in het gegevenselement/relatie record)
- als er één is: sluit deze af (update afvoer veld) en maak wijziging record aan
- als er meer dan één is: dat is een fout, want er mag maar één actief gegevenselement/relatie zijn bij enkelvoudig voorkomen
- -----> foutmelding geven en transactie afbreken. <------
- vinden: bovenliggende tabel...
*/
// Niet indien correctie
if registratie.IsRegistratie() && meta.Metatype != model.MetatypeEntiteit && meta.Momentvoorkomen == model.Enkelvoudig {
if err := sluitActieveEnkelvoudigeVoorgangersAf(c, tx, registratie.ID, registratie.Tijdstip, representatienaam, representatie, meta); err != nil {
return err
}
}
/* ===== BEIDE, MAAR SKIP DE ENTITEIT BIJ CORRECTIE ========
Verder is de code voor registratie en correctie gelijk
*/
if !(registratie.IsCorrectie() && meta.Metatype == model.MetatypeEntiteit) {
if meta.Metatype != model.MetatypeEntiteit {
// Zorg dat we geen gegevenselement/relatie toevoegen aan een afgevoerde entiteit.
var err error
entiteitnaam, entiteitID, err = vindEntiteitContext(entiteitnaam, entiteitID, representatienaam, representatie, meta)
if err != nil {
return err
}
if err := checkBovenliggendeEntiteitActief(c, tx, entiteitnaam, entiteitID); err != nil {
return err
}
}
// Alleen ClearID() als de DB het ID toekent via autoincrement (RelatieveAutoincrement=true).
// Entiteiten hebben een door de gebruiker opgegeven ID en mogen niet worden leeggemaakt.
if meta.RelatieveAutoincrement {
representatie.ClearID()
}
representatie.SetOpvoer(®istratie.Tijdstip)
_, err := tx.NewInsert().
Model(representatie).
Exec(c.Request.Context())
if err != nil {
return fmt.Errorf("HANDLER: failed to insert %s: %v", representatienaam, err)
}
// ** entiteit **
if meta.Metatype == model.MetatypeEntiteit {
entiteitnaam = representatienaam
entiteitID = fmt.Sprint(representatie.GetID())
if err := persisteerWijziging(c, tx, model.WijzigingstypeOpvoer, registratie.ID,
representatienaam, fmt.Sprint(representatie.GetID()), "", "", registratie.Tijdstip); err != nil {
return err
}
} else {
// ** Geen entiteit **
if err := persisteerWijziging(c, tx, model.WijzigingstypeOpvoer, registratie.ID,
entiteitnaam, entiteitID, representatienaam, fmt.Sprint(representatie.GetID()), registratie.Tijdstip); err != nil {
return err
}
}
}
/*
RECURSIE: Indien onderliggend gegevenselementen/relaties (typisch bij entiteiten):
*/
if meta.Metatype == model.MetatypeEntiteit {
onderliggendeRepresentaties, ok := representatie.(model.HeeftOnderliggendeGegevenselementen)
if !ok {
return fmt.Errorf("HANDLER: voor type %s vind ik geen onderliggende gegevenselementen in de metamap", representatienaam)
}
for _, onderliggende := range onderliggendeRepresentaties.GeefOnderliggendeGegevenselementen() {
if err := handleRepresentatieOpvoer(c, tx, registratie, entiteitnaam, entiteitID, onderliggende.Typenaam, onderliggende.Representatie); err != nil {
return err
}
}
}
return nil
}
func handleRepresentatieAfvoer(c *gin.Context, tx bun.Tx, registratieID int64, afvoerTijdstip time.Time,
entiteitnaam string, entiteitID string, representatienaam string, representatie model.FormeleRepresentatie) error {
/* Scenario 1: Afvoer van hele entiteit met eventueel onderliggende gegevenselementen en/of relaties
- eerst 'de entiteit afvoeren' (i.e.: het afgeleide veld "afvoer" UPDATEN in de DB)
- en het bijbehorende wijziging (afvoer) record maken
- itereren over onderliggende gegevenselementen/relaties en die ook afvoeren (met eigen wijziging records)
* Scenario 2: Afvoer van individuele gegevenselementen/relaties
- alleen dat gegevenselement/relatie afvoeren, zonder dat de hele entiteit wordt aangeraakt
- ook hier moet een wijziging record worden gemaakt
- een reeds afgevoerde representatie mag niet nogmaals worden afgevoerd,
dus eerst wordt gecheckt of deze al is afgevoerd, en indien ja, dan foutmelding en transactie afbreken.
*/
meta, ok := model.MetaRegistry.GetTypeMeta(representatienaam)
if !ok {
return fmt.Errorf("HANDLER: onbekend type voor afvoer: %s", representatienaam)
}
// een reeds afgevoerde representatie mag niet nogmaals worden afgevoerd, dus eerst checken of deze al is afgevoerd, en indien ja, dan foutmelding en transactie afbreken.
huidigeRep, err := haalRepresentatieUitDB(c, tx, meta, representatie.GetID())
if err != nil {
return err
}
if huidigeRep.GetAfvoer() != nil {
return fmt.Errorf("HANDLER: kan %s met ID %v niet afvoeren, want deze is al afgevoerd op %v", representatienaam, representatie.GetID(), huidigeRep.GetAfvoer())
}
if meta.Metatype != model.MetatypeEntiteit {
if err := updateAfvoerByID(c, tx, meta, representatie.GetID(), afvoerTijdstip); err != nil {
return err
}
// vind de bovenliggende entiteit en ID op basis van de representatie en de metamap voor in het wijziging record
entiteitnaam, entiteitID, err = vindEntiteitContext(entiteitnaam, entiteitID, representatienaam, huidigeRep, meta)
if err != nil {
return err
}
return persisteerWijziging(c, tx, model.WijzigingstypeAfvoer, registratieID,
entiteitnaam, entiteitID, representatienaam, fmt.Sprint(representatie.GetID()), afvoerTijdstip)
}
entiteitnaam = representatienaam
entiteitID = fmt.Sprint(representatie.GetID())
// ENTITEIT AFVOER
if err := updateAfvoerByID(c, tx, meta, representatie.GetID(), afvoerTijdstip); err != nil {
return err
}
if err := persisteerWijziging(c, tx, model.WijzigingstypeAfvoer, registratieID,
entiteitnaam, entiteitID, "", "", afvoerTijdstip); err != nil {
return err
}
// nodig omdat nu alle gegevenselementen/relaties van een entiteit een int ID_NAAR_ENTITEIT veld hebben?
entiteitIDInt, ok := anyNaarInt(representatie.GetID()) // hulpfunctie om de ID als int te krijgen, ongeacht het type
if !ok {
return fmt.Errorf("HANDLER: entiteit ID is geen int voor %s", representatienaam)
}
// Doorloop onderliggende gegevenselementen/relaties en voer die ook af (recursief)
for _, rel := range meta.OnderliggendeGegevenselementen {
childMeta, ok := model.MetaRegistry.GetTypeMeta(rel.Doeltype)
if !ok {
return fmt.Errorf("HANDLER: unknown related type: %s", rel.Doeltype)
}
fkColumn := childMeta.EntiteitIDKolom
if fkColumn == "" {
return fmt.Errorf("HANDLER: no entity id column for %s", childMeta.Typenaam)
}
activeIDs, err := haalActieveIDsGegevenselementUitDB(c, tx, childMeta, fkColumn, entiteitIDInt)
if err != nil {
return err
}
for _, id := range activeIDs {
if err := updateAfvoerByID(c, tx, childMeta, id, afvoerTijdstip); err != nil {
return err
}
if err := persisteerWijziging(c, tx, model.WijzigingstypeAfvoer, registratieID,
entiteitnaam, entiteitID, childMeta.Typenaam, fmt.Sprint(id), afvoerTijdstip); err != nil {
return err
}
}
}
return nil
}
func updateAfvoerByID(c *gin.Context, tx bun.Tx, meta model.TypeMeta, id any, afvoerTijdstip time.Time) error {
_, err := tx.NewUpdate().
Table(meta.Tabelnaam).
Set("afvoer = ?", afvoerTijdstip).
Where(fmt.Sprintf("%s = ?", meta.IDKolom), id).
Exec(c.Request.Context())
if err != nil {
return fmt.Errorf("HANDLER: failed to update %s afvoer: %v", meta.Typenaam, err)
}
return nil
}
func haalRepresentatieUitDB(c *gin.Context, tx bun.Tx, meta model.TypeMeta, id any) (model.FormeleRepresentatie, error) {
if isZeroID(id) {
return nil, fmt.Errorf("HANDLER: lege ID voor %s", meta.Typenaam)
}
if meta.DBFactory == nil {
return nil, fmt.Errorf("HANDLER: DBFactory ontbreekt voor type %s", meta.Typenaam)
}
repAny := meta.DBFactory()
rep, ok := repAny.(model.FormeleRepresentatie)
if !ok {
return nil, fmt.Errorf("HANDLER: DBFactory voor type %s levert geen FormeleRepresentatie (kreeg %T)", meta.Typenaam, repAny)
}
err := tx.NewSelect().
Model(rep).
Where(fmt.Sprintf("%s = ?", meta.IDKolom), id).
Limit(1).
Scan(c.Request.Context())
if err != nil {
if err == sql.ErrNoRows {
return nil, fmt.Errorf("HANDLER: geen %s gevonden met %s=%v", meta.Typenaam, meta.IDKolom, id)
}
return nil, fmt.Errorf("HANDLER: ophalen van %s met %s=%v mislukt: %v", meta.Typenaam, meta.IDKolom, id, err)
}
return rep, nil
}
func haalActieveIDsGegevenselementUitDB(c *gin.Context, tx bun.Tx, meta model.TypeMeta, fkColumn string, entiteitID int) ([]int, error) {
ids := make([]int, 0)
query := tx.NewSelect().
Table(meta.Tabelnaam).
Column(meta.IDKolom).
Where(fmt.Sprintf("%s = ?", fkColumn), entiteitID).
Where("opvoer IS NOT NULL").
Where("afvoer IS NULL")
if err := query.Scan(c.Request.Context(), &ids); err != nil && err != sql.ErrNoRows {
return nil, fmt.Errorf("HANDLER: failed to query active %s records: %v", meta.Typenaam, err)
}
return ids, nil
}
/*
===== Maak wijziging aan in wijzigingstabel ======
*/
func persisteerWijziging(c *gin.Context, tx bun.Tx, wijzigingstype model.WijzigingstypeEnum,
registratieID int64, entiteitnaam string, entiteitID string,
representatienaam string, representatieID string, registratietijdstip time.Time) error {
wijziging := model.Wijziging{
Wijzigingstype: wijzigingstype,
RegistratieID: registratieID,
Entiteitnaam: entiteitnaam,
EntiteitID: entiteitID,
Representatienaam: representatienaam,
RepresentatieID: representatieID,
Tijdstip: registratietijdstip, //afgeleid van registratie tijdstip
}
_, err := tx.NewInsert().
Model(&wijziging).
Exec(c.Request.Context())
if err != nil {
return fmt.Errorf("failed to insert wijziging: %v", err)
}
return nil
}
func anyNaarInt(v any) (int, bool) {
switch value := v.(type) {
case int:
return value, true
case int8:
return int(value), true
case int16:
return int(value), true
case int32:
return int(value), true
case int64:
return int(value), true
case uint:
return int(value), true
case uint8:
return int(value), true
case uint16:
return int(value), true
case uint32:
return int(value), true
case uint64:
return int(value), true
default:
return 0, false
}
}
func vindEntiteitContext(entiteitnaam string, entiteitID string, representatienaam string,
representatie model.FormeleRepresentatie, meta model.TypeMeta) (string, string, error) {
if entiteitnaam == "" {
bovenliggendeRelatieMeta, ok := model.MetaRegistry.GetBovenliggendeRelatieMeta(representatienaam)
if !ok {
return "", "", fmt.Errorf("HANDLER: geen bovenliggende entiteit gevonden voor type %s", representatienaam)
}
entiteitnaam = bovenliggendeRelatieMeta.ParentType.Typenaam
}
if entiteitID == "" {
fkColumn := meta.EntiteitIDKolom
if fkColumn == "" {
return "", "", fmt.Errorf("HANDLER: geen entiteit FK-kolom geconfigureerd voor type %s", representatienaam)
}
afgeleideEntiteitID, err := haalIntWaardeVoorKolomUitRepresentatie(representatie, fkColumn)
if err != nil {
return "", "", fmt.Errorf("HANDLER: kon entiteitID niet afleiden voor %s: %v", representatienaam, err)
}
entiteitID = fmt.Sprint(afgeleideEntiteitID)
}
return entiteitnaam, entiteitID, nil
}
func checkBovenliggendeEntiteitActief(c *gin.Context, tx bun.Tx, entiteitnaam string, entiteitID string) error {
entiteitMeta, ok := model.MetaRegistry.GetTypeMeta(entiteitnaam)
if !ok {
return fmt.Errorf("HANDLER: geen meta gevonden voor bovenliggende entiteit %s", entiteitnaam)
}
var entityIDAny any = entiteitID
if intID, err := strconv.Atoi(entiteitID); err == nil {
entityIDAny = intID
}
entiteitRep, err := haalRepresentatieUitDB(c, tx, entiteitMeta, entityIDAny)
if err != nil {
return err
}
if entiteitRep.GetAfvoer() != nil {
return fmt.Errorf("HANDLER: kan %s niet opvoeren, want bovenliggende entiteit %s met ID %s is afgevoerd op %v", entiteitnaam, entiteitnaam, entiteitID, entiteitRep.GetAfvoer())
}
return nil
}
func sluitActieveEnkelvoudigeVoorgangersAf(c *gin.Context, tx bun.Tx, registratieID int64, registratietijdstip time.Time,
representatienaam string, representatie model.FormeleRepresentatie, meta model.TypeMeta) error {
if meta.Metatype == model.MetatypeEntiteit || meta.Momentvoorkomen != model.Enkelvoudig {
return nil
}
bovenliggendeRelatieMeta, ok := model.MetaRegistry.GetBovenliggendeRelatieMeta(meta.Typenaam)
if !ok {
return fmt.Errorf("HANDLER: geen bovenliggende entiteit gevonden voor type %s", representatienaam)
}
fkColumn := meta.EntiteitIDKolom
if fkColumn == "" {
return fmt.Errorf("HANDLER: geen entiteit FK-kolom geconfigureerd voor type %s", representatienaam)
}
entiteitID, err := haalIntWaardeVoorKolomUitRepresentatie(representatie, fkColumn)
if err != nil {
return fmt.Errorf("HANDLER: kon bovenliggende %s id niet bepalen voor %s: %v", bovenliggendeRelatieMeta.ParentType.Typenaam, representatienaam, err)
}
if entiteitID == 0 {
return fmt.Errorf("HANDLER: bovenliggende %s id ontbreekt voor %s", bovenliggendeRelatieMeta.ParentType.Typenaam, representatienaam)
}
activeIDs, err := haalActieveIDsGegevenselementUitDB(c, tx, meta, fkColumn, entiteitID)
if err != nil {
return err
}
if len(activeIDs) > 1 {
return fmt.Errorf("HANDLER: meerdere actieve %s records gevonden voor %s=%d (enkelvoudig verwacht)",
representatienaam, fkColumn, entiteitID)
}
for _, id := range activeIDs {
if err := updateAfvoerByID(c, tx, meta, id, registratietijdstip); err != nil {
return err
}
if err := persisteerWijziging(c, tx, model.WijzigingstypeAfvoer, registratieID,
bovenliggendeRelatieMeta.ParentType.Typenaam, fmt.Sprint(entiteitID), representatienaam, fmt.Sprint(id), registratietijdstip); err != nil {
return err
}
}
return nil
}
func haalIntWaardeVoorKolomUitRepresentatie(representatie any, kolomnaam string) (int, error) {
value := reflect.ValueOf(representatie)
for value.Kind() == reflect.Pointer {
if value.IsNil() {
return 0, fmt.Errorf("lege representatie")
}
value = value.Elem()
}
if value.Kind() != reflect.Struct {
return 0, fmt.Errorf("representatie is geen struct")
}
typeInfo := value.Type()
normalizedKolom := normalizeVeldnaam(kolomnaam)
for i := 0; i < typeInfo.NumField(); i++ {
fieldType := typeInfo.Field(i)
fieldValue := value.Field(i)
if !fieldValue.CanInterface() {
continue
}
if normalizeVeldnaam(fieldType.Name) == normalizedKolom ||
normalizeVeldnaam(firstTagValue(fieldType.Tag.Get("json"))) == normalizedKolom ||
normalizeVeldnaam(firstTagValue(fieldType.Tag.Get("bun"))) == normalizedKolom {
result, ok := anyNaarInt(fieldValue.Interface())
if !ok {
return 0, fmt.Errorf("veld %s is geen integer", fieldType.Name)
}
return result, nil
}
}
return 0, fmt.Errorf("kolom %s niet gevonden in representatie", kolomnaam)
}
func firstTagValue(tag string) string {
if tag == "" {
return ""
}
parts := strings.Split(tag, ",")
return parts[0]
}
func normalizeVeldnaam(veld string) string {
return strings.ReplaceAll(strings.ToLower(strings.TrimSpace(veld)), "_", "")
}
func parseStringNaarKolomType(meta model.TypeMeta, kolomnaam string, raw string) (any, error) {
if strings.TrimSpace(raw) == "" {
return nil, fmt.Errorf("lege waarde")
}
kolomType, err := vindKolomTypeInDBModel(meta, kolomnaam)
if err != nil {
return nil, err
}
for kolomType.Kind() == reflect.Pointer {
kolomType = kolomType.Elem()
}
switch kolomType.Kind() {
case reflect.String:
return raw, nil
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
parsed, err := strconv.ParseInt(raw, 10, kolomType.Bits())
if err != nil {
return nil, err
}
v := reflect.New(kolomType).Elem()
v.SetInt(parsed)
return v.Interface(), nil
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
parsed, err := strconv.ParseUint(raw, 10, kolomType.Bits())
if err != nil {
return nil, err
}
v := reflect.New(kolomType).Elem()
v.SetUint(parsed)
return v.Interface(), nil
default:
return raw, nil
}
}
func vindKolomTypeInDBModel(meta model.TypeMeta, kolomnaam string) (reflect.Type, error) {
if meta.DBFactory == nil {
return nil, fmt.Errorf("DBFactory ontbreekt voor type %s", meta.Typenaam)
}
rep := meta.DBFactory()
rv := reflect.ValueOf(rep)
for rv.Kind() == reflect.Pointer {
if rv.IsNil() {
return nil, fmt.Errorf("lege DBFactory representatie voor type %s", meta.Typenaam)
}
rv = rv.Elem()
}
if rv.Kind() != reflect.Struct {
return nil, fmt.Errorf("DBFactory voor type %s levert geen struct", meta.Typenaam)
}
rt := rv.Type()
normalizedKolom := normalizeVeldnaam(kolomnaam)
for i := 0; i < rt.NumField(); i++ {
field := rt.Field(i)
if normalizeVeldnaam(field.Name) == normalizedKolom ||
normalizeVeldnaam(firstTagValue(field.Tag.Get("bun"))) == normalizedKolom ||
normalizeVeldnaam(firstTagValue(field.Tag.Get("json"))) == normalizedKolom {
return field.Type, nil
}
}
return nil, fmt.Errorf("kolom %s niet gevonden in DB model voor type %s", kolomnaam, meta.Typenaam)
}
package handlers
import (
"net/http"
"strconv"
"strings"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/gin-gonic/gin"
)
// PatchRegistratie updates mutable metadata fields on an existing registratie.
// For now we only support updating the optional 'opmerking'.
func PatchRegistratie() gin.HandlerFunc {
return func(c *gin.Context) {
idParam := strings.TrimSpace(c.Param("id"))
if idParam == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "ID must be present"})
return
}
registratieID, err := strconv.ParseInt(idParam, 10, 64)
if err != nil || registratieID <= 0 {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid registratie id"})
return
}
var payload map[string]any
if err := c.ShouldBindJSON(&payload); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
opmerkingRaw, ok := payload["opmerking"]
if !ok {
c.JSON(http.StatusBadRequest, gin.H{"error": "payload must include 'opmerking'"})
return
}
var opmerking *string
switch v := opmerkingRaw.(type) {
case nil:
opmerking = nil
case string:
trimmed := strings.TrimSpace(v)
if trimmed != "" {
opmerking = &trimmed
}
default:
c.JSON(http.StatusBadRequest, gin.H{"error": "'opmerking' must be a string or null"})
return
}
result, err := DB.NewUpdate().
Model(&model.Registratie{}).
Set("opmerking = ?", opmerking).
Where("id = ?", registratieID).
Exec(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
rowsAffected, err := result.RowsAffected()
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
if rowsAffected == 0 {
c.JSON(http.StatusNotFound, gin.H{"error": "registratie not found"})
return
}
var updated model.Registratie
if err := DB.NewSelect().Model(&updated).Where("id = ?", registratieID).Scan(c.Request.Context()); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, gin.H{
"message": "Registratie opmerking bijgewerkt",
"registratie": updated,
})
}
}
package handlers
import (
"net/http"
"os"
"github.com/gin-gonic/gin"
"github.com/uptrace/bun"
)
var DB *bun.DB
func HomePage(ctx *gin.Context) {
const rootIndexPath = "./web/root_index.html"
if _, err := os.Stat(rootIndexPath); err == nil {
ctx.File(rootIndexPath)
return
}
ctx.JSON(http.StatusOK, gin.H{
"message": "Welcome to the Bitemp Go API",
"viz": "/viz/react/",
"version": "/version",
"graphql": "/graphql/playground",
"vizSchema": "/api/viz/schema",
})
}
package handlers
import (
"net/http"
"github.com/gin-gonic/gin"
//"github.com/zaahidali/task_manager_api_with_bun/model" // we imported the model here
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
)
//var DB *bun.DB
func GetTests(ctx *gin.Context) {
// Create a slice to store the retrieved tests
var tests []model.Test
// Execute the database query to retrieve Tests using Go bun
err := DB.NewSelect().Model(&tests).Scan(ctx.Request.Context())
if err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
// Return the retrieved Tests in the response
ctx.JSON(http.StatusOK, gin.H{"Tests": tests})
}
func GetTest(c *gin.Context) {
testID := c.Param("id")
// Check if the test ID is empty
if testID == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "ID must be present"})
return
}
test := &model.Test{}
// Fetch specific record from the database using Go bun
err := DB.NewSelect().Model(test).Where("id = ?", testID).Scan(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
if test.ID == "" {
c.JSON(http.StatusNotFound, gin.H{"message": "Test not found"})
return
}
c.JSON(http.StatusOK, test)
}
func UpdateTest(ctx *gin.Context) {
testID := ctx.Param("id")
if testID == "" {
ctx.JSON(http.StatusNoContent, gin.H{"error": "ID must be present"})
return
}
updatedTest := &model.Test{}
// Bind JSON body to the updatedTest struct
if err := ctx.ShouldBindJSON(updatedTest); err != nil {
ctx.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
// Update the test record in the database using Go bun
_, err := DB.NewUpdate().Model(updatedTest).
Set("name = ?", updatedTest.Name).
Where("id = ?", testID).
Exec(ctx.Request.Context())
if err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
ctx.JSON(http.StatusOK, gin.H{"message": "Task updated"})
}
func RemoveTest(ctx *gin.Context) {
testID := ctx.Param("id")
test := &model.Test{}
// Delete specific test record from the database
res, err := DB.NewDelete().Model(test).Where("id = ?", testID).Exec(ctx.Request.Context())
if err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
rowsAffected, err := res.RowsAffected()
if err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
// Check if any rows were affected by the delete operation
if rowsAffected > 0 {
ctx.JSON(http.StatusOK, gin.H{"message": "Test removed"})
} else {
ctx.JSON(http.StatusNotFound, gin.H{"message": "Test not found"})
}
}
func AddTest(ctx *gin.Context) {
newTest := &model.Test{}
if err := ctx.ShouldBindJSON(&newTest); err != nil {
ctx.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
// Insert the new test record into the database
_, err := DB.NewInsert().Model(newTest).Exec(ctx.Request.Context())
if err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
ctx.JSON(http.StatusCreated, gin.H{"message": "Test created"})
}
package handlers
import (
"database/sql"
"errors"
"net/http"
"strconv"
"strings"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/gin-gonic/gin"
)
type vizEntiteitMaxIDResponse struct {
Typenaam string `json:"typenaam"`
IDKolom string `json:"idKolom"`
MaxID int `json:"maxId"`
NextID int `json:"nextId"`
}
func MaakVizEntiteitMaxIDHandler() gin.HandlerFunc {
return func(c *gin.Context) {
if DB == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "database not initialized"})
return
}
typeNaam := strings.TrimSpace(c.Param("typenaam"))
if typeNaam == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "type naam ontbreekt"})
return
}
meta, ok := model.MetaRegistry.GetTypeMeta(typeNaam)
if !ok {
c.JSON(http.StatusNotFound, gin.H{"error": "onbekend type"})
return
}
if meta.Metatype != model.MetatypeEntiteit {
c.JSON(http.StatusBadRequest, gin.H{"error": "type is geen entiteit"})
return
}
ids := make([]int, 0, 1)
err := DB.NewSelect().
Table(meta.Tabelnaam).
Column(meta.IDKolom).
OrderExpr(meta.IDKolom+" DESC").
Limit(1).
Scan(c.Request.Context(), &ids)
if err != nil {
// Geen rows is geen fout: dan is max 0 en next 1.
if !errors.Is(err, sql.ErrNoRows) {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
}
maxID := 0
if len(ids) > 0 {
maxID = ids[0]
}
nextID := maxID + 1
if raw := strings.TrimSpace(c.Query("atLeast")); raw != "" {
if minVal, convErr := strconv.Atoi(raw); convErr == nil && minVal > nextID {
nextID = minVal
}
}
c.JSON(http.StatusOK, vizEntiteitMaxIDResponse{
Typenaam: meta.Typenaam,
IDKolom: meta.IDKolom,
MaxID: maxID,
NextID: nextID,
})
}
}
package handlers
import (
"net/http"
"strconv"
"strings"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/gin-gonic/gin"
)
type vizRelatieSecondaireIDsResponse struct {
Typenaam string `json:"typenaam"`
SecondaireEntiteitType string `json:"secondaireEntiteitType"`
SecondaireEntiteitIDKolom string `json:"secondaireEntiteitIDKolom"`
IDs []int `json:"ids"`
}
// Leidt uit een FK-kolomnaam zoals "b_id" het entiteittype "B" af.
func entiteitTypeUitKolomnaam(kolomnaam string) string {
prefix := strings.ToUpper(strings.TrimSpace(strings.Split(kolomnaam, "_")[0]))
if prefix == "" {
return ""
}
return prefix
}
// Parse een positieve query-int met default en bovengrens (voor veilige API-calls).
func parsePositiveInt(c *gin.Context, name string, defaultValue int, maxValue int) (int, error) {
raw := strings.TrimSpace(c.Query(name))
if raw == "" {
return defaultValue, nil
}
v, err := strconv.Atoi(raw)
if err != nil || v <= 0 {
return 0, err
}
if v > maxValue {
v = maxValue
}
return v, nil
}
// MaakVizRelatieSecondaireIDsHandler levert suggesties voor secundaire entiteit-ID's
// bij een relatie-type. Dit wordt in de frontend gebruikt als dropdown-opties.
func MaakVizRelatieSecondaireIDsHandler() gin.HandlerFunc {
return func(c *gin.Context) {
if DB == nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "database not initialized"})
return
}
typeNaam := strings.TrimSpace(c.Param("typenaam"))
if typeNaam == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "type naam ontbreekt"})
return
}
relatieMeta, ok := model.MetaRegistry.GetTypeMeta(typeNaam)
if !ok {
c.JSON(http.StatusNotFound, gin.H{"error": "onbekend type"})
return
}
if relatieMeta.Metatype != model.MetatypeRelatie {
c.JSON(http.StatusBadRequest, gin.H{"error": "type is geen relatie"})
return
}
if strings.TrimSpace(relatieMeta.SecondaireEntiteitIDKolom) == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "relatie heeft geen secondaire entiteit-id kolom"})
return
}
// Limit voorkomt dat de endpoint per ongeluk te veel IDs terugstuurt.
limit, err := parsePositiveInt(c, "limit", 200, 2000)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "ongeldige limit parameter"})
return
}
secondaireEntiteitType := entiteitTypeUitKolomnaam(relatieMeta.SecondaireEntiteitIDKolom)
if secondaireEntiteitType == "" {
c.JSON(http.StatusInternalServerError, gin.H{"error": "kan secondaire entiteittype niet afleiden"})
return
}
secondaireMeta, ok := model.MetaRegistry.GetTypeMeta(secondaireEntiteitType)
if !ok || secondaireMeta.Metatype != model.MetatypeEntiteit {
c.JSON(http.StatusInternalServerError, gin.H{"error": "kan secondaire entiteitmeta niet vinden"})
return
}
ids := make([]int, 0)
// Alleen actieve (niet-afgevoerde) secondaire entiteiten aanbieden,
// zodat de UI niet naar afgesloten records linkt.
err = DB.NewSelect().
Table(secondaireMeta.Tabelnaam).
Column(secondaireMeta.IDKolom).
Distinct().
Where("afvoer IS NULL").
OrderExpr(secondaireMeta.IDKolom+" ASC").
Limit(limit).
Scan(c.Request.Context(), &ids)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, vizRelatieSecondaireIDsResponse{
Typenaam: relatieMeta.Typenaam,
SecondaireEntiteitType: secondaireEntiteitType,
SecondaireEntiteitIDKolom: relatieMeta.SecondaireEntiteitIDKolom,
IDs: ids,
})
}
}
package handlers
import (
"net/http"
"reflect"
"sort"
"strings"
"time"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/gin-gonic/gin"
)
var (
timeType = reflect.TypeOf(time.Time{})
dateType = reflect.TypeOf(model.Date{})
)
type vizSchemaChildDTO struct {
Rolnaam string `json:"rolnaam"`
JSONRolnaam string `json:"jsonRolnaam,omitempty"`
Doeltype string `json:"doeltype"`
Momentvoorkomen string `json:"momentvoorkomen"`
}
type vizSchemaTypeDTO struct {
Typenaam string `json:"typenaam"`
Description string `json:"description,omitempty"`
Metatype model.Metatype `json:"metatype"`
Kleur string `json:"kleur,omitempty"`
Veldnaam string `json:"veldnaam"`
Velden []vizSchemaFieldDTO `json:"velden,omitempty"`
Tabelnaam string `json:"tabelnaam"`
IDKolom string `json:"idKolom"`
IDAutoIncrement bool `json:"idAutoIncrement,omitempty"`
HeeftPFK bool `json:"heeftPFK"`
EntiteitIDKolom string `json:"entiteitIDKolom,omitempty"`
SecondaireEntiteitIDKolom string `json:"secondaireEntiteitIDKolom,omitempty"`
Momentvoorkomen string `json:"momentvoorkomen,omitempty"`
Onderliggende []vizSchemaChildDTO `json:"onderliggende,omitempty"`
}
type vizSchemaResponse struct {
Versie string `json:"versie"`
Types []vizSchemaTypeDTO `json:"types"`
}
type vizSchemaFieldDTO struct {
Naam string `json:"naam"`
Description string `json:"description,omitempty"`
Type string `json:"type"`
Format string `json:"format,omitempty"`
Enum []string `json:"enum,omitempty"`
Verplicht bool `json:"verplicht"`
AutoIncrement bool `json:"autoIncrement,omitempty"`
}
// hasBunOption controleert of een bun-struct-tag een bepaalde optie bevat (bijv. "autoincrement").
func hasBunOption(tag, option string) bool {
for _, part := range strings.Split(tag, ",") {
if strings.EqualFold(strings.TrimSpace(part), option) {
return true
}
}
return false
}
// parseJSONTag haalt veldnaam en omitempty-informatie uit een json-tag.
// skip=true betekent dat het veld niet naar de API moet (bijv. json:"-").
func parseJSONTag(tag string) (name string, hasOmitEmpty bool, skip bool) {
if tag == "-" {
return "", false, true
}
if tag == "" {
return "", false, false
}
parts := strings.Split(tag, ",")
name = strings.TrimSpace(parts[0])
for i := 1; i < len(parts); i++ {
if strings.TrimSpace(parts[i]) == "omitempty" {
hasOmitEmpty = true
break
}
}
if name == "-" {
return "", hasOmitEmpty, true
}
return name, hasOmitEmpty, false
}
func enumValuesFromSchemaTag(tag string) []string {
if tag == "" {
return nil
}
for _, part := range strings.Split(tag, ",") {
trimmed := strings.TrimSpace(part)
if !strings.HasPrefix(trimmed, "enum=") {
continue
}
rawValues := strings.Split(strings.TrimPrefix(trimmed, "enum="), "|")
values := make([]string, 0, len(rawValues))
for _, rawValue := range rawValues {
value := strings.TrimSpace(rawValue)
if value != "" {
values = append(values, value)
}
}
if len(values) > 0 {
return values
}
}
return nil
}
// schemaTypeVoorReflectType mapt Go-types op API-typen en optionele formats.
func schemaTypeVoorReflectType(t reflect.Type) (string, string) {
if t == nil {
return "string", ""
}
for t.Kind() == reflect.Ptr {
t = t.Elem()
}
isArray := false
for t.Kind() == reflect.Slice || t.Kind() == reflect.Array {
isArray = true
t = t.Elem()
for t.Kind() == reflect.Ptr {
t = t.Elem()
}
}
if t == timeType {
if isArray {
return "string", "array:date-time"
}
return "string", "date-time"
}
if t == dateType {
if isArray {
return "string", "array:date"
}
return "string", "date"
}
if meta, ok := model.MetaRegistry.GetTypeMeta(t.Name()); ok {
if isArray {
return meta.Typenaam, "array"
}
return meta.Typenaam, ""
}
switch t.Kind() {
case reflect.Bool:
if isArray {
return "boolean", "array"
}
return "boolean", ""
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
if isArray {
return "integer", "array"
}
return "integer", ""
case reflect.Float32:
if isArray {
return "number", "array:float32"
}
return "number", "float32"
case reflect.Float64:
if isArray {
return "number", "array:float64"
}
return "number", "float64"
case reflect.String:
if isArray {
return "string", "array"
}
return "string", ""
default:
if isArray {
return t.Name(), "array"
}
if t.Name() != "" {
return t.Name(), ""
}
return "string", ""
}
}
// reflectedVeldenVoorMeta leest de representatie-struct via reflectie uit
// en zet die om naar formuliervelden voor de frontend.
// Technische tijdvelden worden expliciet weggefilterd.
func reflectedVeldenVoorMeta(meta model.TypeMeta) []vizSchemaFieldDTO {
ignore := map[string]struct{}{
"opvoer": {},
"afvoer": {},
"aanvang": {},
"einde": {},
}
rep := meta.Factory()
if rep == nil {
return nil
}
t := reflect.TypeOf(rep)
if t.Kind() == reflect.Ptr {
t = t.Elem()
}
if t.Kind() != reflect.Struct {
return nil
}
velden := make([]vizSchemaFieldDTO, 0, t.NumField())
for i := 0; i < t.NumField(); i++ {
f := t.Field(i)
if f.PkgPath != "" {
// Alleen exported velden meenemen.
continue
}
name, hasOmitEmpty, skip := parseJSONTag(f.Tag.Get("json"))
if skip {
continue
}
if name == "" {
if f.Anonymous {
continue
}
name = strings.ToLower(f.Name)
}
if _, shouldSkip := ignore[strings.ToLower(name)]; shouldSkip {
continue
}
veldType, format := schemaTypeVoorReflectType(f.Type)
enum := enumValuesFromSchemaTag(f.Tag.Get("schema"))
description := strings.TrimSpace(f.Tag.Get("schema_desc"))
velden = append(velden, vizSchemaFieldDTO{
Naam: name,
Description: description,
Type: veldType,
Format: format,
Enum: enum,
Verplicht: !hasOmitEmpty,
AutoIncrement: hasBunOption(f.Tag.Get("bun"), "autoincrement"),
})
}
return velden
}
func momentvoorkomenNaarString(m model.Momentvoorkomen) string {
if m == model.Enkelvoudig {
return "enkelvoudig"
}
return "meervoudig"
}
func MaakVizSchemaHandler() gin.HandlerFunc {
return func(c *gin.Context) {
// Sorteer voor stabiele output (fijn voor frontend en tests).
typeNamen := make([]string, 0, len(model.MetaRegistry))
for typeNaam := range model.MetaRegistry {
typeNamen = append(typeNamen, typeNaam)
}
sort.Strings(typeNamen)
items := make([]vizSchemaTypeDTO, 0, len(typeNamen))
for _, typeNaam := range typeNamen {
meta, ok := model.MetaRegistry.GetTypeMeta(typeNaam)
if !ok {
continue
}
item := vizSchemaTypeDTO{
Typenaam: meta.Typenaam,
Description: meta.Description,
Metatype: meta.Metatype,
Kleur: meta.Kleur,
Veldnaam: meta.Veldnaam,
Velden: reflectedVeldenVoorMeta(meta),
Tabelnaam: meta.Tabelnaam,
IDKolom: meta.IDKolom,
IDAutoIncrement: meta.RelatieveAutoincrement,
HeeftPFK: meta.HeeftPFK,
EntiteitIDKolom: meta.EntiteitIDKolom,
SecondaireEntiteitIDKolom: meta.SecondaireEntiteitIDKolom,
}
if meta.Metatype != model.MetatypeEntiteit {
item.Momentvoorkomen = momentvoorkomenNaarString(meta.Momentvoorkomen)
}
if len(meta.OnderliggendeGegevenselementen) > 0 {
children := make([]vizSchemaChildDTO, 0, len(meta.OnderliggendeGegevenselementen))
for _, child := range meta.OnderliggendeGegevenselementen {
children = append(children, vizSchemaChildDTO{
Rolnaam: child.Rolnaam,
JSONRolnaam: child.JSONRolnaam,
Doeltype: child.Doeltype,
Momentvoorkomen: momentvoorkomenNaarString(child.Momentvoorkomen),
})
}
item.Onderliggende = children
}
items = append(items, item)
}
c.JSON(http.StatusOK, vizSchemaResponse{
Versie: "v1",
Types: items,
})
}
}
package main
import (
"context"
"database/sql"
"errors"
"fmt"
"net/url"
"os"
"strings"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
"github.com/uptrace/bun"
"github.com/uptrace/bun/dialect/pgdialect"
"github.com/uptrace/bun/driver/pgdriver"
"github.com/uptrace/bun/extra/bundebug"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/dbsetup"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/handlers"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/routes"
)
var commit = "dev"
var buildTime = "26 feb 2024"
func main() {
loadDotEnvIfPresent()
fmt.Println("Bitemp Go API Project")
fmt.Printf("build commit: %s, build time: %s\n", commit, buildTime)
dropTablesEnabled := isDropTablesEnabled()
fmt.Printf("admin drop tables enabled: %t\n", dropTablesEnabled)
if dropTablesEnabled && isProductionEnvironment() {
fmt.Println("WARNING: ALLOW_DROP_TABLES=true while running in production context")
}
// Establish a connection to the PostgreSQL database
db, err := connectToDatabase()
if err != nil {
fmt.Println("Failed to connect to the database:", err)
return
}
fmt.Println("Succesfully connected to the database.")
defer db.Close()
// Create the "tasks" table in the database if it doesn't exist
err = dbsetup.CreateTables(db)
if err != nil {
fmt.Println("Failed to create table:", err)
return
}
fmt.Println("Table(s) created successfully or they were already present.")
// Add a query hook for logging only when explicitly enabled.
if isBunDebugEnabled() {
db.AddQueryHook(bundebug.NewQueryHook(
bundebug.WithVerbose(true),
))
}
// Ping the database to test the connection
err = db.Ping()
if err != nil {
fmt.Println("Failed to connect to the database")
return
}
// Connection successful
fmt.Println("Succesfully connected to the database.")
handlers.DB = db
// Create router and register routes
router := NewRouter()
//run the server
router.Run()
}
func loadDotEnvIfPresent() {
err := godotenv.Load()
if err != nil {
fmt.Println("No .env file loaded (using existing environment variables)")
}
}
func isDropTablesEnabled() bool {
return os.Getenv("ALLOW_DROP_TABLES") == "true"
}
func isBunDebugEnabled() bool {
v := strings.ToLower(strings.TrimSpace(os.Getenv("BUNDEBUG")))
return v == "1" || v == "true" || v == "yes" || v == "on"
}
func isProductionEnvironment() bool {
if os.Getenv("APP_ENV") == "production" {
return true
}
return os.Getenv("GIN_MODE") == gin.ReleaseMode
}
// NewRouter creates and returns a Gin engine with all routes registered.
func NewRouter() *gin.Engine {
router := gin.Default()
//Homepage
router.GET("/", handlers.HomePage)
router.GET("/docs", handlers.DocsIndex)
router.GET("/docs/*filepath", handlers.DocsPage)
router.GET("/api/viz/schema", handlers.MaakVizSchemaHandler())
router.GET("/api/viz/entiteit/:typenaam/max-id", handlers.MaakVizEntiteitMaxIDHandler())
router.GET("/api/viz/relatie/:typenaam/secondaire-ids", handlers.MaakVizRelatieSecondaireIDsHandler())
router.Static("/viz", "./web")
// Version endpoint
router.GET("/version", func(c *gin.Context) {
c.JSON(200, gin.H{"commit": commit, "build_time": buildTime})
})
// GraphQL endpoint
router.GET("/graphql/playground", handlers.PlaygroundHandler())
router.POST("/graphql/query", handlers.GraphQLHandler())
router.GET("/graphql/query", handlers.GraphQLHandler())
// admin routes
router.DELETE("/admin/db/droptables/:password", handlers.DropTables)
router.POST("/admin/db/createtables", handlers.CreateTables)
//Add all functional routes
routes.AddRoutes(router)
return router
}
func connectToDatabase() (*bun.DB, error) {
// Get DSN from environment variable or use default
dsn := os.Getenv("DATABASE_URL")
if dsn == "" {
// Default DSN for local development
dsn = "postgres://postgres:1234@localhost:5432/bitemp_go_db_v05?sslmode=disable"
}
if isAutoCreateDatabaseEnabled() {
err := ensureDatabaseExists(dsn)
if err != nil {
return nil, err
}
}
sqldb := sql.OpenDB(pgdriver.NewConnector(pgdriver.WithDSN(dsn)))
db := bun.NewDB(sqldb, pgdialect.New())
return db, nil
}
func isAutoCreateDatabaseEnabled() bool {
v := strings.ToLower(strings.TrimSpace(os.Getenv("AUTO_CREATE_DATABASE")))
return v == "1" || v == "true" || v == "yes" || v == "on"
}
func ensureDatabaseExists(appDSN string) error {
databaseName, err := extractDatabaseNameFromDSN(appDSN)
if err != nil {
return err
}
adminDSN := strings.TrimSpace(os.Getenv("DATABASE_ADMIN_URL"))
if adminDSN == "" {
adminDSN, err = replaceDSNDatabase(appDSN, "postgres")
if err != nil {
return err
}
}
adminDB := sql.OpenDB(pgdriver.NewConnector(pgdriver.WithDSN(adminDSN)))
defer adminDB.Close()
ctx := context.Background()
var exists bool
err = adminDB.QueryRowContext(
ctx,
"SELECT EXISTS (SELECT 1 FROM pg_database WHERE datname = $1)",
databaseName,
).Scan(&exists)
if err != nil {
return fmt.Errorf("failed checking database %q existence: %w", databaseName, err)
}
if exists {
fmt.Printf("Database %q already exists.\n", databaseName)
return nil
}
_, err = adminDB.ExecContext(ctx, fmt.Sprintf("CREATE DATABASE %s", quoteIdentifier(databaseName)))
if err != nil {
return fmt.Errorf(
"failed creating database %q: %w (set DATABASE_ADMIN_URL with a user that has CREATEDB privilege)",
databaseName,
err,
)
}
fmt.Printf("Database %q created successfully.\n", databaseName)
return nil
}
func extractDatabaseNameFromDSN(dsn string) (string, error) {
parsed, err := url.Parse(dsn)
if err != nil {
return "", fmt.Errorf("invalid DATABASE_URL: %w", err)
}
databaseName := strings.TrimPrefix(parsed.Path, "/")
if strings.TrimSpace(databaseName) == "" {
return "", errors.New("DATABASE_URL must include a database name in the path")
}
return databaseName, nil
}
func replaceDSNDatabase(dsn string, databaseName string) (string, error) {
parsed, err := url.Parse(dsn)
if err != nil {
return "", fmt.Errorf("invalid DATABASE_URL: %w", err)
}
parsed.Path = "/" + strings.TrimPrefix(databaseName, "/")
return parsed.String(), nil
}
func quoteIdentifier(name string) string {
return `"` + strings.ReplaceAll(name, `"`, `""`) + `"`
}
package model
import (
"encoding/json"
"fmt"
)
/*
Algemene structs voor registratie requests (bitemporele registratie)
Dit is eigenlijk ook plumbing
*/
/*
RegistreerRequest is het request format voor POST /registreer/{entiteitnaam}s
(bijv. /registreer/as of /registreer/bs)
Het bevat de Registratie data en een lijst van Wijzigingen, waarbij elke Wijziging een opvoer of afvoer kan bevatten van een volledige entiteit of individuele gegevenselementen of relaties.
*/
type RegistreerRequest struct {
Registratie Registratie `json:"registratie"`
Wijzigingen []WijzigingRequest `json:"wijzigingen"`
}
type WijzigingRequest struct {
Opvoer *RepresentatiePlusNaam `json:"opvoer,omitempty"`
Afvoer *RepresentatiePlusNaam `json:"afvoer,omitempty"`
}
/*
De representatie (interface) plus velden voor:
- de type-naam van de representatie (A, B, Rel_A_B, A_U, A_V, B_X, B_Y)
- de JSON veldnaam in de request (a, b, rel_a_b, u, v, x, y)
Deze struct heeft een custom UnmarshalJSON functie die de JSON data inspecteert, de representatienaam en payload eruit haalt,
en op basis van de representatienaam de juiste struct (Full_A, Full_B, Rel_A_B, A_U, A_V, B_X of B_Y) unmarshal't.
De RepresentatiePlusNaam struct heeft ook helper methoden AsA() en AsB().
Deze proberen de representatie te casten naar een type dat geldig is voor A of B flow, geven een fout terug als dat niet mogelijk is.
Deze aanpak maakt het mogelijk om in de WijzigingRequest struct flexibele opvoer/afvoer velden te hebben
die verschillende soorten representaties kunnen bevatten,
terwijl we toch duidelijkheid hebben over wat er in die velden zit en hoe ermee om te gaan in de handlers.
*/
type RepresentatiePlusNaam struct {
Representatie Representatie `json:"-"`
Representatienaam string `json:"-"` // Type-naam (bijv. A, B, A_U, Rel_A_B)
Veldnaam string `json:"-"` // JSON veldnaam (bijv. a, b, u, rel_a_b)
}
func (rep RepresentatiePlusNaam) MarshalJSON() ([]byte, error) {
if rep.Representatie == nil {
return []byte("null"), nil
}
veldnaam := rep.Veldnaam
if veldnaam == "" && rep.Representatienaam != "" {
meta, ok := MetaRegistry.GetTypeMeta(rep.Representatienaam)
if ok {
veldnaam = meta.Veldnaam
}
}
if veldnaam == "" {
return nil, fmt.Errorf("cannot marshal representatie zonder veldnaam (typenaam=%s)", rep.Representatienaam)
}
return json.Marshal(map[string]Representatie{veldnaam: rep.Representatie})
}
func (rep *RepresentatiePlusNaam) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
return nil
}
var raw map[string]json.RawMessage
if err := json.Unmarshal(data, &raw); err != nil {
return err
}
if len(raw) != 1 {
return fmt.Errorf("Er mag in opvoer/afvoer maar één representatie aanwezig zijn, maar er zijn %d gevonden", len(raw))
}
for veldnaam, payload := range raw {
meta, ok := MetaRegistry.GetByVeldnaam(veldnaam)
if !ok {
return fmt.Errorf("unsupported representatie key '%s'", veldnaam)
}
representatie := meta.Factory()
if err := json.Unmarshal(payload, representatie); err != nil {
return err
}
rep.Representatienaam = meta.Typenaam
rep.Veldnaam = veldnaam
rep.Representatie = representatie
if debugLogsEnabled() {
fmt.Printf("MODELS: representatienaam=%s veldnaam=%s metatype=%s id=%v\n", meta.Typenaam, veldnaam, representatie.Metatype(), representatie.GetID())
}
}
return nil
}
func (rep *RepresentatiePlusNaam) AsA() (*OpvoerAfvoerA, error) {
if rep == nil || rep.Representatie == nil {
return nil, nil
}
switch value := rep.Representatie.(type) {
case *Full_A:
return &OpvoerAfvoerA{A: value}, nil
case *A_U:
return &OpvoerAfvoerA{U: value}, nil
case *A_V:
return &OpvoerAfvoerA{V: value}, nil
case *Rel_A_B:
return &OpvoerAfvoerA{Rel_A_B: value}, nil
default:
return nil, fmt.Errorf("representatie '%T' is not valid for A-flow", rep.Representatie)
}
}
func (rep *RepresentatiePlusNaam) AsB() (*OpvoerAfvoerB, error) {
if rep == nil || rep.Representatie == nil {
return nil, nil
}
switch value := rep.Representatie.(type) {
case *Full_B:
return &OpvoerAfvoerB{B: value}, nil
case *B_X:
return &OpvoerAfvoerB{X: value}, nil
case *B_Y:
return &OpvoerAfvoerB{Y: value}, nil
default:
return nil, fmt.Errorf("representatie '%T' is not valid for B-flow", rep.Representatie)
}
}
// OpvoerAfvoerA can contain either a full entity or individual data elements
type OpvoerAfvoerA struct {
// Voor opvoer/afvoer van hele entiteit A
A *Full_A `json:"a,omitempty"`
// Voor opvoer/afvoer van individuele gegevenselementen
U *A_U `json:"u,omitempty"`
V *A_V `json:"v,omitempty"`
// Voor opvoer/afvoer van relaties
Rel_A_B *Rel_A_B `json:"rel_a_b,omitempty"`
// Voor batch opvoer/afvoer van meerdere gegevenselementen van hetzelfde type
Us []A_U `json:"us,omitempty"`
Vs []A_V `json:"vs,omitempty"`
// Voor batch opvoer/afvoer van meerdere relaties
Rel_A_Bs []Rel_A_B `json:"rel_a_bs,omitempty"`
}
// OpvoerAfvoerB can contain either a full entity or individual data elements
type OpvoerAfvoerB struct {
// Voor opvoer/afvoer van hele entiteit B
B *Full_B `json:"b,omitempty"`
// Voor opvoer/afvoer van individuele gegevenselementen
X *B_X `json:"x,omitempty"`
Y *B_Y `json:"y,omitempty"`
// Voor batch opvoer/afvoer van meerdere gegevenselementen van hetzelfde type
Xs []B_X `json:"xs,omitempty"`
Ys []B_Y `json:"ys,omitempty"`
}
package model
import (
"database/sql/driver"
"encoding/json"
"fmt"
"time"
)
const dateLayout = "2006-01-02"
// Date serializes as YYYY-MM-DD and stores as a SQL DATE.
type Date struct {
time.Time
}
func NewDate(year int, month time.Month, day int) Date {
return Date{Time: time.Date(year, month, day, 0, 0, 0, 0, time.UTC)}
}
func (d Date) String() string {
if d.Time.IsZero() {
return ""
}
return d.Time.Format(dateLayout)
}
func (d Date) MarshalJSON() ([]byte, error) {
if d.Time.IsZero() {
return []byte("null"), nil
}
return json.Marshal(d.Time.Format(dateLayout))
}
func (d *Date) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
if d != nil {
d.Time = time.Time{}
}
return nil
}
var value string
if err := json.Unmarshal(data, &value); err != nil {
return fmt.Errorf("datum moet een string in formaat %s zijn: %w", dateLayout, err)
}
parsed, err := time.Parse(dateLayout, value)
if err != nil {
return fmt.Errorf("ongeldige datum %q, verwacht formaat %s: %w", value, dateLayout, err)
}
d.Time = parsed
return nil
}
func (d Date) Value() (driver.Value, error) {
if d.Time.IsZero() {
return nil, nil
}
return d.Time.Format(dateLayout), nil
}
func (d *Date) Scan(src any) error {
if src == nil {
d.Time = time.Time{}
return nil
}
switch value := src.(type) {
case time.Time:
d.Time = time.Date(value.Year(), value.Month(), value.Day(), 0, 0, 0, 0, time.UTC)
return nil
case string:
parsed, err := time.Parse(dateLayout, value)
if err != nil {
return fmt.Errorf("kon datum-string %q niet parsen: %w", value, err)
}
d.Time = parsed
return nil
case []byte:
parsed, err := time.Parse(dateLayout, string(value))
if err != nil {
return fmt.Errorf("kon datum-bytes %q niet parsen: %w", string(value), err)
}
d.Time = parsed
return nil
default:
return fmt.Errorf("onbekend datumtype %T", src)
}
}
package model
import (
"os"
"strings"
)
func debugLogsEnabled() bool {
v := strings.ToLower(strings.TrimSpace(os.Getenv("APP_DEBUG_LOGS")))
return v == "1" || v == "true" || v == "yes" || v == "on"
}
package model
// Equal returns true if two values of a comparable type are equal using `==`.
// Use this when you want a compile-time checked generic equality for comparable types.
func Equal[T comparable](a, b T) bool {
return a == b
}
package model
import (
"time"
"github.com/uptrace/bun"
)
/*
Full entity structs = Entiteiten inclusief alle gegevenselementen en relaties,
maar zonder de bitemporal plumbing (registratie, wijziging, opvoer/afvoer tijdstippen).
Opvoer en afvoer zijn afgeleid daarvan, en in die zin ook een soort plumbing.
Deze structuren worden gebruikt voor de API requests en responses,
en bevatten alle relevante data voor een entiteit, inclusief de gerelateerde gegevenselementen en relaties.
*/
// GetID methods
func (a Full_A) GetID() any { return a.ID }
func (a Full_A) Metatype() Metatype { return MetatypeEntiteit }
func (a *Full_A) ClearID() { a.ID = 0 }
func (b Full_B) GetID() any { return b.ID }
func (b Full_B) Metatype() Metatype { return MetatypeEntiteit }
func (b *Full_B) ClearID() { b.ID = 0 }
// GeefOnderliggendeGegevenselementen returns all child representaties of A.
func (a *Full_A) GeefOnderliggendeGegevenselementen() []OnderliggendeRepresentatie {
result := make([]OnderliggendeRepresentatie, 0)
for i := range a.Us {
if a.Us[i].A_ID == 0 {
a.Us[i].A_ID = a.ID
}
result = append(result, OnderliggendeRepresentatie{Typenaam: "A_U", Representatie: &a.Us[i]})
}
for i := range a.Vs {
if a.Vs[i].A_ID == 0 {
a.Vs[i].A_ID = a.ID
}
result = append(result, OnderliggendeRepresentatie{Typenaam: "A_V", Representatie: &a.Vs[i]})
}
for i := range a.Ws {
if a.Ws[i].A_ID == 0 {
a.Ws[i].A_ID = a.ID
}
result = append(result, OnderliggendeRepresentatie{Typenaam: "A_W", Representatie: &a.Ws[i]})
}
for i := range a.RelABs {
if a.RelABs[i].A_ID == 0 {
a.RelABs[i].A_ID = a.ID
}
result = append(result, OnderliggendeRepresentatie{Typenaam: "Rel_A_B", Representatie: &a.RelABs[i]})
}
return result
}
// GeefOnderliggendeGegevenselementen returns all child representaties of B.
func (b *Full_B) GeefOnderliggendeGegevenselementen() []OnderliggendeRepresentatie {
result := make([]OnderliggendeRepresentatie, 0)
for i := range b.Xs {
if b.Xs[i].B_ID == 0 {
b.Xs[i].B_ID = b.ID
}
result = append(result, OnderliggendeRepresentatie{Typenaam: "B_X", Representatie: &b.Xs[i]})
}
for i := range b.Ys {
if b.Ys[i].B_ID == 0 {
b.Ys[i].B_ID = b.ID
}
result = append(result, OnderliggendeRepresentatie{Typenaam: "B_Y", Representatie: &b.Ys[i]})
}
return result
}
// Full_A includes all fields of A and its related entities (like Vs)
type Full_A struct {
bun.BaseModel `bun:"table:a,alias:a"`
ID int `json:"id" bun:"id,pk"`
Opvoer *time.Time `json:"opvoer,omitempty"` // afgeleid van registratie tijdstip opvoer
Afvoer *time.Time `json:"afvoer,omitempty"` // afgeleid van registratie tijdstip afvoer
//Aanvang *time.Time `json:"aanvang,omitempty"` // afgeleid van A_Aanvang
//Einde *time.Time `json:"einde,omitempty"` // afgeleid van A_Einde
// De U's behorende bij A, 1-1 op enig moment (enkelvoudig: todo tag)
Us []A_U `bun:"rel:has-many,join:id=a_id" json:"us,omitempty"`
/*
De relatie: 'has-many' vertelt Bun dat er meerdere V 's bij deze A horen.
Deze relatie is meervoudig op enig moment.
Ik mweet nog niet hoe dat in bun of andere tag weer te geven. Dit gaat over validatie en niet over de DB,
dus misschien een andere tag in de struct die aangeeft dat deze relatie meervoudig is op enig moment.
OPM: nu in de MetaRegistry opgenomen als Momentvoorkomen: Meervoudig.
*/
Vs []A_V `bun:"rel:has-many,join:id=a_id" json:"vs,omitempty"`
// De W's behorende bij A, meervoudig op enig moment
Ws []A_W `bun:"rel:has-many,join:id=a_id" json:"ws,omitempty"`
//Relaties Rel_AB's bij A (meervoudig op enig moment)
RelABs []Rel_A_B `bun:"rel:has-many,join:id=a_id" json:"rel_abs,omitempty"`
}
// Full_B includes all fields of B and its related entities (like Xs)
type Full_B struct {
bun.BaseModel `bun:"table:b,alias:b"`
ID int `json:"id" bun:"id,pk"`
Opvoer *time.Time `json:"opvoer,omitempty"` // afgeleid van registratie tijdstip opvoer
Afvoer *time.Time `json:"afvoer,omitempty"` // afgeleid van registratie tijdstip afvoer
//Aanvang *time.Time `json:"aanvang,omitempty"` // afgeleid van A_Aanvang
//Einde *time.Time `json:"einde,omitempty"` // afgeleid van A_Einde
// De X's behorende bij B, 1-1 op enig moment (enkelvoudig: todo tag)
Xs []B_X `bun:"rel:has-many,join:id=b_id" json:"xs,omitempty"`
// De Y's behorende bij B, 1-1 op enig moment (enkelvoudig: todo tag)
Ys []B_Y `bun:"rel:has-many,join:id=b_id" json:"ys,omitempty"`
}
package model
// MetaRegistry is the hardcoded meta model registry.
var MetaRegistry = MetaRegistryType{
"A": {
// UML
Typenaam: "A",
Description: "Entiteit A met materiele tijdlijn en onderliggende representaties U, V, W en Rel_A_B.",
Metatype: MetatypeEntiteit,
IsMaterieel: true,
Kleur: "#bfdbfe",
// JSON veldnaam in REST requests
Veldnaam: "a",
Padnaam: "as",
Factory: func() Representatie { return &Full_A{} },
SliceFactory: func() any { return &[]Full_A{} },
// Database
Tabelnaam: "a",
IDKolom: "id",
DBFactory: func() Representatie { return &A_basis{} },
DBSliceFactory: func() any { return &[]A_basis{} },
// Alleen voor gegevenselementen/relaties:
// die hebben een FK naar een of twee entiteiten
HeeftPFK: false,
RelatieveAutoincrement: false,
EntiteitIDKolom: "",
SecondaireEntiteitIDKolom: "",
// Alleen voor entiteiten: de onderliggende gegevenselementen/relaties
OnderliggendeGegevenselementen: []OnderliggendGegevenselement{
{Rolnaam: "Us", JSONRolnaam: "us", Doeltype: "A_U", Momentvoorkomen: Enkelvoudig},
{Rolnaam: "Vs", JSONRolnaam: "vs", Doeltype: "A_V", Momentvoorkomen: Meervoudig},
{Rolnaam: "Ws", JSONRolnaam: "ws", Doeltype: "A_W", Momentvoorkomen: Meervoudig},
{Rolnaam: "RelABs", JSONRolnaam: "rel_abs", Doeltype: "Rel_A_B", Momentvoorkomen: Meervoudig},
},
},
"B": {
// UML
Typenaam: "B",
Description: "Entiteit B met materiele tijdlijn en onderliggende representaties X en Y.",
Metatype: MetatypeEntiteit,
IsMaterieel: true,
Kleur: "#fecaca",
// JSON veldnaam in REST requests
Veldnaam: "b",
Padnaam: "bs",
Factory: func() Representatie { return &Full_B{} },
SliceFactory: func() any { return &[]Full_B{} },
// Database
Tabelnaam: "b",
IDKolom: "id",
DBFactory: func() Representatie { return &B_basis{} },
DBSliceFactory: func() any { return &[]B_basis{} },
// Alleen voor gegevenselementen/relaties:
// die hebben een FK naar een of twee entiteiten
HeeftPFK: false,
RelatieveAutoincrement: false,
EntiteitIDKolom: "",
SecondaireEntiteitIDKolom: "",
// Alleen voor entiteiten: de onderliggende gegevenselementen/relaties
OnderliggendeGegevenselementen: []OnderliggendGegevenselement{
{Rolnaam: "Xs", JSONRolnaam: "xs", Doeltype: "B_X", Momentvoorkomen: Enkelvoudig},
{Rolnaam: "Ys", JSONRolnaam: "ys", Doeltype: "B_Y", Momentvoorkomen: Enkelvoudig},
},
},
"Rel_A_B": {
// UML
Typenaam: "Rel_A_B",
Description: "Relatie tussen A en B, meervoudig voorkomend per A en met relatieve relatie-id.",
Metatype: MetatypeRelatie,
IsMaterieel: true,
Kleur: "#ede9fe",
// JSON veldnaam in REST requests
Veldnaam: "rel_a_b",
Padnaam: "rel_a_bs",
Factory: func() Representatie { return &Rel_A_B{} },
// Database
Tabelnaam: "rel_a_b",
IDKolom: "rel_id",
DBFactory: func() Representatie { return &Rel_A_B{} },
DBSliceFactory: func() any { return &[]Rel_A_B{} },
// Alleen voor gegevenselementen/relaties:
// die hebben een FK naar een (of twee bij relaties) entiteiten
HeeftPFK: true,
EntiteitIDKolom: "a_id",
RelatieveAutoincrement: true,
SecondaireEntiteitIDKolom: "b_id",
Momentvoorkomen: Meervoudig,
},
"A_U": {
// UML
Typenaam: "A_U",
Description: "Enkelvoudig gegevenselement van A met formele tijdlijn.",
Metatype: MetatypeGegevenselement,
IsMaterieel: false,
Kleur: "#dbeafe",
// JSON veldnaam in REST requests
Veldnaam: "u",
Padnaam: "a_us",
Factory: func() Representatie { return &A_U{} },
// Database
Tabelnaam: "a_u",
IDKolom: "rel_id",
DBFactory: func() Representatie { return &A_U{} },
DBSliceFactory: func() any { return &[]A_U{} },
// Alleen voor gegevenselementen/relaties:
// die hebben een FK naar een of twee entiteiten
HeeftPFK: true,
RelatieveAutoincrement: true,
EntiteitIDKolom: "a_id",
SecondaireEntiteitIDKolom: "",
Momentvoorkomen: Enkelvoudig,
},
"A_V": {
// UML
Typenaam: "A_V",
Description: "Meervoudig gegevenselement van A met onder andere een datumveld.",
Metatype: MetatypeGegevenselement,
IsMaterieel: false,
Kleur: "#c7f9cc",
// JSON veldnaam in REST requests
Veldnaam: "v",
Padnaam: "a_vs",
Factory: func() Representatie { return &A_V{} },
// Database
Tabelnaam: "a_v",
IDKolom: "rel_id",
DBFactory: func() Representatie { return &A_V{} },
DBSliceFactory: func() any { return &[]A_V{} },
// Alleen voor gegevenselementen/relaties:
// die hebben een FK naar een of twee entiteiten
HeeftPFK: true,
RelatieveAutoincrement: true,
EntiteitIDKolom: "a_id",
SecondaireEntiteitIDKolom: "",
Momentvoorkomen: Meervoudig,
},
"A_W": {
// UML
Typenaam: "A_W",
Description: "Meervoudig gegevenselement van A met numerieke waarden.",
Metatype: MetatypeGegevenselement,
IsMaterieel: false,
Kleur: "#bbf7d0",
// JSON veldnaam in REST requests
Veldnaam: "w",
Padnaam: "a_ws",
Factory: func() Representatie { return &A_W{} },
// Database
Tabelnaam: "a_w",
IDKolom: "rel_id",
DBFactory: func() Representatie { return &A_W{} },
DBSliceFactory: func() any { return &[]A_W{} },
// Alleen voor gegevenselementen/relaties:
// die hebben een FK naar een of twee entiteiten
HeeftPFK: true,
RelatieveAutoincrement: true,
EntiteitIDKolom: "a_id",
SecondaireEntiteitIDKolom: "",
Momentvoorkomen: Meervoudig,
},
"B_X": {
// UML
Typenaam: "B_X",
Description: "Enkelvoudig gegevenselement van B met twee tekstvelden.",
Metatype: MetatypeGegevenselement,
IsMaterieel: false,
Kleur: "#fdba74",
// JSON veldnaam in REST requests
Veldnaam: "x",
Padnaam: "b_xs",
Factory: func() Representatie { return &B_X{} },
// Database
Tabelnaam: "b_x",
IDKolom: "rel_id",
DBFactory: func() Representatie { return &B_X{} },
DBSliceFactory: func() any { return &[]B_X{} },
// Alleen voor gegevenselementen/relaties:
// die hebben een FK naar een of twee entiteiten
HeeftPFK: true,
RelatieveAutoincrement: true,
EntiteitIDKolom: "b_id",
SecondaireEntiteitIDKolom: "",
Momentvoorkomen: Enkelvoudig,
},
"B_Y": {
// UML
Typenaam: "B_Y",
Description: "Enkelvoudig gegevenselement van B met een tekstveld.",
Metatype: MetatypeGegevenselement,
IsMaterieel: false,
Kleur: "#fde68a",
// JSON veldnaam in REST requests
Veldnaam: "y",
Padnaam: "b_ys",
Factory: func() Representatie { return &B_Y{} },
// Database
Tabelnaam: "b_y",
IDKolom: "rel_id",
DBFactory: func() Representatie { return &B_Y{} },
DBSliceFactory: func() any { return &[]B_Y{} },
// Alleen voor gegevenselementen/relaties:
// die hebben een FK naar een of twee entiteiten
HeeftPFK: true,
RelatieveAutoincrement: true,
EntiteitIDKolom: "b_id",
SecondaireEntiteitIDKolom: "",
Momentvoorkomen: Enkelvoudig,
},
}
package model
// Hardcoded meta model for representatie types, avoiding reflection.
// Momentvoorkomen describes whether a relation is single or multiple.
type Momentvoorkomen int
const (
Enkelvoudig Momentvoorkomen = iota
Meervoudig
)
// OnderliggendGegevenselement describes a related field on an entity and its multiplicity.
type OnderliggendGegevenselement struct {
Rolnaam string
JSONRolnaam string
Doeltype string
Momentvoorkomen Momentvoorkomen // enkelvoudig of meervoudig = het voorkomen op enig moment in de tijd
}
// OnderliggendeRepresentatie koppelt een typenaam aan een concrete FormeleRepresentatie.
type OnderliggendeRepresentatie struct {
Typenaam string
Representatie FormeleRepresentatie
}
// HeeftOnderliggendeGegevenselementen wordt geïmplementeerd door entiteitstypen
// die hun onderliggende gegevenselementen/relaties kunnen teruggeven.
type HeeftOnderliggendeGegevenselementen interface {
GeefOnderliggendeGegevenselementen() []OnderliggendeRepresentatie
}
// TypeMeta holds metadata for a representatie type.
type TypeMeta struct {
// ==== UML ====
Typenaam string
Description string
Metatype Metatype
IsMaterieel bool
// ==== JSON ====
// Veldnaam is the JSON field name used in REST requests (bijv. "a", "b", "rel_a_b", "u").
Veldnaam string
// Padnaam is the URL path segment used in REST routes (bijv. "as", "bs", "rel_a_bs", "a_us").
Padnaam string
// Kleur is een optionele visualisatiekleur (bijv. "#eef6ff").
Kleur string
// Factory creates a new zero-value instance of the concrete Representatie struct.
Factory func() Representatie
// SliceFactory creates a pointer to a concrete slice for full/list queries, e.g. &[]Full_A{}.
SliceFactory func() any
// ==== Database (alle representaties) ====
// Tabelnaam is the database table name for the representatie type.
Tabelnaam string
// IDKolom is the name of the primary key column in the database table.
IDKolom string
// De factory van de representatie struct die gebruikt wordt voor database operaties, zoals het aanmaken van tabellen.
DBFactory func() Representatie
// DBSliceFactory creates a pointer to a concrete slice for list queries, e.g. &[]A_basis{}.
DBSliceFactory func() any
// ==== Database (gegevenselementen/relaties) ====
// Of er een samengestelde sleutel is, bijv. van (EntiteitID, Rel_ID)
HeeftPFK bool
// of de ID kolom een relatieve auto-increment is binnen de parent entiteit
// (dus niet globaal uniek)
RelatieveAutoincrement bool
// EntiteitIDKolom is the FK column pointing to the primary entiteit (if any).
EntiteitIDKolom string
// SecondaireEntiteitIDKolom is the FK column for a secondary entiteit (relations only).
SecondaireEntiteitIDKolom string
// ook bij het gegevenselement/relatie meta, want dat is nodig voor
// het automatisch afvoeren van onderliggende gegevenselementen/relaties
// bij opvoer van een opvolgend gegevenselement/relatie
Momentvoorkomen Momentvoorkomen // enkelvoudig of meervoudig = het voorkomen op enig moment in de tijd
// ==== Alleen voor entiteiten (of misschien toch ook voor GEn?)====
// OnderliggendeGegevenselementen applies to entiteiten; empty for gegevenselementen/relaties.
OnderliggendeGegevenselementen []OnderliggendGegevenselement
}
// MetaRegistryType is a named map type for the meta model registry, enabling methods.
type MetaRegistryType map[string]TypeMeta
// BovenliggendeRelatieMeta describes how a child type hangs under a parent entiteit type.
type BovenliggendeRelatieMeta struct {
ParentType TypeMeta
Relatie OnderliggendGegevenselement
}
/*
GetTypeMeta geeft (TypeMeta, bool) terug.
Als het type niet bestaat, krijg je ok=false en
kun je daar netjes op reageren.
MustTypeMeta gaat ervan uit dat het type altijd bestaat.
Als het ontbreekt, panickt hij meteen.
Handig voor plekken waar een ontbrekend type een programmeerfout is
en je liever hard faalt.
*/
// GetTypeMeta returns metadata for a type, if present.
func (r MetaRegistryType) GetTypeMeta(typeName string) (TypeMeta, bool) {
meta, ok := r[typeName]
return meta, ok
}
// MustTypeMeta returns metadata for a type or panics if missing.
func (r MetaRegistryType) MustTypeMeta(typeName string) TypeMeta {
meta, ok := r[typeName]
if !ok {
panic("unknown type: " + typeName)
}
return meta
}
// GetByVeldnaam zoekt een TypeMeta op basis van de JSON veldnaam (bijv. "a", "u", "rel_a_b").
func (r MetaRegistryType) GetByVeldnaam(veldnaam string) (TypeMeta, bool) {
for _, meta := range r {
if meta.Veldnaam == veldnaam {
return meta, true
}
}
return TypeMeta{}, false
}
// GetBovenliggendeRelatieMeta finds the parent entiteit metadata for a given child type.
func (r MetaRegistryType) GetBovenliggendeRelatieMeta(childTypeName string) (BovenliggendeRelatieMeta, bool) {
for _, parentMeta := range r {
if parentMeta.Metatype != MetatypeEntiteit {
continue
}
for _, rel := range parentMeta.OnderliggendeGegevenselementen {
if rel.Doeltype == childTypeName {
return BovenliggendeRelatieMeta{
ParentType: parentMeta,
Relatie: rel,
}, true
}
}
}
return BovenliggendeRelatieMeta{}, false
}
// RelationNames returns the Bun relation field names for child representaties of an entity.
func (m TypeMeta) RelationNames() []string {
if len(m.OnderliggendeGegevenselementen) == 0 {
return nil
}
namen := make([]string, 0, len(m.OnderliggendeGegevenselementen))
for _, rel := range m.OnderliggendeGegevenselementen {
namen = append(namen, rel.Rolnaam)
}
return namen
}
package model
import (
"encoding/json"
"time"
"github.com/uptrace/bun"
)
/* ======= GENERIEKE REPRESENTATIE INTERFACES EN HELPERS ====== */
// Representatie is de gemeenschappelijke interface voor alle representaties (entiteiten, relaties, gegevenselementen)
type Representatie interface {
HasID
Metatyped
String() string // voor debuggen
}
// FormeleRepresentatie combineert de Representatie interface met opvoer/afvoer (formele tijdslijn)
type FormeleRepresentatie interface {
Representatie
HeeftOpvoerAfvoer
HeeftClearID
}
// MaterieleRepresentatie combineert de FormeleRepresentatie interface met aanvang/einde (materiële tijdslijn)
type MaterieleRepresentatie interface {
FormeleRepresentatie
HeeftAanvangEinde
}
// HasID allows generic handlers to access an entity's ID
type HasID interface {
GetID() any
}
type HeeftClearID interface {
ClearID()
}
type Metatype string
const (
MetatypeEntiteit Metatype = "entiteit"
MetatypeRelatie Metatype = "relatie"
MetatypeGegevenselement Metatype = "gegevenselement"
)
type Metatyped interface {
Metatype() Metatype
}
// HeeftOpvoerAfvoer beschrijft representaties met opvoer/afvoer tijdstippen.
// Setters gebruiken pointer receivers op de concrete types.
type HeeftOpvoerAfvoer interface {
GetOpvoer() *time.Time
SetOpvoer(*time.Time)
GetAfvoer() *time.Time
SetAfvoer(*time.Time)
}
// HeeftAanvangEinde beschrijft representaties met aanvang/einde tijdstippen.
type HeeftAanvangEinde interface {
GetAanvang() *time.Time
SetAanvang(*time.Time)
GetEinde() *time.Time
SetEinde(*time.Time)
}
/*
Materiele tijd plumbing (aanvang en einde)
deze structs kunnen aan een representatie hangen
in de database worden ze gerepresenteerd als aparte tabellen:
- dit vergt wel aparte database logica:
- bij het creeren van de tabellen moeten alle materiele representaties ook een aanvang en einde tabel krijgen
- bij het aanmaken van een representatie moeten er mogelijk ook aanvang en einde records worden aangemaakt
- het zijn geen verplichte velden, maar ze zijn standaard wel enkelvoudig
- ze volgen dus eigenlijk de logica van een enkelvoudig gegevenselement
- Aanvang en einde zijn dus zelf weer materiele elementen
*/
type Aanvang struct {
Entiteit_ID int `json:"entiteit_id"`
Gegevenselement_ID int `json:"gegevenselement_id"`
Aanvang *time.Time `json:"aanvang,omitempty"`
Opvoer *time.Time `json:"opvoer,omitempty"`
Afvoer *time.Time `json:"afvoer,omitempty"`
}
type Einde struct {
Entiteit_ID int `json:"entiteit_id"`
Gegevenselement_ID int `json:"gegevenselement_id"`
Einde *time.Time `json:"einde,omitempty"`
Opvoer *time.Time `json:"opvoer,omitempty"`
Afvoer *time.Time `json:"afvoer,omitempty"`
}
// helper functies voor type checks
func IsEntiteit(v Metatyped) bool {
return v.Metatype() == MetatypeEntiteit
}
func IsRelatie(v Metatyped) bool {
return v.Metatype() == MetatypeRelatie
}
func IsGegevenselement(v Metatyped) bool {
return v.Metatype() == MetatypeGegevenselement
}
/* ====== WIJZIGING EN REGISTRATIE STRUCTUREN ====== */
// WijzigingstypeEnum defines the possible values for Wijzigingstype
type WijzigingstypeEnum string
const (
WijzigingstypeOpvoer WijzigingstypeEnum = "opvoer"
WijzigingstypeAfvoer WijzigingstypeEnum = "afvoer"
)
// RegistratietypeEnum defines the possible values for Registratietype
type RegistratietypeEnum string
const (
RegistratietypeRegistratie RegistratietypeEnum = "registratie"
RegistratietypeCorrectie RegistratietypeEnum = "correctie"
RegistratietypeOngedaanmaking RegistratietypeEnum = "ongedaanmaking"
)
// Wijziging zit tussen Registratie en om het even welke representatie in
// gebruikt om de gegevens in de database te zetten
type Wijziging struct {
bun.BaseModel `bun:"table:wijziging"`
ID int64 `json:"id" bun:"id,pk,autoincrement"`
Wijzigingstype WijzigingstypeEnum `json:"wijzigingstype"` // Opvoer of Afvoer
RegistratieID int64 `json:"registratie_id"` // verwijzing naar de registratie waarbij deze wijziging hoort
Entiteitnaam string `json:"entiteitnaam"` // type-naam van de eventueel bovenliggende entiteit, zoals "A" of "B"
EntiteitID string `json:"entiteit_id"` // Bewust een string to support both numeric and string IDs, or for instance UUIDs
Representatienaam string `json:"representatienaam"` // type-naam van de representatie, zoals "A", "B", "Rel_A_B", "A_U", "A_V", "B_X" of "B_Y"
RepresentatieID string `json:"representatie_id"` // Bewust een string to support both numeric and string IDs, or for instance UUIDs
Tijdstip time.Time `json:"tijdstip"` //afgeleid van registratie tijdstip
IsOngedaangemaakt bool `json:"is_ongedaangemaakt,omitempty" bun:"is_ongedaan_gemaakt"` // afgeleid (wordt op true gezet bij een ongedaanmaking van deze wijziging)
}
// not used (yet?)
type WijzigingCompact struct {
Wijzigingstype WijzigingstypeEnum `json:"wijzigingstype"`
}
// Registratie, Correctie, Ongedaanmaking
type Registratie struct {
bun.BaseModel `bun:"table:registratie"`
ID int64 `json:"id" bun:"id,pk,autoincrement"`
Registratietype RegistratietypeEnum `json:"registratietype"` // Registratie, Correctie, Ongedaanmaking
Tijdstip time.Time `json:"tijdstip"` // Het tijdstip van de registratie, correctie of ongedaanmaking
Opmerking *string `json:"opmerking,omitempty"` // optioneel veld voor extra informatie
CorrigeertRegistratieID *int64 `json:"corrigeert_registratie_id,omitempty"` // bij correcties: verwijzing naar de registratie die gecorrigeerd wordt
MaaktOngedaanRegistratieID *int64 `json:"maakt_ongedaan_registratie_id,omitempty"` // bij ongedaanmakings: verwijzing naar de registratie die ongedaan wordt gemaakt
IsOngedaangemaakt bool `json:"is_ongedaangemaakt,omitempty" bun:"is_ongedaan_gemaakt"` // afgeleid (wordt op true gezet bij een ongedaanmaking van deze registratie)
Wijzigingen []Wijziging `json:"wijzigingen,omitempty" bun:"rel:has-many,join:id=registratie_id"`
RequestBody json.RawMessage `json:"request_body,omitempty" bun:"request_body,type:jsonb,nullzero"` // raw request payload voor audit
ResponseBody json.RawMessage `json:"response_body,omitempty" bun:"response_body,type:jsonb,nullzero"` // raw response payload voor audit
ResponseCode *int `json:"response_code,omitempty" bun:"response_code,nullzero"` // HTTP statuscode van de response
RequestPath *string `json:"request_path,omitempty" bun:"request_path,nullzero"` // request pad voor audit, bv /registreer/as
RequestMethod *string `json:"request_method,omitempty" bun:"request_method,nullzero"` // HTTP methode, bv POST
DurationMs *int64 `json:"duration_ms,omitempty" bun:"duration_ms,nullzero"` // afhandeltijd in milliseconden
}
func (reg Registratie) IsRegistratie() bool {
return reg.Registratietype == RegistratietypeRegistratie
}
func (reg Registratie) IsCorrectie() bool {
return reg.Registratietype == RegistratietypeCorrectie
}
func (reg Registratie) IsOngedaanmaking() bool {
return reg.Registratietype == RegistratietypeOngedaanmaking
}
// UnmarshalJSON accepteert zowel snake_case als Camel/PascalCase sleutelvarianten
// voor compatibiliteit met bestaande clients.
func (reg *Registratie) UnmarshalJSON(data []byte) error {
type registratieAlias Registratie
aux := struct {
registratieAlias
CorrigeertRegistratieIDCamel *int64 `json:"CorrigeertRegistratieID"`
MaaktOngedaanRegistratieIDCamel *int64 `json:"MaaktOngedaanRegistratieID"`
}{
registratieAlias: registratieAlias(*reg),
}
if err := json.Unmarshal(data, &aux); err != nil {
return err
}
*reg = Registratie(aux.registratieAlias)
if reg.CorrigeertRegistratieID == nil && aux.CorrigeertRegistratieIDCamel != nil {
reg.CorrigeertRegistratieID = aux.CorrigeertRegistratieIDCamel
}
if reg.MaaktOngedaanRegistratieID == nil && aux.MaaktOngedaanRegistratieIDCamel != nil {
reg.MaaktOngedaanRegistratieID = aux.MaaktOngedaanRegistratieIDCamel
}
return nil
}
// methodes op registratie en wijziging om ID te kunnen ophalen in de generic handlers
func (reg Registratie) GetID() any { return reg.ID } // waarschijnlijk niet nodig, want Registratie is geen representatie
func (wij Wijziging) GetID() any { return wij.ID } //waarschijnlijk niet nodig, want Wijziging is geen representatie
package model
import (
"time"
"github.com/uptrace/bun"
)
// GetID en Metatype methoden voor alle representaties
// Entiteiten
func (a A_basis) GetID() any { return a.ID }
func (a A_basis) Metatype() Metatype { return MetatypeEntiteit }
func (a *A_basis) ClearID() { a.ID = 0 }
func (b B_basis) GetID() any { return b.ID }
func (b B_basis) Metatype() Metatype { return MetatypeEntiteit }
func (b *B_basis) ClearID() { b.ID = 0 }
// Relaties
func (r Rel_A_B) GetID() any { return r.Rel_ID }
func (r Rel_A_B) Metatype() Metatype { return MetatypeRelatie }
func (r *Rel_A_B) ClearID() { r.Rel_ID = 0 }
// Gegevenselementen
func (au A_U) GetID() any { return au.Rel_ID }
func (au A_U) Metatype() Metatype { return MetatypeGegevenselement }
func (au *A_U) ClearID() { au.Rel_ID = 0 }
func (av A_V) GetID() any { return av.Rel_ID }
func (av A_V) Metatype() Metatype { return MetatypeGegevenselement }
func (av *A_V) ClearID() { av.Rel_ID = 0 }
func (aw A_W) GetID() any { return aw.Rel_ID }
func (aw A_W) Metatype() Metatype { return MetatypeGegevenselement }
func (aw *A_W) ClearID() { aw.Rel_ID = 0 }
func (bx B_X) GetID() any { return bx.Rel_ID }
func (bx B_X) Metatype() Metatype { return MetatypeGegevenselement }
func (bx *B_X) ClearID() { bx.Rel_ID = 0 }
func (by B_Y) GetID() any { return by.Rel_ID }
func (by B_Y) Metatype() Metatype { return MetatypeGegevenselement }
func (by *B_Y) ClearID() { by.Rel_ID = 0 }
/* Basis structs voor alle representaties
Dat is zonder de relatie van entiteit naar gegevenselementen en relaties.
Wel met relatie terug van gegevenselementen/relaties naar entiteit.
Daar ben ik eigenlijk nog niet blij mee, want dat is eigenlijk ook al een vorm van plumbing, maar het maakt de handlers wel simpeler.
Deze structuren worden gebruikt voor zowel de database als de basis REST interacties.
*/
// Entiteiten
type A_basis struct {
bun.BaseModel `bun:"table:a"`
ID int `json:"id" bun:"id,pk"`
Opvoer *time.Time `json:"opvoer,omitempty"` // afgeleid van registratie tijdstip opvoer
Afvoer *time.Time `json:"afvoer,omitempty"` // afgeleid van registratie tijdstip afvoer
Aanvang *Aanvang `json:"aanvang,omitempty"` // A_Aanvang in de DB, maar in de code via generieke routines
Einde *Einde `json:"einde,omitempty"` // A_Einde in de DB, maar in de code via generieke routines
}
type B_basis struct {
bun.BaseModel `bun:"table:b"`
ID int `json:"id" bun:"id,pk"`
Opvoer *time.Time `json:"opvoer,omitempty"`
Afvoer *time.Time `json:"afvoer,omitempty"`
Aanvang *Aanvang `json:"aanvang,omitempty"`
Einde *Einde `json:"einde,omitempty"`
}
type RelABSoort string
const (
RelABSoortLTT RelABSoort = "LTT"
RelABSoortLAT RelABSoort = "LAT"
RelABSoortLTA RelABSoort = "LTA"
)
// Relaties
// Rel_A_B hoort primair bij A
type Rel_A_B struct {
bun.BaseModel `bun:"table:rel_a_b"`
A_ID int `json:"a_id" schema_desc:"ID van de A-entiteit waar deze relatie bij hoort"`
Rel_ID int `json:"rel_id" bun:"rel_id,pk,autoincrement" schema_desc:"Relatieve ID van de relatie binnen A"`
ParentA *A_basis `json:"-" bun:"rel:belongs-to,join:a_id=id,on_delete:cascade"`
B_ID int `json:"b_id"`
Soort RelABSoort `json:"soort" schema:"enum=LTT|LAT|LTA" schema_desc:"Soort relatie tussen A en B"`
Opvoer *time.Time `json:"opvoer,omitempty"`
Afvoer *time.Time `json:"afvoer,omitempty"`
Aanvang *Aanvang `json:"aanvang,omitempty"`
Einde *Einde `json:"einde,omitempty"`
}
// Gegevenselementen
// A (1) - (1) U
type A_U struct {
bun.BaseModel `bun:"table:a_u"`
A_ID int `json:"a_id" bun:"a_id,pk"`
Rel_ID int `json:"rel_id" bun:"rel_id,pk,autoincrement"` // autoincrement zal zijn via een triggerfunctie voor de relatieve ID
ParentA *A_basis `json:"-" bun:"rel:belongs-to,join:a_id=id,on_delete:cascade"`
Aaa string `json:"aaa"`
Bbb *bool `json:"bbb,omitempty"`
Opvoer *time.Time `json:"opvoer,omitempty"`
Afvoer *time.Time `json:"afvoer,omitempty"`
}
// A (1) - (*) V
type A_V struct {
bun.BaseModel `bun:"table:a_v"`
A_ID int `json:"a_id" bun:"a_id,pk"`
Rel_ID int `json:"rel_id" bun:"rel_id,pk,autoincrement"`
ParentA *A_basis `json:"-" bun:"rel:belongs-to,join:a_id=id,on_delete:cascade"`
Ccc string `json:"ccc"`
Datum *Date `json:"datum,omitempty" bun:"datum,type:date"`
Opvoer *time.Time `json:"opvoer,omitempty"`
Afvoer *time.Time `json:"afvoer,omitempty"`
}
// A (1) - (*) W
type A_W struct {
bun.BaseModel `bun:"table:a_w"`
A_ID int `json:"a_id" bun:"a_id,pk"`
Rel_ID int `json:"rel_id" bun:"rel_id,pk,autoincrement"`
ParentA *A_basis `json:"-" bun:"rel:belongs-to,join:a_id=id,on_delete:cascade"`
Float float64 `json:"float"`
Heel int `json:"heel"`
Opvoer *time.Time `json:"opvoer,omitempty"`
Afvoer *time.Time `json:"afvoer,omitempty"`
}
// B (1) - (1) X
type B_X struct {
bun.BaseModel `bun:"table:b_x"`
B_ID int `json:"b_id" bun:"b_id,pk"`
Rel_ID int `json:"rel_id" bun:"rel_id,pk,autoincrement"`
ParentB *B_basis `json:"-" bun:"rel:belongs-to,join:b_id=id,on_delete:cascade"`
Fff string `json:"fff"`
Ggg string `json:"ggg"`
Opvoer *time.Time `json:"opvoer,omitempty"`
Afvoer *time.Time `json:"afvoer,omitempty"`
}
// B (1) - (1) Y
type B_Y struct {
bun.BaseModel `bun:"table:b_y"`
B_ID int `json:"b_id" bun:"b_id,pk"`
Rel_ID int `json:"rel_id" bun:"rel_id,pk,autoincrement"`
ParentB *B_basis `json:"-" bun:"rel:belongs-to,join:b_id=id,on_delete:cascade"`
Hhh string `json:"hhh"`
Opvoer *time.Time `json:"opvoer,omitempty"`
Afvoer *time.Time `json:"afvoer,omitempty"`
}
// Opvoer / Afvoer (formele tijd) methoden voor formele tijd intereface implementatie
func (a A_basis) GetOpvoer() *time.Time { return a.Opvoer }
func (a *A_basis) SetOpvoer(t *time.Time) { a.Opvoer = t }
func (a A_basis) GetAfvoer() *time.Time { return a.Afvoer }
func (a *A_basis) SetAfvoer(t *time.Time) { a.Afvoer = t }
func (b B_basis) GetOpvoer() *time.Time { return b.Opvoer }
func (b *B_basis) SetOpvoer(t *time.Time) { b.Opvoer = t }
func (b B_basis) GetAfvoer() *time.Time { return b.Afvoer }
func (b *B_basis) SetAfvoer(t *time.Time) { b.Afvoer = t }
func (r Rel_A_B) GetOpvoer() *time.Time { return r.Opvoer }
func (r *Rel_A_B) SetOpvoer(t *time.Time) { r.Opvoer = t }
func (r Rel_A_B) GetAfvoer() *time.Time { return r.Afvoer }
func (r *Rel_A_B) SetAfvoer(t *time.Time) { r.Afvoer = t }
func (au A_U) GetOpvoer() *time.Time { return au.Opvoer }
func (au *A_U) SetOpvoer(t *time.Time) { au.Opvoer = t }
func (au A_U) GetAfvoer() *time.Time { return au.Afvoer }
func (au *A_U) SetAfvoer(t *time.Time) { au.Afvoer = t }
func (av A_V) GetOpvoer() *time.Time { return av.Opvoer }
func (av *A_V) SetOpvoer(t *time.Time) { av.Opvoer = t }
func (av A_V) GetAfvoer() *time.Time { return av.Afvoer }
func (av *A_V) SetAfvoer(t *time.Time) { av.Afvoer = t }
func (aw A_W) GetOpvoer() *time.Time { return aw.Opvoer }
func (aw *A_W) SetOpvoer(t *time.Time) { aw.Opvoer = t }
func (aw A_W) GetAfvoer() *time.Time { return aw.Afvoer }
func (aw *A_W) SetAfvoer(t *time.Time) { aw.Afvoer = t }
func (bx B_X) GetOpvoer() *time.Time { return bx.Opvoer }
func (bx *B_X) SetOpvoer(t *time.Time) { bx.Opvoer = t }
func (bx B_X) GetAfvoer() *time.Time { return bx.Afvoer }
func (bx *B_X) SetAfvoer(t *time.Time) { bx.Afvoer = t }
func (by B_Y) GetOpvoer() *time.Time { return by.Opvoer }
func (by *B_Y) SetOpvoer(t *time.Time) { by.Opvoer = t }
func (by B_Y) GetAfvoer() *time.Time { return by.Afvoer }
func (by *B_Y) SetAfvoer(t *time.Time) { by.Afvoer = t }
func (a Full_A) GetOpvoer() *time.Time { return a.Opvoer }
func (a *Full_A) SetOpvoer(t *time.Time) { a.Opvoer = t }
func (a Full_A) GetAfvoer() *time.Time { return a.Afvoer }
func (a *Full_A) SetAfvoer(t *time.Time) { a.Afvoer = t }
func (b Full_B) GetOpvoer() *time.Time { return b.Opvoer }
func (b *Full_B) SetOpvoer(t *time.Time) { b.Opvoer = t }
func (b Full_B) GetAfvoer() *time.Time { return b.Afvoer }
func (b *Full_B) SetAfvoer(t *time.Time) { b.Afvoer = t }
// Aanvang / Einde (materiële tijd) methoden voor materiële tijd intereface implementatie
func (a A_basis) GetAanvang() *time.Time { return a.Aanvang.Aanvang }
func (a *A_basis) SetAanvang(t *time.Time) { a.Aanvang.Aanvang = t }
func (a A_basis) GetEinde() *time.Time { return a.Einde.Einde }
func (a *A_basis) SetEinde(t *time.Time) { a.Einde.Einde = t }
func (b B_basis) GetAanvang() *time.Time { return b.Aanvang.Aanvang }
func (b *B_basis) SetAanvang(t *time.Time) { b.Aanvang.Aanvang = t }
func (b B_basis) GetEinde() *time.Time { return b.Einde.Einde }
func (b *B_basis) SetEinde(t *time.Time) { b.Einde.Einde = t }
func (r Rel_A_B) GetAanvang() *time.Time { return r.Aanvang.Aanvang }
func (r *Rel_A_B) SetAanvang(t *time.Time) { r.Aanvang.Aanvang = t }
func (r Rel_A_B) GetEinde() *time.Time { return r.Einde.Einde }
func (r *Rel_A_B) SetEinde(t *time.Time) { r.Einde.Einde = t }
//TODO: als A_U, A_V, A_W, B_X, B_Y ook aanvang/einde krijgen, dan hier ook getters/setters toevoegen
// String methoden voor debuggen
func (a A_basis) String() string { return RepresentatieToString(a) }
func (b B_basis) String() string { return RepresentatieToString(b) }
func (r Rel_A_B) String() string { return RepresentatieToString(r) }
func (au A_U) String() string { return RepresentatieToString(au) }
func (av A_V) String() string { return RepresentatieToString(av) }
func (aw A_W) String() string { return RepresentatieToString(aw) }
func (bx B_X) String() string { return RepresentatieToString(bx) }
func (by B_Y) String() string { return RepresentatieToString(by) }
func (a Full_A) String() string { return RepresentatieToString(a) }
func (b Full_B) String() string { return RepresentatieToString(b) }
package model
import (
"context"
"github.com/uptrace/bun"
)
type User struct {
ID int64 `bun:"id,pk,autoincrement"`
Name string `bun:"name"`
// De bestaande 1-op-veel relatie
Articles []Article `bun:"rel:has-many,join:id=author_id"`
// De nieuwe 1-op-1 relatie
// Let op: 'rel:has-one' omdat de FK (user_id) in de CV tabel staat
CV *CV `bun:"rel:has-one,join:id=user_id"`
}
type CV struct {
ID int64 `bun:"id,pk,autoincrement"`
Education string `bun:"education"`
Experience string `bun:"experience"`
UserID int64 `bun:"user_id"` // De foreign key
}
type Article struct {
ID int64 `bun:"id,pk,autoincrement"`
Title string `bun:"title"`
Content string `bun:"content"`
AuthorID int64 `bun:"author_id"`
}
func GetUser(db *bun.DB) ([]User, error) {
ctx := context.Background()
users := make([]User, 0)
err := db.NewSelect().
Model(&users).
Relation("Articles"). // Laad alle artikelen
Relation("CV"). // Laad ook het CV
Scan(ctx)
if err != nil {
return nil, err
}
return users, nil
}
package model
import (
"fmt"
"reflect"
"strings"
"time"
)
var dateType = reflect.TypeOf(Date{})
func RepresentatieToString(rep Representatie) string {
if rep == nil {
return "<nil representatie>"
}
var builder strings.Builder
visited := map[uintptr]bool{}
writeValueTree(&builder, "representatie", reflect.ValueOf(rep), 0, visited)
return builder.String()
}
func writeValueTree(builder *strings.Builder, label string, value reflect.Value, depth int, visited map[uintptr]bool) {
indent := strings.Repeat(" ", depth)
if !value.IsValid() {
builder.WriteString(fmt.Sprintf("%s%s=<invalid>\n", indent, label))
return
}
for value.Kind() == reflect.Interface || value.Kind() == reflect.Pointer {
if value.IsNil() {
builder.WriteString(fmt.Sprintf("%s%s=<nil>\n", indent, label))
return
}
if value.Kind() == reflect.Pointer {
ptr := value.Pointer()
if ptr != 0 {
if visited[ptr] {
builder.WriteString(fmt.Sprintf("%s%s=<cycle>\n", indent, label))
return
}
visited[ptr] = true
}
}
value = value.Elem()
}
if value.CanInterface() {
if rep, ok := value.Interface().(Representatie); ok {
builder.WriteString(fmt.Sprintf("%s- %s: type=%T metatype=%s id=%v\n", indent, label, rep, rep.Metatype(), rep.GetID()))
}
}
if value.Type() == reflect.TypeOf(time.Time{}) {
t := value.Interface().(time.Time)
builder.WriteString(fmt.Sprintf("%s %s=%s\n", indent, label, t.Format(time.RFC3339Nano)))
return
}
if value.Type() == dateType {
d := value.Interface().(Date)
builder.WriteString(fmt.Sprintf("%s %s=%s\n", indent, label, d.String()))
return
}
switch value.Kind() {
case reflect.Struct:
structType := value.Type()
for i := 0; i < value.NumField(); i++ {
fieldType := structType.Field(i)
fieldValue := value.Field(i)
if !fieldType.IsExported() {
continue
}
if fieldType.Anonymous && fieldType.Type.String() == "bun.BaseModel" {
continue
}
if isZeroReflectValue(fieldValue) {
continue
}
writeValueTree(builder, fieldType.Name, fieldValue, depth+1, visited)
}
case reflect.Slice, reflect.Array:
for i := 0; i < value.Len(); i++ {
item := value.Index(i)
writeValueTree(builder, fmt.Sprintf("%s[%d]", label, i), item, depth+1, visited)
}
default:
if value.CanInterface() {
builder.WriteString(fmt.Sprintf("%s%s=%v\n", indent, label, value.Interface()))
}
}
}
func isZeroReflectValue(value reflect.Value) bool {
deferred := value
for deferred.Kind() == reflect.Interface || deferred.Kind() == reflect.Pointer {
if deferred.IsNil() {
return true
}
deferred = deferred.Elem()
}
return deferred.IsZero()
}
package routes
import (
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/handlers"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/gin-gonic/gin"
)
/*
Add functional REST routes to the provided router,
including routes for entities, relations and data elements,
as well as bitemporal registration, correction and undoing routes.
*/
func AddRoutes(router *gin.Engine) {
//Add Tests routes to router
router.GET("/tests", handlers.GetTests)
router.GET("/tests/:id", handlers.GetTest)
router.DELETE("/tests/:id", handlers.RemoveTest)
router.POST("/tests", handlers.AddTest)
router.PUT("/tests/:id", handlers.UpdateTest)
//Add Entities routes to router (via metamap)
addMetaRegistryRoutes(router)
// Full entity routes (via metamap)
addMetaRegistryFullRoutes(router)
// Registratie routes (dedicated, want plumbing,maar gebruikt een generieke handler)
router.GET("/registraties", handlers.MakeGetEntitiesHandler[model.Registratie]("Registraties"))
router.GET("/registraties/:id", handlers.MakeGetEntityHandler[model.Registratie]("Registratie"))
router.POST("/registraties", handlers.MakeAddEntityHandler[model.Registratie]("Registratie"))
router.PATCH("/registraties/:id", handlers.PatchRegistratie())
// Wijziging routes (idem dedicated, generieke handler)
router.GET("/wijzigingen", handlers.MakeGetEntitiesHandler[model.Wijziging]("Wijzigingen"))
router.GET("/wijzigingen/:id", handlers.MakeGetEntityHandler[model.Wijziging]("Wijziging"))
router.POST("/wijzigingen", handlers.MakeAddEntityHandler[model.Wijziging]("Wijziging"))
// Get registratie met onderliggende wijzigingen (geen generieke handler gebruikt,
// omdat dit een specifiek afhandeling vroeg, en bovendien toch plumbing is)
router.GET("/full/registraties", handlers.MakeGetRegistratiesMetWijzigingenHandler())
router.GET("/full/registraties/:id", handlers.MakeGetRegistratieMetWijzigingenByIDHandler())
/*
=== BELANGRIJKSTE BITEMPORELE REGISTRATIE ENDPOINT ===
REGISTRATIE, CORRECTIE EN ONGEDAANMAKING ROUTES
Dit gaat allemaal via /registratie/ en de payload in de de body.
Zie voorbeelden in de readme.
*/
router.POST("/registratie/", handlers.RegistreerMetNieuweAanpak())
/* IDEE
Idee voor een generieke registratie/correctie/ongedaanmaking route,
waarbij het entiteittype en de te corrigeren gegevenselementen in de URL worden meegegeven.
De body bevat dan de volledige nieuwe versie van de entiteit,
inclusief alle gegevenselementen.
De handler haalt de bestaande versie van de entiteit op,
vergelijkt deze met de nieuwe versie,
bepaalt welke gegevenselementen zijn gewijzigd
en maakt op basis daarvan de juiste Registratie en Wijziging records aan.
Deze aanpak vereist wel dat we in de handler kunnen bepalen
welke gegevenselementen bij welk entiteittype horen,
bijvoorbeeld door middel van een map of door gebruik te maken van reflectie.
*/
//router.POST("/registreer/:entity", handlers.RegisterEntity)
//router.POST("/corrigeer/:entity/:id", handlers.CorrectEntity)
//router.POST("/maakongedaan/:entity/:id", handlers.UndoEntity)
}
package routes
import (
"sort"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/handlers"
"github.com/MarkWestbroek/Bitemporal_2026/bitemporal_go_API_v05/model"
"github.com/gin-gonic/gin"
)
func addMetaRegistryRoutes(router *gin.Engine) {
typeNamen := make([]string, 0, len(model.MetaRegistry))
for typeNaam := range model.MetaRegistry {
typeNamen = append(typeNamen, typeNaam)
}
sort.Strings(typeNamen)
for _, typeNaam := range typeNamen {
meta, ok := model.MetaRegistry.GetTypeMeta(typeNaam)
if !ok || meta.DBFactory == nil || meta.Padnaam == "" {
continue
}
basePath := "/" + meta.Padnaam
router.GET(basePath, handlers.MakeGetEntitiesByMetaHandler(meta))
router.GET(basePath+"/:id", handlers.MakeGetEntityByMetaHandler(meta))
router.POST(basePath, handlers.MakeAddEntityByMetaHandler(meta))
}
}
func addMetaRegistryFullRoutes(router *gin.Engine) {
typeNamen := make([]string, 0, len(model.MetaRegistry))
for typeNaam := range model.MetaRegistry {
typeNamen = append(typeNamen, typeNaam)
}
sort.Strings(typeNamen)
for _, typeNaam := range typeNamen {
meta, ok := model.MetaRegistry.GetTypeMeta(typeNaam)
if !ok || meta.Metatype != model.MetatypeEntiteit || meta.Factory == nil || meta.SliceFactory == nil || meta.Padnaam == "" {
continue
}
basePath := "/full/" + meta.Padnaam
router.GET(basePath, handlers.MakeGetFullEntitiesByMetaHandler(meta))
router.GET(basePath+"/:id", handlers.MakeGetFullEntityByMetaHandler(meta))
router.POST(basePath, handlers.MakeAddFullEntityByMetaHandler(meta))
}
}