Remove audit link to registries
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -33,7 +33,6 @@ type (
|
||||
ReferenceID string `db:"reference_id"`
|
||||
Area *string `db:"area"`
|
||||
Source *string `db:"source"`
|
||||
AuditID gid.GID `db:"audit_id"`
|
||||
Requirement *string `db:"requirement"`
|
||||
ActionsToBeImplemented *string `db:"actions_to_be_implemented"`
|
||||
Regulator *string `db:"regulator"`
|
||||
@@ -78,7 +77,6 @@ SELECT
|
||||
reference_id,
|
||||
area,
|
||||
source,
|
||||
audit_id,
|
||||
requirement,
|
||||
actions_to_be_implemented,
|
||||
regulator,
|
||||
@@ -162,7 +160,6 @@ SELECT
|
||||
reference_id,
|
||||
area,
|
||||
source,
|
||||
audit_id,
|
||||
requirement,
|
||||
actions_to_be_implemented,
|
||||
regulator,
|
||||
@@ -214,7 +211,6 @@ INSERT INTO compliance_registries (
|
||||
reference_id,
|
||||
area,
|
||||
source,
|
||||
audit_id,
|
||||
requirement,
|
||||
actions_to_be_implemented,
|
||||
regulator,
|
||||
@@ -231,7 +227,6 @@ INSERT INTO compliance_registries (
|
||||
@reference_id,
|
||||
@area,
|
||||
@source,
|
||||
@audit_id,
|
||||
@requirement,
|
||||
@actions_to_be_implemented,
|
||||
@regulator,
|
||||
@@ -251,7 +246,6 @@ INSERT INTO compliance_registries (
|
||||
"reference_id": cr.ReferenceID,
|
||||
"area": cr.Area,
|
||||
"source": cr.Source,
|
||||
"audit_id": cr.AuditID,
|
||||
"requirement": cr.Requirement,
|
||||
"actions_to_be_implemented": cr.ActionsToBeImplemented,
|
||||
"regulator": cr.Regulator,
|
||||
@@ -281,7 +275,6 @@ UPDATE compliance_registries SET
|
||||
reference_id = @reference_id,
|
||||
area = @area,
|
||||
source = @source,
|
||||
audit_id = @audit_id,
|
||||
requirement = @requirement,
|
||||
actions_to_be_implemented = @actions_to_be_implemented,
|
||||
regulator = @regulator,
|
||||
@@ -302,7 +295,6 @@ WHERE
|
||||
"reference_id": cr.ReferenceID,
|
||||
"area": cr.Area,
|
||||
"source": cr.Source,
|
||||
"audit_id": cr.AuditID,
|
||||
"requirement": cr.Requirement,
|
||||
"actions_to_be_implemented": cr.ActionsToBeImplemented,
|
||||
"regulator": cr.Regulator,
|
||||
|
||||
@@ -32,7 +32,6 @@ type (
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
ReferenceID string `db:"reference_id"`
|
||||
Description *string `db:"description"`
|
||||
AuditID gid.GID `db:"audit_id"`
|
||||
Source *string `db:"source"`
|
||||
OwnerID gid.GID `db:"owner_id"`
|
||||
TargetDate *time.Time `db:"target_date"`
|
||||
@@ -74,7 +73,6 @@ SELECT
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
audit_id,
|
||||
source,
|
||||
owner_id,
|
||||
target_date,
|
||||
@@ -155,7 +153,6 @@ SELECT
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
audit_id,
|
||||
source,
|
||||
owner_id,
|
||||
target_date,
|
||||
@@ -204,7 +201,6 @@ INSERT INTO continual_improvement_registries (
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
audit_id,
|
||||
source,
|
||||
owner_id,
|
||||
target_date,
|
||||
@@ -218,7 +214,6 @@ INSERT INTO continual_improvement_registries (
|
||||
@organization_id,
|
||||
@reference_id,
|
||||
@description,
|
||||
@audit_id,
|
||||
@source,
|
||||
@owner_id,
|
||||
@target_date,
|
||||
@@ -235,7 +230,6 @@ INSERT INTO continual_improvement_registries (
|
||||
"organization_id": cir.OrganizationID,
|
||||
"reference_id": cir.ReferenceID,
|
||||
"description": cir.Description,
|
||||
"audit_id": cir.AuditID,
|
||||
"source": cir.Source,
|
||||
"owner_id": cir.OwnerID,
|
||||
"target_date": cir.TargetDate,
|
||||
@@ -262,7 +256,6 @@ func (cir *ContinualImprovementRegistry) Update(
|
||||
UPDATE continual_improvement_registries SET
|
||||
reference_id = @reference_id,
|
||||
description = @description,
|
||||
audit_id = @audit_id,
|
||||
source = @source,
|
||||
owner_id = @owner_id,
|
||||
target_date = @target_date,
|
||||
@@ -280,7 +273,6 @@ WHERE
|
||||
"id": cir.ID,
|
||||
"reference_id": cir.ReferenceID,
|
||||
"description": cir.Description,
|
||||
"audit_id": cir.AuditID,
|
||||
"source": cir.Source,
|
||||
"owner_id": cir.OwnerID,
|
||||
"target_date": cir.TargetDate,
|
||||
|
||||
@@ -36,7 +36,6 @@ CREATE TABLE processing_activity_registries (
|
||||
id TEXT PRIMARY KEY,
|
||||
tenant_id TEXT NOT NULL,
|
||||
organization_id TEXT NOT NULL,
|
||||
audit_id TEXT NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
purpose TEXT,
|
||||
data_subject_category TEXT,
|
||||
@@ -59,11 +58,5 @@ CREATE TABLE processing_activity_registries (
|
||||
FOREIGN KEY (organization_id)
|
||||
REFERENCES organizations(id)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE CASCADE,
|
||||
|
||||
CONSTRAINT processing_activity_registries_audit_id_fkey
|
||||
FOREIGN KEY (audit_id)
|
||||
REFERENCES audits(id)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE CASCADE
|
||||
);
|
||||
|
||||
5
pkg/coredata/migrations/20250828T120643Z.sql
Normal file
5
pkg/coredata/migrations/20250828T120643Z.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE compliance_registries DROP CONSTRAINT compliance_registries_audit_id_fkey;
|
||||
ALTER TABLE compliance_registries DROP COLUMN audit_id;
|
||||
|
||||
ALTER TABLE continual_improvement_registries DROP CONSTRAINT continual_improvement_registries_audit_id_fkey;
|
||||
ALTER TABLE continual_improvement_registries DROP COLUMN audit_id;
|
||||
@@ -30,7 +30,6 @@ type (
|
||||
ProcessingActivityRegistry struct {
|
||||
ID gid.GID `db:"id"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
AuditID gid.GID `db:"audit_id"`
|
||||
Name string `db:"name"`
|
||||
Purpose *string `db:"purpose"`
|
||||
DataSubjectCategory *string `db:"data_subject_category"`
|
||||
@@ -74,7 +73,6 @@ func (p *ProcessingActivityRegistry) LoadByID(
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
audit_id,
|
||||
name,
|
||||
purpose,
|
||||
data_subject_category,
|
||||
@@ -163,7 +161,6 @@ func (p *ProcessingActivityRegistries) LoadByOrganizationID(
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
audit_id,
|
||||
name,
|
||||
purpose,
|
||||
data_subject_category,
|
||||
@@ -210,96 +207,6 @@ WHERE
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistries) CountByAuditID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
auditID gid.GID,
|
||||
) (int, error) {
|
||||
q := `
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM
|
||||
processing_activity_registries
|
||||
WHERE
|
||||
%s
|
||||
AND audit_id = @audit_id
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"audit_id": auditID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
row := conn.QueryRow(ctx, q, args)
|
||||
|
||||
var count int
|
||||
err := row.Scan(&count)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("cannot count processing activity registries: %w", err)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistries) LoadByAuditID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
auditID gid.GID,
|
||||
cursor *page.Cursor[ProcessingActivityRegistryOrderField],
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
audit_id,
|
||||
name,
|
||||
purpose,
|
||||
data_subject_category,
|
||||
personal_data_category,
|
||||
special_or_criminal_data,
|
||||
consent_evidence_link,
|
||||
lawful_basis,
|
||||
recipients,
|
||||
location,
|
||||
international_transfers,
|
||||
transfer_safeguards,
|
||||
retention_period,
|
||||
security_measures,
|
||||
data_protection_impact_assessment,
|
||||
transfer_impact_assessment,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
processing_activity_registries
|
||||
WHERE
|
||||
%s
|
||||
AND audit_id = @audit_id
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"audit_id": auditID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, cursor.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query processing activity registries: %w", err)
|
||||
}
|
||||
|
||||
processingActivityRegistries, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ProcessingActivityRegistry])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect processing activity registries: %w", err)
|
||||
}
|
||||
|
||||
*p = processingActivityRegistries
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistry) Insert(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
@@ -310,7 +217,6 @@ INSERT INTO processing_activity_registries (
|
||||
id,
|
||||
tenant_id,
|
||||
organization_id,
|
||||
audit_id,
|
||||
name,
|
||||
purpose,
|
||||
data_subject_category,
|
||||
@@ -332,7 +238,6 @@ INSERT INTO processing_activity_registries (
|
||||
@id,
|
||||
@tenant_id,
|
||||
@organization_id,
|
||||
@audit_id,
|
||||
@name,
|
||||
@purpose,
|
||||
@data_subject_category,
|
||||
@@ -357,7 +262,6 @@ INSERT INTO processing_activity_registries (
|
||||
"id": p.ID,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"organization_id": p.OrganizationID,
|
||||
"audit_id": p.AuditID,
|
||||
"name": p.Name,
|
||||
"purpose": p.Purpose,
|
||||
"data_subject_category": p.DataSubjectCategory,
|
||||
@@ -395,7 +299,6 @@ UPDATE processing_activity_registries
|
||||
SET
|
||||
name = @name,
|
||||
purpose = @purpose,
|
||||
audit_id = @audit_id,
|
||||
data_subject_category = @data_subject_category,
|
||||
personal_data_category = @personal_data_category,
|
||||
special_or_criminal_data = @special_or_criminal_data,
|
||||
@@ -421,7 +324,6 @@ WHERE
|
||||
"id": p.ID,
|
||||
"name": p.Name,
|
||||
"purpose": p.Purpose,
|
||||
"audit_id": p.AuditID,
|
||||
"data_subject_category": p.DataSubjectCategory,
|
||||
"personal_data_category": p.PersonalDataCategory,
|
||||
"special_or_criminal_data": p.SpecialOrCriminalData,
|
||||
|
||||
@@ -35,7 +35,6 @@ type (
|
||||
ReferenceID string
|
||||
Area *string
|
||||
Source *string
|
||||
AuditID gid.GID
|
||||
Requirement *string
|
||||
ActionsToBeImplemented *string
|
||||
Regulator *string
|
||||
@@ -50,7 +49,6 @@ type (
|
||||
ReferenceID *string
|
||||
Area **string
|
||||
Source **string
|
||||
AuditID *gid.GID
|
||||
Requirement **string
|
||||
ActionsToBeImplemented **string
|
||||
Regulator **string
|
||||
@@ -97,7 +95,6 @@ func (s *ComplianceRegistryService) Create(
|
||||
ReferenceID: req.ReferenceID,
|
||||
Area: req.Area,
|
||||
Source: req.Source,
|
||||
AuditID: req.AuditID,
|
||||
Requirement: req.Requirement,
|
||||
ActionsToBeImplemented: req.ActionsToBeImplemented,
|
||||
Regulator: req.Regulator,
|
||||
@@ -117,11 +114,6 @@ func (s *ComplianceRegistryService) Create(
|
||||
return fmt.Errorf("cannot load organization: %w", err)
|
||||
}
|
||||
|
||||
audit := &coredata.Audit{}
|
||||
if err := audit.LoadByID(ctx, conn, s.svc.scope, req.AuditID); err != nil {
|
||||
return fmt.Errorf("cannot load audit: %w", err)
|
||||
}
|
||||
|
||||
owner := &coredata.People{}
|
||||
if err := owner.LoadByID(ctx, conn, s.svc.scope, req.OwnerID); err != nil {
|
||||
return fmt.Errorf("cannot load owner: %w", err)
|
||||
@@ -167,14 +159,6 @@ func (s *ComplianceRegistryService) Update(
|
||||
registry.Source = *req.Source
|
||||
}
|
||||
|
||||
if req.AuditID != nil {
|
||||
audit := &coredata.Audit{}
|
||||
if err := audit.LoadByID(ctx, conn, s.svc.scope, *req.AuditID); err != nil {
|
||||
return fmt.Errorf("cannot load audit: %w", err)
|
||||
}
|
||||
registry.AuditID = *req.AuditID
|
||||
}
|
||||
|
||||
if req.Requirement != nil {
|
||||
registry.Requirement = *req.Requirement
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ type (
|
||||
OrganizationID gid.GID
|
||||
ReferenceID string
|
||||
Description *string
|
||||
AuditID gid.GID
|
||||
Source *string
|
||||
OwnerID gid.GID
|
||||
TargetDate *time.Time
|
||||
@@ -46,7 +45,6 @@ type (
|
||||
ID gid.GID
|
||||
ReferenceID *string
|
||||
Description **string
|
||||
AuditID *gid.GID
|
||||
Source **string
|
||||
OwnerID *gid.GID
|
||||
TargetDate **time.Time
|
||||
@@ -90,7 +88,6 @@ func (s *ContinualImprovementRegistriesService) Create(
|
||||
OrganizationID: req.OrganizationID,
|
||||
ReferenceID: req.ReferenceID,
|
||||
Description: req.Description,
|
||||
AuditID: req.AuditID,
|
||||
Source: req.Source,
|
||||
OwnerID: req.OwnerID,
|
||||
TargetDate: req.TargetDate,
|
||||
@@ -108,11 +105,6 @@ func (s *ContinualImprovementRegistriesService) Create(
|
||||
return fmt.Errorf("cannot load organization: %w", err)
|
||||
}
|
||||
|
||||
audit := &coredata.Audit{}
|
||||
if err := audit.LoadByID(ctx, conn, s.svc.scope, req.AuditID); err != nil {
|
||||
return fmt.Errorf("cannot load audit: %w", err)
|
||||
}
|
||||
|
||||
owner := &coredata.People{}
|
||||
if err := owner.LoadByID(ctx, conn, s.svc.scope, req.OwnerID); err != nil {
|
||||
return fmt.Errorf("cannot load owner: %w", err)
|
||||
@@ -154,14 +146,6 @@ func (s *ContinualImprovementRegistriesService) Update(
|
||||
registry.Description = *req.Description
|
||||
}
|
||||
|
||||
if req.AuditID != nil {
|
||||
audit := &coredata.Audit{}
|
||||
if err := audit.LoadByID(ctx, conn, s.svc.scope, *req.AuditID); err != nil {
|
||||
return fmt.Errorf("cannot load audit: %w", err)
|
||||
}
|
||||
registry.AuditID = *req.AuditID
|
||||
}
|
||||
|
||||
if req.Source != nil {
|
||||
registry.Source = *req.Source
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ type ProcessingActivityRegistryService struct {
|
||||
type (
|
||||
CreateProcessingActivityRegistryRequest struct {
|
||||
OrganizationID gid.GID
|
||||
AuditID gid.GID
|
||||
Name string
|
||||
Purpose *string
|
||||
DataSubjectCategory *string
|
||||
@@ -52,7 +51,6 @@ type (
|
||||
|
||||
UpdateProcessingActivityRegistryRequest struct {
|
||||
ID gid.GID
|
||||
AuditID *gid.GID
|
||||
Name *string
|
||||
Purpose **string
|
||||
DataSubjectCategory **string
|
||||
@@ -100,7 +98,6 @@ func (s *ProcessingActivityRegistryService) Create(
|
||||
processingActivityRegistry := &coredata.ProcessingActivityRegistry{
|
||||
ID: gid.New(s.svc.scope.GetTenantID(), coredata.ProcessingActivityRegistryEntityType),
|
||||
OrganizationID: req.OrganizationID,
|
||||
AuditID: req.AuditID,
|
||||
Name: req.Name,
|
||||
Purpose: req.Purpose,
|
||||
DataSubjectCategory: req.DataSubjectCategory,
|
||||
@@ -128,11 +125,6 @@ func (s *ProcessingActivityRegistryService) Create(
|
||||
return fmt.Errorf("cannot load organization: %w", err)
|
||||
}
|
||||
|
||||
audit := &coredata.Audit{}
|
||||
if err := audit.LoadByID(ctx, conn, s.svc.scope, req.AuditID); err != nil {
|
||||
return fmt.Errorf("cannot load audit: %w", err)
|
||||
}
|
||||
|
||||
if err := processingActivityRegistry.Insert(ctx, conn, s.svc.scope); err != nil {
|
||||
return fmt.Errorf("cannot insert processing activity registry: %w", err)
|
||||
}
|
||||
@@ -161,14 +153,6 @@ func (s *ProcessingActivityRegistryService) Update(
|
||||
return fmt.Errorf("cannot load processing activity registry: %w", err)
|
||||
}
|
||||
|
||||
if req.AuditID != nil {
|
||||
audit := &coredata.Audit{}
|
||||
if err := audit.LoadByID(ctx, conn, s.svc.scope, *req.AuditID); err != nil {
|
||||
return fmt.Errorf("cannot load audit: %w", err)
|
||||
}
|
||||
processingActivityRegistry.AuditID = audit.ID
|
||||
}
|
||||
|
||||
if req.Name != nil {
|
||||
processingActivityRegistry.Name = *req.Name
|
||||
}
|
||||
@@ -300,60 +284,3 @@ func (s ProcessingActivityRegistryService) CountForOrganizationID(
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (s ProcessingActivityRegistryService) ListForAuditID(
|
||||
ctx context.Context,
|
||||
auditID gid.GID,
|
||||
cursor *page.Cursor[coredata.ProcessingActivityRegistryOrderField],
|
||||
) (*page.Page[*coredata.ProcessingActivityRegistry, coredata.ProcessingActivityRegistryOrderField], error) {
|
||||
var processingActivityRegistries coredata.ProcessingActivityRegistries
|
||||
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) error {
|
||||
audit := &coredata.Audit{}
|
||||
if err := audit.LoadByID(ctx, conn, s.svc.scope, auditID); err != nil {
|
||||
return fmt.Errorf("cannot load audit: %w", err)
|
||||
}
|
||||
|
||||
err := processingActivityRegistries.LoadByAuditID(ctx, conn, s.svc.scope, audit.ID, cursor)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot load processing activity registries: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return page.NewPage(processingActivityRegistries, cursor), nil
|
||||
}
|
||||
|
||||
func (s ProcessingActivityRegistryService) CountForAuditID(
|
||||
ctx context.Context,
|
||||
auditID gid.GID,
|
||||
) (int, error) {
|
||||
var count int
|
||||
|
||||
err := s.svc.pg.WithConn(
|
||||
ctx,
|
||||
func(conn pg.Conn) (err error) {
|
||||
processingActivityRegistries := coredata.ProcessingActivityRegistries{}
|
||||
count, err = processingActivityRegistries.CountByAuditID(ctx, conn, s.svc.scope, auditID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot count processing activity registries: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
@@ -1691,14 +1691,6 @@ type Audit implements Node {
|
||||
filter: ControlFilter
|
||||
): ControlConnection! @goField(forceResolver: true)
|
||||
|
||||
processingActivityRegistries(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: ProcessingActivityRegistryOrder
|
||||
): ProcessingActivityRegistryConnection! @goField(forceResolver: true)
|
||||
|
||||
showOnTrustCenter: Boolean!
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
@@ -1727,7 +1719,6 @@ type ComplianceRegistry implements Node {
|
||||
referenceId: String!
|
||||
area: String
|
||||
source: String
|
||||
audit: Audit! @goField(forceResolver: true)
|
||||
requirement: String
|
||||
actionsToBeImplemented: String
|
||||
regulator: String
|
||||
@@ -1744,7 +1735,6 @@ type ContinualImprovementRegistry implements Node {
|
||||
organization: Organization! @goField(forceResolver: true)
|
||||
referenceId: String!
|
||||
description: String
|
||||
audit: Audit! @goField(forceResolver: true)
|
||||
source: String
|
||||
owner: People! @goField(forceResolver: true)
|
||||
targetDate: Datetime
|
||||
@@ -1757,7 +1747,6 @@ type ContinualImprovementRegistry implements Node {
|
||||
type ProcessingActivityRegistry implements Node {
|
||||
id: ID!
|
||||
organization: Organization! @goField(forceResolver: true)
|
||||
audit: Audit! @goField(forceResolver: true)
|
||||
name: String!
|
||||
purpose: String
|
||||
dataSubjectCategory: String
|
||||
@@ -2971,7 +2960,6 @@ input CreateComplianceRegistryInput {
|
||||
referenceId: String!
|
||||
area: String
|
||||
source: String
|
||||
auditId: ID!
|
||||
requirement: String
|
||||
actionsToBeImplemented: String
|
||||
regulator: String
|
||||
@@ -2986,7 +2974,6 @@ input UpdateComplianceRegistryInput {
|
||||
referenceId: String
|
||||
area: String
|
||||
source: String
|
||||
auditId: ID
|
||||
requirement: String
|
||||
actionsToBeImplemented: String
|
||||
regulator: String
|
||||
@@ -3004,7 +2991,6 @@ input CreateContinualImprovementRegistryInput {
|
||||
organizationId: ID!
|
||||
referenceId: String!
|
||||
description: String
|
||||
auditId: ID!
|
||||
source: String
|
||||
ownerId: ID!
|
||||
targetDate: Datetime
|
||||
@@ -3016,7 +3002,6 @@ input UpdateContinualImprovementRegistryInput {
|
||||
id: ID!
|
||||
referenceId: String
|
||||
description: String
|
||||
auditId: ID
|
||||
source: String
|
||||
ownerId: ID
|
||||
targetDate: Datetime
|
||||
@@ -3030,7 +3015,6 @@ input DeleteContinualImprovementRegistryInput {
|
||||
|
||||
input CreateProcessingActivityRegistryInput {
|
||||
organizationId: ID!
|
||||
auditId: ID!
|
||||
name: String!
|
||||
purpose: String
|
||||
dataSubjectCategory: String
|
||||
@@ -3050,7 +3034,6 @@ input CreateProcessingActivityRegistryInput {
|
||||
|
||||
input UpdateProcessingActivityRegistryInput {
|
||||
id: ID!
|
||||
auditId: ID
|
||||
name: String
|
||||
purpose: String
|
||||
dataSubjectCategory: String
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -57,20 +57,19 @@ type AssignTaskPayload struct {
|
||||
}
|
||||
|
||||
type Audit struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Organization *Organization `json:"organization"`
|
||||
Framework *Framework `json:"framework"`
|
||||
ValidFrom *time.Time `json:"validFrom,omitempty"`
|
||||
ValidUntil *time.Time `json:"validUntil,omitempty"`
|
||||
Report *Report `json:"report,omitempty"`
|
||||
ReportURL *string `json:"reportUrl,omitempty"`
|
||||
State coredata.AuditState `json:"state"`
|
||||
Controls *ControlConnection `json:"controls"`
|
||||
ProcessingActivityRegistries *ProcessingActivityRegistryConnection `json:"processingActivityRegistries"`
|
||||
ShowOnTrustCenter bool `json:"showOnTrustCenter"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
ID gid.GID `json:"id"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Organization *Organization `json:"organization"`
|
||||
Framework *Framework `json:"framework"`
|
||||
ValidFrom *time.Time `json:"validFrom,omitempty"`
|
||||
ValidUntil *time.Time `json:"validUntil,omitempty"`
|
||||
Report *Report `json:"report,omitempty"`
|
||||
ReportURL *string `json:"reportUrl,omitempty"`
|
||||
State coredata.AuditState `json:"state"`
|
||||
Controls *ControlConnection `json:"controls"`
|
||||
ShowOnTrustCenter bool `json:"showOnTrustCenter"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (Audit) IsNode() {}
|
||||
@@ -114,7 +113,6 @@ type ComplianceRegistry struct {
|
||||
ReferenceID string `json:"referenceId"`
|
||||
Area *string `json:"area,omitempty"`
|
||||
Source *string `json:"source,omitempty"`
|
||||
Audit *Audit `json:"audit"`
|
||||
Requirement *string `json:"requirement,omitempty"`
|
||||
ActionsToBeImplemented *string `json:"actionsToBeImplemented,omitempty"`
|
||||
Regulator *string `json:"regulator,omitempty"`
|
||||
@@ -173,7 +171,6 @@ type ContinualImprovementRegistry struct {
|
||||
Organization *Organization `json:"organization"`
|
||||
ReferenceID string `json:"referenceId"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Audit *Audit `json:"audit"`
|
||||
Source *string `json:"source,omitempty"`
|
||||
Owner *People `json:"owner"`
|
||||
TargetDate *time.Time `json:"targetDate,omitempty"`
|
||||
@@ -252,7 +249,6 @@ type CreateComplianceRegistryInput struct {
|
||||
ReferenceID string `json:"referenceId"`
|
||||
Area *string `json:"area,omitempty"`
|
||||
Source *string `json:"source,omitempty"`
|
||||
AuditID gid.GID `json:"auditId"`
|
||||
Requirement *string `json:"requirement,omitempty"`
|
||||
ActionsToBeImplemented *string `json:"actionsToBeImplemented,omitempty"`
|
||||
Regulator *string `json:"regulator,omitempty"`
|
||||
@@ -270,7 +266,6 @@ type CreateContinualImprovementRegistryInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
ReferenceID string `json:"referenceId"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
AuditID gid.GID `json:"auditId"`
|
||||
Source *string `json:"source,omitempty"`
|
||||
OwnerID gid.GID `json:"ownerId"`
|
||||
TargetDate *time.Time `json:"targetDate,omitempty"`
|
||||
@@ -445,7 +440,6 @@ type CreatePeoplePayload struct {
|
||||
|
||||
type CreateProcessingActivityRegistryInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
AuditID gid.GID `json:"auditId"`
|
||||
Name string `json:"name"`
|
||||
Purpose *string `json:"purpose,omitempty"`
|
||||
DataSubjectCategory *string `json:"dataSubjectCategory,omitempty"`
|
||||
@@ -1228,7 +1222,6 @@ type PeopleFilter struct {
|
||||
type ProcessingActivityRegistry struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Organization *Organization `json:"organization"`
|
||||
Audit *Audit `json:"audit"`
|
||||
Name string `json:"name"`
|
||||
Purpose *string `json:"purpose,omitempty"`
|
||||
DataSubjectCategory *string `json:"dataSubjectCategory,omitempty"`
|
||||
@@ -1486,7 +1479,6 @@ type UpdateComplianceRegistryInput struct {
|
||||
ReferenceID *string `json:"referenceId,omitempty"`
|
||||
Area *string `json:"area,omitempty"`
|
||||
Source *string `json:"source,omitempty"`
|
||||
AuditID *gid.GID `json:"auditId,omitempty"`
|
||||
Requirement *string `json:"requirement,omitempty"`
|
||||
ActionsToBeImplemented *string `json:"actionsToBeImplemented,omitempty"`
|
||||
Regulator *string `json:"regulator,omitempty"`
|
||||
@@ -1504,7 +1496,6 @@ type UpdateContinualImprovementRegistryInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
ReferenceID *string `json:"referenceId,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
AuditID *gid.GID `json:"auditId,omitempty"`
|
||||
Source *string `json:"source,omitempty"`
|
||||
OwnerID *gid.GID `json:"ownerId,omitempty"`
|
||||
TargetDate *time.Time `json:"targetDate,omitempty"`
|
||||
@@ -1631,7 +1622,6 @@ type UpdatePeoplePayload struct {
|
||||
|
||||
type UpdateProcessingActivityRegistryInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
AuditID *gid.GID `json:"auditId,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Purpose *string `json:"purpose,omitempty"`
|
||||
DataSubjectCategory *string `json:"dataSubjectCategory,omitempty"`
|
||||
|
||||
@@ -209,31 +209,6 @@ func (r *auditResolver) Controls(ctx context.Context, obj *types.Audit, first *i
|
||||
return types.NewControlConnection(page, r, obj.ID, controlFilter), nil
|
||||
}
|
||||
|
||||
// ProcessingActivityRegistries is the resolver for the processingActivityRegistries field.
|
||||
func (r *auditResolver) ProcessingActivityRegistries(ctx context.Context, obj *types.Audit, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ProcessingActivityRegistryOrderBy) (*types.ProcessingActivityRegistryConnection, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.ProcessingActivityRegistryOrderField]{
|
||||
Field: coredata.ProcessingActivityRegistryOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.ProcessingActivityRegistryOrderField]{
|
||||
Field: orderBy.Field,
|
||||
Direction: orderBy.Direction,
|
||||
}
|
||||
}
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.ProcessingActivityRegistries.ListForAuditID(ctx, obj.ID, cursor)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot list processing activity registries: %w", err)
|
||||
}
|
||||
|
||||
return types.NewProcessingActivityRegistryConnection(page, r, obj.ID), nil
|
||||
}
|
||||
|
||||
// TotalCount is the resolver for the totalCount field.
|
||||
func (r *auditConnectionResolver) TotalCount(ctx context.Context, obj *types.AuditConnection) (int, error) {
|
||||
prb := r.ProboService(ctx, obj.ParentID.TenantID())
|
||||
@@ -262,23 +237,6 @@ func (r *complianceRegistryResolver) Organization(ctx context.Context, obj *type
|
||||
return types.NewOrganization(organization), nil
|
||||
}
|
||||
|
||||
// Audit is the resolver for the audit field.
|
||||
func (r *complianceRegistryResolver) Audit(ctx context.Context, obj *types.ComplianceRegistry) (*types.Audit, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
registry, err := prb.ComplianceRegistries.Get(ctx, obj.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get compliance registry: %w", err))
|
||||
}
|
||||
|
||||
audit, err := prb.Audits.Get(ctx, registry.AuditID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get compliance registry audit: %w", err))
|
||||
}
|
||||
|
||||
return types.NewAudit(audit), nil
|
||||
}
|
||||
|
||||
// Owner is the resolver for the owner field.
|
||||
func (r *complianceRegistryResolver) Owner(ctx context.Context, obj *types.ComplianceRegistry) (*types.People, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
@@ -329,23 +287,6 @@ func (r *continualImprovementRegistryResolver) Organization(ctx context.Context,
|
||||
return types.NewOrganization(organization), nil
|
||||
}
|
||||
|
||||
// Audit is the resolver for the audit field.
|
||||
func (r *continualImprovementRegistryResolver) Audit(ctx context.Context, obj *types.ContinualImprovementRegistry) (*types.Audit, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
registry, err := prb.ContinualImprovementRegistries.Get(ctx, obj.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get continual improvement registry: %w", err))
|
||||
}
|
||||
|
||||
audit, err := prb.Audits.Get(ctx, registry.AuditID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get continual improvement registry audit: %w", err))
|
||||
}
|
||||
|
||||
return types.NewAudit(audit), nil
|
||||
}
|
||||
|
||||
// Owner is the resolver for the owner field.
|
||||
func (r *continualImprovementRegistryResolver) Owner(ctx context.Context, obj *types.ContinualImprovementRegistry) (*types.People, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
@@ -3080,7 +3021,6 @@ func (r *mutationResolver) CreateComplianceRegistry(ctx context.Context, input t
|
||||
ReferenceID: input.ReferenceID,
|
||||
Area: input.Area,
|
||||
Source: input.Source,
|
||||
AuditID: input.AuditID,
|
||||
Requirement: input.Requirement,
|
||||
ActionsToBeImplemented: input.ActionsToBeImplemented,
|
||||
Regulator: input.Regulator,
|
||||
@@ -3109,7 +3049,6 @@ func (r *mutationResolver) UpdateComplianceRegistry(ctx context.Context, input t
|
||||
ReferenceID: input.ReferenceID,
|
||||
Area: &input.Area,
|
||||
Source: &input.Source,
|
||||
AuditID: input.AuditID,
|
||||
Requirement: &input.Requirement,
|
||||
ActionsToBeImplemented: &input.ActionsToBeImplemented,
|
||||
Regulator: &input.Regulator,
|
||||
@@ -3151,7 +3090,6 @@ func (r *mutationResolver) CreateContinualImprovementRegistry(ctx context.Contex
|
||||
OrganizationID: input.OrganizationID,
|
||||
ReferenceID: input.ReferenceID,
|
||||
Description: input.Description,
|
||||
AuditID: input.AuditID,
|
||||
Source: input.Source,
|
||||
OwnerID: input.OwnerID,
|
||||
TargetDate: input.TargetDate,
|
||||
@@ -3177,7 +3115,6 @@ func (r *mutationResolver) UpdateContinualImprovementRegistry(ctx context.Contex
|
||||
ID: input.ID,
|
||||
ReferenceID: input.ReferenceID,
|
||||
Description: &input.Description,
|
||||
AuditID: input.AuditID,
|
||||
Source: &input.Source,
|
||||
OwnerID: input.OwnerID,
|
||||
TargetDate: &input.TargetDate,
|
||||
@@ -3229,7 +3166,6 @@ func (r *mutationResolver) CreateProcessingActivityRegistry(ctx context.Context,
|
||||
SecurityMeasures: input.SecurityMeasures,
|
||||
DataProtectionImpactAssessment: input.DataProtectionImpactAssessment,
|
||||
TransferImpactAssessment: input.TransferImpactAssessment,
|
||||
AuditID: input.AuditID,
|
||||
}
|
||||
|
||||
registry, err := prb.ProcessingActivityRegistries.Create(ctx, &req)
|
||||
@@ -3262,7 +3198,6 @@ func (r *mutationResolver) UpdateProcessingActivityRegistry(ctx context.Context,
|
||||
SecurityMeasures: &input.SecurityMeasures,
|
||||
DataProtectionImpactAssessment: input.DataProtectionImpactAssessment,
|
||||
TransferImpactAssessment: input.TransferImpactAssessment,
|
||||
AuditID: input.AuditID,
|
||||
}
|
||||
|
||||
registry, err := prb.ProcessingActivityRegistries.Update(ctx, &req)
|
||||
@@ -3922,23 +3857,6 @@ func (r *processingActivityRegistryResolver) Organization(ctx context.Context, o
|
||||
return types.NewOrganization(organization), nil
|
||||
}
|
||||
|
||||
// Audit is the resolver for the audit field.
|
||||
func (r *processingActivityRegistryResolver) Audit(ctx context.Context, obj *types.ProcessingActivityRegistry) (*types.Audit, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
processingActivityRegistry, err := prb.ProcessingActivityRegistries.Get(ctx, obj.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get processing activity registry: %w", err))
|
||||
}
|
||||
|
||||
audit, err := prb.Audits.Get(ctx, processingActivityRegistry.AuditID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot get audit: %w", err)
|
||||
}
|
||||
|
||||
return types.NewAudit(audit), nil
|
||||
}
|
||||
|
||||
// TotalCount is the resolver for the totalCount field.
|
||||
func (r *processingActivityRegistryConnectionResolver) TotalCount(ctx context.Context, obj *types.ProcessingActivityRegistryConnection) (int, error) {
|
||||
prb := r.ProboService(ctx, obj.ParentID.TenantID())
|
||||
@@ -3950,12 +3868,6 @@ func (r *processingActivityRegistryConnectionResolver) TotalCount(ctx context.Co
|
||||
panic(fmt.Errorf("cannot count organization processing activity registries: %w", err))
|
||||
}
|
||||
return count, nil
|
||||
case *auditResolver:
|
||||
count, err := prb.ProcessingActivityRegistries.CountForAuditID(ctx, obj.ParentID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot count audit processing activity registries: %w", err))
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
|
||||
panic(fmt.Errorf("unsupported resolver: %T", obj.Resolver))
|
||||
|
||||
Reference in New Issue
Block a user