@@ -16,9 +16,9 @@ package coredata
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
|
||||||
"maps"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"maps"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/jackc/pgx/v5"
|
"github.com/jackc/pgx/v5"
|
||||||
"go.gearno.de/kit/pg"
|
"go.gearno.de/kit/pg"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
Scope struct {}
|
Scope struct{}
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewScope() *Scope {
|
func NewScope() *Scope {
|
||||||
|
|||||||
@@ -45,7 +45,12 @@ func (s *Service) GetOrganization(
|
|||||||
err := s.pg.WithConn(
|
err := s.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
return organization.LoadByID(ctx, conn, s.scope, organizationID)
|
return organization.LoadByID(
|
||||||
|
ctx,
|
||||||
|
conn,
|
||||||
|
s.scope,
|
||||||
|
organizationID,
|
||||||
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -66,7 +71,13 @@ func (s *Service) ListOrganizationFrameworks(
|
|||||||
err := s.pg.WithConn(
|
err := s.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
return frameworks.LoadByOrganizationID(ctx, conn, s.scope, organizationID, cursor)
|
return frameworks.LoadByOrganizationID(
|
||||||
|
ctx,
|
||||||
|
conn,
|
||||||
|
s.scope,
|
||||||
|
organizationID,
|
||||||
|
cursor,
|
||||||
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -87,7 +98,13 @@ func (s *Service) ListFrameworkControls(
|
|||||||
err := s.pg.WithConn(
|
err := s.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
return controls.LoadByFrameworkID(ctx, conn, s.scope, frameworkID, cursor)
|
return controls.LoadByFrameworkID(
|
||||||
|
ctx,
|
||||||
|
conn,
|
||||||
|
s.scope,
|
||||||
|
frameworkID,
|
||||||
|
cursor,
|
||||||
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -108,7 +125,13 @@ func (s *Service) ListControlTasks(
|
|||||||
err := s.pg.WithConn(
|
err := s.pg.WithConn(
|
||||||
ctx,
|
ctx,
|
||||||
func(conn pg.Conn) error {
|
func(conn pg.Conn) error {
|
||||||
return tasks.LoadByControlID(ctx, conn, s.scope, controlID, cursor)
|
return tasks.LoadByControlID(
|
||||||
|
ctx,
|
||||||
|
conn,
|
||||||
|
s.scope,
|
||||||
|
controlID,
|
||||||
|
cursor,
|
||||||
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user