Remove audit link to registries
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -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