Change registry names

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-12-19 17:25:56 +01:00
parent dccd186eb7
commit cd13f9aa00
42 changed files with 5623 additions and 5610 deletions

View File

@@ -38,36 +38,36 @@ const (
const (
ActionGet Action = "get"
ActionGetAssetType Action = "getAssetType"
ActionGetAssignedTo Action = "getAssignedTo"
ActionGetAuthMethod Action = "getAuthMethod"
ActionGetBusinessAssociateAgreement Action = "getBusinessAssociateAgreement"
ActionGetBusinessOwner Action = "getBusinessOwner"
ActionGetCustomDomain Action = "getCustomDomain"
ActionGetDataPrivacyAgreement Action = "getDataPrivacyAgreement"
ActionGetDataProtectionOfficer Action = "getDataProtectionOfficer"
ActionGetDPIA Action = "getDPIA"
ActionGetTIA Action = "getTIA"
ActionGetDocument Action = "getDocument"
ActionGetReport Action = "getReport"
ActionGetFile Action = "getFile"
ActionGetAudit Action = "getAudit"
ActionGetFileUrl Action = "getFileUrl"
ActionGetFramework Action = "getFramework"
ActionGetHorizontalLogoUrl Action = "getHorizontalLogoUrl"
ActionGetLogoUrl Action = "getLogoUrl"
ActionGetMeasure Action = "getMeasure"
ActionGetNdaFileUrl Action = "getNdaFileUrl"
ActionGetOrganization Action = "getOrganization"
ActionGetOwner Action = "getOwner"
ActionGetSecurityOwner Action = "getSecurityOwner"
ActionGetSigned Action = "getSigned"
ActionGetSignableDocument Action = "getSignableDocument"
ActionGetSnapshot Action = "getSnapshot"
ActionGetTask Action = "getTask"
ActionGetTrustCenter Action = "getTrustCenter"
ActionGetTrustCenterFile Action = "getTrustCenterFile"
ActionGetVendor Action = "getVendor"
ActionGetAssetType Action = "getAssetType"
ActionGetAssignedTo Action = "getAssignedTo"
ActionGetAuthMethod Action = "getAuthMethod"
ActionGetBusinessAssociateAgreement Action = "getBusinessAssociateAgreement"
ActionGetBusinessOwner Action = "getBusinessOwner"
ActionGetCustomDomain Action = "getCustomDomain"
ActionGetDataPrivacyAgreement Action = "getDataPrivacyAgreement"
ActionGetDataProtectionOfficer Action = "getDataProtectionOfficer"
ActionGetDataProtectionImpactAssessment Action = "getDataProtectionImpactAssessment"
ActionGetTransferImpactAssessment Action = "getTransferImpactAssessment"
ActionGetDocument Action = "getDocument"
ActionGetReport Action = "getReport"
ActionGetFile Action = "getFile"
ActionGetAudit Action = "getAudit"
ActionGetFileUrl Action = "getFileUrl"
ActionGetFramework Action = "getFramework"
ActionGetHorizontalLogoUrl Action = "getHorizontalLogoUrl"
ActionGetLogoUrl Action = "getLogoUrl"
ActionGetMeasure Action = "getMeasure"
ActionGetNdaFileUrl Action = "getNdaFileUrl"
ActionGetOrganization Action = "getOrganization"
ActionGetOwner Action = "getOwner"
ActionGetSecurityOwner Action = "getSecurityOwner"
ActionGetSigned Action = "getSigned"
ActionGetSignableDocument Action = "getSignableDocument"
ActionGetSnapshot Action = "getSnapshot"
ActionGetTask Action = "getTask"
ActionGetTrustCenter Action = "getTrustCenter"
ActionGetTrustCenterFile Action = "getTrustCenterFile"
ActionGetVendor Action = "getVendor"
ActionActiveCount Action = "activeCount"
ActionAudit Action = "audit"
@@ -119,42 +119,42 @@ const (
ActionListSignableDocuments Action = "listSignableDocuments"
ActionListSignableDocumentVersion Action = "listSignableDocumentVersion"
ActionCreateAsset Action = "createAsset"
ActionCreateAudit Action = "createAudit"
ActionCreateContinualImprovement Action = "createContinualImprovement"
ActionCreateControl Action = "createControl"
ActionCreateControlAuditMapping Action = "createControlAuditMapping"
ActionCreateControlDocumentMapping Action = "createControlDocumentMapping"
ActionCreateControlMeasureMapping Action = "createControlMeasureMapping"
ActionCreateControlSnapshotMapping Action = "createControlSnapshotMapping"
ActionCreateCustomDomain Action = "createCustomDomain"
ActionCreateDatum Action = "createDatum"
ActionCreateDocument Action = "createDocument"
ActionCreateDraftDocumentVersion Action = "createDraftDocumentVersion"
ActionCreateFramework Action = "createFramework"
ActionCreateMeasure Action = "createMeasure"
ActionCreateMeeting Action = "createMeeting"
ActionCreateNonconformity Action = "createNonconformity"
ActionCreateObligation Action = "createObligation"
ActionCreatePeople Action = "createPeople"
ActionCreateProcessingActivity Action = "createProcessingActivity"
ActionCreateProcessingActivityDPIA Action = "createProcessingActivityDPIA"
ActionCreateProcessingActivityTIA Action = "createProcessingActivityTIA"
ActionCreateRisk Action = "createRisk"
ActionCreateRiskDocumentMapping Action = "createRiskDocumentMapping"
ActionCreateRiskMeasureMapping Action = "createRiskMeasureMapping"
ActionCreateRiskObligationMapping Action = "createRiskObligationMapping"
ActionCreateSAMLConfiguration Action = "createSAMLConfiguration"
ActionCreateSnapshot Action = "createSnapshot"
ActionCreateTask Action = "createTask"
ActionCreateTrustCenter Action = "createTrustCenter"
ActionCreateTrustCenterAccess Action = "createTrustCenterAccess"
ActionCreateTrustCenterFile Action = "createTrustCenterFile"
ActionCreateTrustCenterReference Action = "createTrustCenterReference"
ActionCreateVendor Action = "createVendor"
ActionCreateVendorContact Action = "createVendorContact"
ActionCreateVendorRiskAssessment Action = "createVendorRiskAssessment"
ActionCreateVendorService Action = "createVendorService"
ActionCreateAsset Action = "createAsset"
ActionCreateAudit Action = "createAudit"
ActionCreateContinualImprovement Action = "createContinualImprovement"
ActionCreateControl Action = "createControl"
ActionCreateControlAuditMapping Action = "createControlAuditMapping"
ActionCreateControlDocumentMapping Action = "createControlDocumentMapping"
ActionCreateControlMeasureMapping Action = "createControlMeasureMapping"
ActionCreateControlSnapshotMapping Action = "createControlSnapshotMapping"
ActionCreateCustomDomain Action = "createCustomDomain"
ActionCreateDatum Action = "createDatum"
ActionCreateDocument Action = "createDocument"
ActionCreateDraftDocumentVersion Action = "createDraftDocumentVersion"
ActionCreateFramework Action = "createFramework"
ActionCreateMeasure Action = "createMeasure"
ActionCreateMeeting Action = "createMeeting"
ActionCreateNonconformity Action = "createNonconformity"
ActionCreateObligation Action = "createObligation"
ActionCreatePeople Action = "createPeople"
ActionCreateProcessingActivity Action = "createProcessingActivity"
ActionCreateDataProtectionImpactAssessment Action = "createDataProtectionImpactAssessment"
ActionCreateTransferImpactAssessment Action = "createTransferImpactAssessment"
ActionCreateRisk Action = "createRisk"
ActionCreateRiskDocumentMapping Action = "createRiskDocumentMapping"
ActionCreateRiskMeasureMapping Action = "createRiskMeasureMapping"
ActionCreateRiskObligationMapping Action = "createRiskObligationMapping"
ActionCreateSAMLConfiguration Action = "createSAMLConfiguration"
ActionCreateSnapshot Action = "createSnapshot"
ActionCreateTask Action = "createTask"
ActionCreateTrustCenter Action = "createTrustCenter"
ActionCreateTrustCenterAccess Action = "createTrustCenterAccess"
ActionCreateTrustCenterFile Action = "createTrustCenterFile"
ActionCreateTrustCenterReference Action = "createTrustCenterReference"
ActionCreateVendor Action = "createVendor"
ActionCreateVendorContact Action = "createVendorContact"
ActionCreateVendorRiskAssessment Action = "createVendorRiskAssessment"
ActionCreateVendorService Action = "createVendorService"
ActionUpdateAsset Action = "updateAsset"
ActionUpdateAudit Action = "updateAudit"
@@ -172,8 +172,8 @@ const (
ActionUpdateOrganization Action = "updateOrganization"
ActionUpdatePeople Action = "updatePeople"
ActionUpdateProcessingActivity Action = "updateProcessingActivity"
ActionUpdateProcessingActivityDPIA Action = "updateProcessingActivityDPIA"
ActionUpdateProcessingActivityTIA Action = "updateProcessingActivityTIA"
ActionUpdateDataProtectionImpactAssessment Action = "updateDataProtectionImpactAssessment"
ActionUpdateTransferImpactAssessment Action = "updateTransferImpactAssessment"
ActionUpdateRisk Action = "updateRisk"
ActionUpdateSAMLConfiguration Action = "updateSAMLConfiguration"
ActionUpdateTask Action = "updateTask"
@@ -211,8 +211,8 @@ const (
ActionDeleteOrganizationHorizontalLogo Action = "deleteOrganizationHorizontalLogo"
ActionDeletePeople Action = "deletePeople"
ActionDeleteProcessingActivity Action = "deleteProcessingActivity"
ActionDeleteProcessingActivityDPIA Action = "deleteProcessingActivityDPIA"
ActionDeleteProcessingActivityTIA Action = "deleteProcessingActivityTIA"
ActionDeleteDataProtectionImpactAssessment Action = "deleteDataProtectionImpactAssessment"
ActionDeleteTransferImpactAssessment Action = "deleteTransferImpactAssessment"
ActionDeleteRisk Action = "deleteRisk"
ActionDeleteRiskDocumentMapping Action = "deleteRiskDocumentMapping"
ActionDeleteRiskMeasureMapping Action = "deleteRiskMeasureMapping"
@@ -674,33 +674,33 @@ var Permissions = map[uint16]map[Action][]Role{
ActionDeleteContinualImprovement: EditRoles,
},
coredata.ProcessingActivityEntityType: {
ActionGet: NonEmployeeRoles,
ActionGetOrganization: NonEmployeeRoles,
ActionListVendors: NonEmployeeRoles,
ActionGetDataProtectionOfficer: NonEmployeeRoles,
ActionGetDPIA: NonEmployeeRoles,
ActionGetTIA: NonEmployeeRoles,
ActionGet: NonEmployeeRoles,
ActionGetOrganization: NonEmployeeRoles,
ActionListVendors: NonEmployeeRoles,
ActionGetDataProtectionOfficer: NonEmployeeRoles,
ActionGetDataProtectionImpactAssessment: NonEmployeeRoles,
ActionGetTransferImpactAssessment: NonEmployeeRoles,
ActionUpdateProcessingActivity: EditRoles,
ActionDeleteProcessingActivity: EditRoles,
ActionCreateProcessingActivityDPIA: EditRoles,
ActionCreateProcessingActivityTIA: EditRoles,
ActionUpdateProcessingActivity: EditRoles,
ActionDeleteProcessingActivity: EditRoles,
ActionCreateDataProtectionImpactAssessment: EditRoles,
ActionCreateTransferImpactAssessment: EditRoles,
},
coredata.ProcessingActivityDPIAEntityType: {
coredata.DataProtectionImpactAssessmentEntityType: {
ActionGet: NonEmployeeRoles,
ActionGetOrganization: NonEmployeeRoles,
ActionCreateProcessingActivityDPIA: EditRoles,
ActionUpdateProcessingActivityDPIA: EditRoles,
ActionDeleteProcessingActivityDPIA: EditRoles,
ActionCreateDataProtectionImpactAssessment: EditRoles,
ActionUpdateDataProtectionImpactAssessment: EditRoles,
ActionDeleteDataProtectionImpactAssessment: EditRoles,
},
coredata.ProcessingActivityTIAEntityType: {
coredata.TransferImpactAssessmentEntityType: {
ActionGet: NonEmployeeRoles,
ActionGetOrganization: NonEmployeeRoles,
ActionCreateProcessingActivityTIA: EditRoles,
ActionUpdateProcessingActivityTIA: EditRoles,
ActionDeleteProcessingActivityTIA: EditRoles,
ActionCreateTransferImpactAssessment: EditRoles,
ActionUpdateTransferImpactAssessment: EditRoles,
ActionDeleteTransferImpactAssessment: EditRoles,
},
coredata.SnapshotEntityType: {
ActionGet: NonEmployeeRoles,

View File

@@ -27,48 +27,48 @@ import (
"go.probo.inc/probo/pkg/page"
)
type ErrProcessingActivityDPIANotFound struct {
type ErrDataProtectionImpactAssessmentNotFound struct {
Identifier string
}
func (e ErrProcessingActivityDPIANotFound) Error() string {
return fmt.Sprintf("processing activity dpia not found: %q", e.Identifier)
func (e ErrDataProtectionImpactAssessmentNotFound) Error() string {
return fmt.Sprintf("data protection impact assessment not found: %q", e.Identifier)
}
type (
ProcessingActivityDPIA struct {
ID gid.GID `db:"id"`
SnapshotID *gid.GID `db:"snapshot_id"`
SourceID *gid.GID `db:"source_id"`
OrganizationID gid.GID `db:"organization_id"`
ProcessingActivityID gid.GID `db:"processing_activity_id"`
Description *string `db:"description"`
NecessityAndProportionality *string `db:"necessity_and_proportionality"`
PotentialRisk *string `db:"potential_risk"`
Mitigations *string `db:"mitigations"`
ResidualRisk *ProcessingActivityDPIAResidualRisk `db:"residual_risk"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
DataProtectionImpactAssessment struct {
ID gid.GID `db:"id"`
SnapshotID *gid.GID `db:"snapshot_id"`
SourceID *gid.GID `db:"source_id"`
OrganizationID gid.GID `db:"organization_id"`
ProcessingActivityID gid.GID `db:"processing_activity_id"`
Description *string `db:"description"`
NecessityAndProportionality *string `db:"necessity_and_proportionality"`
PotentialRisk *string `db:"potential_risk"`
Mitigations *string `db:"mitigations"`
ResidualRisk *DataProtectionImpactAssessmentResidualRisk `db:"residual_risk"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
ProcessingActivityDPIAs []*ProcessingActivityDPIA
DataProtectionImpactAssessments []*DataProtectionImpactAssessment
)
func (dpia *ProcessingActivityDPIA) CursorKey(field ProcessingActivityDPIAOrderField) page.CursorKey {
func (dpia *DataProtectionImpactAssessment) CursorKey(field DataProtectionImpactAssessmentOrderField) page.CursorKey {
switch field {
case ProcessingActivityDPIAOrderFieldCreatedAt:
case DataProtectionImpactAssessmentOrderFieldCreatedAt:
return page.NewCursorKey(dpia.ID, dpia.CreatedAt)
}
panic(fmt.Sprintf("unsupported order by: %s", field))
}
func (dpias *ProcessingActivityDPIAs) CountByOrganizationID(
func (dpias *DataProtectionImpactAssessments) CountByOrganizationID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
organizationID gid.GID,
filter *ProcessingActivityDPIAFilter,
filter *DataProtectionImpactAssessmentFilter,
) (int, error) {
q := `
SELECT
@@ -92,19 +92,19 @@ WHERE
var count int
err := row.Scan(&count)
if err != nil {
return 0, fmt.Errorf("cannot count processing activity dpias: %w", err)
return 0, fmt.Errorf("cannot count data protection impact assessments: %w", err)
}
return count, nil
}
func (dpias *ProcessingActivityDPIAs) LoadByOrganizationID(
func (dpias *DataProtectionImpactAssessments) LoadByOrganizationID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
organizationID gid.GID,
cursor *page.Cursor[ProcessingActivityDPIAOrderField],
filter *ProcessingActivityDPIAFilter,
cursor *page.Cursor[DataProtectionImpactAssessmentOrderField],
filter *DataProtectionImpactAssessmentFilter,
) error {
q := `
SELECT
@@ -138,12 +138,12 @@ WHERE
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity dpias: %w", err)
return fmt.Errorf("cannot query data protection impact assessments: %w", err)
}
results, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ProcessingActivityDPIA])
results, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[DataProtectionImpactAssessment])
if err != nil {
return fmt.Errorf("cannot collect processing activity dpias: %w", err)
return fmt.Errorf("cannot collect data protection impact assessments: %w", err)
}
*dpias = results
@@ -151,7 +151,7 @@ WHERE
return nil
}
func (dpia *ProcessingActivityDPIA) LoadByID(
func (dpia *DataProtectionImpactAssessment) LoadByID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -186,15 +186,15 @@ LIMIT 1;
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity dpia: %w", err)
return fmt.Errorf("cannot query data protection impact assessment: %w", err)
}
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ProcessingActivityDPIA])
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[DataProtectionImpactAssessment])
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return &ErrProcessingActivityDPIANotFound{Identifier: dpiaID.String()}
return &ErrDataProtectionImpactAssessmentNotFound{Identifier: dpiaID.String()}
}
return fmt.Errorf("cannot collect processing activity dpia: %w", err)
return fmt.Errorf("cannot collect data protection impact assessment: %w", err)
}
*dpia = result
@@ -202,7 +202,7 @@ LIMIT 1;
return nil
}
func (dpia *ProcessingActivityDPIA) LoadByProcessingActivityID(
func (dpia *DataProtectionImpactAssessment) LoadByProcessingActivityID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -237,15 +237,15 @@ LIMIT 1;
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity dpia: %w", err)
return fmt.Errorf("cannot query data protection impact assessment: %w", err)
}
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ProcessingActivityDPIA])
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[DataProtectionImpactAssessment])
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return &ErrProcessingActivityDPIANotFound{Identifier: processingActivityID.String()}
return &ErrDataProtectionImpactAssessmentNotFound{Identifier: processingActivityID.String()}
}
return fmt.Errorf("cannot collect processing activity dpia: %w", err)
return fmt.Errorf("cannot collect data protection impact assessment: %w", err)
}
*dpia = result
@@ -253,7 +253,7 @@ LIMIT 1;
return nil
}
func (dpia *ProcessingActivityDPIA) Insert(
func (dpia *DataProtectionImpactAssessment) Insert(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -302,13 +302,13 @@ INSERT INTO processing_activity_data_protection_impact_assessments (
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot insert processing activity dpia: %w", err)
return fmt.Errorf("cannot insert data protection impact assessment: %w", err)
}
return nil
}
func (dpia *ProcessingActivityDPIA) Update(
func (dpia *DataProtectionImpactAssessment) Update(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -341,13 +341,13 @@ WHERE
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot update processing activity dpia: %w", err)
return fmt.Errorf("cannot update data protection impact assessment: %w", err)
}
return nil
}
func (dpia *ProcessingActivityDPIA) Delete(
func (dpia *DataProtectionImpactAssessment) Delete(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -366,13 +366,13 @@ WHERE
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot delete processing activity dpia: %w", err)
return fmt.Errorf("cannot delete data protection impact assessment: %w", err)
}
return nil
}
func (dpias ProcessingActivityDPIAs) InsertProcessingActivitySnapshots(
func (dpias DataProtectionImpactAssessments) InsertProcessingActivitySnapshots(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -419,13 +419,14 @@ WHERE dpia.tenant_id = @tenant_id AND dpia.organization_id = @organization_id AN
"tenant_id": scope.GetTenantID(),
"snapshot_id": snapshotID,
"organization_id": organizationID,
"dpia_entity_type": ProcessingActivityDPIAEntityType,
"dpia_entity_type": DataProtectionImpactAssessmentEntityType,
}
_, err := conn.Exec(ctx, query, args)
if err != nil {
return fmt.Errorf("cannot insert processing activity dpia snapshots: %w", err)
return fmt.Errorf("cannot insert data protection impact assessment snapshots: %w", err)
}
return nil
}

View File

@@ -20,18 +20,18 @@ import (
)
type (
ProcessingActivityDPIAFilter struct {
DataProtectionImpactAssessmentFilter struct {
snapshotID **gid.GID
}
)
func NewProcessingActivityDPIAFilter(snapshotID **gid.GID) *ProcessingActivityDPIAFilter {
return &ProcessingActivityDPIAFilter{
func NewDataProtectionImpactAssessmentFilter(snapshotID **gid.GID) *DataProtectionImpactAssessmentFilter {
return &DataProtectionImpactAssessmentFilter{
snapshotID: snapshotID,
}
}
func (f *ProcessingActivityDPIAFilter) SQLArguments() pgx.NamedArgs {
func (f *DataProtectionImpactAssessmentFilter) SQLArguments() pgx.NamedArgs {
args := pgx.NamedArgs{}
if f.snapshotID != nil && *f.snapshotID != nil {
@@ -41,7 +41,7 @@ func (f *ProcessingActivityDPIAFilter) SQLArguments() pgx.NamedArgs {
return args
}
func (f *ProcessingActivityDPIAFilter) SQLFragment() string {
func (f *DataProtectionImpactAssessmentFilter) SQLFragment() string {
if f.snapshotID == nil {
return "TRUE"
}
@@ -52,3 +52,4 @@ func (f *ProcessingActivityDPIAFilter) SQLFragment() string {
return "snapshot_id = @filter_snapshot_id"
}
}

View File

@@ -16,30 +16,31 @@ package coredata
import "fmt"
type ProcessingActivityTIAOrderField string
type DataProtectionImpactAssessmentOrderField string
const (
ProcessingActivityTIAOrderFieldCreatedAt ProcessingActivityTIAOrderField = "CREATED_AT"
DataProtectionImpactAssessmentOrderFieldCreatedAt DataProtectionImpactAssessmentOrderField = "CREATED_AT"
)
func (p ProcessingActivityTIAOrderField) Column() string {
func (p DataProtectionImpactAssessmentOrderField) Column() string {
return string(p)
}
func (p ProcessingActivityTIAOrderField) String() string {
func (p DataProtectionImpactAssessmentOrderField) String() string {
return string(p)
}
func (p ProcessingActivityTIAOrderField) MarshalText() ([]byte, error) {
func (p DataProtectionImpactAssessmentOrderField) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}
func (p *ProcessingActivityTIAOrderField) UnmarshalText(text []byte) error {
func (p *DataProtectionImpactAssessmentOrderField) UnmarshalText(text []byte) error {
val := string(text)
switch val {
case string(ProcessingActivityTIAOrderFieldCreatedAt):
*p = ProcessingActivityTIAOrderFieldCreatedAt
case string(DataProtectionImpactAssessmentOrderFieldCreatedAt):
*p = DataProtectionImpactAssessmentOrderFieldCreatedAt
return nil
}
return fmt.Errorf("invalid ProcessingActivityTIAOrderField value: %q", val)
return fmt.Errorf("invalid DataProtectionImpactAssessmentOrderField value: %q", val)
}

View File

@@ -0,0 +1,69 @@
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
package coredata
import (
"database/sql/driver"
"fmt"
)
type DataProtectionImpactAssessmentResidualRisk string
const (
DataProtectionImpactAssessmentResidualRiskLow DataProtectionImpactAssessmentResidualRisk = "LOW"
DataProtectionImpactAssessmentResidualRiskMedium DataProtectionImpactAssessmentResidualRisk = "MEDIUM"
DataProtectionImpactAssessmentResidualRiskHigh DataProtectionImpactAssessmentResidualRisk = "HIGH"
)
func DataProtectionImpactAssessmentResidualRisks() []DataProtectionImpactAssessmentResidualRisk {
return []DataProtectionImpactAssessmentResidualRisk{
DataProtectionImpactAssessmentResidualRiskLow,
DataProtectionImpactAssessmentResidualRiskMedium,
DataProtectionImpactAssessmentResidualRiskHigh,
}
}
func (p DataProtectionImpactAssessmentResidualRisk) String() string {
return string(p)
}
func (p *DataProtectionImpactAssessmentResidualRisk) Scan(value any) error {
var s string
switch v := value.(type) {
case string:
s = v
case []byte:
s = string(v)
default:
return fmt.Errorf("unsupported type for DataProtectionImpactAssessmentResidualRisk: %T", value)
}
switch s {
case "LOW":
*p = DataProtectionImpactAssessmentResidualRiskLow
case "MEDIUM":
*p = DataProtectionImpactAssessmentResidualRiskMedium
case "HIGH":
*p = DataProtectionImpactAssessmentResidualRiskHigh
default:
return fmt.Errorf("invalid DataProtectionImpactAssessmentResidualRisk value: %q", s)
}
return nil
}
func (p DataProtectionImpactAssessmentResidualRisk) Value() (driver.Value, error) {
return p.String(), nil
}

View File

@@ -67,8 +67,8 @@ const (
UserAPIKeyEntityType uint16 = 43
UserAPIKeyMembershipEntityType uint16 = 44
MeetingEntityType uint16 = 45
ProcessingActivityDPIAEntityType uint16 = 46
ProcessingActivityTIAEntityType uint16 = 47
DataProtectionImpactAssessmentEntityType uint16 = 46
TransferImpactAssessmentEntityType uint16 = 47
)
type EntityInfo struct {
@@ -261,12 +261,12 @@ var entityRegistry = map[uint16]EntityInfo{
Model: "Meeting",
Table: "meetings",
},
ProcessingActivityDPIAEntityType: {
Model: "ProcessingActivityDPIA",
DataProtectionImpactAssessmentEntityType: {
Model: "DataProtectionImpactAssessment",
Table: "processing_activity_data_protection_impact_assessments",
},
ProcessingActivityTIAEntityType: {
Model: "ProcessingActivityTIA",
TransferImpactAssessmentEntityType: {
Model: "TransferImpactAssessment",
Table: "processing_activity_transfer_impact_assessments",
},
}

View File

@@ -2,13 +2,16 @@ ALTER TABLE processing_activities ADD COLUMN last_review_date DATE;
ALTER TABLE processing_activities ADD COLUMN next_review_date DATE;
CREATE TYPE processing_activity_role AS ENUM ('CONTROLLER', 'PROCESSOR');
ALTER TABLE processing_activities ADD COLUMN IF NOT EXISTS role processing_activity_role NOT NULL DEFAULT 'PROCESSOR';
ALTER TABLE processing_activities ADD COLUMN role processing_activity_role NOT NULL DEFAULT 'PROCESSOR';
ALTER TABLE processing_activities ALTER COLUMN role DROP DEFAULT;
ALTER TABLE processing_activities ADD COLUMN IF NOT EXISTS data_protection_officer_id TEXT REFERENCES peoples(id) ON DELETE RESTRICT;
ALTER TABLE processing_activities ADD COLUMN data_protection_officer_id TEXT REFERENCES peoples(id) ON DELETE RESTRICT;
CREATE TYPE processing_activity_dpia_residual_risk AS ENUM ('LOW', 'MEDIUM', 'HIGH');
ALTER TABLE processing_activities RENAME COLUMN data_protection_impact_assessment TO data_protection_impact_assessment_needed;
ALTER TABLE processing_activities RENAME COLUMN transfer_impact_assessment TO transfer_impact_assessment_needed;
CREATE TABLE processing_activity_data_protection_impact_assessments (
id TEXT PRIMARY KEY,
tenant_id TEXT NOT NULL,

View File

@@ -28,31 +28,31 @@ import (
type (
ProcessingActivity struct {
ID gid.GID `db:"id"`
SnapshotID *gid.GID `db:"snapshot_id"`
SourceID *gid.GID `db:"source_id"`
OrganizationID gid.GID `db:"organization_id"`
Name string `db:"name"`
Purpose *string `db:"purpose"`
DataSubjectCategory *string `db:"data_subject_category"`
PersonalDataCategory *string `db:"personal_data_category"`
SpecialOrCriminalData ProcessingActivitySpecialOrCriminalDatum `db:"special_or_criminal_data"`
ConsentEvidenceLink *string `db:"consent_evidence_link"`
LawfulBasis ProcessingActivityLawfulBasis `db:"lawful_basis"`
Recipients *string `db:"recipients"`
Location *string `db:"location"`
InternationalTransfers bool `db:"international_transfers"`
TransferSafeguard *ProcessingActivityTransferSafeguard `db:"transfer_safeguards"`
RetentionPeriod *string `db:"retention_period"`
SecurityMeasures *string `db:"security_measures"`
DataProtectionImpactAssessment ProcessingActivityDataProtectionImpactAssessment `db:"data_protection_impact_assessment"`
TransferImpactAssessment ProcessingActivityTransferImpactAssessment `db:"transfer_impact_assessment"`
LastReviewDate *time.Time `db:"last_review_date"`
NextReviewDate *time.Time `db:"next_review_date"`
Role ProcessingActivityRole `db:"role"`
DataProtectionOfficerID *gid.GID `db:"data_protection_officer_id"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
ID gid.GID `db:"id"`
SnapshotID *gid.GID `db:"snapshot_id"`
SourceID *gid.GID `db:"source_id"`
OrganizationID gid.GID `db:"organization_id"`
Name string `db:"name"`
Purpose *string `db:"purpose"`
DataSubjectCategory *string `db:"data_subject_category"`
PersonalDataCategory *string `db:"personal_data_category"`
SpecialOrCriminalData ProcessingActivitySpecialOrCriminalDatum `db:"special_or_criminal_data"`
ConsentEvidenceLink *string `db:"consent_evidence_link"`
LawfulBasis ProcessingActivityLawfulBasis `db:"lawful_basis"`
Recipients *string `db:"recipients"`
Location *string `db:"location"`
InternationalTransfers bool `db:"international_transfers"`
TransferSafeguard *ProcessingActivityTransferSafeguard `db:"transfer_safeguards"`
RetentionPeriod *string `db:"retention_period"`
SecurityMeasures *string `db:"security_measures"`
DataProtectionImpactAssessmentNeeded ProcessingActivityDataProtectionImpactAssessment `db:"data_protection_impact_assessment_needed"`
TransferImpactAssessmentNeeded ProcessingActivityTransferImpactAssessment `db:"transfer_impact_assessment_needed"`
LastReviewDate *time.Time `db:"last_review_date"`
NextReviewDate *time.Time `db:"next_review_date"`
Role ProcessingActivityRole `db:"role"`
DataProtectionOfficerID *gid.GID `db:"data_protection_officer_id"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
ProcessingActivities []*ProcessingActivity
@@ -94,8 +94,8 @@ SELECT
transfer_safeguards,
retention_period,
security_measures,
data_protection_impact_assessment,
transfer_impact_assessment,
data_protection_impact_assessment_needed,
transfer_impact_assessment_needed,
last_review_date,
next_review_date,
role,
@@ -192,8 +192,8 @@ SELECT
transfer_safeguards,
retention_period,
security_measures,
data_protection_impact_assessment,
transfer_impact_assessment,
data_protection_impact_assessment_needed,
transfer_impact_assessment_needed,
last_review_date,
next_review_date,
role,
@@ -256,8 +256,8 @@ INSERT INTO processing_activities (
transfer_safeguards,
retention_period,
security_measures,
data_protection_impact_assessment,
transfer_impact_assessment,
data_protection_impact_assessment_needed,
transfer_impact_assessment_needed,
last_review_date,
next_review_date,
role,
@@ -283,8 +283,8 @@ INSERT INTO processing_activities (
@transfer_safeguards,
@retention_period,
@security_measures,
@data_protection_impact_assessment,
@transfer_impact_assessment,
@data_protection_impact_assessment_needed,
@transfer_impact_assessment_needed,
@last_review_date,
@next_review_date,
@role,
@@ -295,32 +295,32 @@ INSERT INTO processing_activities (
`
args := pgx.StrictNamedArgs{
"id": p.ID,
"tenant_id": scope.GetTenantID(),
"snapshot_id": p.SnapshotID,
"source_id": p.SourceID,
"organization_id": p.OrganizationID,
"name": p.Name,
"purpose": p.Purpose,
"data_subject_category": p.DataSubjectCategory,
"personal_data_category": p.PersonalDataCategory,
"special_or_criminal_data": p.SpecialOrCriminalData,
"consent_evidence_link": p.ConsentEvidenceLink,
"lawful_basis": p.LawfulBasis,
"recipients": p.Recipients,
"location": p.Location,
"international_transfers": p.InternationalTransfers,
"transfer_safeguards": p.TransferSafeguard,
"retention_period": p.RetentionPeriod,
"security_measures": p.SecurityMeasures,
"data_protection_impact_assessment": p.DataProtectionImpactAssessment,
"transfer_impact_assessment": p.TransferImpactAssessment,
"last_review_date": p.LastReviewDate,
"next_review_date": p.NextReviewDate,
"role": p.Role,
"data_protection_officer_id": p.DataProtectionOfficerID,
"created_at": p.CreatedAt,
"updated_at": p.UpdatedAt,
"id": p.ID,
"tenant_id": scope.GetTenantID(),
"snapshot_id": p.SnapshotID,
"source_id": p.SourceID,
"organization_id": p.OrganizationID,
"name": p.Name,
"purpose": p.Purpose,
"data_subject_category": p.DataSubjectCategory,
"personal_data_category": p.PersonalDataCategory,
"special_or_criminal_data": p.SpecialOrCriminalData,
"consent_evidence_link": p.ConsentEvidenceLink,
"lawful_basis": p.LawfulBasis,
"recipients": p.Recipients,
"location": p.Location,
"international_transfers": p.InternationalTransfers,
"transfer_safeguards": p.TransferSafeguard,
"retention_period": p.RetentionPeriod,
"security_measures": p.SecurityMeasures,
"data_protection_impact_assessment_needed": p.DataProtectionImpactAssessmentNeeded,
"transfer_impact_assessment_needed": p.TransferImpactAssessmentNeeded,
"last_review_date": p.LastReviewDate,
"next_review_date": p.NextReviewDate,
"role": p.Role,
"data_protection_officer_id": p.DataProtectionOfficerID,
"created_at": p.CreatedAt,
"updated_at": p.UpdatedAt,
}
_, err := conn.Exec(ctx, q, args)
@@ -352,8 +352,8 @@ SET
transfer_safeguards = @transfer_safeguards,
retention_period = @retention_period,
security_measures = @security_measures,
data_protection_impact_assessment = @data_protection_impact_assessment,
transfer_impact_assessment = @transfer_impact_assessment,
data_protection_impact_assessment_needed = @data_protection_impact_assessment_needed,
transfer_impact_assessment_needed = @transfer_impact_assessment_needed,
last_review_date = @last_review_date,
next_review_date = @next_review_date,
role = @role,
@@ -368,27 +368,27 @@ WHERE
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{
"id": p.ID,
"name": p.Name,
"purpose": p.Purpose,
"data_subject_category": p.DataSubjectCategory,
"personal_data_category": p.PersonalDataCategory,
"special_or_criminal_data": p.SpecialOrCriminalData,
"consent_evidence_link": p.ConsentEvidenceLink,
"lawful_basis": p.LawfulBasis,
"recipients": p.Recipients,
"location": p.Location,
"international_transfers": p.InternationalTransfers,
"transfer_safeguards": p.TransferSafeguard,
"retention_period": p.RetentionPeriod,
"security_measures": p.SecurityMeasures,
"data_protection_impact_assessment": p.DataProtectionImpactAssessment,
"transfer_impact_assessment": p.TransferImpactAssessment,
"last_review_date": p.LastReviewDate,
"next_review_date": p.NextReviewDate,
"role": p.Role,
"data_protection_officer_id": p.DataProtectionOfficerID,
"updated_at": p.UpdatedAt,
"id": p.ID,
"name": p.Name,
"purpose": p.Purpose,
"data_subject_category": p.DataSubjectCategory,
"personal_data_category": p.PersonalDataCategory,
"special_or_criminal_data": p.SpecialOrCriminalData,
"consent_evidence_link": p.ConsentEvidenceLink,
"lawful_basis": p.LawfulBasis,
"recipients": p.Recipients,
"location": p.Location,
"international_transfers": p.InternationalTransfers,
"transfer_safeguards": p.TransferSafeguard,
"retention_period": p.RetentionPeriod,
"security_measures": p.SecurityMeasures,
"data_protection_impact_assessment_needed": p.DataProtectionImpactAssessmentNeeded,
"transfer_impact_assessment_needed": p.TransferImpactAssessmentNeeded,
"last_review_date": p.LastReviewDate,
"next_review_date": p.NextReviewDate,
"role": p.Role,
"data_protection_officer_id": p.DataProtectionOfficerID,
"updated_at": p.UpdatedAt,
}
maps.Copy(args, scope.SQLArguments())
@@ -427,7 +427,7 @@ WHERE
}
func (pas ProcessingActivities) Snapshot(ctx context.Context, conn pg.Conn, scope Scoper, organizationID, snapshotID gid.GID) error {
snapshotters := []ProcessingActivitySnapshotter{ProcessingActivities{}, Vendors{}, ProcessingActivityVendors{}, ProcessingActivityDPIAs{}, ProcessingActivityTIAs{}}
snapshotters := []ProcessingActivitySnapshotter{ProcessingActivities{}, Vendors{}, ProcessingActivityVendors{}, DataProtectionImpactAssessments{}, TransferImpactAssessments{}}
for _, snapshotter := range snapshotters {
if err := snapshotter.InsertProcessingActivitySnapshots(ctx, conn, scope, organizationID, snapshotID); err != nil {
@@ -465,8 +465,8 @@ INSERT INTO processing_activities (
transfer_safeguards,
retention_period,
security_measures,
data_protection_impact_assessment,
transfer_impact_assessment,
data_protection_impact_assessment_needed,
transfer_impact_assessment_needed,
last_review_date,
next_review_date,
role,
@@ -493,8 +493,8 @@ SELECT
par.transfer_safeguards,
par.retention_period,
par.security_measures,
par.data_protection_impact_assessment,
par.transfer_impact_assessment,
par.data_protection_impact_assessment_needed,
par.transfer_impact_assessment_needed,
par.last_review_date,
par.next_review_date,
par.role,

View File

@@ -1,68 +0,0 @@
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
package coredata
import (
"database/sql/driver"
"fmt"
)
type ProcessingActivityDPIAResidualRisk string
const (
ProcessingActivityDPIAResidualRiskLow ProcessingActivityDPIAResidualRisk = "LOW"
ProcessingActivityDPIAResidualRiskMedium ProcessingActivityDPIAResidualRisk = "MEDIUM"
ProcessingActivityDPIAResidualRiskHigh ProcessingActivityDPIAResidualRisk = "HIGH"
)
func ProcessingActivityDPIAResidualRisks() []ProcessingActivityDPIAResidualRisk {
return []ProcessingActivityDPIAResidualRisk{
ProcessingActivityDPIAResidualRiskLow,
ProcessingActivityDPIAResidualRiskMedium,
ProcessingActivityDPIAResidualRiskHigh,
}
}
func (p ProcessingActivityDPIAResidualRisk) String() string {
return string(p)
}
func (p *ProcessingActivityDPIAResidualRisk) Scan(value any) error {
var s string
switch v := value.(type) {
case string:
s = v
case []byte:
s = string(v)
default:
return fmt.Errorf("unsupported type for ProcessingActivityDPIAResidualRisk: %T", value)
}
switch s {
case "LOW":
*p = ProcessingActivityDPIAResidualRiskLow
case "MEDIUM":
*p = ProcessingActivityDPIAResidualRiskMedium
case "HIGH":
*p = ProcessingActivityDPIAResidualRiskHigh
default:
return fmt.Errorf("invalid ProcessingActivityDPIAResidualRisk value: %q", s)
}
return nil
}
func (p ProcessingActivityDPIAResidualRisk) Value() (driver.Value, error) {
return p.String(), nil
}

View File

@@ -27,16 +27,16 @@ import (
"go.probo.inc/probo/pkg/page"
)
type ErrProcessingActivityTIANotFound struct {
type ErrTransferImpactAssessmentNotFound struct {
Identifier string
}
func (e ErrProcessingActivityTIANotFound) Error() string {
return fmt.Sprintf("processing activity tia not found: %q", e.Identifier)
func (e ErrTransferImpactAssessmentNotFound) Error() string {
return fmt.Sprintf("transfer impact assessment not found: %q", e.Identifier)
}
type (
ProcessingActivityTIA struct {
TransferImpactAssessment struct {
ID gid.GID `db:"id"`
SnapshotID *gid.GID `db:"snapshot_id"`
SourceID *gid.GID `db:"source_id"`
@@ -51,24 +51,24 @@ type (
UpdatedAt time.Time `db:"updated_at"`
}
ProcessingActivityTIAs []*ProcessingActivityTIA
TransferImpactAssessments []*TransferImpactAssessment
)
func (tia *ProcessingActivityTIA) CursorKey(field ProcessingActivityTIAOrderField) page.CursorKey {
func (tia *TransferImpactAssessment) CursorKey(field TransferImpactAssessmentOrderField) page.CursorKey {
switch field {
case ProcessingActivityTIAOrderFieldCreatedAt:
case TransferImpactAssessmentOrderFieldCreatedAt:
return page.NewCursorKey(tia.ID, tia.CreatedAt)
}
panic(fmt.Sprintf("unsupported order by: %s", field))
}
func (tias *ProcessingActivityTIAs) CountByOrganizationID(
func (tias *TransferImpactAssessments) CountByOrganizationID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
organizationID gid.GID,
filter *ProcessingActivityTIAFilter,
filter *TransferImpactAssessmentFilter,
) (int, error) {
q := `
SELECT
@@ -92,19 +92,19 @@ WHERE
var count int
err := row.Scan(&count)
if err != nil {
return 0, fmt.Errorf("cannot count processing activity tias: %w", err)
return 0, fmt.Errorf("cannot count transfer impact assessments: %w", err)
}
return count, nil
}
func (tias *ProcessingActivityTIAs) LoadByOrganizationID(
func (tias *TransferImpactAssessments) LoadByOrganizationID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
organizationID gid.GID,
cursor *page.Cursor[ProcessingActivityTIAOrderField],
filter *ProcessingActivityTIAFilter,
cursor *page.Cursor[TransferImpactAssessmentOrderField],
filter *TransferImpactAssessmentFilter,
) error {
q := `
SELECT
@@ -138,12 +138,12 @@ WHERE
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity tias: %w", err)
return fmt.Errorf("cannot query transfer impact assessments: %w", err)
}
results, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ProcessingActivityTIA])
results, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[TransferImpactAssessment])
if err != nil {
return fmt.Errorf("cannot collect processing activity tias: %w", err)
return fmt.Errorf("cannot collect transfer impact assessments: %w", err)
}
*tias = results
@@ -151,7 +151,7 @@ WHERE
return nil
}
func (tia *ProcessingActivityTIA) LoadByID(
func (tia *TransferImpactAssessment) LoadByID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -186,15 +186,15 @@ LIMIT 1;
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity tia: %w", err)
return fmt.Errorf("cannot query transfer impact assessment: %w", err)
}
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ProcessingActivityTIA])
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[TransferImpactAssessment])
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return &ErrProcessingActivityTIANotFound{Identifier: tiaID.String()}
return &ErrTransferImpactAssessmentNotFound{Identifier: tiaID.String()}
}
return fmt.Errorf("cannot collect processing activity tia: %w", err)
return fmt.Errorf("cannot collect transfer impact assessment: %w", err)
}
*tia = result
@@ -202,7 +202,7 @@ LIMIT 1;
return nil
}
func (tia *ProcessingActivityTIA) LoadByProcessingActivityID(
func (tia *TransferImpactAssessment) LoadByProcessingActivityID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -237,15 +237,15 @@ LIMIT 1;
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity tia: %w", err)
return fmt.Errorf("cannot query transfer impact assessment: %w", err)
}
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ProcessingActivityTIA])
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[TransferImpactAssessment])
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return &ErrProcessingActivityTIANotFound{Identifier: processingActivityID.String()}
return &ErrTransferImpactAssessmentNotFound{Identifier: processingActivityID.String()}
}
return fmt.Errorf("cannot collect processing activity tia: %w", err)
return fmt.Errorf("cannot collect transfer impact assessment: %w", err)
}
*tia = result
@@ -253,7 +253,7 @@ LIMIT 1;
return nil
}
func (tia *ProcessingActivityTIA) Insert(
func (tia *TransferImpactAssessment) Insert(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -302,13 +302,13 @@ INSERT INTO processing_activity_transfer_impact_assessments (
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot insert processing activity tia: %w", err)
return fmt.Errorf("cannot insert transfer impact assessment: %w", err)
}
return nil
}
func (tia *ProcessingActivityTIA) Update(
func (tia *TransferImpactAssessment) Update(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -341,13 +341,13 @@ WHERE
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot update processing activity tia: %w", err)
return fmt.Errorf("cannot update transfer impact assessment: %w", err)
}
return nil
}
func (tia *ProcessingActivityTIA) Delete(
func (tia *TransferImpactAssessment) Delete(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -366,13 +366,13 @@ WHERE
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot delete processing activity tia: %w", err)
return fmt.Errorf("cannot delete transfer impact assessment: %w", err)
}
return nil
}
func (tias ProcessingActivityTIAs) InsertProcessingActivitySnapshots(
func (tias TransferImpactAssessments) InsertProcessingActivitySnapshots(
ctx context.Context,
conn pg.Conn,
scope Scoper,
@@ -419,13 +419,14 @@ WHERE tia.tenant_id = @tenant_id AND tia.organization_id = @organization_id AND
"tenant_id": scope.GetTenantID(),
"snapshot_id": snapshotID,
"organization_id": organizationID,
"tia_entity_type": ProcessingActivityTIAEntityType,
"tia_entity_type": TransferImpactAssessmentEntityType,
}
_, err := conn.Exec(ctx, query, args)
if err != nil {
return fmt.Errorf("cannot insert processing activity tia snapshots: %w", err)
return fmt.Errorf("cannot insert transfer impact assessment snapshots: %w", err)
}
return nil
}

View File

@@ -20,18 +20,18 @@ import (
)
type (
ProcessingActivityTIAFilter struct {
TransferImpactAssessmentFilter struct {
snapshotID **gid.GID
}
)
func NewProcessingActivityTIAFilter(snapshotID **gid.GID) *ProcessingActivityTIAFilter {
return &ProcessingActivityTIAFilter{
func NewTransferImpactAssessmentFilter(snapshotID **gid.GID) *TransferImpactAssessmentFilter {
return &TransferImpactAssessmentFilter{
snapshotID: snapshotID,
}
}
func (f *ProcessingActivityTIAFilter) SQLArguments() pgx.NamedArgs {
func (f *TransferImpactAssessmentFilter) SQLArguments() pgx.NamedArgs {
args := pgx.NamedArgs{}
if f.snapshotID != nil && *f.snapshotID != nil {
@@ -41,7 +41,7 @@ func (f *ProcessingActivityTIAFilter) SQLArguments() pgx.NamedArgs {
return args
}
func (f *ProcessingActivityTIAFilter) SQLFragment() string {
func (f *TransferImpactAssessmentFilter) SQLFragment() string {
if f.snapshotID == nil {
return "TRUE"
}
@@ -52,3 +52,4 @@ func (f *ProcessingActivityTIAFilter) SQLFragment() string {
return "snapshot_id = @filter_snapshot_id"
}
}

View File

@@ -16,30 +16,31 @@ package coredata
import "fmt"
type ProcessingActivityDPIAOrderField string
type TransferImpactAssessmentOrderField string
const (
ProcessingActivityDPIAOrderFieldCreatedAt ProcessingActivityDPIAOrderField = "CREATED_AT"
TransferImpactAssessmentOrderFieldCreatedAt TransferImpactAssessmentOrderField = "CREATED_AT"
)
func (p ProcessingActivityDPIAOrderField) Column() string {
func (p TransferImpactAssessmentOrderField) Column() string {
return string(p)
}
func (p ProcessingActivityDPIAOrderField) String() string {
func (p TransferImpactAssessmentOrderField) String() string {
return string(p)
}
func (p ProcessingActivityDPIAOrderField) MarshalText() ([]byte, error) {
func (p TransferImpactAssessmentOrderField) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}
func (p *ProcessingActivityDPIAOrderField) UnmarshalText(text []byte) error {
func (p *TransferImpactAssessmentOrderField) UnmarshalText(text []byte) error {
val := string(text)
switch val {
case string(ProcessingActivityDPIAOrderFieldCreatedAt):
*p = ProcessingActivityDPIAOrderFieldCreatedAt
case string(TransferImpactAssessmentOrderFieldCreatedAt):
*p = TransferImpactAssessmentOrderFieldCreatedAt
return nil
}
return fmt.Errorf("invalid ProcessingActivityDPIAOrderField value: %q", val)
return fmt.Errorf("invalid TransferImpactAssessmentOrderField value: %q", val)
}

View File

@@ -26,31 +26,31 @@ import (
"go.probo.inc/probo/pkg/validator"
)
type ProcessingActivityDPIAService struct {
type DataProtectionImpactAssessmentService struct {
svc *TenantService
}
type (
CreateProcessingActivityDPIARequest struct {
CreateDataProtectionImpactAssessmentRequest struct {
ProcessingActivityID gid.GID
Description *string
NecessityAndProportionality *string
PotentialRisk *string
Mitigations *string
ResidualRisk *coredata.ProcessingActivityDPIAResidualRisk
ResidualRisk *coredata.DataProtectionImpactAssessmentResidualRisk
}
UpdateProcessingActivityDPIARequest struct {
UpdateDataProtectionImpactAssessmentRequest struct {
ID gid.GID
Description **string
NecessityAndProportionality **string
PotentialRisk **string
Mitigations **string
ResidualRisk *coredata.ProcessingActivityDPIAResidualRisk
ResidualRisk *coredata.DataProtectionImpactAssessmentResidualRisk
}
)
func (req *CreateProcessingActivityDPIARequest) Validate() error {
func (req *CreateDataProtectionImpactAssessmentRequest) Validate() error {
v := validator.New()
v.Check(req.ProcessingActivityID, "processing_activity_id", validator.Required(), validator.GID(coredata.ProcessingActivityEntityType))
@@ -58,35 +58,35 @@ func (req *CreateProcessingActivityDPIARequest) Validate() error {
v.Check(req.NecessityAndProportionality, "necessity_and_proportionality", validator.SafeText(ContentMaxLength))
v.Check(req.PotentialRisk, "potential_risk", validator.SafeText(ContentMaxLength))
v.Check(req.Mitigations, "mitigations", validator.SafeText(ContentMaxLength))
v.Check(req.ResidualRisk, "residual_risk", validator.OneOfSlice(coredata.ProcessingActivityDPIAResidualRisks()))
v.Check(req.ResidualRisk, "residual_risk", validator.OneOfSlice(coredata.DataProtectionImpactAssessmentResidualRisks()))
return v.Error()
}
func (req *UpdateProcessingActivityDPIARequest) Validate() error {
func (req *UpdateDataProtectionImpactAssessmentRequest) Validate() error {
v := validator.New()
v.Check(req.ID, "id", validator.Required(), validator.GID(coredata.ProcessingActivityDPIAEntityType))
v.Check(req.ID, "id", validator.Required(), validator.GID(coredata.DataProtectionImpactAssessmentEntityType))
v.Check(req.Description, "description", validator.SafeText(ContentMaxLength))
v.Check(req.NecessityAndProportionality, "necessity_and_proportionality", validator.SafeText(ContentMaxLength))
v.Check(req.PotentialRisk, "potential_risk", validator.SafeText(ContentMaxLength))
v.Check(req.Mitigations, "mitigations", validator.SafeText(ContentMaxLength))
v.Check(req.ResidualRisk, "residual_risk", validator.OneOfSlice(coredata.ProcessingActivityDPIAResidualRisks()))
v.Check(req.ResidualRisk, "residual_risk", validator.OneOfSlice(coredata.DataProtectionImpactAssessmentResidualRisks()))
return v.Error()
}
func (s ProcessingActivityDPIAService) Get(
func (s DataProtectionImpactAssessmentService) Get(
ctx context.Context,
dpiaID gid.GID,
) (*coredata.ProcessingActivityDPIA, error) {
dpia := &coredata.ProcessingActivityDPIA{}
) (*coredata.DataProtectionImpactAssessment, error) {
dpia := &coredata.DataProtectionImpactAssessment{}
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
if err := dpia.LoadByID(ctx, conn, s.svc.scope, dpiaID); err != nil {
return fmt.Errorf("cannot load processing activity dpia: %w", err)
return fmt.Errorf("cannot load data protection impact assessment: %w", err)
}
return nil
@@ -100,17 +100,17 @@ func (s ProcessingActivityDPIAService) Get(
return dpia, nil
}
func (s ProcessingActivityDPIAService) GetByProcessingActivityID(
func (s DataProtectionImpactAssessmentService) GetByProcessingActivityID(
ctx context.Context,
processingActivityID gid.GID,
) (*coredata.ProcessingActivityDPIA, error) {
dpia := &coredata.ProcessingActivityDPIA{}
) (*coredata.DataProtectionImpactAssessment, error) {
dpia := &coredata.DataProtectionImpactAssessment{}
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
if err := dpia.LoadByProcessingActivityID(ctx, conn, s.svc.scope, processingActivityID); err != nil {
return fmt.Errorf("cannot load processing activity dpia: %w", err)
return fmt.Errorf("cannot load data protection impact assessment: %w", err)
}
return nil
@@ -124,20 +124,20 @@ func (s ProcessingActivityDPIAService) GetByProcessingActivityID(
return dpia, nil
}
func (s ProcessingActivityDPIAService) ListForOrganizationID(
func (s DataProtectionImpactAssessmentService) ListForOrganizationID(
ctx context.Context,
organizationID gid.GID,
cursor *page.Cursor[coredata.ProcessingActivityDPIAOrderField],
filter *coredata.ProcessingActivityDPIAFilter,
) (*page.Page[*coredata.ProcessingActivityDPIA, coredata.ProcessingActivityDPIAOrderField], error) {
var dpias coredata.ProcessingActivityDPIAs
cursor *page.Cursor[coredata.DataProtectionImpactAssessmentOrderField],
filter *coredata.DataProtectionImpactAssessmentFilter,
) (*page.Page[*coredata.DataProtectionImpactAssessment, coredata.DataProtectionImpactAssessmentOrderField], error) {
var dpias coredata.DataProtectionImpactAssessments
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
err := dpias.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID, cursor, filter)
if err != nil {
return fmt.Errorf("cannot load processing activity dpias: %w", err)
return fmt.Errorf("cannot load data protection impact assessments: %w", err)
}
return nil
@@ -151,17 +151,17 @@ func (s ProcessingActivityDPIAService) ListForOrganizationID(
return page.NewPage(dpias, cursor), nil
}
func (s ProcessingActivityDPIAService) CountForOrganizationID(
func (s DataProtectionImpactAssessmentService) CountForOrganizationID(
ctx context.Context,
organizationID gid.GID,
filter *coredata.ProcessingActivityDPIAFilter,
filter *coredata.DataProtectionImpactAssessmentFilter,
) (int, error) {
var count int
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) (err error) {
dpias := coredata.ProcessingActivityDPIAs{}
dpias := coredata.DataProtectionImpactAssessments{}
count, err = dpias.CountByOrganizationID(ctx, conn, s.svc.scope, organizationID, filter)
return err
},
@@ -174,18 +174,18 @@ func (s ProcessingActivityDPIAService) CountForOrganizationID(
return count, nil
}
func (s *ProcessingActivityDPIAService) Create(
func (s *DataProtectionImpactAssessmentService) Create(
ctx context.Context,
req *CreateProcessingActivityDPIARequest,
) (*coredata.ProcessingActivityDPIA, error) {
req *CreateDataProtectionImpactAssessmentRequest,
) (*coredata.DataProtectionImpactAssessment, error) {
if err := req.Validate(); err != nil {
return nil, err
}
now := time.Now()
dpia := &coredata.ProcessingActivityDPIA{
ID: gid.New(s.svc.scope.GetTenantID(), coredata.ProcessingActivityDPIAEntityType),
dpia := &coredata.DataProtectionImpactAssessment{
ID: gid.New(s.svc.scope.GetTenantID(), coredata.DataProtectionImpactAssessmentEntityType),
ProcessingActivityID: req.ProcessingActivityID,
Description: req.Description,
NecessityAndProportionality: req.NecessityAndProportionality,
@@ -207,7 +207,7 @@ func (s *ProcessingActivityDPIAService) Create(
dpia.OrganizationID = processingActivity.OrganizationID
if err := dpia.Insert(ctx, conn, s.svc.scope); err != nil {
return fmt.Errorf("cannot insert processing activity dpia: %w", err)
return fmt.Errorf("cannot insert data protection impact assessment: %w", err)
}
return nil
@@ -221,21 +221,21 @@ func (s *ProcessingActivityDPIAService) Create(
return dpia, nil
}
func (s *ProcessingActivityDPIAService) Update(
func (s *DataProtectionImpactAssessmentService) Update(
ctx context.Context,
req *UpdateProcessingActivityDPIARequest,
) (*coredata.ProcessingActivityDPIA, error) {
req *UpdateDataProtectionImpactAssessmentRequest,
) (*coredata.DataProtectionImpactAssessment, error) {
if err := req.Validate(); err != nil {
return nil, err
}
dpia := &coredata.ProcessingActivityDPIA{}
dpia := &coredata.DataProtectionImpactAssessment{}
err := s.svc.pg.WithTx(
ctx,
func(conn pg.Conn) error {
if err := dpia.LoadByID(ctx, conn, s.svc.scope, req.ID); err != nil {
return fmt.Errorf("cannot load processing activity dpia: %w", err)
return fmt.Errorf("cannot load data protection impact assessment: %w", err)
}
if req.Description != nil {
@@ -261,7 +261,7 @@ func (s *ProcessingActivityDPIAService) Update(
dpia.UpdatedAt = time.Now()
if err := dpia.Update(ctx, conn, s.svc.scope); err != nil {
return fmt.Errorf("cannot update processing activity dpia: %w", err)
return fmt.Errorf("cannot update data protection impact assessment: %w", err)
}
return nil
@@ -275,20 +275,20 @@ func (s *ProcessingActivityDPIAService) Update(
return dpia, nil
}
func (s *ProcessingActivityDPIAService) Delete(
func (s *DataProtectionImpactAssessmentService) Delete(
ctx context.Context,
dpiaID gid.GID,
) error {
err := s.svc.pg.WithTx(
ctx,
func(conn pg.Conn) error {
dpia := &coredata.ProcessingActivityDPIA{}
dpia := &coredata.DataProtectionImpactAssessment{}
if err := dpia.LoadByID(ctx, conn, s.svc.scope, dpiaID); err != nil {
return fmt.Errorf("cannot load processing activity dpia: %w", err)
return fmt.Errorf("cannot load data protection impact assessment: %w", err)
}
if err := dpia.Delete(ctx, conn, s.svc.scope); err != nil {
return fmt.Errorf("cannot delete processing activity dpia: %w", err)
return fmt.Errorf("cannot delete data protection impact assessment: %w", err)
}
return nil
@@ -297,3 +297,4 @@ func (s *ProcessingActivityDPIAService) Delete(
return err
}

View File

@@ -32,51 +32,51 @@ type ProcessingActivityService struct {
type (
CreateProcessingActivityRequest struct {
OrganizationID gid.GID
Name string
Purpose *string
DataSubjectCategory *string
PersonalDataCategory *string
SpecialOrCriminalData coredata.ProcessingActivitySpecialOrCriminalDatum
ConsentEvidenceLink *string
LawfulBasis coredata.ProcessingActivityLawfulBasis
Recipients *string
Location *string
InternationalTransfers bool
TransferSafeguard *coredata.ProcessingActivityTransferSafeguard
RetentionPeriod *string
SecurityMeasures *string
DataProtectionImpactAssessment coredata.ProcessingActivityDataProtectionImpactAssessment
TransferImpactAssessment coredata.ProcessingActivityTransferImpactAssessment
LastReviewDate *time.Time
NextReviewDate *time.Time
Role coredata.ProcessingActivityRole
DataProtectionOfficerID *gid.GID
VendorIDs []gid.GID
OrganizationID gid.GID
Name string
Purpose *string
DataSubjectCategory *string
PersonalDataCategory *string
SpecialOrCriminalData coredata.ProcessingActivitySpecialOrCriminalDatum
ConsentEvidenceLink *string
LawfulBasis coredata.ProcessingActivityLawfulBasis
Recipients *string
Location *string
InternationalTransfers bool
TransferSafeguard *coredata.ProcessingActivityTransferSafeguard
RetentionPeriod *string
SecurityMeasures *string
DataProtectionImpactAssessmentNeeded coredata.ProcessingActivityDataProtectionImpactAssessment
TransferImpactAssessmentNeeded coredata.ProcessingActivityTransferImpactAssessment
LastReviewDate *time.Time
NextReviewDate *time.Time
Role coredata.ProcessingActivityRole
DataProtectionOfficerID *gid.GID
VendorIDs []gid.GID
}
UpdateProcessingActivityRequest struct {
ID gid.GID
Name *string
Purpose **string
DataSubjectCategory **string
PersonalDataCategory **string
SpecialOrCriminalData *coredata.ProcessingActivitySpecialOrCriminalDatum
ConsentEvidenceLink **string
LawfulBasis *coredata.ProcessingActivityLawfulBasis
Recipients **string
Location **string
InternationalTransfers *bool
TransferSafeguard **coredata.ProcessingActivityTransferSafeguard
RetentionPeriod **string
SecurityMeasures **string
DataProtectionImpactAssessment *coredata.ProcessingActivityDataProtectionImpactAssessment
TransferImpactAssessment *coredata.ProcessingActivityTransferImpactAssessment
LastReviewDate **time.Time
NextReviewDate **time.Time
Role *coredata.ProcessingActivityRole
DataProtectionOfficerID **gid.GID
VendorIDs *[]gid.GID
ID gid.GID
Name *string
Purpose **string
DataSubjectCategory **string
PersonalDataCategory **string
SpecialOrCriminalData *coredata.ProcessingActivitySpecialOrCriminalDatum
ConsentEvidenceLink **string
LawfulBasis *coredata.ProcessingActivityLawfulBasis
Recipients **string
Location **string
InternationalTransfers *bool
TransferSafeguard **coredata.ProcessingActivityTransferSafeguard
RetentionPeriod **string
SecurityMeasures **string
DataProtectionImpactAssessmentNeeded *coredata.ProcessingActivityDataProtectionImpactAssessment
TransferImpactAssessmentNeeded *coredata.ProcessingActivityTransferImpactAssessment
LastReviewDate **time.Time
NextReviewDate **time.Time
Role *coredata.ProcessingActivityRole
DataProtectionOfficerID **gid.GID
VendorIDs *[]gid.GID
}
)
@@ -97,8 +97,8 @@ func (cpar *CreateProcessingActivityRequest) Validate() error {
v.Check(cpar.TransferSafeguard, "transfer_safeguard", validator.OneOfSlice(coredata.ProcessingActivityTransferSafeguards()))
v.Check(cpar.RetentionPeriod, "retention_period", validator.SafeText(TitleMaxLength))
v.Check(cpar.SecurityMeasures, "security_measures", validator.SafeText(TitleMaxLength))
v.Check(cpar.DataProtectionImpactAssessment, "data_protection_impact_assessment", validator.Required(), validator.OneOfSlice(coredata.ProcessingActivityDataProtectionImpactAssessments()))
v.Check(cpar.TransferImpactAssessment, "transfer_impact_assessment", validator.Required(), validator.OneOfSlice(coredata.ProcessingActivityTransferImpactAssessments()))
v.Check(cpar.DataProtectionImpactAssessmentNeeded, "data_protection_impact_assessment_needed", validator.Required(), validator.OneOfSlice(coredata.ProcessingActivityDataProtectionImpactAssessments()))
v.Check(cpar.TransferImpactAssessmentNeeded, "transfer_impact_assessment_needed", validator.Required(), validator.OneOfSlice(coredata.ProcessingActivityTransferImpactAssessments()))
v.Check(cpar.Role, "role", validator.Required(), validator.OneOfSlice(coredata.ProcessingActivityRoles()))
v.Check(cpar.DataProtectionOfficerID, "data_protection_officer_id", validator.GID(coredata.PeopleEntityType))
v.CheckEach(cpar.VendorIDs, "vendor_ids", func(index int, item any) {
@@ -124,8 +124,8 @@ func (upar *UpdateProcessingActivityRequest) Validate() error {
v.Check(upar.TransferSafeguard, "transfer_safeguards", validator.OneOfSlice(coredata.ProcessingActivityTransferSafeguards()))
v.Check(upar.RetentionPeriod, "retention_period", validator.SafeText(TitleMaxLength))
v.Check(upar.SecurityMeasures, "security_measures", validator.SafeText(TitleMaxLength))
v.Check(upar.DataProtectionImpactAssessment, "data_protection_impact_assessment", validator.OneOfSlice(coredata.ProcessingActivityDataProtectionImpactAssessments()))
v.Check(upar.TransferImpactAssessment, "transfer_impact_assessment", validator.OneOfSlice(coredata.ProcessingActivityTransferImpactAssessments()))
v.Check(upar.DataProtectionImpactAssessmentNeeded, "data_protection_impact_assessment_needed", validator.OneOfSlice(coredata.ProcessingActivityDataProtectionImpactAssessments()))
v.Check(upar.TransferImpactAssessmentNeeded, "transfer_impact_assessment_needed", validator.OneOfSlice(coredata.ProcessingActivityTransferImpactAssessments()))
v.Check(upar.Role, "role", validator.OneOfSlice(coredata.ProcessingActivityRoles()))
v.Check(upar.DataProtectionOfficerID, "data_protection_officer_id", validator.GID(coredata.PeopleEntityType))
v.CheckEach(upar.VendorIDs, "vendor_ids", func(index int, item any) {
@@ -163,29 +163,29 @@ func (s *ProcessingActivityService) Create(
processingActivityVendors := &coredata.ProcessingActivityVendors{}
processingActivity := &coredata.ProcessingActivity{
ID: gid.New(s.svc.scope.GetTenantID(), coredata.ProcessingActivityEntityType),
OrganizationID: req.OrganizationID,
Name: req.Name,
Purpose: req.Purpose,
DataSubjectCategory: req.DataSubjectCategory,
PersonalDataCategory: req.PersonalDataCategory,
SpecialOrCriminalData: req.SpecialOrCriminalData,
ConsentEvidenceLink: req.ConsentEvidenceLink,
LawfulBasis: req.LawfulBasis,
Recipients: req.Recipients,
Location: req.Location,
InternationalTransfers: req.InternationalTransfers,
TransferSafeguard: req.TransferSafeguard,
RetentionPeriod: req.RetentionPeriod,
SecurityMeasures: req.SecurityMeasures,
DataProtectionImpactAssessment: req.DataProtectionImpactAssessment,
TransferImpactAssessment: req.TransferImpactAssessment,
LastReviewDate: req.LastReviewDate,
NextReviewDate: req.NextReviewDate,
Role: req.Role,
DataProtectionOfficerID: req.DataProtectionOfficerID,
CreatedAt: now,
UpdatedAt: now,
ID: gid.New(s.svc.scope.GetTenantID(), coredata.ProcessingActivityEntityType),
OrganizationID: req.OrganizationID,
Name: req.Name,
Purpose: req.Purpose,
DataSubjectCategory: req.DataSubjectCategory,
PersonalDataCategory: req.PersonalDataCategory,
SpecialOrCriminalData: req.SpecialOrCriminalData,
ConsentEvidenceLink: req.ConsentEvidenceLink,
LawfulBasis: req.LawfulBasis,
Recipients: req.Recipients,
Location: req.Location,
InternationalTransfers: req.InternationalTransfers,
TransferSafeguard: req.TransferSafeguard,
RetentionPeriod: req.RetentionPeriod,
SecurityMeasures: req.SecurityMeasures,
DataProtectionImpactAssessmentNeeded: req.DataProtectionImpactAssessmentNeeded,
TransferImpactAssessmentNeeded: req.TransferImpactAssessmentNeeded,
LastReviewDate: req.LastReviewDate,
NextReviewDate: req.NextReviewDate,
Role: req.Role,
DataProtectionOfficerID: req.DataProtectionOfficerID,
CreatedAt: now,
UpdatedAt: now,
}
err := s.svc.pg.WithTx(
@@ -270,11 +270,11 @@ func (s *ProcessingActivityService) Update(
if req.SecurityMeasures != nil {
processingActivity.SecurityMeasures = *req.SecurityMeasures
}
if req.DataProtectionImpactAssessment != nil {
processingActivity.DataProtectionImpactAssessment = *req.DataProtectionImpactAssessment
if req.DataProtectionImpactAssessmentNeeded != nil {
processingActivity.DataProtectionImpactAssessmentNeeded = *req.DataProtectionImpactAssessmentNeeded
}
if req.TransferImpactAssessment != nil {
processingActivity.TransferImpactAssessment = *req.TransferImpactAssessment
if req.TransferImpactAssessmentNeeded != nil {
processingActivity.TransferImpactAssessmentNeeded = *req.TransferImpactAssessmentNeeded
}
if req.LastReviewDate != nil {
processingActivity.LastReviewDate = *req.LastReviewDate

View File

@@ -114,8 +114,8 @@ type (
Snapshots *SnapshotService
ContinualImprovements *ContinualImprovementService
ProcessingActivities *ProcessingActivityService
ProcessingActivityDPIAs *ProcessingActivityDPIAService
ProcessingActivityTIAs *ProcessingActivityTIAService
DataProtectionImpactAssessments *DataProtectionImpactAssessmentService
TransferImpactAssessments *TransferImpactAssessmentService
Files *FileService
CustomDomains *CustomDomainService
SlackMessages *slack.SlackMessageService
@@ -251,8 +251,8 @@ func (s *Service) WithTenant(tenantID gid.TenantID) *TenantService {
tenantService.Snapshots = &SnapshotService{svc: tenantService}
tenantService.ContinualImprovements = &ContinualImprovementService{svc: tenantService}
tenantService.ProcessingActivities = &ProcessingActivityService{svc: tenantService}
tenantService.ProcessingActivityDPIAs = &ProcessingActivityDPIAService{svc: tenantService}
tenantService.ProcessingActivityTIAs = &ProcessingActivityTIAService{svc: tenantService}
tenantService.DataProtectionImpactAssessments = &DataProtectionImpactAssessmentService{svc: tenantService}
tenantService.TransferImpactAssessments = &TransferImpactAssessmentService{svc: tenantService}
tenantService.Files = &FileService{svc: tenantService}
tenantService.CustomDomains = &CustomDomainService{
svc: tenantService,

View File

@@ -26,12 +26,12 @@ import (
"go.probo.inc/probo/pkg/validator"
)
type ProcessingActivityTIAService struct {
type TransferImpactAssessmentService struct {
svc *TenantService
}
type (
CreateProcessingActivityTIARequest struct {
CreateTransferImpactAssessmentRequest struct {
ProcessingActivityID gid.GID
DataSubjects *string
LegalMechanism *string
@@ -40,7 +40,7 @@ type (
SupplementaryMeasures *string
}
UpdateProcessingActivityTIARequest struct {
UpdateTransferImpactAssessmentRequest struct {
ID gid.GID
DataSubjects **string
LegalMechanism **string
@@ -50,7 +50,7 @@ type (
}
)
func (req *CreateProcessingActivityTIARequest) Validate() error {
func (req *CreateTransferImpactAssessmentRequest) Validate() error {
v := validator.New()
v.Check(req.ProcessingActivityID, "processing_activity_id", validator.Required(), validator.GID(coredata.ProcessingActivityEntityType))
@@ -63,10 +63,10 @@ func (req *CreateProcessingActivityTIARequest) Validate() error {
return v.Error()
}
func (req *UpdateProcessingActivityTIARequest) Validate() error {
func (req *UpdateTransferImpactAssessmentRequest) Validate() error {
v := validator.New()
v.Check(req.ID, "id", validator.Required(), validator.GID(coredata.ProcessingActivityTIAEntityType))
v.Check(req.ID, "id", validator.Required(), validator.GID(coredata.TransferImpactAssessmentEntityType))
v.Check(req.DataSubjects, "data_subjects", validator.SafeText(ContentMaxLength))
v.Check(req.LegalMechanism, "legal_mechanism", validator.SafeText(ContentMaxLength))
v.Check(req.Transfer, "transfer", validator.SafeText(ContentMaxLength))
@@ -76,17 +76,17 @@ func (req *UpdateProcessingActivityTIARequest) Validate() error {
return v.Error()
}
func (s ProcessingActivityTIAService) Get(
func (s TransferImpactAssessmentService) Get(
ctx context.Context,
tiaID gid.GID,
) (*coredata.ProcessingActivityTIA, error) {
tia := &coredata.ProcessingActivityTIA{}
) (*coredata.TransferImpactAssessment, error) {
tia := &coredata.TransferImpactAssessment{}
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
if err := tia.LoadByID(ctx, conn, s.svc.scope, tiaID); err != nil {
return fmt.Errorf("cannot load processing activity tia: %w", err)
return fmt.Errorf("cannot load transfer impact assessment: %w", err)
}
return nil
@@ -100,17 +100,17 @@ func (s ProcessingActivityTIAService) Get(
return tia, nil
}
func (s ProcessingActivityTIAService) GetByProcessingActivityID(
func (s TransferImpactAssessmentService) GetByProcessingActivityID(
ctx context.Context,
processingActivityID gid.GID,
) (*coredata.ProcessingActivityTIA, error) {
tia := &coredata.ProcessingActivityTIA{}
) (*coredata.TransferImpactAssessment, error) {
tia := &coredata.TransferImpactAssessment{}
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
if err := tia.LoadByProcessingActivityID(ctx, conn, s.svc.scope, processingActivityID); err != nil {
return fmt.Errorf("cannot load processing activity tia: %w", err)
return fmt.Errorf("cannot load transfer impact assessment: %w", err)
}
return nil
@@ -124,20 +124,20 @@ func (s ProcessingActivityTIAService) GetByProcessingActivityID(
return tia, nil
}
func (s ProcessingActivityTIAService) ListForOrganizationID(
func (s TransferImpactAssessmentService) ListForOrganizationID(
ctx context.Context,
organizationID gid.GID,
cursor *page.Cursor[coredata.ProcessingActivityTIAOrderField],
filter *coredata.ProcessingActivityTIAFilter,
) (*page.Page[*coredata.ProcessingActivityTIA, coredata.ProcessingActivityTIAOrderField], error) {
var tias coredata.ProcessingActivityTIAs
cursor *page.Cursor[coredata.TransferImpactAssessmentOrderField],
filter *coredata.TransferImpactAssessmentFilter,
) (*page.Page[*coredata.TransferImpactAssessment, coredata.TransferImpactAssessmentOrderField], error) {
var tias coredata.TransferImpactAssessments
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
err := tias.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID, cursor, filter)
if err != nil {
return fmt.Errorf("cannot load processing activity tias: %w", err)
return fmt.Errorf("cannot load transfer impact assessments: %w", err)
}
return nil
@@ -151,17 +151,17 @@ func (s ProcessingActivityTIAService) ListForOrganizationID(
return page.NewPage(tias, cursor), nil
}
func (s ProcessingActivityTIAService) CountForOrganizationID(
func (s TransferImpactAssessmentService) CountForOrganizationID(
ctx context.Context,
organizationID gid.GID,
filter *coredata.ProcessingActivityTIAFilter,
filter *coredata.TransferImpactAssessmentFilter,
) (int, error) {
var count int
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) (err error) {
tias := coredata.ProcessingActivityTIAs{}
tias := coredata.TransferImpactAssessments{}
count, err = tias.CountByOrganizationID(ctx, conn, s.svc.scope, organizationID, filter)
return err
},
@@ -174,18 +174,18 @@ func (s ProcessingActivityTIAService) CountForOrganizationID(
return count, nil
}
func (s *ProcessingActivityTIAService) Create(
func (s *TransferImpactAssessmentService) Create(
ctx context.Context,
req *CreateProcessingActivityTIARequest,
) (*coredata.ProcessingActivityTIA, error) {
req *CreateTransferImpactAssessmentRequest,
) (*coredata.TransferImpactAssessment, error) {
if err := req.Validate(); err != nil {
return nil, err
}
now := time.Now()
tia := &coredata.ProcessingActivityTIA{
ID: gid.New(s.svc.scope.GetTenantID(), coredata.ProcessingActivityTIAEntityType),
tia := &coredata.TransferImpactAssessment{
ID: gid.New(s.svc.scope.GetTenantID(), coredata.TransferImpactAssessmentEntityType),
ProcessingActivityID: req.ProcessingActivityID,
DataSubjects: req.DataSubjects,
LegalMechanism: req.LegalMechanism,
@@ -207,7 +207,7 @@ func (s *ProcessingActivityTIAService) Create(
tia.OrganizationID = processingActivity.OrganizationID
if err := tia.Insert(ctx, conn, s.svc.scope); err != nil {
return fmt.Errorf("cannot insert processing activity tia: %w", err)
return fmt.Errorf("cannot insert transfer impact assessment: %w", err)
}
return nil
@@ -221,21 +221,21 @@ func (s *ProcessingActivityTIAService) Create(
return tia, nil
}
func (s *ProcessingActivityTIAService) Update(
func (s *TransferImpactAssessmentService) Update(
ctx context.Context,
req *UpdateProcessingActivityTIARequest,
) (*coredata.ProcessingActivityTIA, error) {
req *UpdateTransferImpactAssessmentRequest,
) (*coredata.TransferImpactAssessment, error) {
if err := req.Validate(); err != nil {
return nil, err
}
tia := &coredata.ProcessingActivityTIA{}
tia := &coredata.TransferImpactAssessment{}
err := s.svc.pg.WithTx(
ctx,
func(conn pg.Conn) error {
if err := tia.LoadByID(ctx, conn, s.svc.scope, req.ID); err != nil {
return fmt.Errorf("cannot load processing activity tia: %w", err)
return fmt.Errorf("cannot load transfer impact assessment: %w", err)
}
if req.DataSubjects != nil {
@@ -261,7 +261,7 @@ func (s *ProcessingActivityTIAService) Update(
tia.UpdatedAt = time.Now()
if err := tia.Update(ctx, conn, s.svc.scope); err != nil {
return fmt.Errorf("cannot update processing activity tia: %w", err)
return fmt.Errorf("cannot update transfer impact assessment: %w", err)
}
return nil
@@ -275,20 +275,20 @@ func (s *ProcessingActivityTIAService) Update(
return tia, nil
}
func (s *ProcessingActivityTIAService) Delete(
func (s *TransferImpactAssessmentService) Delete(
ctx context.Context,
tiaID gid.GID,
) error {
err := s.svc.pg.WithTx(
ctx,
func(conn pg.Conn) error {
tia := &coredata.ProcessingActivityTIA{}
tia := &coredata.TransferImpactAssessment{}
if err := tia.LoadByID(ctx, conn, s.svc.scope, tiaID); err != nil {
return fmt.Errorf("cannot load processing activity tia: %w", err)
return fmt.Errorf("cannot load transfer impact assessment: %w", err)
}
if err := tia.Delete(ctx, conn, s.svc.scope); err != nil {
return fmt.Errorf("cannot delete processing activity tia: %w", err)
return fmt.Errorf("cannot delete transfer impact assessment: %w", err)
}
return nil
@@ -297,3 +297,4 @@ func (s *ProcessingActivityTIAService) Delete(
return err
}

View File

@@ -366,21 +366,21 @@ enum ProcessingActivityTransferImpactAssessment
)
}
enum ProcessingActivityDPIAResidualRisk
enum DataProtectionImpactAssessmentResidualRisk
@goModel(
model: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAResidualRisk"
model: "go.probo.inc/probo/pkg/coredata.DataProtectionImpactAssessmentResidualRisk"
) {
LOW
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAResidualRiskLow"
value: "go.probo.inc/probo/pkg/coredata.DataProtectionImpactAssessmentResidualRiskLow"
)
MEDIUM
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAResidualRiskMedium"
value: "go.probo.inc/probo/pkg/coredata.DataProtectionImpactAssessmentResidualRiskMedium"
)
HIGH
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAResidualRiskHigh"
value: "go.probo.inc/probo/pkg/coredata.DataProtectionImpactAssessmentResidualRiskHigh"
)
}
@@ -1079,23 +1079,23 @@ enum ProcessingActivityOrderField
)
}
enum ProcessingActivityDPIAOrderField
enum DataProtectionImpactAssessmentOrderField
@goModel(
model: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAOrderField"
model: "go.probo.inc/probo/pkg/coredata.DataProtectionImpactAssessmentOrderField"
) {
CREATED_AT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAOrderFieldCreatedAt"
value: "go.probo.inc/probo/pkg/coredata.DataProtectionImpactAssessmentOrderFieldCreatedAt"
)
}
enum ProcessingActivityTIAOrderField
enum TransferImpactAssessmentOrderField
@goModel(
model: "go.probo.inc/probo/pkg/coredata.ProcessingActivityTIAOrderField"
model: "go.probo.inc/probo/pkg/coredata.TransferImpactAssessmentOrderField"
) {
CREATED_AT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityTIAOrderFieldCreatedAt"
value: "go.probo.inc/probo/pkg/coredata.TransferImpactAssessmentOrderFieldCreatedAt"
)
}
@@ -1352,20 +1352,20 @@ input ProcessingActivityOrder
field: ProcessingActivityOrderField!
}
input ProcessingActivityDPIAOrder
input DataProtectionImpactAssessmentOrder
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ProcessingActivityDPIAOrderBy"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.DataProtectionImpactAssessmentOrderBy"
) {
direction: OrderDirection!
field: ProcessingActivityDPIAOrderField!
field: DataProtectionImpactAssessmentOrderField!
}
input ProcessingActivityTIAOrder
input TransferImpactAssessmentOrder
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ProcessingActivityTIAOrderBy"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TransferImpactAssessmentOrderBy"
) {
direction: OrderDirection!
field: ProcessingActivityTIAOrderField!
field: TransferImpactAssessmentOrderField!
}
input TrustCenterAccessOrder
@@ -1517,11 +1517,11 @@ input ProcessingActivityFilter {
snapshotId: ID
}
input ProcessingActivityDPIAFilter {
input DataProtectionImpactAssessmentFilter {
snapshotId: ID
}
input ProcessingActivityTIAFilter {
input TransferImpactAssessmentFilter {
snapshotId: ID
}
@@ -1741,18 +1741,18 @@ type Organization implements Node {
after: CursorKey
last: Int
before: CursorKey
orderBy: ProcessingActivityDPIAOrder
filter: ProcessingActivityDPIAFilter = { snapshotId: null }
): ProcessingActivityDPIAConnection! @goField(forceResolver: true)
orderBy: DataProtectionImpactAssessmentOrder
filter: DataProtectionImpactAssessmentFilter = { snapshotId: null }
): DataProtectionImpactAssessmentConnection! @goField(forceResolver: true)
transferImpactAssessments(
first: Int
after: CursorKey
last: Int
before: CursorKey
orderBy: ProcessingActivityTIAOrder
filter: ProcessingActivityTIAFilter = { snapshotId: null }
): ProcessingActivityTIAConnection! @goField(forceResolver: true)
orderBy: TransferImpactAssessmentOrder
filter: TransferImpactAssessmentFilter = { snapshotId: null }
): TransferImpactAssessmentConnection! @goField(forceResolver: true)
snapshots(
first: Int
@@ -2344,8 +2344,8 @@ type ProcessingActivity implements Node {
transferSafeguards: ProcessingActivityTransferSafeguard
retentionPeriod: String
securityMeasures: String
dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment!
transferImpactAssessment: ProcessingActivityTransferImpactAssessment!
dataProtectionImpactAssessmentNeeded: ProcessingActivityDataProtectionImpactAssessment!
transferImpactAssessmentNeeded: ProcessingActivityTransferImpactAssessment!
lastReviewDate: Datetime
nextReviewDate: Datetime
role: ProcessingActivityRole!
@@ -2357,13 +2357,13 @@ type ProcessingActivity implements Node {
before: CursorKey
orderBy: VendorOrder
): VendorConnection! @goField(forceResolver: true)
dpia: ProcessingActivityDPIA @goField(forceResolver: true)
tia: ProcessingActivityTIA @goField(forceResolver: true)
dataProtectionImpactAssessment: DataProtectionImpactAssessment @goField(forceResolver: true)
transferImpactAssessment: TransferImpactAssessment @goField(forceResolver: true)
createdAt: Datetime!
updatedAt: Datetime!
}
type ProcessingActivityDPIA implements Node {
type DataProtectionImpactAssessment implements Node {
id: ID!
processingActivity: ProcessingActivity! @goField(forceResolver: true)
organization: Organization! @goField(forceResolver: true)
@@ -2371,12 +2371,12 @@ type ProcessingActivityDPIA implements Node {
necessityAndProportionality: String
potentialRisk: String
mitigations: String
residualRisk: ProcessingActivityDPIAResidualRisk
residualRisk: DataProtectionImpactAssessmentResidualRisk
createdAt: Datetime!
updatedAt: Datetime!
}
type ProcessingActivityTIA implements Node {
type TransferImpactAssessment implements Node {
id: ID!
processingActivity: ProcessingActivity! @goField(forceResolver: true)
organization: Organization! @goField(forceResolver: true)
@@ -2893,32 +2893,32 @@ type ProcessingActivityEdge {
node: ProcessingActivity!
}
type ProcessingActivityDPIAConnection
type DataProtectionImpactAssessmentConnection
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ProcessingActivityDPIAConnection"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.DataProtectionImpactAssessmentConnection"
) {
totalCount: Int! @goField(forceResolver: true)
edges: [ProcessingActivityDPIAEdge!]!
edges: [DataProtectionImpactAssessmentEdge!]!
pageInfo: PageInfo!
}
type ProcessingActivityDPIAEdge {
type DataProtectionImpactAssessmentEdge {
cursor: CursorKey!
node: ProcessingActivityDPIA!
node: DataProtectionImpactAssessment!
}
type ProcessingActivityTIAConnection
type TransferImpactAssessmentConnection
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ProcessingActivityTIAConnection"
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TransferImpactAssessmentConnection"
) {
totalCount: Int! @goField(forceResolver: true)
edges: [ProcessingActivityTIAEdge!]!
edges: [TransferImpactAssessmentEdge!]!
pageInfo: PageInfo!
}
type ProcessingActivityTIAEdge {
type TransferImpactAssessmentEdge {
cursor: CursorKey!
node: ProcessingActivityTIA!
node: TransferImpactAssessment!
}
type SnapshotConnection
@@ -3258,26 +3258,26 @@ type Mutation {
deleteProcessingActivity(
input: DeleteProcessingActivityInput!
): DeleteProcessingActivityPayload!
# Processing Activity DPIA mutations
createProcessingActivityDPIA(
input: CreateProcessingActivityDPIAInput!
): CreateProcessingActivityDPIAPayload!
updateProcessingActivityDPIA(
input: UpdateProcessingActivityDPIAInput!
): UpdateProcessingActivityDPIAPayload!
deleteProcessingActivityDPIA(
input: DeleteProcessingActivityDPIAInput!
): DeleteProcessingActivityDPIAPayload!
# Processing Activity TIA mutations
createProcessingActivityTIA(
input: CreateProcessingActivityTIAInput!
): CreateProcessingActivityTIAPayload!
updateProcessingActivityTIA(
input: UpdateProcessingActivityTIAInput!
): UpdateProcessingActivityTIAPayload!
deleteProcessingActivityTIA(
input: DeleteProcessingActivityTIAInput!
): DeleteProcessingActivityTIAPayload!
# Data Protection Impact Assessment mutations
createDataProtectionImpactAssessment(
input: CreateDataProtectionImpactAssessmentInput!
): CreateDataProtectionImpactAssessmentPayload!
updateDataProtectionImpactAssessment(
input: UpdateDataProtectionImpactAssessmentInput!
): UpdateDataProtectionImpactAssessmentPayload!
deleteDataProtectionImpactAssessment(
input: DeleteDataProtectionImpactAssessmentInput!
): DeleteDataProtectionImpactAssessmentPayload!
# Transfer Impact Assessment mutations
createTransferImpactAssessment(
input: CreateTransferImpactAssessmentInput!
): CreateTransferImpactAssessmentPayload!
updateTransferImpactAssessment(
input: UpdateTransferImpactAssessmentInput!
): UpdateTransferImpactAssessmentPayload!
deleteTransferImpactAssessment(
input: DeleteTransferImpactAssessmentInput!
): DeleteTransferImpactAssessmentPayload!
# Snapshot mutations
createSnapshot(input: CreateSnapshotInput!): CreateSnapshotPayload!
deleteSnapshot(input: DeleteSnapshotInput!): DeleteSnapshotPayload!
@@ -4046,8 +4046,8 @@ input CreateProcessingActivityInput {
transferSafeguards: ProcessingActivityTransferSafeguard
retentionPeriod: String
securityMeasures: String
dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment!
transferImpactAssessment: ProcessingActivityTransferImpactAssessment!
dataProtectionImpactAssessmentNeeded: ProcessingActivityDataProtectionImpactAssessment!
transferImpactAssessmentNeeded: ProcessingActivityTransferImpactAssessment!
lastReviewDate: Datetime
nextReviewDate: Datetime
role: ProcessingActivityRole!
@@ -4071,8 +4071,8 @@ input UpdateProcessingActivityInput {
@goField(omittable: true)
retentionPeriod: String @goField(omittable: true)
securityMeasures: String @goField(omittable: true)
dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment
transferImpactAssessment: ProcessingActivityTransferImpactAssessment
dataProtectionImpactAssessmentNeeded: ProcessingActivityDataProtectionImpactAssessment
transferImpactAssessmentNeeded: ProcessingActivityTransferImpactAssessment
lastReviewDate: Datetime @goField(omittable: true)
nextReviewDate: Datetime @goField(omittable: true)
role: ProcessingActivityRole
@@ -4084,29 +4084,29 @@ input DeleteProcessingActivityInput {
processingActivityId: ID!
}
input CreateProcessingActivityDPIAInput {
input CreateDataProtectionImpactAssessmentInput {
processingActivityId: ID!
description: String
necessityAndProportionality: String
potentialRisk: String
mitigations: String
residualRisk: ProcessingActivityDPIAResidualRisk
residualRisk: DataProtectionImpactAssessmentResidualRisk
}
input UpdateProcessingActivityDPIAInput {
input UpdateDataProtectionImpactAssessmentInput {
id: ID!
description: String @goField(omittable: true)
necessityAndProportionality: String @goField(omittable: true)
potentialRisk: String @goField(omittable: true)
mitigations: String @goField(omittable: true)
residualRisk: ProcessingActivityDPIAResidualRisk
residualRisk: DataProtectionImpactAssessmentResidualRisk
}
input DeleteProcessingActivityDPIAInput {
processingActivityDpiaId: ID!
input DeleteDataProtectionImpactAssessmentInput {
dataProtectionImpactAssessmentId: ID!
}
input CreateProcessingActivityTIAInput {
input CreateTransferImpactAssessmentInput {
processingActivityId: ID!
dataSubjects: String
legalMechanism: String
@@ -4115,7 +4115,7 @@ input CreateProcessingActivityTIAInput {
supplementaryMeasures: String
}
input UpdateProcessingActivityTIAInput {
input UpdateTransferImpactAssessmentInput {
id: ID!
dataSubjects: String @goField(omittable: true)
legalMechanism: String @goField(omittable: true)
@@ -4124,8 +4124,8 @@ input UpdateProcessingActivityTIAInput {
supplementaryMeasures: String @goField(omittable: true)
}
input DeleteProcessingActivityTIAInput {
processingActivityTiaId: ID!
input DeleteTransferImpactAssessmentInput {
transferImpactAssessmentId: ID!
}
input CreateSnapshotInput {
@@ -4992,28 +4992,28 @@ type DeleteProcessingActivityPayload {
deletedProcessingActivityId: ID!
}
type CreateProcessingActivityDPIAPayload {
processingActivityDpia: ProcessingActivityDPIA!
type CreateDataProtectionImpactAssessmentPayload {
dataProtectionImpactAssessment: DataProtectionImpactAssessment!
}
type UpdateProcessingActivityDPIAPayload {
processingActivityDpia: ProcessingActivityDPIA!
type UpdateDataProtectionImpactAssessmentPayload {
dataProtectionImpactAssessment: DataProtectionImpactAssessment!
}
type DeleteProcessingActivityDPIAPayload {
deletedProcessingActivityDpiaId: ID!
type DeleteDataProtectionImpactAssessmentPayload {
deletedDataProtectionImpactAssessmentId: ID!
}
type CreateProcessingActivityTIAPayload {
processingActivityTia: ProcessingActivityTIA!
type CreateTransferImpactAssessmentPayload {
transferImpactAssessment: TransferImpactAssessment!
}
type UpdateProcessingActivityTIAPayload {
processingActivityTia: ProcessingActivityTIA!
type UpdateTransferImpactAssessmentPayload {
transferImpactAssessment: TransferImpactAssessment!
}
type DeleteProcessingActivityTIAPayload {
deletedProcessingActivityTiaId: ID!
type DeleteTransferImpactAssessmentPayload {
deletedTransferImpactAssessmentId: ID!
}
type CreateSnapshotPayload {

File diff suppressed because it is too large Load Diff

View File

@@ -21,31 +21,31 @@ import (
)
type (
ProcessingActivityDPIAOrderBy OrderBy[coredata.ProcessingActivityDPIAOrderField]
DataProtectionImpactAssessmentOrderBy OrderBy[coredata.DataProtectionImpactAssessmentOrderField]
ProcessingActivityDPIAConnection struct {
DataProtectionImpactAssessmentConnection struct {
TotalCount int
Edges []*ProcessingActivityDPIAEdge
Edges []*DataProtectionImpactAssessmentEdge
PageInfo PageInfo
Resolver any
ParentID gid.GID
Filter *coredata.ProcessingActivityDPIAFilter
Filter *coredata.DataProtectionImpactAssessmentFilter
}
)
func NewProcessingActivityDPIAConnection(
p *page.Page[*coredata.ProcessingActivityDPIA, coredata.ProcessingActivityDPIAOrderField],
func NewDataProtectionImpactAssessmentConnection(
p *page.Page[*coredata.DataProtectionImpactAssessment, coredata.DataProtectionImpactAssessmentOrderField],
parentType any,
parentID gid.GID,
filter *coredata.ProcessingActivityDPIAFilter,
) *ProcessingActivityDPIAConnection {
edges := make([]*ProcessingActivityDPIAEdge, len(p.Data))
filter *coredata.DataProtectionImpactAssessmentFilter,
) *DataProtectionImpactAssessmentConnection {
edges := make([]*DataProtectionImpactAssessmentEdge, len(p.Data))
for i, dpia := range p.Data {
edges[i] = NewProcessingActivityDPIAEdge(dpia, p.Cursor.OrderBy.Field)
edges[i] = NewDataProtectionImpactAssessmentEdge(dpia, p.Cursor.OrderBy.Field)
}
return &ProcessingActivityDPIAConnection{
return &DataProtectionImpactAssessmentConnection{
Edges: edges,
PageInfo: *NewPageInfo(p),
@@ -55,15 +55,15 @@ func NewProcessingActivityDPIAConnection(
}
}
func NewProcessingActivityDPIAEdge(dpia *coredata.ProcessingActivityDPIA, orderField coredata.ProcessingActivityDPIAOrderField) *ProcessingActivityDPIAEdge {
return &ProcessingActivityDPIAEdge{
Node: NewProcessingActivityDpia(dpia),
func NewDataProtectionImpactAssessmentEdge(dpia *coredata.DataProtectionImpactAssessment, orderField coredata.DataProtectionImpactAssessmentOrderField) *DataProtectionImpactAssessmentEdge {
return &DataProtectionImpactAssessmentEdge{
Node: NewDataProtectionImpactAssessment(dpia),
Cursor: dpia.CursorKey(orderField),
}
}
func NewProcessingActivityDpia(dpia *coredata.ProcessingActivityDPIA) *ProcessingActivityDpia {
return &ProcessingActivityDpia{
func NewDataProtectionImpactAssessment(dpia *coredata.DataProtectionImpactAssessment) *DataProtectionImpactAssessment {
return &DataProtectionImpactAssessment{
ID: dpia.ID,
Description: dpia.Description,
NecessityAndProportionality: dpia.NecessityAndProportionality,
@@ -74,3 +74,4 @@ func NewProcessingActivityDpia(dpia *coredata.ProcessingActivityDPIA) *Processin
UpdatedAt: dpia.UpdatedAt,
}
}

View File

@@ -57,29 +57,29 @@ func NewProcessingActivityConnection(
func NewProcessingActivity(par *coredata.ProcessingActivity) *ProcessingActivity {
return &ProcessingActivity{
ID: par.ID,
SnapshotID: par.SnapshotID,
SourceID: par.SourceID,
Name: par.Name,
Purpose: par.Purpose,
DataSubjectCategory: par.DataSubjectCategory,
PersonalDataCategory: par.PersonalDataCategory,
SpecialOrCriminalData: par.SpecialOrCriminalData,
ConsentEvidenceLink: par.ConsentEvidenceLink,
LawfulBasis: par.LawfulBasis,
Recipients: par.Recipients,
Location: par.Location,
InternationalTransfers: par.InternationalTransfers,
TransferSafeguards: par.TransferSafeguard,
RetentionPeriod: par.RetentionPeriod,
SecurityMeasures: par.SecurityMeasures,
DataProtectionImpactAssessment: par.DataProtectionImpactAssessment,
TransferImpactAssessment: par.TransferImpactAssessment,
LastReviewDate: par.LastReviewDate,
NextReviewDate: par.NextReviewDate,
Role: par.Role,
CreatedAt: par.CreatedAt,
UpdatedAt: par.UpdatedAt,
ID: par.ID,
SnapshotID: par.SnapshotID,
SourceID: par.SourceID,
Name: par.Name,
Purpose: par.Purpose,
DataSubjectCategory: par.DataSubjectCategory,
PersonalDataCategory: par.PersonalDataCategory,
SpecialOrCriminalData: par.SpecialOrCriminalData,
ConsentEvidenceLink: par.ConsentEvidenceLink,
LawfulBasis: par.LawfulBasis,
Recipients: par.Recipients,
Location: par.Location,
InternationalTransfers: par.InternationalTransfers,
TransferSafeguards: par.TransferSafeguard,
RetentionPeriod: par.RetentionPeriod,
SecurityMeasures: par.SecurityMeasures,
DataProtectionImpactAssessmentNeeded: par.DataProtectionImpactAssessmentNeeded,
TransferImpactAssessmentNeeded: par.TransferImpactAssessmentNeeded,
LastReviewDate: par.LastReviewDate,
NextReviewDate: par.NextReviewDate,
Role: par.Role,
CreatedAt: par.CreatedAt,
UpdatedAt: par.UpdatedAt,
}
}

View File

@@ -21,31 +21,31 @@ import (
)
type (
ProcessingActivityTIAOrderBy OrderBy[coredata.ProcessingActivityTIAOrderField]
TransferImpactAssessmentOrderBy OrderBy[coredata.TransferImpactAssessmentOrderField]
ProcessingActivityTIAConnection struct {
TransferImpactAssessmentConnection struct {
TotalCount int
Edges []*ProcessingActivityTIAEdge
Edges []*TransferImpactAssessmentEdge
PageInfo PageInfo
Resolver any
ParentID gid.GID
Filter *coredata.ProcessingActivityTIAFilter
Filter *coredata.TransferImpactAssessmentFilter
}
)
func NewProcessingActivityTIAConnection(
p *page.Page[*coredata.ProcessingActivityTIA, coredata.ProcessingActivityTIAOrderField],
func NewTransferImpactAssessmentConnection(
p *page.Page[*coredata.TransferImpactAssessment, coredata.TransferImpactAssessmentOrderField],
parentType any,
parentID gid.GID,
filter *coredata.ProcessingActivityTIAFilter,
) *ProcessingActivityTIAConnection {
edges := make([]*ProcessingActivityTIAEdge, len(p.Data))
filter *coredata.TransferImpactAssessmentFilter,
) *TransferImpactAssessmentConnection {
edges := make([]*TransferImpactAssessmentEdge, len(p.Data))
for i, tia := range p.Data {
edges[i] = NewProcessingActivityTIAEdge(tia, p.Cursor.OrderBy.Field)
edges[i] = NewTransferImpactAssessmentEdge(tia, p.Cursor.OrderBy.Field)
}
return &ProcessingActivityTIAConnection{
return &TransferImpactAssessmentConnection{
Edges: edges,
PageInfo: *NewPageInfo(p),
@@ -55,15 +55,15 @@ func NewProcessingActivityTIAConnection(
}
}
func NewProcessingActivityTIAEdge(tia *coredata.ProcessingActivityTIA, orderField coredata.ProcessingActivityTIAOrderField) *ProcessingActivityTIAEdge {
return &ProcessingActivityTIAEdge{
Node: NewProcessingActivityTia(tia),
func NewTransferImpactAssessmentEdge(tia *coredata.TransferImpactAssessment, orderField coredata.TransferImpactAssessmentOrderField) *TransferImpactAssessmentEdge {
return &TransferImpactAssessmentEdge{
Node: NewTransferImpactAssessment(tia),
Cursor: tia.CursorKey(orderField),
}
}
func NewProcessingActivityTia(tia *coredata.ProcessingActivityTIA) *ProcessingActivityTia {
return &ProcessingActivityTia{
func NewTransferImpactAssessment(tia *coredata.TransferImpactAssessment) *TransferImpactAssessment {
return &TransferImpactAssessment{
ID: tia.ID,
DataSubjects: tia.DataSubjects,
LegalMechanism: tia.LegalMechanism,
@@ -74,3 +74,4 @@ func NewProcessingActivityTia(tia *coredata.ProcessingActivityTIA) *ProcessingAc
UpdatedAt: tia.UpdatedAt,
}
}

View File

@@ -293,6 +293,19 @@ type CreateCustomDomainPayload struct {
CustomDomain *CustomDomain `json:"customDomain"`
}
type CreateDataProtectionImpactAssessmentInput struct {
ProcessingActivityID gid.GID `json:"processingActivityId"`
Description *string `json:"description,omitempty"`
NecessityAndProportionality *string `json:"necessityAndProportionality,omitempty"`
PotentialRisk *string `json:"potentialRisk,omitempty"`
Mitigations *string `json:"mitigations,omitempty"`
ResidualRisk *coredata.DataProtectionImpactAssessmentResidualRisk `json:"residualRisk,omitempty"`
}
type CreateDataProtectionImpactAssessmentPayload struct {
DataProtectionImpactAssessment *DataProtectionImpactAssessment `json:"dataProtectionImpactAssessment"`
}
type CreateDatumInput struct {
OrganizationID gid.GID `json:"organizationId"`
Name string `json:"name"`
@@ -432,60 +445,34 @@ type CreatePeoplePayload struct {
PeopleEdge *PeopleEdge `json:"peopleEdge"`
}
type CreateProcessingActivityDPIAInput struct {
ProcessingActivityID gid.GID `json:"processingActivityId"`
Description *string `json:"description,omitempty"`
NecessityAndProportionality *string `json:"necessityAndProportionality,omitempty"`
PotentialRisk *string `json:"potentialRisk,omitempty"`
Mitigations *string `json:"mitigations,omitempty"`
ResidualRisk *coredata.ProcessingActivityDPIAResidualRisk `json:"residualRisk,omitempty"`
}
type CreateProcessingActivityDPIAPayload struct {
ProcessingActivityDpia *ProcessingActivityDpia `json:"processingActivityDpia"`
}
type CreateProcessingActivityInput struct {
OrganizationID gid.GID `json:"organizationId"`
Name string `json:"name"`
Purpose *string `json:"purpose,omitempty"`
DataSubjectCategory *string `json:"dataSubjectCategory,omitempty"`
PersonalDataCategory *string `json:"personalDataCategory,omitempty"`
SpecialOrCriminalData coredata.ProcessingActivitySpecialOrCriminalDatum `json:"specialOrCriminalData"`
ConsentEvidenceLink *string `json:"consentEvidenceLink,omitempty"`
LawfulBasis coredata.ProcessingActivityLawfulBasis `json:"lawfulBasis"`
Recipients *string `json:"recipients,omitempty"`
Location *string `json:"location,omitempty"`
InternationalTransfers bool `json:"internationalTransfers"`
TransferSafeguards *coredata.ProcessingActivityTransferSafeguard `json:"transferSafeguards,omitempty"`
RetentionPeriod *string `json:"retentionPeriod,omitempty"`
SecurityMeasures *string `json:"securityMeasures,omitempty"`
DataProtectionImpactAssessment coredata.ProcessingActivityDataProtectionImpactAssessment `json:"dataProtectionImpactAssessment"`
TransferImpactAssessment coredata.ProcessingActivityTransferImpactAssessment `json:"transferImpactAssessment"`
LastReviewDate *time.Time `json:"lastReviewDate,omitempty"`
NextReviewDate *time.Time `json:"nextReviewDate,omitempty"`
Role coredata.ProcessingActivityRole `json:"role"`
DataProtectionOfficerID *gid.GID `json:"dataProtectionOfficerId,omitempty"`
VendorIds []gid.GID `json:"vendorIds,omitempty"`
OrganizationID gid.GID `json:"organizationId"`
Name string `json:"name"`
Purpose *string `json:"purpose,omitempty"`
DataSubjectCategory *string `json:"dataSubjectCategory,omitempty"`
PersonalDataCategory *string `json:"personalDataCategory,omitempty"`
SpecialOrCriminalData coredata.ProcessingActivitySpecialOrCriminalDatum `json:"specialOrCriminalData"`
ConsentEvidenceLink *string `json:"consentEvidenceLink,omitempty"`
LawfulBasis coredata.ProcessingActivityLawfulBasis `json:"lawfulBasis"`
Recipients *string `json:"recipients,omitempty"`
Location *string `json:"location,omitempty"`
InternationalTransfers bool `json:"internationalTransfers"`
TransferSafeguards *coredata.ProcessingActivityTransferSafeguard `json:"transferSafeguards,omitempty"`
RetentionPeriod *string `json:"retentionPeriod,omitempty"`
SecurityMeasures *string `json:"securityMeasures,omitempty"`
DataProtectionImpactAssessmentNeeded coredata.ProcessingActivityDataProtectionImpactAssessment `json:"dataProtectionImpactAssessmentNeeded"`
TransferImpactAssessmentNeeded coredata.ProcessingActivityTransferImpactAssessment `json:"transferImpactAssessmentNeeded"`
LastReviewDate *time.Time `json:"lastReviewDate,omitempty"`
NextReviewDate *time.Time `json:"nextReviewDate,omitempty"`
Role coredata.ProcessingActivityRole `json:"role"`
DataProtectionOfficerID *gid.GID `json:"dataProtectionOfficerId,omitempty"`
VendorIds []gid.GID `json:"vendorIds,omitempty"`
}
type CreateProcessingActivityPayload struct {
ProcessingActivityEdge *ProcessingActivityEdge `json:"processingActivityEdge"`
}
type CreateProcessingActivityTIAInput struct {
ProcessingActivityID gid.GID `json:"processingActivityId"`
DataSubjects *string `json:"dataSubjects,omitempty"`
LegalMechanism *string `json:"legalMechanism,omitempty"`
Transfer *string `json:"transfer,omitempty"`
LocalLawRisk *string `json:"localLawRisk,omitempty"`
SupplementaryMeasures *string `json:"supplementaryMeasures,omitempty"`
}
type CreateProcessingActivityTIAPayload struct {
ProcessingActivityTia *ProcessingActivityTia `json:"processingActivityTia"`
}
type CreateRiskDocumentMappingInput struct {
RiskID gid.GID `json:"riskId"`
DocumentID gid.GID `json:"documentId"`
@@ -581,6 +568,19 @@ type CreateTaskPayload struct {
TaskEdge *TaskEdge `json:"taskEdge"`
}
type CreateTransferImpactAssessmentInput struct {
ProcessingActivityID gid.GID `json:"processingActivityId"`
DataSubjects *string `json:"dataSubjects,omitempty"`
LegalMechanism *string `json:"legalMechanism,omitempty"`
Transfer *string `json:"transfer,omitempty"`
LocalLawRisk *string `json:"localLawRisk,omitempty"`
SupplementaryMeasures *string `json:"supplementaryMeasures,omitempty"`
}
type CreateTransferImpactAssessmentPayload struct {
TransferImpactAssessment *TransferImpactAssessment `json:"transferImpactAssessment"`
}
type CreateTrustCenterAccessInput struct {
TrustCenterID gid.GID `json:"trustCenterId"`
Email mail.Addr `json:"email"`
@@ -701,6 +701,31 @@ type DNSRecordInstruction struct {
Purpose string `json:"purpose"`
}
type DataProtectionImpactAssessment struct {
ID gid.GID `json:"id"`
ProcessingActivity *ProcessingActivity `json:"processingActivity"`
Organization *Organization `json:"organization"`
Description *string `json:"description,omitempty"`
NecessityAndProportionality *string `json:"necessityAndProportionality,omitempty"`
PotentialRisk *string `json:"potentialRisk,omitempty"`
Mitigations *string `json:"mitigations,omitempty"`
ResidualRisk *coredata.DataProtectionImpactAssessmentResidualRisk `json:"residualRisk,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func (DataProtectionImpactAssessment) IsNode() {}
func (this DataProtectionImpactAssessment) GetID() gid.GID { return this.ID }
type DataProtectionImpactAssessmentEdge struct {
Cursor page.CursorKey `json:"cursor"`
Node *DataProtectionImpactAssessment `json:"node"`
}
type DataProtectionImpactAssessmentFilter struct {
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
}
type DatumEdge struct {
Cursor page.CursorKey `json:"cursor"`
Node *Datum `json:"node"`
@@ -798,6 +823,14 @@ type DeleteCustomDomainPayload struct {
DeletedCustomDomainID gid.GID `json:"deletedCustomDomainId"`
}
type DeleteDataProtectionImpactAssessmentInput struct {
DataProtectionImpactAssessmentID gid.GID `json:"dataProtectionImpactAssessmentId"`
}
type DeleteDataProtectionImpactAssessmentPayload struct {
DeletedDataProtectionImpactAssessmentID gid.GID `json:"deletedDataProtectionImpactAssessmentId"`
}
type DeleteDatumInput struct {
DatumID gid.GID `json:"datumId"`
}
@@ -902,14 +935,6 @@ type DeletePeoplePayload struct {
DeletedPeopleID gid.GID `json:"deletedPeopleId"`
}
type DeleteProcessingActivityDPIAInput struct {
ProcessingActivityDpiaID gid.GID `json:"processingActivityDpiaId"`
}
type DeleteProcessingActivityDPIAPayload struct {
DeletedProcessingActivityDpiaID gid.GID `json:"deletedProcessingActivityDpiaId"`
}
type DeleteProcessingActivityInput struct {
ProcessingActivityID gid.GID `json:"processingActivityId"`
}
@@ -918,14 +943,6 @@ type DeleteProcessingActivityPayload struct {
DeletedProcessingActivityID gid.GID `json:"deletedProcessingActivityId"`
}
type DeleteProcessingActivityTIAInput struct {
ProcessingActivityTiaID gid.GID `json:"processingActivityTiaId"`
}
type DeleteProcessingActivityTIAPayload struct {
DeletedProcessingActivityTiaID gid.GID `json:"deletedProcessingActivityTiaId"`
}
type DeleteRiskDocumentMappingInput struct {
RiskID gid.GID `json:"riskId"`
DocumentID gid.GID `json:"documentId"`
@@ -988,6 +1005,14 @@ type DeleteTaskPayload struct {
DeletedTaskID gid.GID `json:"deletedTaskId"`
}
type DeleteTransferImpactAssessmentInput struct {
TransferImpactAssessmentID gid.GID `json:"transferImpactAssessmentId"`
}
type DeleteTransferImpactAssessmentPayload struct {
DeletedTransferImpactAssessmentID gid.GID `json:"deletedTransferImpactAssessmentId"`
}
type DeleteTrustCenterAccessInput struct {
ID gid.GID `json:"id"`
}
@@ -1472,43 +1497,43 @@ type ObligationFilter struct {
}
type Organization struct {
ID gid.GID `json:"id"`
Name string `json:"name"`
LogoURL *string `json:"logoUrl,omitempty"`
HorizontalLogoURL *string `json:"horizontalLogoUrl,omitempty"`
Description *string `json:"description,omitempty"`
WebsiteURL *string `json:"websiteUrl,omitempty"`
Email *string `json:"email,omitempty"`
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
Context *OrganizationContext `json:"context,omitempty"`
Memberships *MembershipConnection `json:"memberships"`
Invitations *InvitationConnection `json:"invitations"`
SlackConnections *SlackConnectionConnection `json:"slackConnections"`
Frameworks *FrameworkConnection `json:"frameworks"`
Controls *ControlConnection `json:"controls"`
Vendors *VendorConnection `json:"vendors"`
Peoples *PeopleConnection `json:"peoples"`
Documents *DocumentConnection `json:"documents"`
Meetings *MeetingConnection `json:"meetings"`
Measures *MeasureConnection `json:"measures"`
Risks *RiskConnection `json:"risks"`
Tasks *TaskConnection `json:"tasks"`
Assets *AssetConnection `json:"assets"`
Data *DatumConnection `json:"data"`
Audits *AuditConnection `json:"audits"`
Nonconformities *NonconformityConnection `json:"nonconformities"`
Obligations *ObligationConnection `json:"obligations"`
ContinualImprovements *ContinualImprovementConnection `json:"continualImprovements"`
ProcessingActivities *ProcessingActivityConnection `json:"processingActivities"`
DataProtectionImpactAssessments *ProcessingActivityDPIAConnection `json:"dataProtectionImpactAssessments"`
TransferImpactAssessments *ProcessingActivityTIAConnection `json:"transferImpactAssessments"`
Snapshots *SnapshotConnection `json:"snapshots"`
TrustCenterFiles *TrustCenterFileConnection `json:"trustCenterFiles"`
TrustCenter *TrustCenter `json:"trustCenter,omitempty"`
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
SamlConfigurations []*SAMLConfiguration `json:"samlConfigurations"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
ID gid.GID `json:"id"`
Name string `json:"name"`
LogoURL *string `json:"logoUrl,omitempty"`
HorizontalLogoURL *string `json:"horizontalLogoUrl,omitempty"`
Description *string `json:"description,omitempty"`
WebsiteURL *string `json:"websiteUrl,omitempty"`
Email *string `json:"email,omitempty"`
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
Context *OrganizationContext `json:"context,omitempty"`
Memberships *MembershipConnection `json:"memberships"`
Invitations *InvitationConnection `json:"invitations"`
SlackConnections *SlackConnectionConnection `json:"slackConnections"`
Frameworks *FrameworkConnection `json:"frameworks"`
Controls *ControlConnection `json:"controls"`
Vendors *VendorConnection `json:"vendors"`
Peoples *PeopleConnection `json:"peoples"`
Documents *DocumentConnection `json:"documents"`
Meetings *MeetingConnection `json:"meetings"`
Measures *MeasureConnection `json:"measures"`
Risks *RiskConnection `json:"risks"`
Tasks *TaskConnection `json:"tasks"`
Assets *AssetConnection `json:"assets"`
Data *DatumConnection `json:"data"`
Audits *AuditConnection `json:"audits"`
Nonconformities *NonconformityConnection `json:"nonconformities"`
Obligations *ObligationConnection `json:"obligations"`
ContinualImprovements *ContinualImprovementConnection `json:"continualImprovements"`
ProcessingActivities *ProcessingActivityConnection `json:"processingActivities"`
DataProtectionImpactAssessments *DataProtectionImpactAssessmentConnection `json:"dataProtectionImpactAssessments"`
TransferImpactAssessments *TransferImpactAssessmentConnection `json:"transferImpactAssessments"`
Snapshots *SnapshotConnection `json:"snapshots"`
TrustCenterFiles *TrustCenterFileConnection `json:"trustCenterFiles"`
TrustCenter *TrustCenter `json:"trustCenter,omitempty"`
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
SamlConfigurations []*SAMLConfiguration `json:"samlConfigurations"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func (Organization) IsNode() {}
@@ -1567,64 +1592,39 @@ type PeopleFilter struct {
}
type ProcessingActivity struct {
ID gid.GID `json:"id"`
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
SourceID *gid.GID `json:"sourceId,omitempty"`
Organization *Organization `json:"organization"`
Name string `json:"name"`
Purpose *string `json:"purpose,omitempty"`
DataSubjectCategory *string `json:"dataSubjectCategory,omitempty"`
PersonalDataCategory *string `json:"personalDataCategory,omitempty"`
SpecialOrCriminalData coredata.ProcessingActivitySpecialOrCriminalDatum `json:"specialOrCriminalData"`
ConsentEvidenceLink *string `json:"consentEvidenceLink,omitempty"`
LawfulBasis coredata.ProcessingActivityLawfulBasis `json:"lawfulBasis"`
Recipients *string `json:"recipients,omitempty"`
Location *string `json:"location,omitempty"`
InternationalTransfers bool `json:"internationalTransfers"`
TransferSafeguards *coredata.ProcessingActivityTransferSafeguard `json:"transferSafeguards,omitempty"`
RetentionPeriod *string `json:"retentionPeriod,omitempty"`
SecurityMeasures *string `json:"securityMeasures,omitempty"`
DataProtectionImpactAssessment coredata.ProcessingActivityDataProtectionImpactAssessment `json:"dataProtectionImpactAssessment"`
TransferImpactAssessment coredata.ProcessingActivityTransferImpactAssessment `json:"transferImpactAssessment"`
LastReviewDate *time.Time `json:"lastReviewDate,omitempty"`
NextReviewDate *time.Time `json:"nextReviewDate,omitempty"`
Role coredata.ProcessingActivityRole `json:"role"`
DataProtectionOfficer *People `json:"dataProtectionOfficer,omitempty"`
Vendors *VendorConnection `json:"vendors"`
Dpia *ProcessingActivityDpia `json:"dpia,omitempty"`
Tia *ProcessingActivityTia `json:"tia,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
ID gid.GID `json:"id"`
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
SourceID *gid.GID `json:"sourceId,omitempty"`
Organization *Organization `json:"organization"`
Name string `json:"name"`
Purpose *string `json:"purpose,omitempty"`
DataSubjectCategory *string `json:"dataSubjectCategory,omitempty"`
PersonalDataCategory *string `json:"personalDataCategory,omitempty"`
SpecialOrCriminalData coredata.ProcessingActivitySpecialOrCriminalDatum `json:"specialOrCriminalData"`
ConsentEvidenceLink *string `json:"consentEvidenceLink,omitempty"`
LawfulBasis coredata.ProcessingActivityLawfulBasis `json:"lawfulBasis"`
Recipients *string `json:"recipients,omitempty"`
Location *string `json:"location,omitempty"`
InternationalTransfers bool `json:"internationalTransfers"`
TransferSafeguards *coredata.ProcessingActivityTransferSafeguard `json:"transferSafeguards,omitempty"`
RetentionPeriod *string `json:"retentionPeriod,omitempty"`
SecurityMeasures *string `json:"securityMeasures,omitempty"`
DataProtectionImpactAssessmentNeeded coredata.ProcessingActivityDataProtectionImpactAssessment `json:"dataProtectionImpactAssessmentNeeded"`
TransferImpactAssessmentNeeded coredata.ProcessingActivityTransferImpactAssessment `json:"transferImpactAssessmentNeeded"`
LastReviewDate *time.Time `json:"lastReviewDate,omitempty"`
NextReviewDate *time.Time `json:"nextReviewDate,omitempty"`
Role coredata.ProcessingActivityRole `json:"role"`
DataProtectionOfficer *People `json:"dataProtectionOfficer,omitempty"`
Vendors *VendorConnection `json:"vendors"`
DataProtectionImpactAssessment *DataProtectionImpactAssessment `json:"dataProtectionImpactAssessment,omitempty"`
TransferImpactAssessment *TransferImpactAssessment `json:"transferImpactAssessment,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func (ProcessingActivity) IsNode() {}
func (this ProcessingActivity) GetID() gid.GID { return this.ID }
type ProcessingActivityDpia struct {
ID gid.GID `json:"id"`
ProcessingActivity *ProcessingActivity `json:"processingActivity"`
Organization *Organization `json:"organization"`
Description *string `json:"description,omitempty"`
NecessityAndProportionality *string `json:"necessityAndProportionality,omitempty"`
PotentialRisk *string `json:"potentialRisk,omitempty"`
Mitigations *string `json:"mitigations,omitempty"`
ResidualRisk *coredata.ProcessingActivityDPIAResidualRisk `json:"residualRisk,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func (ProcessingActivityDpia) IsNode() {}
func (this ProcessingActivityDpia) GetID() gid.GID { return this.ID }
type ProcessingActivityDPIAEdge struct {
Cursor page.CursorKey `json:"cursor"`
Node *ProcessingActivityDpia `json:"node"`
}
type ProcessingActivityDPIAFilter struct {
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
}
type ProcessingActivityEdge struct {
Cursor page.CursorKey `json:"cursor"`
Node *ProcessingActivity `json:"node"`
@@ -1634,31 +1634,6 @@ type ProcessingActivityFilter struct {
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
}
type ProcessingActivityTia struct {
ID gid.GID `json:"id"`
ProcessingActivity *ProcessingActivity `json:"processingActivity"`
Organization *Organization `json:"organization"`
DataSubjects *string `json:"dataSubjects,omitempty"`
LegalMechanism *string `json:"legalMechanism,omitempty"`
Transfer *string `json:"transfer,omitempty"`
LocalLawRisk *string `json:"localLawRisk,omitempty"`
SupplementaryMeasures *string `json:"supplementaryMeasures,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func (ProcessingActivityTia) IsNode() {}
func (this ProcessingActivityTia) GetID() gid.GID { return this.ID }
type ProcessingActivityTIAEdge struct {
Cursor page.CursorKey `json:"cursor"`
Node *ProcessingActivityTia `json:"node"`
}
type ProcessingActivityTIAFilter struct {
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
}
type PublishDocumentVersionInput struct {
DocumentID gid.GID `json:"documentId"`
Changelog *string `json:"changelog,omitempty"`
@@ -1862,6 +1837,31 @@ type TaskEdge struct {
Node *Task `json:"node"`
}
type TransferImpactAssessment struct {
ID gid.GID `json:"id"`
ProcessingActivity *ProcessingActivity `json:"processingActivity"`
Organization *Organization `json:"organization"`
DataSubjects *string `json:"dataSubjects,omitempty"`
LegalMechanism *string `json:"legalMechanism,omitempty"`
Transfer *string `json:"transfer,omitempty"`
LocalLawRisk *string `json:"localLawRisk,omitempty"`
SupplementaryMeasures *string `json:"supplementaryMeasures,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func (TransferImpactAssessment) IsNode() {}
func (this TransferImpactAssessment) GetID() gid.GID { return this.ID }
type TransferImpactAssessmentEdge struct {
Cursor page.CursorKey `json:"cursor"`
Node *TransferImpactAssessment `json:"node"`
}
type TransferImpactAssessmentFilter struct {
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
}
type TrustCenter struct {
ID gid.GID `json:"id"`
Active bool `json:"active"`
@@ -2022,6 +2022,19 @@ type UpdateControlPayload struct {
Control *Control `json:"control"`
}
type UpdateDataProtectionImpactAssessmentInput struct {
ID gid.GID `json:"id"`
Description graphql.Omittable[*string] `json:"description,omitempty"`
NecessityAndProportionality graphql.Omittable[*string] `json:"necessityAndProportionality,omitempty"`
PotentialRisk graphql.Omittable[*string] `json:"potentialRisk,omitempty"`
Mitigations graphql.Omittable[*string] `json:"mitigations,omitempty"`
ResidualRisk *coredata.DataProtectionImpactAssessmentResidualRisk `json:"residualRisk,omitempty"`
}
type UpdateDataProtectionImpactAssessmentPayload struct {
DataProtectionImpactAssessment *DataProtectionImpactAssessment `json:"dataProtectionImpactAssessment"`
}
type UpdateDatumInput struct {
ID gid.GID `json:"id"`
Name *string `json:"name,omitempty"`
@@ -2175,60 +2188,34 @@ type UpdatePeoplePayload struct {
People *People `json:"people"`
}
type UpdateProcessingActivityDPIAInput struct {
ID gid.GID `json:"id"`
Description graphql.Omittable[*string] `json:"description,omitempty"`
NecessityAndProportionality graphql.Omittable[*string] `json:"necessityAndProportionality,omitempty"`
PotentialRisk graphql.Omittable[*string] `json:"potentialRisk,omitempty"`
Mitigations graphql.Omittable[*string] `json:"mitigations,omitempty"`
ResidualRisk *coredata.ProcessingActivityDPIAResidualRisk `json:"residualRisk,omitempty"`
}
type UpdateProcessingActivityDPIAPayload struct {
ProcessingActivityDpia *ProcessingActivityDpia `json:"processingActivityDpia"`
}
type UpdateProcessingActivityInput struct {
ID gid.GID `json:"id"`
Name *string `json:"name,omitempty"`
Purpose graphql.Omittable[*string] `json:"purpose,omitempty"`
DataSubjectCategory graphql.Omittable[*string] `json:"dataSubjectCategory,omitempty"`
PersonalDataCategory graphql.Omittable[*string] `json:"personalDataCategory,omitempty"`
SpecialOrCriminalData *coredata.ProcessingActivitySpecialOrCriminalDatum `json:"specialOrCriminalData,omitempty"`
ConsentEvidenceLink *string `json:"consentEvidenceLink,omitempty"`
LawfulBasis *coredata.ProcessingActivityLawfulBasis `json:"lawfulBasis,omitempty"`
Recipients graphql.Omittable[*string] `json:"recipients,omitempty"`
Location graphql.Omittable[*string] `json:"location,omitempty"`
InternationalTransfers *bool `json:"internationalTransfers,omitempty"`
TransferSafeguards graphql.Omittable[*coredata.ProcessingActivityTransferSafeguard] `json:"transferSafeguards,omitempty"`
RetentionPeriod graphql.Omittable[*string] `json:"retentionPeriod,omitempty"`
SecurityMeasures graphql.Omittable[*string] `json:"securityMeasures,omitempty"`
DataProtectionImpactAssessment *coredata.ProcessingActivityDataProtectionImpactAssessment `json:"dataProtectionImpactAssessment,omitempty"`
TransferImpactAssessment *coredata.ProcessingActivityTransferImpactAssessment `json:"transferImpactAssessment,omitempty"`
LastReviewDate graphql.Omittable[*time.Time] `json:"lastReviewDate,omitempty"`
NextReviewDate graphql.Omittable[*time.Time] `json:"nextReviewDate,omitempty"`
Role *coredata.ProcessingActivityRole `json:"role,omitempty"`
DataProtectionOfficerID graphql.Omittable[*gid.GID] `json:"dataProtectionOfficerId,omitempty"`
VendorIds []gid.GID `json:"vendorIds,omitempty"`
ID gid.GID `json:"id"`
Name *string `json:"name,omitempty"`
Purpose graphql.Omittable[*string] `json:"purpose,omitempty"`
DataSubjectCategory graphql.Omittable[*string] `json:"dataSubjectCategory,omitempty"`
PersonalDataCategory graphql.Omittable[*string] `json:"personalDataCategory,omitempty"`
SpecialOrCriminalData *coredata.ProcessingActivitySpecialOrCriminalDatum `json:"specialOrCriminalData,omitempty"`
ConsentEvidenceLink *string `json:"consentEvidenceLink,omitempty"`
LawfulBasis *coredata.ProcessingActivityLawfulBasis `json:"lawfulBasis,omitempty"`
Recipients graphql.Omittable[*string] `json:"recipients,omitempty"`
Location graphql.Omittable[*string] `json:"location,omitempty"`
InternationalTransfers *bool `json:"internationalTransfers,omitempty"`
TransferSafeguards graphql.Omittable[*coredata.ProcessingActivityTransferSafeguard] `json:"transferSafeguards,omitempty"`
RetentionPeriod graphql.Omittable[*string] `json:"retentionPeriod,omitempty"`
SecurityMeasures graphql.Omittable[*string] `json:"securityMeasures,omitempty"`
DataProtectionImpactAssessmentNeeded *coredata.ProcessingActivityDataProtectionImpactAssessment `json:"dataProtectionImpactAssessmentNeeded,omitempty"`
TransferImpactAssessmentNeeded *coredata.ProcessingActivityTransferImpactAssessment `json:"transferImpactAssessmentNeeded,omitempty"`
LastReviewDate graphql.Omittable[*time.Time] `json:"lastReviewDate,omitempty"`
NextReviewDate graphql.Omittable[*time.Time] `json:"nextReviewDate,omitempty"`
Role *coredata.ProcessingActivityRole `json:"role,omitempty"`
DataProtectionOfficerID graphql.Omittable[*gid.GID] `json:"dataProtectionOfficerId,omitempty"`
VendorIds []gid.GID `json:"vendorIds,omitempty"`
}
type UpdateProcessingActivityPayload struct {
ProcessingActivity *ProcessingActivity `json:"processingActivity"`
}
type UpdateProcessingActivityTIAInput struct {
ID gid.GID `json:"id"`
DataSubjects graphql.Omittable[*string] `json:"dataSubjects,omitempty"`
LegalMechanism graphql.Omittable[*string] `json:"legalMechanism,omitempty"`
Transfer graphql.Omittable[*string] `json:"transfer,omitempty"`
LocalLawRisk graphql.Omittable[*string] `json:"localLawRisk,omitempty"`
SupplementaryMeasures graphql.Omittable[*string] `json:"supplementaryMeasures,omitempty"`
}
type UpdateProcessingActivityTIAPayload struct {
ProcessingActivityTia *ProcessingActivityTia `json:"processingActivityTia"`
}
type UpdateRiskInput struct {
ID gid.GID `json:"id"`
Name *string `json:"name,omitempty"`
@@ -2281,6 +2268,19 @@ type UpdateTaskPayload struct {
Task *Task `json:"task"`
}
type UpdateTransferImpactAssessmentInput struct {
ID gid.GID `json:"id"`
DataSubjects graphql.Omittable[*string] `json:"dataSubjects,omitempty"`
LegalMechanism graphql.Omittable[*string] `json:"legalMechanism,omitempty"`
Transfer graphql.Omittable[*string] `json:"transfer,omitempty"`
LocalLawRisk graphql.Omittable[*string] `json:"localLawRisk,omitempty"`
SupplementaryMeasures graphql.Omittable[*string] `json:"supplementaryMeasures,omitempty"`
}
type UpdateTransferImpactAssessmentPayload struct {
TransferImpactAssessment *TransferImpactAssessment `json:"transferImpactAssessment"`
}
type UpdateTrustCenterAccessInput struct {
ID gid.GID `json:"id"`
Name *string `json:"name,omitempty"`

View File

@@ -551,6 +551,66 @@ func (r *controlConnectionResolver) TotalCount(ctx context.Context, obj *types.C
panic(fmt.Errorf("unsupported resolver: %T", obj.Resolver))
}
// ProcessingActivity is the resolver for the processingActivity field.
func (r *dataProtectionImpactAssessmentResolver) ProcessingActivity(ctx context.Context, obj *types.DataProtectionImpactAssessment) (*types.ProcessingActivity, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGet)
prb := r.ProboService(ctx, obj.ID.TenantID())
dpia, err := prb.DataProtectionImpactAssessments.Get(ctx, obj.ID)
if err != nil {
panic(fmt.Errorf("cannot get processing activity dpia: %w", err))
}
processingActivity, err := prb.ProcessingActivities.Get(ctx, dpia.ProcessingActivityID)
if err != nil {
panic(fmt.Errorf("cannot get processing activity: %w", err))
}
return types.NewProcessingActivity(processingActivity), nil
}
// Organization is the resolver for the organization field.
func (r *dataProtectionImpactAssessmentResolver) Organization(ctx context.Context, obj *types.DataProtectionImpactAssessment) (*types.Organization, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetOrganization)
prb := r.ProboService(ctx, obj.ID.TenantID())
dpia, err := prb.DataProtectionImpactAssessments.Get(ctx, obj.ID)
if err != nil {
panic(fmt.Errorf("cannot get processing activity dpia: %w", err))
}
organization, err := prb.Organizations.Get(ctx, dpia.OrganizationID)
if err != nil {
var errNotFound *coredata.ErrOrganizationNotFound
if errors.As(err, &errNotFound) {
return nil, gqlutils.NotFound(errNotFound)
}
panic(fmt.Errorf("cannot get organization: %w", err))
}
return types.NewOrganization(organization), nil
}
// TotalCount is the resolver for the totalCount field.
func (r *dataProtectionImpactAssessmentConnectionResolver) TotalCount(ctx context.Context, obj *types.DataProtectionImpactAssessmentConnection) (int, error) {
r.MustBeAuthorized(ctx, obj.ParentID, authz.ActionTotalCount)
prb := r.ProboService(ctx, obj.ParentID.TenantID())
switch obj.Resolver.(type) {
case *organizationResolver:
count, err := prb.DataProtectionImpactAssessments.CountForOrganizationID(ctx, obj.ParentID, obj.Filter)
if err != nil {
panic(fmt.Errorf("cannot count organization data protection impact assessments: %w", err))
}
return count, nil
}
panic(fmt.Errorf("unsupported resolver: %T", obj.Resolver))
}
// Owner is the resolver for the owner field.
func (r *datumResolver) Owner(ctx context.Context, obj *types.Datum) (*types.People, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetOwner)
@@ -4212,26 +4272,26 @@ func (r *mutationResolver) CreateProcessingActivity(ctx context.Context, input t
prb := r.ProboService(ctx, input.OrganizationID.TenantID())
req := probo.CreateProcessingActivityRequest{
OrganizationID: input.OrganizationID,
Name: input.Name,
Purpose: input.Purpose,
DataSubjectCategory: input.DataSubjectCategory,
PersonalDataCategory: input.PersonalDataCategory,
SpecialOrCriminalData: input.SpecialOrCriminalData,
LawfulBasis: input.LawfulBasis,
Recipients: input.Recipients,
Location: input.Location,
InternationalTransfers: input.InternationalTransfers,
TransferSafeguard: input.TransferSafeguards,
RetentionPeriod: input.RetentionPeriod,
SecurityMeasures: input.SecurityMeasures,
DataProtectionImpactAssessment: input.DataProtectionImpactAssessment,
TransferImpactAssessment: input.TransferImpactAssessment,
LastReviewDate: input.LastReviewDate,
NextReviewDate: input.NextReviewDate,
Role: input.Role,
DataProtectionOfficerID: input.DataProtectionOfficerID,
VendorIDs: input.VendorIds,
OrganizationID: input.OrganizationID,
Name: input.Name,
Purpose: input.Purpose,
DataSubjectCategory: input.DataSubjectCategory,
PersonalDataCategory: input.PersonalDataCategory,
SpecialOrCriminalData: input.SpecialOrCriminalData,
LawfulBasis: input.LawfulBasis,
Recipients: input.Recipients,
Location: input.Location,
InternationalTransfers: input.InternationalTransfers,
TransferSafeguard: input.TransferSafeguards,
RetentionPeriod: input.RetentionPeriod,
SecurityMeasures: input.SecurityMeasures,
DataProtectionImpactAssessmentNeeded: input.DataProtectionImpactAssessmentNeeded,
TransferImpactAssessmentNeeded: input.TransferImpactAssessmentNeeded,
LastReviewDate: input.LastReviewDate,
NextReviewDate: input.NextReviewDate,
Role: input.Role,
DataProtectionOfficerID: input.DataProtectionOfficerID,
VendorIDs: input.VendorIds,
}
activity, err := prb.ProcessingActivities.Create(ctx, &req)
@@ -4251,26 +4311,26 @@ func (r *mutationResolver) UpdateProcessingActivity(ctx context.Context, input t
prb := r.ProboService(ctx, input.ID.TenantID())
req := probo.UpdateProcessingActivityRequest{
ID: input.ID,
Name: input.Name,
Purpose: UnwrapOmittable(input.Purpose),
DataSubjectCategory: UnwrapOmittable(input.DataSubjectCategory),
PersonalDataCategory: UnwrapOmittable(input.PersonalDataCategory),
SpecialOrCriminalData: input.SpecialOrCriminalData,
LawfulBasis: input.LawfulBasis,
Recipients: UnwrapOmittable(input.Recipients),
Location: UnwrapOmittable(input.Location),
InternationalTransfers: input.InternationalTransfers,
TransferSafeguard: UnwrapOmittable(input.TransferSafeguards),
RetentionPeriod: UnwrapOmittable(input.RetentionPeriod),
SecurityMeasures: UnwrapOmittable(input.SecurityMeasures),
DataProtectionImpactAssessment: input.DataProtectionImpactAssessment,
TransferImpactAssessment: input.TransferImpactAssessment,
LastReviewDate: UnwrapOmittable(input.LastReviewDate),
NextReviewDate: UnwrapOmittable(input.NextReviewDate),
Role: input.Role,
DataProtectionOfficerID: UnwrapOmittable(input.DataProtectionOfficerID),
VendorIDs: &input.VendorIds,
ID: input.ID,
Name: input.Name,
Purpose: UnwrapOmittable(input.Purpose),
DataSubjectCategory: UnwrapOmittable(input.DataSubjectCategory),
PersonalDataCategory: UnwrapOmittable(input.PersonalDataCategory),
SpecialOrCriminalData: input.SpecialOrCriminalData,
LawfulBasis: input.LawfulBasis,
Recipients: UnwrapOmittable(input.Recipients),
Location: UnwrapOmittable(input.Location),
InternationalTransfers: input.InternationalTransfers,
TransferSafeguard: UnwrapOmittable(input.TransferSafeguards),
RetentionPeriod: UnwrapOmittable(input.RetentionPeriod),
SecurityMeasures: UnwrapOmittable(input.SecurityMeasures),
DataProtectionImpactAssessmentNeeded: input.DataProtectionImpactAssessmentNeeded,
TransferImpactAssessmentNeeded: input.TransferImpactAssessmentNeeded,
LastReviewDate: UnwrapOmittable(input.LastReviewDate),
NextReviewDate: UnwrapOmittable(input.NextReviewDate),
Role: input.Role,
DataProtectionOfficerID: UnwrapOmittable(input.DataProtectionOfficerID),
VendorIDs: &input.VendorIds,
}
activity, err := prb.ProcessingActivities.Update(ctx, &req)
@@ -4299,13 +4359,13 @@ func (r *mutationResolver) DeleteProcessingActivity(ctx context.Context, input t
}, nil
}
// CreateProcessingActivityDpia is the resolver for the createProcessingActivityDPIA field.
func (r *mutationResolver) CreateProcessingActivityDpia(ctx context.Context, input types.CreateProcessingActivityDPIAInput) (*types.CreateProcessingActivityDPIAPayload, error) {
r.MustBeAuthorized(ctx, input.ProcessingActivityID, authz.ActionCreateProcessingActivityDPIA)
// CreateDataProtectionImpactAssessment is the resolver for the createDataProtectionImpactAssessment field.
func (r *mutationResolver) CreateDataProtectionImpactAssessment(ctx context.Context, input types.CreateDataProtectionImpactAssessmentInput) (*types.CreateDataProtectionImpactAssessmentPayload, error) {
r.MustBeAuthorized(ctx, input.ProcessingActivityID, authz.ActionCreateDataProtectionImpactAssessment)
prb := r.ProboService(ctx, input.ProcessingActivityID.TenantID())
req := probo.CreateProcessingActivityDPIARequest{
req := probo.CreateDataProtectionImpactAssessmentRequest{
ProcessingActivityID: input.ProcessingActivityID,
Description: input.Description,
NecessityAndProportionality: input.NecessityAndProportionality,
@@ -4314,23 +4374,23 @@ func (r *mutationResolver) CreateProcessingActivityDpia(ctx context.Context, inp
ResidualRisk: input.ResidualRisk,
}
dpia, err := prb.ProcessingActivityDPIAs.Create(ctx, &req)
dpia, err := prb.DataProtectionImpactAssessments.Create(ctx, &req)
if err != nil {
panic(fmt.Errorf("cannot create processing activity dpia: %w", err))
panic(fmt.Errorf("cannot create data protection impact assessment: %w", err))
}
return &types.CreateProcessingActivityDPIAPayload{
ProcessingActivityDpia: types.NewProcessingActivityDpia(dpia),
return &types.CreateDataProtectionImpactAssessmentPayload{
DataProtectionImpactAssessment: types.NewDataProtectionImpactAssessment(dpia),
}, nil
}
// UpdateProcessingActivityDpia is the resolver for the updateProcessingActivityDPIA field.
func (r *mutationResolver) UpdateProcessingActivityDpia(ctx context.Context, input types.UpdateProcessingActivityDPIAInput) (*types.UpdateProcessingActivityDPIAPayload, error) {
r.MustBeAuthorized(ctx, input.ID, authz.ActionUpdateProcessingActivityDPIA)
// UpdateDataProtectionImpactAssessment is the resolver for the updateDataProtectionImpactAssessment field.
func (r *mutationResolver) UpdateDataProtectionImpactAssessment(ctx context.Context, input types.UpdateDataProtectionImpactAssessmentInput) (*types.UpdateDataProtectionImpactAssessmentPayload, error) {
r.MustBeAuthorized(ctx, input.ID, authz.ActionUpdateDataProtectionImpactAssessment)
prb := r.ProboService(ctx, input.ID.TenantID())
req := probo.UpdateProcessingActivityDPIARequest{
req := probo.UpdateDataProtectionImpactAssessmentRequest{
ID: input.ID,
Description: UnwrapOmittable(input.Description),
NecessityAndProportionality: UnwrapOmittable(input.NecessityAndProportionality),
@@ -4339,39 +4399,39 @@ func (r *mutationResolver) UpdateProcessingActivityDpia(ctx context.Context, inp
ResidualRisk: input.ResidualRisk,
}
dpia, err := prb.ProcessingActivityDPIAs.Update(ctx, &req)
dpia, err := prb.DataProtectionImpactAssessments.Update(ctx, &req)
if err != nil {
panic(fmt.Errorf("cannot update processing activity dpia: %w", err))
panic(fmt.Errorf("cannot update data protection impact assessment: %w", err))
}
return &types.UpdateProcessingActivityDPIAPayload{
ProcessingActivityDpia: types.NewProcessingActivityDpia(dpia),
return &types.UpdateDataProtectionImpactAssessmentPayload{
DataProtectionImpactAssessment: types.NewDataProtectionImpactAssessment(dpia),
}, nil
}
// DeleteProcessingActivityDpia is the resolver for the deleteProcessingActivityDPIA field.
func (r *mutationResolver) DeleteProcessingActivityDpia(ctx context.Context, input types.DeleteProcessingActivityDPIAInput) (*types.DeleteProcessingActivityDPIAPayload, error) {
r.MustBeAuthorized(ctx, input.ProcessingActivityDpiaID, authz.ActionDeleteProcessingActivityDPIA)
// DeleteDataProtectionImpactAssessment is the resolver for the deleteDataProtectionImpactAssessment field.
func (r *mutationResolver) DeleteDataProtectionImpactAssessment(ctx context.Context, input types.DeleteDataProtectionImpactAssessmentInput) (*types.DeleteDataProtectionImpactAssessmentPayload, error) {
r.MustBeAuthorized(ctx, input.DataProtectionImpactAssessmentID, authz.ActionDeleteDataProtectionImpactAssessment)
prb := r.ProboService(ctx, input.ProcessingActivityDpiaID.TenantID())
prb := r.ProboService(ctx, input.DataProtectionImpactAssessmentID.TenantID())
err := prb.ProcessingActivityDPIAs.Delete(ctx, input.ProcessingActivityDpiaID)
err := prb.DataProtectionImpactAssessments.Delete(ctx, input.DataProtectionImpactAssessmentID)
if err != nil {
panic(fmt.Errorf("cannot delete processing activity dpia: %w", err))
panic(fmt.Errorf("cannot delete data protection impact assessment: %w", err))
}
return &types.DeleteProcessingActivityDPIAPayload{
DeletedProcessingActivityDpiaID: input.ProcessingActivityDpiaID,
return &types.DeleteDataProtectionImpactAssessmentPayload{
DeletedDataProtectionImpactAssessmentID: input.DataProtectionImpactAssessmentID,
}, nil
}
// CreateProcessingActivityTia is the resolver for the createProcessingActivityTIA field.
func (r *mutationResolver) CreateProcessingActivityTia(ctx context.Context, input types.CreateProcessingActivityTIAInput) (*types.CreateProcessingActivityTIAPayload, error) {
r.MustBeAuthorized(ctx, input.ProcessingActivityID, authz.ActionCreateProcessingActivityTIA)
// CreateTransferImpactAssessment is the resolver for the createTransferImpactAssessment field.
func (r *mutationResolver) CreateTransferImpactAssessment(ctx context.Context, input types.CreateTransferImpactAssessmentInput) (*types.CreateTransferImpactAssessmentPayload, error) {
r.MustBeAuthorized(ctx, input.ProcessingActivityID, authz.ActionCreateTransferImpactAssessment)
prb := r.ProboService(ctx, input.ProcessingActivityID.TenantID())
req := probo.CreateProcessingActivityTIARequest{
req := probo.CreateTransferImpactAssessmentRequest{
ProcessingActivityID: input.ProcessingActivityID,
DataSubjects: input.DataSubjects,
LegalMechanism: input.LegalMechanism,
@@ -4380,23 +4440,23 @@ func (r *mutationResolver) CreateProcessingActivityTia(ctx context.Context, inpu
SupplementaryMeasures: input.SupplementaryMeasures,
}
tia, err := prb.ProcessingActivityTIAs.Create(ctx, &req)
tia, err := prb.TransferImpactAssessments.Create(ctx, &req)
if err != nil {
panic(fmt.Errorf("cannot create processing activity tia: %w", err))
panic(fmt.Errorf("cannot create transfer impact assessment: %w", err))
}
return &types.CreateProcessingActivityTIAPayload{
ProcessingActivityTia: types.NewProcessingActivityTia(tia),
return &types.CreateTransferImpactAssessmentPayload{
TransferImpactAssessment: types.NewTransferImpactAssessment(tia),
}, nil
}
// UpdateProcessingActivityTia is the resolver for the updateProcessingActivityTIA field.
func (r *mutationResolver) UpdateProcessingActivityTia(ctx context.Context, input types.UpdateProcessingActivityTIAInput) (*types.UpdateProcessingActivityTIAPayload, error) {
r.MustBeAuthorized(ctx, input.ID, authz.ActionUpdateProcessingActivityTIA)
// UpdateTransferImpactAssessment is the resolver for the updateTransferImpactAssessment field.
func (r *mutationResolver) UpdateTransferImpactAssessment(ctx context.Context, input types.UpdateTransferImpactAssessmentInput) (*types.UpdateTransferImpactAssessmentPayload, error) {
r.MustBeAuthorized(ctx, input.ID, authz.ActionUpdateTransferImpactAssessment)
prb := r.ProboService(ctx, input.ID.TenantID())
req := probo.UpdateProcessingActivityTIARequest{
req := probo.UpdateTransferImpactAssessmentRequest{
ID: input.ID,
DataSubjects: UnwrapOmittable(input.DataSubjects),
LegalMechanism: UnwrapOmittable(input.LegalMechanism),
@@ -4405,29 +4465,29 @@ func (r *mutationResolver) UpdateProcessingActivityTia(ctx context.Context, inpu
SupplementaryMeasures: UnwrapOmittable(input.SupplementaryMeasures),
}
tia, err := prb.ProcessingActivityTIAs.Update(ctx, &req)
tia, err := prb.TransferImpactAssessments.Update(ctx, &req)
if err != nil {
panic(fmt.Errorf("cannot update processing activity tia: %w", err))
panic(fmt.Errorf("cannot update transfer impact assessment: %w", err))
}
return &types.UpdateProcessingActivityTIAPayload{
ProcessingActivityTia: types.NewProcessingActivityTia(tia),
return &types.UpdateTransferImpactAssessmentPayload{
TransferImpactAssessment: types.NewTransferImpactAssessment(tia),
}, nil
}
// DeleteProcessingActivityTia is the resolver for the deleteProcessingActivityTIA field.
func (r *mutationResolver) DeleteProcessingActivityTia(ctx context.Context, input types.DeleteProcessingActivityTIAInput) (*types.DeleteProcessingActivityTIAPayload, error) {
r.MustBeAuthorized(ctx, input.ProcessingActivityTiaID, authz.ActionDeleteProcessingActivityTIA)
// DeleteTransferImpactAssessment is the resolver for the deleteTransferImpactAssessment field.
func (r *mutationResolver) DeleteTransferImpactAssessment(ctx context.Context, input types.DeleteTransferImpactAssessmentInput) (*types.DeleteTransferImpactAssessmentPayload, error) {
r.MustBeAuthorized(ctx, input.TransferImpactAssessmentID, authz.ActionDeleteTransferImpactAssessment)
prb := r.ProboService(ctx, input.ProcessingActivityTiaID.TenantID())
prb := r.ProboService(ctx, input.TransferImpactAssessmentID.TenantID())
err := prb.ProcessingActivityTIAs.Delete(ctx, input.ProcessingActivityTiaID)
err := prb.TransferImpactAssessments.Delete(ctx, input.TransferImpactAssessmentID)
if err != nil {
panic(fmt.Errorf("cannot delete processing activity tia: %w", err))
panic(fmt.Errorf("cannot delete transfer impact assessment: %w", err))
}
return &types.DeleteProcessingActivityTIAPayload{
DeletedProcessingActivityTiaID: input.ProcessingActivityTiaID,
return &types.DeleteTransferImpactAssessmentPayload{
DeletedTransferImpactAssessmentID: input.TransferImpactAssessmentID,
}, nil
}
@@ -5531,18 +5591,18 @@ func (r *organizationResolver) ProcessingActivities(ctx context.Context, obj *ty
}
// DataProtectionImpactAssessments is the resolver for the dataProtectionImpactAssessments field.
func (r *organizationResolver) DataProtectionImpactAssessments(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ProcessingActivityDPIAOrderBy, filter *types.ProcessingActivityDPIAFilter) (*types.ProcessingActivityDPIAConnection, error) {
func (r *organizationResolver) DataProtectionImpactAssessments(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.DataProtectionImpactAssessmentOrderBy, filter *types.DataProtectionImpactAssessmentFilter) (*types.DataProtectionImpactAssessmentConnection, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionListProcessingActivities)
prb := r.ProboService(ctx, obj.ID.TenantID())
pageOrderBy := page.OrderBy[coredata.ProcessingActivityDPIAOrderField]{
Field: coredata.ProcessingActivityDPIAOrderFieldCreatedAt,
pageOrderBy := page.OrderBy[coredata.DataProtectionImpactAssessmentOrderField]{
Field: coredata.DataProtectionImpactAssessmentOrderFieldCreatedAt,
Direction: page.OrderDirectionDesc,
}
if orderBy != nil {
pageOrderBy = page.OrderBy[coredata.ProcessingActivityDPIAOrderField]{
pageOrderBy = page.OrderBy[coredata.DataProtectionImpactAssessmentOrderField]{
Field: orderBy.Field,
Direction: orderBy.Direction,
}
@@ -5550,32 +5610,32 @@ func (r *organizationResolver) DataProtectionImpactAssessments(ctx context.Conte
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
dpiaFilter := coredata.NewProcessingActivityDPIAFilter(nil)
dpiaFilter := coredata.NewDataProtectionImpactAssessmentFilter(nil)
if filter != nil {
dpiaFilter = coredata.NewProcessingActivityDPIAFilter(&filter.SnapshotID)
dpiaFilter = coredata.NewDataProtectionImpactAssessmentFilter(&filter.SnapshotID)
}
page, err := prb.ProcessingActivityDPIAs.ListForOrganizationID(ctx, obj.ID, cursor, dpiaFilter)
page, err := prb.DataProtectionImpactAssessments.ListForOrganizationID(ctx, obj.ID, cursor, dpiaFilter)
if err != nil {
panic(fmt.Errorf("cannot list organization data protection impact assessments: %w", err))
}
return types.NewProcessingActivityDPIAConnection(page, r, obj.ID, dpiaFilter), nil
return types.NewDataProtectionImpactAssessmentConnection(page, r, obj.ID, dpiaFilter), nil
}
// TransferImpactAssessments is the resolver for the transferImpactAssessments field.
func (r *organizationResolver) TransferImpactAssessments(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ProcessingActivityTIAOrderBy, filter *types.ProcessingActivityTIAFilter) (*types.ProcessingActivityTIAConnection, error) {
func (r *organizationResolver) TransferImpactAssessments(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.TransferImpactAssessmentOrderBy, filter *types.TransferImpactAssessmentFilter) (*types.TransferImpactAssessmentConnection, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionListProcessingActivities)
prb := r.ProboService(ctx, obj.ID.TenantID())
pageOrderBy := page.OrderBy[coredata.ProcessingActivityTIAOrderField]{
Field: coredata.ProcessingActivityTIAOrderFieldCreatedAt,
pageOrderBy := page.OrderBy[coredata.TransferImpactAssessmentOrderField]{
Field: coredata.TransferImpactAssessmentOrderFieldCreatedAt,
Direction: page.OrderDirectionDesc,
}
if orderBy != nil {
pageOrderBy = page.OrderBy[coredata.ProcessingActivityTIAOrderField]{
pageOrderBy = page.OrderBy[coredata.TransferImpactAssessmentOrderField]{
Field: orderBy.Field,
Direction: orderBy.Direction,
}
@@ -5583,17 +5643,17 @@ func (r *organizationResolver) TransferImpactAssessments(ctx context.Context, ob
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
tiaFilter := coredata.NewProcessingActivityTIAFilter(nil)
tiaFilter := coredata.NewTransferImpactAssessmentFilter(nil)
if filter != nil {
tiaFilter = coredata.NewProcessingActivityTIAFilter(&filter.SnapshotID)
tiaFilter = coredata.NewTransferImpactAssessmentFilter(&filter.SnapshotID)
}
page, err := prb.ProcessingActivityTIAs.ListForOrganizationID(ctx, obj.ID, cursor, tiaFilter)
page, err := prb.TransferImpactAssessments.ListForOrganizationID(ctx, obj.ID, cursor, tiaFilter)
if err != nil {
panic(fmt.Errorf("cannot list organization transfer impact assessments: %w", err))
}
return types.NewProcessingActivityTIAConnection(page, r, obj.ID, tiaFilter), nil
return types.NewTransferImpactAssessmentConnection(page, r, obj.ID, tiaFilter), nil
}
// Snapshots is the resolver for the snapshots field.
@@ -5797,40 +5857,40 @@ func (r *processingActivityResolver) Vendors(ctx context.Context, obj *types.Pro
return types.NewVendorConnection(page, r, obj.ID), nil
}
// Dpia is the resolver for the dpia field.
func (r *processingActivityResolver) Dpia(ctx context.Context, obj *types.ProcessingActivity) (*types.ProcessingActivityDpia, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetDPIA)
// DataProtectionImpactAssessment is the resolver for the dataProtectionImpactAssessment field.
func (r *processingActivityResolver) DataProtectionImpactAssessment(ctx context.Context, obj *types.ProcessingActivity) (*types.DataProtectionImpactAssessment, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetDataProtectionImpactAssessment)
prb := r.ProboService(ctx, obj.ID.TenantID())
dpia, err := prb.ProcessingActivityDPIAs.GetByProcessingActivityID(ctx, obj.ID)
dpia, err := prb.DataProtectionImpactAssessments.GetByProcessingActivityID(ctx, obj.ID)
if err != nil {
var errNotFound *coredata.ErrProcessingActivityDPIANotFound
var errNotFound *coredata.ErrDataProtectionImpactAssessmentNotFound
if errors.As(err, &errNotFound) {
return nil, nil
}
panic(fmt.Errorf("cannot get processing activity dpia: %w", err))
}
return types.NewProcessingActivityDpia(dpia), nil
return types.NewDataProtectionImpactAssessment(dpia), nil
}
// Tia is the resolver for the tia field.
func (r *processingActivityResolver) Tia(ctx context.Context, obj *types.ProcessingActivity) (*types.ProcessingActivityTia, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetTIA)
// TransferImpactAssessment is the resolver for the transferImpactAssessment field.
func (r *processingActivityResolver) TransferImpactAssessment(ctx context.Context, obj *types.ProcessingActivity) (*types.TransferImpactAssessment, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetTransferImpactAssessment)
prb := r.ProboService(ctx, obj.ID.TenantID())
tia, err := prb.ProcessingActivityTIAs.GetByProcessingActivityID(ctx, obj.ID)
tia, err := prb.TransferImpactAssessments.GetByProcessingActivityID(ctx, obj.ID)
if err != nil {
var errNotFound *coredata.ErrProcessingActivityTIANotFound
var errNotFound *coredata.ErrTransferImpactAssessmentNotFound
if errors.As(err, &errNotFound) {
return nil, nil
}
panic(fmt.Errorf("cannot get processing activity tia: %w", err))
}
return types.NewProcessingActivityTia(tia), nil
return types.NewTransferImpactAssessment(tia), nil
}
// TotalCount is the resolver for the totalCount field.
@@ -5856,126 +5916,6 @@ func (r *processingActivityConnectionResolver) TotalCount(ctx context.Context, o
panic(fmt.Errorf("unsupported resolver: %T", obj.Resolver))
}
// ProcessingActivity is the resolver for the processingActivity field.
func (r *processingActivityDPIAResolver) ProcessingActivity(ctx context.Context, obj *types.ProcessingActivityDpia) (*types.ProcessingActivity, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGet)
prb := r.ProboService(ctx, obj.ID.TenantID())
dpia, err := prb.ProcessingActivityDPIAs.Get(ctx, obj.ID)
if err != nil {
panic(fmt.Errorf("cannot get processing activity dpia: %w", err))
}
processingActivity, err := prb.ProcessingActivities.Get(ctx, dpia.ProcessingActivityID)
if err != nil {
panic(fmt.Errorf("cannot get processing activity: %w", err))
}
return types.NewProcessingActivity(processingActivity), nil
}
// Organization is the resolver for the organization field.
func (r *processingActivityDPIAResolver) Organization(ctx context.Context, obj *types.ProcessingActivityDpia) (*types.Organization, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetOrganization)
prb := r.ProboService(ctx, obj.ID.TenantID())
dpia, err := prb.ProcessingActivityDPIAs.Get(ctx, obj.ID)
if err != nil {
panic(fmt.Errorf("cannot get processing activity dpia: %w", err))
}
organization, err := prb.Organizations.Get(ctx, dpia.OrganizationID)
if err != nil {
var errNotFound *coredata.ErrOrganizationNotFound
if errors.As(err, &errNotFound) {
return nil, gqlutils.NotFound(errNotFound)
}
panic(fmt.Errorf("cannot get organization: %w", err))
}
return types.NewOrganization(organization), nil
}
// TotalCount is the resolver for the totalCount field.
func (r *processingActivityDPIAConnectionResolver) TotalCount(ctx context.Context, obj *types.ProcessingActivityDPIAConnection) (int, error) {
r.MustBeAuthorized(ctx, obj.ParentID, authz.ActionTotalCount)
prb := r.ProboService(ctx, obj.ParentID.TenantID())
switch obj.Resolver.(type) {
case *organizationResolver:
count, err := prb.ProcessingActivityDPIAs.CountForOrganizationID(ctx, obj.ParentID, obj.Filter)
if err != nil {
panic(fmt.Errorf("cannot count organization data protection impact assessments: %w", err))
}
return count, nil
}
panic(fmt.Errorf("unsupported resolver: %T", obj.Resolver))
}
// ProcessingActivity is the resolver for the processingActivity field.
func (r *processingActivityTIAResolver) ProcessingActivity(ctx context.Context, obj *types.ProcessingActivityTia) (*types.ProcessingActivity, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGet)
prb := r.ProboService(ctx, obj.ID.TenantID())
tia, err := prb.ProcessingActivityTIAs.Get(ctx, obj.ID)
if err != nil {
panic(fmt.Errorf("cannot get processing activity tia: %w", err))
}
processingActivity, err := prb.ProcessingActivities.Get(ctx, tia.ProcessingActivityID)
if err != nil {
panic(fmt.Errorf("cannot get processing activity: %w", err))
}
return types.NewProcessingActivity(processingActivity), nil
}
// Organization is the resolver for the organization field.
func (r *processingActivityTIAResolver) Organization(ctx context.Context, obj *types.ProcessingActivityTia) (*types.Organization, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetOrganization)
prb := r.ProboService(ctx, obj.ID.TenantID())
tia, err := prb.ProcessingActivityTIAs.Get(ctx, obj.ID)
if err != nil {
panic(fmt.Errorf("cannot get processing activity tia: %w", err))
}
organization, err := prb.Organizations.Get(ctx, tia.OrganizationID)
if err != nil {
var errNotFound *coredata.ErrOrganizationNotFound
if errors.As(err, &errNotFound) {
return nil, gqlutils.NotFound(errNotFound)
}
panic(fmt.Errorf("cannot get organization: %w", err))
}
return types.NewOrganization(organization), nil
}
// TotalCount is the resolver for the totalCount field.
func (r *processingActivityTIAConnectionResolver) TotalCount(ctx context.Context, obj *types.ProcessingActivityTIAConnection) (int, error) {
r.MustBeAuthorized(ctx, obj.ParentID, authz.ActionTotalCount)
prb := r.ProboService(ctx, obj.ParentID.TenantID())
switch obj.Resolver.(type) {
case *organizationResolver:
count, err := prb.ProcessingActivityTIAs.CountForOrganizationID(ctx, obj.ParentID, obj.Filter)
if err != nil {
panic(fmt.Errorf("cannot count organization transfer impact assessments: %w", err))
}
return count, nil
}
panic(fmt.Errorf("unsupported resolver: %T", obj.Resolver))
}
// Node is the resolver for the node field.
func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error) {
r.MustBeAuthorized(ctx, id, authz.ActionGet)
@@ -6182,20 +6122,20 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
}
return types.NewProcessingActivity(processingActivity), nil
case coredata.ProcessingActivityDPIAEntityType:
dpia, err := prb.ProcessingActivityDPIAs.Get(ctx, id)
case coredata.DataProtectionImpactAssessmentEntityType:
dpia, err := prb.DataProtectionImpactAssessments.Get(ctx, id)
if err != nil {
panic(fmt.Errorf("cannot get processing activity dpia: %w", err))
}
return types.NewProcessingActivityDpia(dpia), nil
case coredata.ProcessingActivityTIAEntityType:
tia, err := prb.ProcessingActivityTIAs.Get(ctx, id)
return types.NewDataProtectionImpactAssessment(dpia), nil
case coredata.TransferImpactAssessmentEntityType:
tia, err := prb.TransferImpactAssessments.Get(ctx, id)
if err != nil {
panic(fmt.Errorf("cannot get processing activity tia: %w", err))
}
return types.NewProcessingActivityTia(tia), nil
return types.NewTransferImpactAssessment(tia), nil
case coredata.SnapshotEntityType:
snapshot, err := prb.Snapshots.Get(ctx, id)
if err != nil {
@@ -6791,6 +6731,66 @@ func (r *taskConnectionResolver) TotalCount(ctx context.Context, obj *types.Task
panic(fmt.Errorf("unsupported resolver: %T", obj.Resolver))
}
// ProcessingActivity is the resolver for the processingActivity field.
func (r *transferImpactAssessmentResolver) ProcessingActivity(ctx context.Context, obj *types.TransferImpactAssessment) (*types.ProcessingActivity, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGet)
prb := r.ProboService(ctx, obj.ID.TenantID())
tia, err := prb.TransferImpactAssessments.Get(ctx, obj.ID)
if err != nil {
panic(fmt.Errorf("cannot get transfer impact assessment: %w", err))
}
processingActivity, err := prb.ProcessingActivities.Get(ctx, tia.ProcessingActivityID)
if err != nil {
panic(fmt.Errorf("cannot get processing activity: %w", err))
}
return types.NewProcessingActivity(processingActivity), nil
}
// Organization is the resolver for the organization field.
func (r *transferImpactAssessmentResolver) Organization(ctx context.Context, obj *types.TransferImpactAssessment) (*types.Organization, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetOrganization)
prb := r.ProboService(ctx, obj.ID.TenantID())
tia, err := prb.TransferImpactAssessments.Get(ctx, obj.ID)
if err != nil {
panic(fmt.Errorf("cannot get transfer impact assessment: %w", err))
}
organization, err := prb.Organizations.Get(ctx, tia.OrganizationID)
if err != nil {
var errNotFound *coredata.ErrOrganizationNotFound
if errors.As(err, &errNotFound) {
return nil, gqlutils.NotFound(errNotFound)
}
panic(fmt.Errorf("cannot get organization: %w", err))
}
return types.NewOrganization(organization), nil
}
// TotalCount is the resolver for the totalCount field.
func (r *transferImpactAssessmentConnectionResolver) TotalCount(ctx context.Context, obj *types.TransferImpactAssessmentConnection) (int, error) {
r.MustBeAuthorized(ctx, obj.ParentID, authz.ActionTotalCount)
prb := r.ProboService(ctx, obj.ParentID.TenantID())
switch obj.Resolver.(type) {
case *organizationResolver:
count, err := prb.TransferImpactAssessments.CountForOrganizationID(ctx, obj.ParentID, obj.Filter)
if err != nil {
panic(fmt.Errorf("cannot count organization transfer impact assessments: %w", err))
}
return count, nil
}
panic(fmt.Errorf("unsupported resolver: %T", obj.Resolver))
}
// NdaFileURL is the resolver for the ndaFileUrl field.
func (r *trustCenterResolver) NdaFileURL(ctx context.Context, obj *types.TrustCenter) (*string, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetNdaFileUrl)
@@ -7681,6 +7681,16 @@ func (r *Resolver) ControlConnection() schema.ControlConnectionResolver {
return &controlConnectionResolver{r}
}
// DataProtectionImpactAssessment returns schema.DataProtectionImpactAssessmentResolver implementation.
func (r *Resolver) DataProtectionImpactAssessment() schema.DataProtectionImpactAssessmentResolver {
return &dataProtectionImpactAssessmentResolver{r}
}
// DataProtectionImpactAssessmentConnection returns schema.DataProtectionImpactAssessmentConnectionResolver implementation.
func (r *Resolver) DataProtectionImpactAssessmentConnection() schema.DataProtectionImpactAssessmentConnectionResolver {
return &dataProtectionImpactAssessmentConnectionResolver{r}
}
// Datum returns schema.DatumResolver implementation.
func (r *Resolver) Datum() schema.DatumResolver { return &datumResolver{r} }
@@ -7795,26 +7805,6 @@ func (r *Resolver) ProcessingActivityConnection() schema.ProcessingActivityConne
return &processingActivityConnectionResolver{r}
}
// ProcessingActivityDPIA returns schema.ProcessingActivityDPIAResolver implementation.
func (r *Resolver) ProcessingActivityDPIA() schema.ProcessingActivityDPIAResolver {
return &processingActivityDPIAResolver{r}
}
// ProcessingActivityDPIAConnection returns schema.ProcessingActivityDPIAConnectionResolver implementation.
func (r *Resolver) ProcessingActivityDPIAConnection() schema.ProcessingActivityDPIAConnectionResolver {
return &processingActivityDPIAConnectionResolver{r}
}
// ProcessingActivityTIA returns schema.ProcessingActivityTIAResolver implementation.
func (r *Resolver) ProcessingActivityTIA() schema.ProcessingActivityTIAResolver {
return &processingActivityTIAResolver{r}
}
// ProcessingActivityTIAConnection returns schema.ProcessingActivityTIAConnectionResolver implementation.
func (r *Resolver) ProcessingActivityTIAConnection() schema.ProcessingActivityTIAConnectionResolver {
return &processingActivityTIAConnectionResolver{r}
}
// Query returns schema.QueryResolver implementation.
func (r *Resolver) Query() schema.QueryResolver { return &queryResolver{r} }
@@ -7851,6 +7841,16 @@ func (r *Resolver) Task() schema.TaskResolver { return &taskResolver{r} }
// TaskConnection returns schema.TaskConnectionResolver implementation.
func (r *Resolver) TaskConnection() schema.TaskConnectionResolver { return &taskConnectionResolver{r} }
// TransferImpactAssessment returns schema.TransferImpactAssessmentResolver implementation.
func (r *Resolver) TransferImpactAssessment() schema.TransferImpactAssessmentResolver {
return &transferImpactAssessmentResolver{r}
}
// TransferImpactAssessmentConnection returns schema.TransferImpactAssessmentConnectionResolver implementation.
func (r *Resolver) TransferImpactAssessmentConnection() schema.TransferImpactAssessmentConnectionResolver {
return &transferImpactAssessmentConnectionResolver{r}
}
// TrustCenter returns schema.TrustCenterResolver implementation.
func (r *Resolver) TrustCenter() schema.TrustCenterResolver { return &trustCenterResolver{r} }
@@ -7937,6 +7937,8 @@ type continualImprovementResolver struct{ *Resolver }
type continualImprovementConnectionResolver struct{ *Resolver }
type controlResolver struct{ *Resolver }
type controlConnectionResolver struct{ *Resolver }
type dataProtectionImpactAssessmentResolver struct{ *Resolver }
type dataProtectionImpactAssessmentConnectionResolver struct{ *Resolver }
type datumResolver struct{ *Resolver }
type datumConnectionResolver struct{ *Resolver }
type documentResolver struct{ *Resolver }
@@ -7965,10 +7967,6 @@ type organizationResolver struct{ *Resolver }
type peopleConnectionResolver struct{ *Resolver }
type processingActivityResolver struct{ *Resolver }
type processingActivityConnectionResolver struct{ *Resolver }
type processingActivityDPIAResolver struct{ *Resolver }
type processingActivityDPIAConnectionResolver struct{ *Resolver }
type processingActivityTIAResolver struct{ *Resolver }
type processingActivityTIAConnectionResolver struct{ *Resolver }
type queryResolver struct{ *Resolver }
type reportResolver struct{ *Resolver }
type riskResolver struct{ *Resolver }
@@ -7979,6 +7977,8 @@ type snapshotResolver struct{ *Resolver }
type snapshotConnectionResolver struct{ *Resolver }
type taskResolver struct{ *Resolver }
type taskConnectionResolver struct{ *Resolver }
type transferImpactAssessmentResolver struct{ *Resolver }
type transferImpactAssessmentConnectionResolver struct{ *Resolver }
type trustCenterResolver struct{ *Resolver }
type trustCenterAccessResolver struct{ *Resolver }
type trustCenterDocumentAccessResolver struct{ *Resolver }