Add new gdpr registries

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-12-16 16:56:33 +01:00
parent 9084d74b06
commit 91b42c6cd1
44 changed files with 12700 additions and 463 deletions

View File

@@ -74,6 +74,21 @@ export function getLawfulBasisLabel(
return labels[value] || value;
}
export function getResidualRiskLabel(
value: "LOW" | "MEDIUM" | "HIGH" | null | undefined,
__: (key: string) => string
): string {
if (!value) return "-";
const labels = {
LOW: __("Low"),
MEDIUM: __("Medium"),
HIGH: __("High"),
};
return labels[value] || value;
}
export function TransferSafeguardsOptions() {
const { __ } = useTranslate();
@@ -150,3 +165,25 @@ export function TransferImpactAssessmentOptions() {
</>
);
}
export function RoleOptions() {
const { __ } = useTranslate();
const options: Array<{
value: "CONTROLLER" | "PROCESSOR";
label: string;
}> = [
{ value: "CONTROLLER", label: __("Controller") },
{ value: "PROCESSOR", label: __("Processor") },
];
return (
<>
{options.map((option) => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</>
);
}

View File

@@ -6,12 +6,15 @@ import { promisifyMutation, sprintf } from "@probo/helpers";
import { useMutationWithToasts } from "../useMutationWithToasts";
export const ProcessingActivitiesConnectionKey = "ProcessingActivitiesPage_processingActivities";
export type ProcessingActivityDPIAResidualRisk = "LOW" | "MEDIUM" | "HIGH";
export const processingActivitiesQuery = graphql`
query ProcessingActivityGraphListQuery($organizationId: ID!, $snapshotId: ID) {
node(id: $organizationId) {
... on Organization {
...ProcessingActivitiesPageFragment @arguments(snapshotId: $snapshotId)
...ProcessingActivitiesPageDPIAFragment
...ProcessingActivitiesPageTIAFragment
}
}
}
@@ -38,6 +41,13 @@ export const processingActivityNodeQuery = graphql`
securityMeasures
dataProtectionImpactAssessment
transferImpactAssessment
lastReviewDate
nextReviewDate
role
dataProtectionOfficer {
id
fullName
}
vendors(first: 50) {
edges {
node {
@@ -48,6 +58,26 @@ export const processingActivityNodeQuery = graphql`
}
}
}
dpia {
id
description
necessityAndProportionality
potentialRisk
mitigations
residualRisk
createdAt
updatedAt
}
tia {
id
dataSubjects
legalMechanism
transfer
localLawRisk
supplementaryMeasures
createdAt
updatedAt
}
organization {
id
name
@@ -83,6 +113,13 @@ export const createProcessingActivityMutation = graphql`
securityMeasures
dataProtectionImpactAssessment
transferImpactAssessment
lastReviewDate
nextReviewDate
role
dataProtectionOfficer {
id
fullName
}
vendors(first: 50) {
edges {
node {
@@ -119,6 +156,13 @@ export const updateProcessingActivityMutation = graphql`
securityMeasures
dataProtectionImpactAssessment
transferImpactAssessment
lastReviewDate
nextReviewDate
role
dataProtectionOfficer {
id
fullName
}
vendors(first: 50) {
edges {
node {
@@ -200,6 +244,10 @@ export const useCreateProcessingActivity = (connectionId?: string) => {
securityMeasures?: string;
dataProtectionImpactAssessment?: string;
transferImpactAssessment?: string;
lastReviewDate?: string;
nextReviewDate?: string;
role: string;
dataProtectionOfficerId?: string;
vendorIds?: string[];
}) => {
if (!input.organizationId) {
@@ -228,6 +276,10 @@ export const useCreateProcessingActivity = (connectionId?: string) => {
securityMeasures: input.securityMeasures,
dataProtectionImpactAssessment: input.dataProtectionImpactAssessment,
transferImpactAssessment: input.transferImpactAssessment,
lastReviewDate: input.lastReviewDate,
nextReviewDate: input.nextReviewDate,
role: input.role,
dataProtectionOfficerId: input.dataProtectionOfficerId,
vendorIds: input.vendorIds,
},
connections: connectionId ? [connectionId] : [],
@@ -257,6 +309,10 @@ export const useUpdateProcessingActivity = () => {
securityMeasures?: string;
dataProtectionImpactAssessment?: string;
transferImpactAssessment?: string;
lastReviewDate?: string | null;
nextReviewDate?: string | null;
role?: string;
dataProtectionOfficerId?: string | null;
vendorIds?: string[];
}) => {
if (!input.id) {
@@ -270,3 +326,257 @@ export const useUpdateProcessingActivity = () => {
});
};
};
export const createProcessingActivityDPIAMutation = graphql`
mutation ProcessingActivityGraphCreateDPIAMutation(
$input: CreateProcessingActivityDPIAInput!
) {
createProcessingActivityDPIA(input: $input) {
processingActivityDpia {
id
description
necessityAndProportionality
potentialRisk
mitigations
residualRisk
createdAt
updatedAt
}
}
}
`;
export const updateProcessingActivityDPIAMutation = graphql`
mutation ProcessingActivityGraphUpdateDPIAMutation(
$input: UpdateProcessingActivityDPIAInput!
) {
updateProcessingActivityDPIA(input: $input) {
processingActivityDpia {
id
description
necessityAndProportionality
potentialRisk
mitigations
residualRisk
createdAt
updatedAt
}
}
}
`;
export const deleteProcessingActivityDPIAMutation = graphql`
mutation ProcessingActivityGraphDeleteDPIAMutation(
$input: DeleteProcessingActivityDPIAInput!
) {
deleteProcessingActivityDPIA(input: $input) {
deletedProcessingActivityDpiaId
}
}
`;
export const useCreateProcessingActivityDPIA = () => {
const [mutate] = useMutation(createProcessingActivityDPIAMutation);
const { __ } = useTranslate();
return (input: {
processingActivityId: string;
description?: string;
necessityAndProportionality?: string;
potentialRisk?: string;
mitigations?: string;
residualRisk?: ProcessingActivityDPIAResidualRisk;
}) => {
if (!input.processingActivityId) {
return alert(__("Failed to create DPIA: Processing Activity ID is required"));
}
return promisifyMutation(mutate)({
variables: {
input,
},
});
};
};
export const useUpdateProcessingActivityDPIA = () => {
const [mutate] = useMutation(updateProcessingActivityDPIAMutation);
const { __ } = useTranslate();
return (input: {
id: string;
description?: string;
necessityAndProportionality?: string;
potentialRisk?: string;
mitigations?: string;
residualRisk?: ProcessingActivityDPIAResidualRisk;
}) => {
if (!input.id) {
return alert(__("Failed to update DPIA: ID is required"));
}
return promisifyMutation(mutate)({
variables: {
input,
},
});
};
};
export const useDeleteProcessingActivityDPIA = (
dpia: { id: string },
options?: { onSuccess?: () => void }
) => {
const { __ } = useTranslate();
const [mutate] = useMutationWithToasts(deleteProcessingActivityDPIAMutation, {
successMessage: __("DPIA deleted successfully"),
errorMessage: __("Failed to delete DPIA"),
});
const confirm = useConfirm();
return () => {
confirm(
() =>
mutate({
variables: {
input: {
processingActivityDpiaId: dpia.id,
},
},
onSuccess: options?.onSuccess,
}),
{
message: __(
"This will permanently delete this Data Protection Impact Assessment. This action cannot be undone."
),
}
);
};
};
export const createProcessingActivityTIAMutation = graphql`
mutation ProcessingActivityGraphCreateTIAMutation(
$input: CreateProcessingActivityTIAInput!
) {
createProcessingActivityTIA(input: $input) {
processingActivityTia {
id
dataSubjects
legalMechanism
transfer
localLawRisk
supplementaryMeasures
createdAt
updatedAt
}
}
}
`;
export const updateProcessingActivityTIAMutation = graphql`
mutation ProcessingActivityGraphUpdateTIAMutation(
$input: UpdateProcessingActivityTIAInput!
) {
updateProcessingActivityTIA(input: $input) {
processingActivityTia {
id
dataSubjects
legalMechanism
transfer
localLawRisk
supplementaryMeasures
createdAt
updatedAt
}
}
}
`;
export const deleteProcessingActivityTIAMutation = graphql`
mutation ProcessingActivityGraphDeleteTIAMutation(
$input: DeleteProcessingActivityTIAInput!
) {
deleteProcessingActivityTIA(input: $input) {
deletedProcessingActivityTiaId
}
}
`;
export const useCreateProcessingActivityTIA = () => {
const [mutate] = useMutation(createProcessingActivityTIAMutation);
const { __ } = useTranslate();
return (input: {
processingActivityId: string;
dataSubjects?: string;
legalMechanism?: string;
transfer?: string;
localLawRisk?: string;
supplementaryMeasures?: string;
}) => {
if (!input.processingActivityId) {
return alert(__("Failed to create TIA: Processing Activity ID is required"));
}
return promisifyMutation(mutate)({
variables: {
input,
},
});
};
};
export const useUpdateProcessingActivityTIA = () => {
const [mutate] = useMutation(updateProcessingActivityTIAMutation);
const { __ } = useTranslate();
return (input: {
id: string;
dataSubjects?: string;
legalMechanism?: string;
transfer?: string;
localLawRisk?: string;
supplementaryMeasures?: string;
}) => {
if (!input.id) {
return alert(__("Failed to update TIA: ID is required"));
}
return promisifyMutation(mutate)({
variables: {
input,
},
});
};
};
export const useDeleteProcessingActivityTIA = (
tia: { id: string },
options?: { onSuccess?: () => void }
) => {
const { __ } = useTranslate();
const [mutate] = useMutationWithToasts(deleteProcessingActivityTIAMutation, {
successMessage: __("TIA deleted successfully"),
errorMessage: __("Failed to delete TIA"),
});
const confirm = useConfirm();
return () => {
confirm(
() =>
mutate({
variables: {
input: {
processingActivityTiaId: tia.id,
},
},
onSuccess: options?.onSuccess,
}),
{
message: __(
"This will permanently delete this Transfer Impact Assessment. This action cannot be undone."
),
}
);
};
};

View File

@@ -0,0 +1,167 @@
/**
* @generated SignedSource<<e12a9622852c453daa5e8d763054fe9b>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type ProcessingActivityDPIAResidualRisk = "HIGH" | "LOW" | "MEDIUM";
export type CreateProcessingActivityDPIAInput = {
description?: string | null | undefined;
mitigations?: string | null | undefined;
necessityAndProportionality?: string | null | undefined;
potentialRisk?: string | null | undefined;
processingActivityId: string;
residualRisk?: ProcessingActivityDPIAResidualRisk | null | undefined;
};
export type ProcessingActivityGraphCreateDPIAMutation$variables = {
input: CreateProcessingActivityDPIAInput;
};
export type ProcessingActivityGraphCreateDPIAMutation$data = {
readonly createProcessingActivityDPIA: {
readonly processingActivityDpia: {
readonly createdAt: any;
readonly description: string | null | undefined;
readonly id: string;
readonly mitigations: string | null | undefined;
readonly necessityAndProportionality: string | null | undefined;
readonly potentialRisk: string | null | undefined;
readonly residualRisk: ProcessingActivityDPIAResidualRisk | null | undefined;
readonly updatedAt: any;
};
};
};
export type ProcessingActivityGraphCreateDPIAMutation = {
response: ProcessingActivityGraphCreateDPIAMutation$data;
variables: ProcessingActivityGraphCreateDPIAMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "CreateProcessingActivityDPIAPayload",
"kind": "LinkedField",
"name": "createProcessingActivityDPIA",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityDPIA",
"kind": "LinkedField",
"name": "processingActivityDpia",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "description",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "necessityAndProportionality",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "potentialRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "mitigations",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "residualRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "ProcessingActivityGraphCreateDPIAMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "ProcessingActivityGraphCreateDPIAMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "5bdea885aa22aedfe71b19bf6781be61",
"id": null,
"metadata": {},
"name": "ProcessingActivityGraphCreateDPIAMutation",
"operationKind": "mutation",
"text": "mutation ProcessingActivityGraphCreateDPIAMutation(\n $input: CreateProcessingActivityDPIAInput!\n) {\n createProcessingActivityDPIA(input: $input) {\n processingActivityDpia {\n id\n description\n necessityAndProportionality\n potentialRisk\n mitigations\n residualRisk\n createdAt\n updatedAt\n }\n }\n}\n"
}
};
})();
(node as any).hash = "2b7346936fb433d268f816e687ddc2a6";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<a804557b48f2dbc4749c8399e708b9fe>>
* @generated SignedSource<<8ff0215134a49d15ba4b9153461f2fd8>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -11,22 +11,27 @@
import { ConcreteRequest } from 'relay-runtime';
export type ProcessingActivityDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED";
export type ProcessingActivityLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS";
export type ProcessingActivityRole = "CONTROLLER" | "PROCESSOR";
export type ProcessingActivitySpecialOrCriminalDatum = "NO" | "POSSIBLE" | "YES";
export type ProcessingActivityTransferImpactAssessment = "NEEDED" | "NOT_NEEDED";
export type ProcessingActivityTransferSafeguard = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES";
export type CreateProcessingActivityInput = {
consentEvidenceLink?: string | null | undefined;
dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment;
dataProtectionOfficerId?: string | null | undefined;
dataSubjectCategory?: string | null | undefined;
internationalTransfers: boolean;
lastReviewDate?: any | null | undefined;
lawfulBasis: ProcessingActivityLawfulBasis;
location?: string | null | undefined;
name: string;
nextReviewDate?: any | null | undefined;
organizationId: string;
personalDataCategory?: string | null | undefined;
purpose?: string | null | undefined;
recipients?: string | null | undefined;
retentionPeriod?: string | null | undefined;
role: ProcessingActivityRole;
securityMeasures?: string | null | undefined;
specialOrCriminalData: ProcessingActivitySpecialOrCriminalDatum;
transferImpactAssessment: ProcessingActivityTransferImpactAssessment;
@@ -44,16 +49,23 @@ export type ProcessingActivityGraphCreateMutation$data = {
readonly consentEvidenceLink: string | null | undefined;
readonly createdAt: any;
readonly dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment;
readonly dataProtectionOfficer: {
readonly fullName: string;
readonly id: string;
} | null | undefined;
readonly dataSubjectCategory: string | null | undefined;
readonly id: string;
readonly internationalTransfers: boolean;
readonly lastReviewDate: any | null | undefined;
readonly lawfulBasis: ProcessingActivityLawfulBasis;
readonly location: string | null | undefined;
readonly name: string;
readonly nextReviewDate: any | null | undefined;
readonly personalDataCategory: string | null | undefined;
readonly purpose: string | null | undefined;
readonly recipients: string | null | undefined;
readonly retentionPeriod: string | null | undefined;
readonly role: ProcessingActivityRole;
readonly securityMeasures: string | null | undefined;
readonly specialOrCriminalData: ProcessingActivitySpecialOrCriminalDatum;
readonly transferImpactAssessment: ProcessingActivityTransferImpactAssessment;
@@ -224,6 +236,46 @@ v5 = {
"name": "transferImpactAssessment",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "lastReviewDate",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "nextReviewDate",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "role",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "People",
"kind": "LinkedField",
"name": "dataProtectionOfficer",
"plural": false,
"selections": [
(v3/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": [
@@ -351,16 +403,16 @@ return {
]
},
"params": {
"cacheID": "4992c543938b28bc08d2316602d7bd1e",
"cacheID": "dbc6953ae60bda370ed5d730e3499eec",
"id": null,
"metadata": {},
"name": "ProcessingActivityGraphCreateMutation",
"operationKind": "mutation",
"text": "mutation ProcessingActivityGraphCreateMutation(\n $input: CreateProcessingActivityInput!\n) {\n createProcessingActivity(input: $input) {\n processingActivityEdge {\n node {\n id\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n specialOrCriminalData\n consentEvidenceLink\n lawfulBasis\n recipients\n location\n internationalTransfers\n transferSafeguards\n retentionPeriod\n securityMeasures\n dataProtectionImpactAssessment\n transferImpactAssessment\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n }\n }\n }\n}\n"
"text": "mutation ProcessingActivityGraphCreateMutation(\n $input: CreateProcessingActivityInput!\n) {\n createProcessingActivity(input: $input) {\n processingActivityEdge {\n node {\n id\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n specialOrCriminalData\n consentEvidenceLink\n lawfulBasis\n recipients\n location\n internationalTransfers\n transferSafeguards\n retentionPeriod\n securityMeasures\n dataProtectionImpactAssessment\n transferImpactAssessment\n lastReviewDate\n nextReviewDate\n role\n dataProtectionOfficer {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n createdAt\n }\n }\n }\n}\n"
}
};
})();
(node as any).hash = "2150e01b5dfb4ebf1553817b7cb39f08";
(node as any).hash = "5bfa8b212d24257297f668a19c230d56";
export default node;

View File

@@ -0,0 +1,166 @@
/**
* @generated SignedSource<<3da7aca4f891de8057947eda276a017f>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type CreateProcessingActivityTIAInput = {
dataSubjects?: string | null | undefined;
legalMechanism?: string | null | undefined;
localLawRisk?: string | null | undefined;
processingActivityId: string;
supplementaryMeasures?: string | null | undefined;
transfer?: string | null | undefined;
};
export type ProcessingActivityGraphCreateTIAMutation$variables = {
input: CreateProcessingActivityTIAInput;
};
export type ProcessingActivityGraphCreateTIAMutation$data = {
readonly createProcessingActivityTIA: {
readonly processingActivityTia: {
readonly createdAt: any;
readonly dataSubjects: string | null | undefined;
readonly id: string;
readonly legalMechanism: string | null | undefined;
readonly localLawRisk: string | null | undefined;
readonly supplementaryMeasures: string | null | undefined;
readonly transfer: string | null | undefined;
readonly updatedAt: any;
};
};
};
export type ProcessingActivityGraphCreateTIAMutation = {
response: ProcessingActivityGraphCreateTIAMutation$data;
variables: ProcessingActivityGraphCreateTIAMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "CreateProcessingActivityTIAPayload",
"kind": "LinkedField",
"name": "createProcessingActivityTIA",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityTIA",
"kind": "LinkedField",
"name": "processingActivityTia",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "dataSubjects",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "legalMechanism",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "transfer",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "localLawRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "supplementaryMeasures",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "ProcessingActivityGraphCreateTIAMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "ProcessingActivityGraphCreateTIAMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "f04e4606a7ac8b57f6155cf5e2fa3eaa",
"id": null,
"metadata": {},
"name": "ProcessingActivityGraphCreateTIAMutation",
"operationKind": "mutation",
"text": "mutation ProcessingActivityGraphCreateTIAMutation(\n $input: CreateProcessingActivityTIAInput!\n) {\n createProcessingActivityTIA(input: $input) {\n processingActivityTia {\n id\n dataSubjects\n legalMechanism\n transfer\n localLawRisk\n supplementaryMeasures\n createdAt\n updatedAt\n }\n }\n}\n"
}
};
})();
(node as any).hash = "e6315a3ae7db66c15850cfdae5927c03";
export default node;

View File

@@ -0,0 +1,92 @@
/**
* @generated SignedSource<<be806f3431452b1a7a4d4945c8eda79b>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type DeleteProcessingActivityDPIAInput = {
processingActivityDpiaId: string;
};
export type ProcessingActivityGraphDeleteDPIAMutation$variables = {
input: DeleteProcessingActivityDPIAInput;
};
export type ProcessingActivityGraphDeleteDPIAMutation$data = {
readonly deleteProcessingActivityDPIA: {
readonly deletedProcessingActivityDpiaId: string;
};
};
export type ProcessingActivityGraphDeleteDPIAMutation = {
response: ProcessingActivityGraphDeleteDPIAMutation$data;
variables: ProcessingActivityGraphDeleteDPIAMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "DeleteProcessingActivityDPIAPayload",
"kind": "LinkedField",
"name": "deleteProcessingActivityDPIA",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "deletedProcessingActivityDpiaId",
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "ProcessingActivityGraphDeleteDPIAMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "ProcessingActivityGraphDeleteDPIAMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "0c27b0098614053d1a252f87e75f8a24",
"id": null,
"metadata": {},
"name": "ProcessingActivityGraphDeleteDPIAMutation",
"operationKind": "mutation",
"text": "mutation ProcessingActivityGraphDeleteDPIAMutation(\n $input: DeleteProcessingActivityDPIAInput!\n) {\n deleteProcessingActivityDPIA(input: $input) {\n deletedProcessingActivityDpiaId\n }\n}\n"
}
};
})();
(node as any).hash = "9fc639df8d4ca6c8856acd9326c92997";
export default node;

View File

@@ -0,0 +1,92 @@
/**
* @generated SignedSource<<0fa59581ecefda2fad4570e8e8c2f667>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type DeleteProcessingActivityTIAInput = {
processingActivityTiaId: string;
};
export type ProcessingActivityGraphDeleteTIAMutation$variables = {
input: DeleteProcessingActivityTIAInput;
};
export type ProcessingActivityGraphDeleteTIAMutation$data = {
readonly deleteProcessingActivityTIA: {
readonly deletedProcessingActivityTiaId: string;
};
};
export type ProcessingActivityGraphDeleteTIAMutation = {
response: ProcessingActivityGraphDeleteTIAMutation$data;
variables: ProcessingActivityGraphDeleteTIAMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "DeleteProcessingActivityTIAPayload",
"kind": "LinkedField",
"name": "deleteProcessingActivityTIA",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "deletedProcessingActivityTiaId",
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "ProcessingActivityGraphDeleteTIAMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "ProcessingActivityGraphDeleteTIAMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "59c2e5775439e71d1c3546f094810389",
"id": null,
"metadata": {},
"name": "ProcessingActivityGraphDeleteTIAMutation",
"operationKind": "mutation",
"text": "mutation ProcessingActivityGraphDeleteTIAMutation(\n $input: DeleteProcessingActivityTIAInput!\n) {\n deleteProcessingActivityTIA(input: $input) {\n deletedProcessingActivityTiaId\n }\n}\n"
}
};
})();
(node as any).hash = "358c23b60d25478b3a217ae16938caed";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<cdb6464dd05ef3e28af38bf6552c1f51>>
* @generated SignedSource<<e0b1ec4a6faf9e19b0d001a9ef481ac7>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -16,7 +16,7 @@ export type ProcessingActivityGraphListQuery$variables = {
};
export type ProcessingActivityGraphListQuery$data = {
readonly node: {
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivitiesPageFragment">;
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivitiesPageDPIAFragment" | "ProcessingActivitiesPageFragment" | "ProcessingActivitiesPageTIAFragment">;
};
};
export type ProcessingActivityGraphListQuery = {
@@ -65,18 +65,107 @@ v4 = {
"name": "id",
"storageKey": null
},
v5 = [
v5 = {
"kind": "Literal",
"name": "first",
"value": 10
},
v6 = [
{
"fields": (v2/*: any*/),
"kind": "ObjectValue",
"name": "filter"
},
{
"kind": "Literal",
"name": "first",
"value": 10
}
];
(v5/*: any*/)
],
v7 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "totalCount",
"storageKey": null
},
v8 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "name",
"storageKey": null
},
v9 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
v10 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
v11 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
},
v12 = {
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
}
],
"storageKey": null
},
v13 = {
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
},
v14 = [
(v5/*: any*/)
],
v15 = {
"alias": null,
"args": null,
"concreteType": "ProcessingActivity",
"kind": "LinkedField",
"name": "processingActivity",
"plural": false,
"selections": [
(v4/*: any*/),
(v8/*: any*/)
],
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
@@ -99,6 +188,16 @@ return {
"args": (v2/*: any*/),
"kind": "FragmentSpread",
"name": "ProcessingActivitiesPageFragment"
},
{
"args": null,
"kind": "FragmentSpread",
"name": "ProcessingActivitiesPageDPIAFragment"
},
{
"args": null,
"kind": "FragmentSpread",
"name": "ProcessingActivitiesPageTIAFragment"
}
],
"type": "Organization",
@@ -132,19 +231,13 @@ return {
"selections": [
{
"alias": null,
"args": (v5/*: any*/),
"args": (v6/*: any*/),
"concreteType": "ProcessingActivityConnection",
"kind": "LinkedField",
"name": "processingActivities",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "totalCount",
"storageKey": null
},
(v7/*: any*/),
{
"alias": null,
"args": null,
@@ -176,13 +269,7 @@ return {
"name": "sourceId",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "name",
"storageKey": null
},
(v8/*: any*/),
{
"alias": null,
"args": null,
@@ -225,77 +312,24 @@ return {
"name": "internationalTransfers",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
(v9/*: any*/),
(v10/*: any*/),
(v3/*: any*/)
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
}
(v11/*: any*/)
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
}
],
"storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
}
(v12/*: any*/),
(v13/*: any*/)
],
"storageKey": null
},
{
"alias": null,
"args": (v5/*: any*/),
"args": (v6/*: any*/),
"filters": [
"filter"
],
@@ -303,6 +337,150 @@ return {
"key": "ProcessingActivitiesPage_processingActivities",
"kind": "LinkedHandle",
"name": "processingActivities"
},
{
"alias": null,
"args": (v14/*: any*/),
"concreteType": "ProcessingActivityDPIAConnection",
"kind": "LinkedField",
"name": "dataProtectionImpactAssessments",
"plural": false,
"selections": [
(v7/*: any*/),
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityDPIAEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityDPIA",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v4/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "description",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "potentialRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "residualRisk",
"storageKey": null
},
(v15/*: any*/),
(v9/*: any*/),
(v10/*: any*/),
(v3/*: any*/)
],
"storageKey": null
},
(v11/*: any*/)
],
"storageKey": null
},
(v12/*: any*/),
(v13/*: any*/)
],
"storageKey": "dataProtectionImpactAssessments(first:10)"
},
{
"alias": null,
"args": (v14/*: any*/),
"filters": null,
"handle": "connection",
"key": "ProcessingActivitiesPage_dataProtectionImpactAssessments",
"kind": "LinkedHandle",
"name": "dataProtectionImpactAssessments"
},
{
"alias": null,
"args": (v14/*: any*/),
"concreteType": "ProcessingActivityTIAConnection",
"kind": "LinkedField",
"name": "transferImpactAssessments",
"plural": false,
"selections": [
(v7/*: any*/),
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityTIAEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityTIA",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v4/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "dataSubjects",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "transfer",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "localLawRisk",
"storageKey": null
},
(v15/*: any*/),
(v9/*: any*/),
(v10/*: any*/),
(v3/*: any*/)
],
"storageKey": null
},
(v11/*: any*/)
],
"storageKey": null
},
(v12/*: any*/),
(v13/*: any*/)
],
"storageKey": "transferImpactAssessments(first:10)"
},
{
"alias": null,
"args": (v14/*: any*/),
"filters": null,
"handle": "connection",
"key": "ProcessingActivitiesPage_transferImpactAssessments",
"kind": "LinkedHandle",
"name": "transferImpactAssessments"
}
],
"type": "Organization",
@@ -314,16 +492,16 @@ return {
]
},
"params": {
"cacheID": "5b9b9ab3b28fe10be6f1e57f3756187a",
"cacheID": "e518b4737308d2e7528a2f68e26d0e32",
"id": null,
"metadata": {},
"name": "ProcessingActivityGraphListQuery",
"operationKind": "query",
"text": "query ProcessingActivityGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ProcessingActivitiesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ProcessingActivitiesPageFragment_3iomuz on Organization {\n id\n processingActivities(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n lawfulBasis\n location\n internationalTransfers\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
"text": "query ProcessingActivityGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ProcessingActivitiesPageFragment_3iomuz\n ...ProcessingActivitiesPageDPIAFragment\n ...ProcessingActivitiesPageTIAFragment\n }\n id\n }\n}\n\nfragment ProcessingActivitiesPageDPIAFragment on Organization {\n id\n dataProtectionImpactAssessments(first: 10) {\n totalCount\n edges {\n node {\n id\n description\n potentialRisk\n residualRisk\n processingActivity {\n id\n name\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n\nfragment ProcessingActivitiesPageFragment_3iomuz on Organization {\n id\n processingActivities(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n lawfulBasis\n location\n internationalTransfers\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n\nfragment ProcessingActivitiesPageTIAFragment on Organization {\n id\n transferImpactAssessments(first: 10) {\n totalCount\n edges {\n node {\n id\n dataSubjects\n transfer\n localLawRisk\n processingActivity {\n id\n name\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
}
};
})();
(node as any).hash = "4daedd61c0ba271c6d37811cef029da8";
(node as any).hash = "bbd2c1907bd9e4607a0beb1bb12d0f11";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<736925258373b1116c286fc16d19ad7d>>
* @generated SignedSource<<65e5159bb6afd503a3dc92a2a87845ea>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -9,8 +9,10 @@
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type ProcessingActivityDPIAResidualRisk = "HIGH" | "LOW" | "MEDIUM";
export type ProcessingActivityDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED";
export type ProcessingActivityLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS";
export type ProcessingActivityRole = "CONTROLLER" | "PROCESSOR";
export type ProcessingActivitySpecialOrCriminalDatum = "NO" | "POSSIBLE" | "YES";
export type ProcessingActivityTransferImpactAssessment = "NEEDED" | "NOT_NEEDED";
export type ProcessingActivityTransferSafeguard = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES";
@@ -23,12 +25,28 @@ export type ProcessingActivityGraphNodeQuery$data = {
readonly consentEvidenceLink?: string | null | undefined;
readonly createdAt?: any;
readonly dataProtectionImpactAssessment?: ProcessingActivityDataProtectionImpactAssessment;
readonly dataProtectionOfficer?: {
readonly fullName: string;
readonly id: string;
} | null | undefined;
readonly dataSubjectCategory?: string | null | undefined;
readonly dpia?: {
readonly createdAt: any;
readonly description: string | null | undefined;
readonly id: string;
readonly mitigations: string | null | undefined;
readonly necessityAndProportionality: string | null | undefined;
readonly potentialRisk: string | null | undefined;
readonly residualRisk: ProcessingActivityDPIAResidualRisk | null | undefined;
readonly updatedAt: any;
} | null | undefined;
readonly id?: string;
readonly internationalTransfers?: boolean;
readonly lastReviewDate?: any | null | undefined;
readonly lawfulBasis?: ProcessingActivityLawfulBasis;
readonly location?: string | null | undefined;
readonly name?: string;
readonly nextReviewDate?: any | null | undefined;
readonly organization?: {
readonly id: string;
readonly name: string;
@@ -37,9 +55,20 @@ export type ProcessingActivityGraphNodeQuery$data = {
readonly purpose?: string | null | undefined;
readonly recipients?: string | null | undefined;
readonly retentionPeriod?: string | null | undefined;
readonly role?: ProcessingActivityRole;
readonly securityMeasures?: string | null | undefined;
readonly snapshotId?: string | null | undefined;
readonly specialOrCriminalData?: ProcessingActivitySpecialOrCriminalDatum;
readonly tia?: {
readonly createdAt: any;
readonly dataSubjects: string | null | undefined;
readonly id: string;
readonly legalMechanism: string | null | undefined;
readonly localLawRisk: string | null | undefined;
readonly supplementaryMeasures: string | null | undefined;
readonly transfer: string | null | undefined;
readonly updatedAt: any;
} | null | undefined;
readonly transferImpactAssessment?: ProcessingActivityTransferImpactAssessment;
readonly transferSafeguards?: ProcessingActivityTransferSafeguard | null | undefined;
readonly updatedAt?: any;
@@ -195,6 +224,46 @@ v18 = {
"storageKey": null
},
v19 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "lastReviewDate",
"storageKey": null
},
v20 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "nextReviewDate",
"storageKey": null
},
v21 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "role",
"storageKey": null
},
v22 = {
"alias": null,
"args": null,
"concreteType": "People",
"kind": "LinkedField",
"name": "dataProtectionOfficer",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
}
],
"storageKey": null
},
v23 = {
"alias": null,
"args": [
{
@@ -249,7 +318,119 @@ v19 = {
],
"storageKey": "vendors(first:50)"
},
v20 = {
v24 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
v25 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
v26 = {
"alias": null,
"args": null,
"concreteType": "ProcessingActivityDPIA",
"kind": "LinkedField",
"name": "dpia",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "description",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "necessityAndProportionality",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "potentialRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "mitigations",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "residualRisk",
"storageKey": null
},
(v24/*: any*/),
(v25/*: any*/)
],
"storageKey": null
},
v27 = {
"alias": null,
"args": null,
"concreteType": "ProcessingActivityTIA",
"kind": "LinkedField",
"name": "tia",
"plural": false,
"selections": [
(v2/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "dataSubjects",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "legalMechanism",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "transfer",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "localLawRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "supplementaryMeasures",
"storageKey": null
},
(v24/*: any*/),
(v25/*: any*/)
],
"storageKey": null
},
v28 = {
"alias": null,
"args": null,
"concreteType": "Organization",
@@ -261,20 +442,6 @@ v20 = {
(v4/*: any*/)
],
"storageKey": null
},
v21 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
v22 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
};
return {
"fragment": {
@@ -314,7 +481,13 @@ return {
(v19/*: any*/),
(v20/*: any*/),
(v21/*: any*/),
(v22/*: any*/)
(v22/*: any*/),
(v23/*: any*/),
(v26/*: any*/),
(v27/*: any*/),
(v28/*: any*/),
(v24/*: any*/),
(v25/*: any*/)
],
"type": "ProcessingActivity",
"abstractKey": null
@@ -370,7 +543,13 @@ return {
(v19/*: any*/),
(v20/*: any*/),
(v21/*: any*/),
(v22/*: any*/)
(v22/*: any*/),
(v23/*: any*/),
(v26/*: any*/),
(v27/*: any*/),
(v28/*: any*/),
(v24/*: any*/),
(v25/*: any*/)
],
"type": "ProcessingActivity",
"abstractKey": null
@@ -381,16 +560,16 @@ return {
]
},
"params": {
"cacheID": "9e9d13d95bf99c04488b8bdd313e8f33",
"cacheID": "8584062347b5ee761ed590f6019926be",
"id": null,
"metadata": {},
"name": "ProcessingActivityGraphNodeQuery",
"operationKind": "query",
"text": "query ProcessingActivityGraphNodeQuery(\n $processingActivityId: ID!\n) {\n node(id: $processingActivityId) {\n __typename\n ... on ProcessingActivity {\n id\n snapshotId\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n specialOrCriminalData\n consentEvidenceLink\n lawfulBasis\n recipients\n location\n internationalTransfers\n transferSafeguards\n retentionPeriod\n securityMeasures\n dataProtectionImpactAssessment\n transferImpactAssessment\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n category\n }\n }\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
"text": "query ProcessingActivityGraphNodeQuery(\n $processingActivityId: ID!\n) {\n node(id: $processingActivityId) {\n __typename\n ... on ProcessingActivity {\n id\n snapshotId\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n specialOrCriminalData\n consentEvidenceLink\n lawfulBasis\n recipients\n location\n internationalTransfers\n transferSafeguards\n retentionPeriod\n securityMeasures\n dataProtectionImpactAssessment\n transferImpactAssessment\n lastReviewDate\n nextReviewDate\n role\n dataProtectionOfficer {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n category\n }\n }\n }\n dpia {\n id\n description\n necessityAndProportionality\n potentialRisk\n mitigations\n residualRisk\n createdAt\n updatedAt\n }\n tia {\n id\n dataSubjects\n legalMechanism\n transfer\n localLawRisk\n supplementaryMeasures\n createdAt\n updatedAt\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
}
};
})();
(node as any).hash = "0112adb4f323533e0ce7a0922c5866d2";
(node as any).hash = "317a9dae11ec982599b6efd6ef6e3187";
export default node;

View File

@@ -0,0 +1,167 @@
/**
* @generated SignedSource<<17c0715666a53d67a24e1c5c860c182d>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type ProcessingActivityDPIAResidualRisk = "HIGH" | "LOW" | "MEDIUM";
export type UpdateProcessingActivityDPIAInput = {
description?: string | null | undefined;
id: string;
mitigations?: string | null | undefined;
necessityAndProportionality?: string | null | undefined;
potentialRisk?: string | null | undefined;
residualRisk?: ProcessingActivityDPIAResidualRisk | null | undefined;
};
export type ProcessingActivityGraphUpdateDPIAMutation$variables = {
input: UpdateProcessingActivityDPIAInput;
};
export type ProcessingActivityGraphUpdateDPIAMutation$data = {
readonly updateProcessingActivityDPIA: {
readonly processingActivityDpia: {
readonly createdAt: any;
readonly description: string | null | undefined;
readonly id: string;
readonly mitigations: string | null | undefined;
readonly necessityAndProportionality: string | null | undefined;
readonly potentialRisk: string | null | undefined;
readonly residualRisk: ProcessingActivityDPIAResidualRisk | null | undefined;
readonly updatedAt: any;
};
};
};
export type ProcessingActivityGraphUpdateDPIAMutation = {
response: ProcessingActivityGraphUpdateDPIAMutation$data;
variables: ProcessingActivityGraphUpdateDPIAMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "UpdateProcessingActivityDPIAPayload",
"kind": "LinkedField",
"name": "updateProcessingActivityDPIA",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityDPIA",
"kind": "LinkedField",
"name": "processingActivityDpia",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "description",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "necessityAndProportionality",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "potentialRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "mitigations",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "residualRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "ProcessingActivityGraphUpdateDPIAMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "ProcessingActivityGraphUpdateDPIAMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "7b73761c8025d6f30a2fe6b9fdafff49",
"id": null,
"metadata": {},
"name": "ProcessingActivityGraphUpdateDPIAMutation",
"operationKind": "mutation",
"text": "mutation ProcessingActivityGraphUpdateDPIAMutation(\n $input: UpdateProcessingActivityDPIAInput!\n) {\n updateProcessingActivityDPIA(input: $input) {\n processingActivityDpia {\n id\n description\n necessityAndProportionality\n potentialRisk\n mitigations\n residualRisk\n createdAt\n updatedAt\n }\n }\n}\n"
}
};
})();
(node as any).hash = "2a4a592df6f98848a7191288ceec2f18";
export default node;

View File

@@ -1,5 +1,5 @@
/**
* @generated SignedSource<<7004a9f42c1d7e16eadf8adbdb613b2a>>
* @generated SignedSource<<b9ced8fbcfaaca6c125c105d90201bd5>>
* @lightSyntaxTransform
* @nogrep
*/
@@ -11,22 +11,27 @@
import { ConcreteRequest } from 'relay-runtime';
export type ProcessingActivityDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED";
export type ProcessingActivityLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS";
export type ProcessingActivityRole = "CONTROLLER" | "PROCESSOR";
export type ProcessingActivitySpecialOrCriminalDatum = "NO" | "POSSIBLE" | "YES";
export type ProcessingActivityTransferImpactAssessment = "NEEDED" | "NOT_NEEDED";
export type ProcessingActivityTransferSafeguard = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES";
export type UpdateProcessingActivityInput = {
consentEvidenceLink?: string | null | undefined;
dataProtectionImpactAssessment?: ProcessingActivityDataProtectionImpactAssessment | null | undefined;
dataProtectionOfficerId?: string | null | undefined;
dataSubjectCategory?: string | null | undefined;
id: string;
internationalTransfers?: boolean | null | undefined;
lastReviewDate?: any | null | undefined;
lawfulBasis?: ProcessingActivityLawfulBasis | null | undefined;
location?: string | null | undefined;
name?: string | null | undefined;
nextReviewDate?: any | null | undefined;
personalDataCategory?: string | null | undefined;
purpose?: string | null | undefined;
recipients?: string | null | undefined;
retentionPeriod?: string | null | undefined;
role?: ProcessingActivityRole | null | undefined;
securityMeasures?: string | null | undefined;
specialOrCriminalData?: ProcessingActivitySpecialOrCriminalDatum | null | undefined;
transferImpactAssessment?: ProcessingActivityTransferImpactAssessment | null | undefined;
@@ -41,16 +46,23 @@ export type ProcessingActivityGraphUpdateMutation$data = {
readonly processingActivity: {
readonly consentEvidenceLink: string | null | undefined;
readonly dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment;
readonly dataProtectionOfficer: {
readonly fullName: string;
readonly id: string;
} | null | undefined;
readonly dataSubjectCategory: string | null | undefined;
readonly id: string;
readonly internationalTransfers: boolean;
readonly lastReviewDate: any | null | undefined;
readonly lawfulBasis: ProcessingActivityLawfulBasis;
readonly location: string | null | undefined;
readonly name: string;
readonly nextReviewDate: any | null | undefined;
readonly personalDataCategory: string | null | undefined;
readonly purpose: string | null | undefined;
readonly recipients: string | null | undefined;
readonly retentionPeriod: string | null | undefined;
readonly role: ProcessingActivityRole;
readonly securityMeasures: string | null | undefined;
readonly specialOrCriminalData: ProcessingActivitySpecialOrCriminalDatum;
readonly transferImpactAssessment: ProcessingActivityTransferImpactAssessment;
@@ -218,6 +230,46 @@ v3 = [
"name": "transferImpactAssessment",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "lastReviewDate",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "nextReviewDate",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "role",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "People",
"kind": "LinkedField",
"name": "dataProtectionOfficer",
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fullName",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": [
@@ -298,16 +350,16 @@ return {
"selections": (v3/*: any*/)
},
"params": {
"cacheID": "8050213c76270c28b5543a629a956d47",
"cacheID": "c67a2cee083821566c9379f74360c489",
"id": null,
"metadata": {},
"name": "ProcessingActivityGraphUpdateMutation",
"operationKind": "mutation",
"text": "mutation ProcessingActivityGraphUpdateMutation(\n $input: UpdateProcessingActivityInput!\n) {\n updateProcessingActivity(input: $input) {\n processingActivity {\n id\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n specialOrCriminalData\n consentEvidenceLink\n lawfulBasis\n recipients\n location\n internationalTransfers\n transferSafeguards\n retentionPeriod\n securityMeasures\n dataProtectionImpactAssessment\n transferImpactAssessment\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n updatedAt\n }\n }\n}\n"
"text": "mutation ProcessingActivityGraphUpdateMutation(\n $input: UpdateProcessingActivityInput!\n) {\n updateProcessingActivity(input: $input) {\n processingActivity {\n id\n name\n purpose\n dataSubjectCategory\n personalDataCategory\n specialOrCriminalData\n consentEvidenceLink\n lawfulBasis\n recipients\n location\n internationalTransfers\n transferSafeguards\n retentionPeriod\n securityMeasures\n dataProtectionImpactAssessment\n transferImpactAssessment\n lastReviewDate\n nextReviewDate\n role\n dataProtectionOfficer {\n id\n fullName\n }\n vendors(first: 50) {\n edges {\n node {\n id\n name\n websiteUrl\n }\n }\n }\n updatedAt\n }\n }\n}\n"
}
};
})();
(node as any).hash = "cb14a2c41f4690c0079a185c8caad3f4";
(node as any).hash = "31dcb6c411d7ffd7a63eb9941f4f2609";
export default node;

View File

@@ -0,0 +1,166 @@
/**
* @generated SignedSource<<a4fc26df235ee47b3cf31c1dc4ffb2c3>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
export type UpdateProcessingActivityTIAInput = {
dataSubjects?: string | null | undefined;
id: string;
legalMechanism?: string | null | undefined;
localLawRisk?: string | null | undefined;
supplementaryMeasures?: string | null | undefined;
transfer?: string | null | undefined;
};
export type ProcessingActivityGraphUpdateTIAMutation$variables = {
input: UpdateProcessingActivityTIAInput;
};
export type ProcessingActivityGraphUpdateTIAMutation$data = {
readonly updateProcessingActivityTIA: {
readonly processingActivityTia: {
readonly createdAt: any;
readonly dataSubjects: string | null | undefined;
readonly id: string;
readonly legalMechanism: string | null | undefined;
readonly localLawRisk: string | null | undefined;
readonly supplementaryMeasures: string | null | undefined;
readonly transfer: string | null | undefined;
readonly updatedAt: any;
};
};
};
export type ProcessingActivityGraphUpdateTIAMutation = {
response: ProcessingActivityGraphUpdateTIAMutation$data;
variables: ProcessingActivityGraphUpdateTIAMutation$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "input"
}
],
v1 = [
{
"alias": null,
"args": [
{
"kind": "Variable",
"name": "input",
"variableName": "input"
}
],
"concreteType": "UpdateProcessingActivityTIAPayload",
"kind": "LinkedField",
"name": "updateProcessingActivityTIA",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityTIA",
"kind": "LinkedField",
"name": "processingActivityTia",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "dataSubjects",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "legalMechanism",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "transfer",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "localLawRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "supplementaryMeasures",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
}
],
"storageKey": null
}
],
"storageKey": null
}
];
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "ProcessingActivityGraphUpdateTIAMutation",
"selections": (v1/*: any*/),
"type": "Mutation",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "ProcessingActivityGraphUpdateTIAMutation",
"selections": (v1/*: any*/)
},
"params": {
"cacheID": "d596534ba9782fe47b15cd56e008db42",
"id": null,
"metadata": {},
"name": "ProcessingActivityGraphUpdateTIAMutation",
"operationKind": "mutation",
"text": "mutation ProcessingActivityGraphUpdateTIAMutation(\n $input: UpdateProcessingActivityTIAInput!\n) {\n updateProcessingActivityTIA(input: $input) {\n processingActivityTia {\n id\n dataSubjects\n legalMechanism\n transfer\n localLawRisk\n supplementaryMeasures\n createdAt\n updatedAt\n }\n }\n}\n"
}
};
})();
(node as any).hash = "a669ab652dd3687dff4069814b3ea0e8";
export default node;

View File

@@ -14,10 +14,12 @@ import {
IconTrashCan,
Table,
useConfirm,
Tabs,
TabItem,
} from "@probo/ui";
import { useTranslate } from "@probo/i18n";
import { usePageTitle } from "@probo/hooks";
import { getLawfulBasisLabel } from "../../../components/form/ProcessingActivityEnumOptions";
import { getLawfulBasisLabel, getResidualRiskLabel } from "../../../components/form/ProcessingActivityEnumOptions";
import {
ConnectionHandler,
graphql,
@@ -37,8 +39,16 @@ import type {
ProcessingActivitiesPageFragment$key,
ProcessingActivitiesPageFragment$data,
} from "./__generated__/ProcessingActivitiesPageFragment.graphql";
import type {
ProcessingActivitiesPageDPIAFragment$key,
ProcessingActivitiesPageDPIAFragment$data,
} from "./__generated__/ProcessingActivitiesPageDPIAFragment.graphql";
import type {
ProcessingActivitiesPageTIAFragment$key,
ProcessingActivitiesPageTIAFragment$data,
} from "./__generated__/ProcessingActivitiesPageTIAFragment.graphql";
import { PermissionsContext } from "/providers/PermissionsContext";
import { use } from "react";
import { use, useState } from "react";
import type { ProcessingActivityGraphListQuery } from "/hooks/graph/__generated__/ProcessingActivityGraphListQuery.graphql";
interface ProcessingActivitiesPageProps {
@@ -86,12 +96,87 @@ const processingActivitiesPageFragment = graphql`
}
`;
const dpiaListPageFragment = graphql`
fragment ProcessingActivitiesPageDPIAFragment on Organization
@refetchable(queryName: "ProcessingActivitiesPageDPIARefetchQuery")
@argumentDefinitions(
first: { type: "Int", defaultValue: 10 }
after: { type: "CursorKey" }
) {
id
dataProtectionImpactAssessments(
first: $first
after: $after
)
@connection(key: "ProcessingActivitiesPage_dataProtectionImpactAssessments") {
__id
totalCount
edges {
node {
id
description
potentialRisk
residualRisk
processingActivity {
id
name
}
createdAt
updatedAt
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
`;
const tiaListPageFragment = graphql`
fragment ProcessingActivitiesPageTIAFragment on Organization
@refetchable(queryName: "ProcessingActivitiesPageTIARefetchQuery")
@argumentDefinitions(
first: { type: "Int", defaultValue: 10 }
after: { type: "CursorKey" }
) {
id
transferImpactAssessments(
first: $first
after: $after
)
@connection(key: "ProcessingActivitiesPage_transferImpactAssessments") {
__id
totalCount
edges {
node {
id
dataSubjects
transfer
localLawRisk
processingActivity {
id
name
}
createdAt
updatedAt
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
`;
export default function ProcessingActivitiesPage({ queryRef }: ProcessingActivitiesPageProps) {
const { __ } = useTranslate();
const organizationId = useOrganizationId();
const { snapshotId } = useParams<{ snapshotId?: string }>();
const isSnapshotMode = Boolean(snapshotId);
const { isAuthorized } = use(PermissionsContext);
const [activeTab, setActiveTab] = useState<"activities" | "dpia" | "tia">("activities");
usePageTitle(__("Processing Activities"));
@@ -101,21 +186,43 @@ export default function ProcessingActivitiesPage({ queryRef }: ProcessingActivit
);
const {
data,
loadNext,
hasNext,
isLoadingNext,
data: activitiesData,
loadNext: loadNextActivities,
hasNext: hasNextActivities,
isLoadingNext: isLoadingNextActivities,
} = usePaginationFragment<
ProcessingActivityGraphListQuery,
ProcessingActivitiesPageFragment$key
>(processingActivitiesPageFragment, organization.node);
const {
data: dpiaData,
loadNext: loadNextDPIAs,
hasNext: hasNextDPIAs,
isLoadingNext: isLoadingNextDPIAs,
} = usePaginationFragment<
ProcessingActivityGraphListQuery,
ProcessingActivitiesPageDPIAFragment$key
>(dpiaListPageFragment, organization.node);
const {
data: tiaData,
loadNext: loadNextTIAs,
hasNext: hasNextTIAs,
isLoadingNext: isLoadingNextTIAs,
} = usePaginationFragment<
ProcessingActivityGraphListQuery,
ProcessingActivitiesPageTIAFragment$key
>(tiaListPageFragment, organization.node);
const connectionId = ConnectionHandler.getConnectionID(
organizationId,
ProcessingActivitiesConnectionKey,
{ filter: { snapshotId: snapshotId || null } }
);
const activities = data?.processingActivities?.edges?.map((edge) => edge.node) ?? [];
const activities = activitiesData?.processingActivities?.edges?.map((edge) => edge.node) ?? [];
const dpias = dpiaData?.dataProtectionImpactAssessments?.edges?.map((edge) => edge.node) ?? [];
const tias = tiaData?.transferImpactAssessments?.edges?.map((edge) => edge.node) ?? [];
const hasAnyAction = !isSnapshotMode && (
isAuthorized("ProcessingActivity", "updateProcessingActivity") ||
@@ -128,7 +235,7 @@ export default function ProcessingActivitiesPage({ queryRef }: ProcessingActivit
<SnapshotBanner snapshotId={snapshotId} />
)}
<PageHeader title={__("Processing Activities")} description={__("Manage your processing activities under GDPR")}>
{!isSnapshotMode && (
{!isSnapshotMode && activeTab === "activities" && (
isAuthorized("Organization", "createProcessingActivity") && (
<CreateProcessingActivityDialog
organizationId={organizationId}
@@ -142,55 +249,165 @@ export default function ProcessingActivitiesPage({ queryRef }: ProcessingActivit
)}
</PageHeader>
{activities.length > 0 ? (
<Card>
<Table>
<Thead>
<Tr>
<Th>{__("Name")}</Th>
<Th>{__("Purpose")}</Th>
<Th>{__("Data Subject")}</Th>
<Th>{__("Lawful Basis")}</Th>
<Th>{__("Location")}</Th>
<Th>{__("International Transfers")}</Th>
{hasAnyAction && <Th>{__("Actions")}</Th>}
</Tr>
</Thead>
<Tbody>
{activities.map((activity) => (
<ActivityRow
key={activity.id}
activity={activity}
connectionId={connectionId}
hasAnyAction={hasAnyAction}
/>
))}
</Tbody>
</Table>
<Tabs>
<TabItem active={activeTab === "activities"} onClick={() => setActiveTab("activities")}>
{__("Processing Activities")}
</TabItem>
<TabItem active={activeTab === "dpia"} onClick={() => setActiveTab("dpia")}>
{__("Data Protection Impact Assessments")}
</TabItem>
<TabItem active={activeTab === "tia"} onClick={() => setActiveTab("tia")}>
{__("Transfer Impact Assessments")}
</TabItem>
</Tabs>
{hasNext && (
<div className="p-4 border-t">
<Button
variant="secondary"
onClick={() => loadNext(10)}
disabled={isLoadingNext}
>
{isLoadingNext ? __("Loading...") : __("Load more")}
</Button>
</div>
{activeTab === "activities" && (
<>
{activities.length > 0 ? (
<Card>
<Table>
<Thead>
<Tr>
<Th>{__("Name")}</Th>
<Th>{__("Purpose")}</Th>
<Th>{__("Data Subject")}</Th>
<Th>{__("Lawful Basis")}</Th>
<Th>{__("Location")}</Th>
<Th>{__("International Transfers")}</Th>
{hasAnyAction && <Th>{__("Actions")}</Th>}
</Tr>
</Thead>
<Tbody>
{activities.map((activity) => (
<ActivityRow
key={activity.id}
activity={activity}
connectionId={connectionId}
hasAnyAction={hasAnyAction}
/>
))}
</Tbody>
</Table>
{hasNextActivities && (
<div className="p-4 border-t">
<Button
variant="secondary"
onClick={() => loadNextActivities(10)}
disabled={isLoadingNextActivities}
>
{isLoadingNextActivities ? __("Loading...") : __("Load more")}
</Button>
</div>
)}
</Card>
) : (
<Card padded>
<div className="text-center py-12">
<h3 className="text-lg font-semibold mb-2">
{__("No processing activities yet")}
</h3>
<p className="text-txt-tertiary mb-4">
{__("Create your first processing activity to get started with GDPR compliance.")}
</p>
</div>
</Card>
)}
</Card>
) : (
<Card padded>
<div className="text-center py-12">
<h3 className="text-lg font-semibold mb-2">
{__("No processing activities yet")}
</h3>
<p className="text-txt-tertiary mb-4">
{__("Create your first processing activity to get started with GDPR compliance.")}
</p>
</div>
</Card>
</>
)}
{activeTab === "dpia" && (
<>
{dpias.length > 0 ? (
<Card>
<Table>
<Thead>
<Tr>
<Th>{__("Processing Activity")}</Th>
<Th>{__("Description")}</Th>
<Th>{__("Potential Risk")}</Th>
<Th>{__("Residual Risk")}</Th>
</Tr>
</Thead>
<Tbody>
{dpias.map((dpia) => (
<DPIARow key={dpia.id} dpia={dpia} />
))}
</Tbody>
</Table>
{hasNextDPIAs && (
<div className="p-4 border-t">
<Button
variant="secondary"
onClick={() => loadNextDPIAs(10)}
disabled={isLoadingNextDPIAs}
>
{isLoadingNextDPIAs ? __("Loading...") : __("Load more")}
</Button>
</div>
)}
</Card>
) : (
<Card padded>
<div className="text-center py-12">
<h3 className="text-lg font-semibold mb-2">
{__("No Data Protection Impact Assessments yet")}
</h3>
<p className="text-txt-tertiary mb-4">
{__("DPIAs are created from within individual processing activities.")}
</p>
</div>
</Card>
)}
</>
)}
{activeTab === "tia" && (
<>
{tias.length > 0 ? (
<Card>
<Table>
<Thead>
<Tr>
<Th>{__("Processing Activity")}</Th>
<Th>{__("Data Subjects")}</Th>
<Th>{__("Transfer")}</Th>
<Th>{__("Local Law Risk")}</Th>
</Tr>
</Thead>
<Tbody>
{tias.map((tia) => (
<TIARow key={tia.id} tia={tia} />
))}
</Tbody>
</Table>
{hasNextTIAs && (
<div className="p-4 border-t">
<Button
variant="secondary"
onClick={() => loadNextTIAs(10)}
disabled={isLoadingNextTIAs}
>
{isLoadingNextTIAs ? __("Loading...") : __("Load more")}
</Button>
</div>
)}
</Card>
) : (
<Card padded>
<div className="text-center py-12">
<h3 className="text-lg font-semibold mb-2">
{__("No Transfer Impact Assessments yet")}
</h3>
<p className="text-txt-tertiary mb-4">
{__("TIAs are created from within individual processing activities.")}
</p>
</div>
</Card>
)}
</>
)}
</div>
);
@@ -275,3 +492,80 @@ function ActivityRow({
</Tr>
);
}
function DPIARow({
dpia,
}: {
dpia: NodeOf<NonNullable<ProcessingActivitiesPageDPIAFragment$data['dataProtectionImpactAssessments']>>;
}) {
const organizationId = useOrganizationId();
const { __ } = useTranslate();
const { snapshotId } = useParams<{ snapshotId?: string }>();
const isSnapshotMode = Boolean(snapshotId);
const activityUrl = isSnapshotMode && snapshotId
? `/organizations/${organizationId}/snapshots/${snapshotId}/processing-activities/${dpia.processingActivity.id}#dpia`
: `/organizations/${organizationId}/processing-activities/${dpia.processingActivity.id}#dpia`;
return (
<Tr to={activityUrl}>
<Td>
<span className="font-semibold">{dpia.processingActivity.name}</span>
</Td>
<Td>
<span className="text-sm text-txt-secondary line-clamp-2">
{dpia.description || "-"}
</span>
</Td>
<Td>
<span className="text-sm text-txt-secondary line-clamp-2">
{dpia.potentialRisk || "-"}
</span>
</Td>
<Td>
{dpia.residualRisk ? (
<Badge variant={dpia.residualRisk === "LOW" ? "success" : dpia.residualRisk === "MEDIUM" ? "warning" : "danger"}>
{getResidualRiskLabel(dpia.residualRisk, __)}
</Badge>
) : "-"}
</Td>
</Tr>
);
}
function TIARow({
tia,
}: {
tia: NodeOf<NonNullable<ProcessingActivitiesPageTIAFragment$data['transferImpactAssessments']>>;
}) {
const organizationId = useOrganizationId();
const { snapshotId } = useParams<{ snapshotId?: string }>();
const isSnapshotMode = Boolean(snapshotId);
const activityUrl = isSnapshotMode && snapshotId
? `/organizations/${organizationId}/snapshots/${snapshotId}/processing-activities/${tia.processingActivity.id}#tia`
: `/organizations/${organizationId}/processing-activities/${tia.processingActivity.id}#tia`;
return (
<Tr to={activityUrl}>
<Td>
<span className="font-semibold">{tia.processingActivity.name}</span>
</Td>
<Td>
<span className="text-sm text-txt-secondary line-clamp-2">
{tia.dataSubjects || "-"}
</span>
</Td>
<Td>
<span className="text-sm text-txt-secondary line-clamp-2">
{tia.transfer || "-"}
</span>
</Td>
<Td>
<span className="text-sm text-txt-secondary line-clamp-2">
{tia.localLawRisk || "-"}
</span>
</Td>
</Tr>
);
}

View File

@@ -0,0 +1,257 @@
/**
* @generated SignedSource<<eaa19415d42ca227134bd17febaa0a89>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
export type ProcessingActivityDPIAResidualRisk = "HIGH" | "LOW" | "MEDIUM";
import { FragmentRefs } from "relay-runtime";
export type ProcessingActivitiesPageDPIAFragment$data = {
readonly dataProtectionImpactAssessments: {
readonly __id: string;
readonly edges: ReadonlyArray<{
readonly node: {
readonly createdAt: any;
readonly description: string | null | undefined;
readonly id: string;
readonly potentialRisk: string | null | undefined;
readonly processingActivity: {
readonly id: string;
readonly name: string;
};
readonly residualRisk: ProcessingActivityDPIAResidualRisk | null | undefined;
readonly updatedAt: any;
};
}>;
readonly pageInfo: {
readonly endCursor: any | null | undefined;
readonly hasNextPage: boolean;
};
readonly totalCount: number;
};
readonly id: string;
readonly " $fragmentType": "ProcessingActivitiesPageDPIAFragment";
};
export type ProcessingActivitiesPageDPIAFragment$key = {
readonly " $data"?: ProcessingActivitiesPageDPIAFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivitiesPageDPIAFragment">;
};
import ProcessingActivitiesPageDPIARefetchQuery_graphql from './ProcessingActivitiesPageDPIARefetchQuery.graphql';
const node: ReaderFragment = (function(){
var v0 = [
"dataProtectionImpactAssessments"
],
v1 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
};
return {
"argumentDefinitions": [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "after"
},
{
"defaultValue": 10,
"kind": "LocalArgument",
"name": "first"
}
],
"kind": "Fragment",
"metadata": {
"connection": [
{
"count": "first",
"cursor": "after",
"direction": "forward",
"path": (v0/*: any*/)
}
],
"refetch": {
"connection": {
"forward": {
"count": "first",
"cursor": "after"
},
"backward": null,
"path": (v0/*: any*/)
},
"fragmentPathInResult": [
"node"
],
"operation": ProcessingActivitiesPageDPIARefetchQuery_graphql,
"identifierInfo": {
"identifierField": "id",
"identifierQueryVariableName": "id"
}
}
},
"name": "ProcessingActivitiesPageDPIAFragment",
"selections": [
(v1/*: any*/),
{
"alias": "dataProtectionImpactAssessments",
"args": null,
"concreteType": "ProcessingActivityDPIAConnection",
"kind": "LinkedField",
"name": "__ProcessingActivitiesPage_dataProtectionImpactAssessments_connection",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "totalCount",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityDPIAEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityDPIA",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "description",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "potentialRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "residualRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivity",
"kind": "LinkedField",
"name": "processingActivity",
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "name",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
}
],
"storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
}
],
"storageKey": null
}
],
"type": "Organization",
"abstractKey": null
};
})();
(node as any).hash = "e49266b9c7b8a8b00dc43813ce499f67";
export default node;

View File

@@ -0,0 +1,296 @@
/**
* @generated SignedSource<<026a23e95a9115022526fa5d6f0cb999>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type ProcessingActivitiesPageDPIARefetchQuery$variables = {
after?: any | null | undefined;
first?: number | null | undefined;
id: string;
};
export type ProcessingActivitiesPageDPIARefetchQuery$data = {
readonly node: {
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivitiesPageDPIAFragment">;
};
};
export type ProcessingActivitiesPageDPIARefetchQuery = {
response: ProcessingActivitiesPageDPIARefetchQuery$data;
variables: ProcessingActivitiesPageDPIARefetchQuery$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "after"
},
{
"defaultValue": 10,
"kind": "LocalArgument",
"name": "first"
},
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "id"
}
],
v1 = [
{
"kind": "Variable",
"name": "id",
"variableName": "id"
}
],
v2 = [
{
"kind": "Variable",
"name": "after",
"variableName": "after"
},
{
"kind": "Variable",
"name": "first",
"variableName": "first"
}
],
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "ProcessingActivitiesPageDPIARefetchQuery",
"selections": [
{
"alias": null,
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
{
"args": (v2/*: any*/),
"kind": "FragmentSpread",
"name": "ProcessingActivitiesPageDPIAFragment"
}
],
"storageKey": null
}
],
"type": "Query",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "ProcessingActivitiesPageDPIARefetchQuery",
"selections": [
{
"alias": null,
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v3/*: any*/),
(v4/*: any*/),
{
"kind": "InlineFragment",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "ProcessingActivityDPIAConnection",
"kind": "LinkedField",
"name": "dataProtectionImpactAssessments",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "totalCount",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityDPIAEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityDPIA",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v4/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "description",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "potentialRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "residualRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivity",
"kind": "LinkedField",
"name": "processingActivity",
"plural": false,
"selections": [
(v4/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "name",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
(v3/*: any*/)
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
}
],
"storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
}
],
"storageKey": null
},
{
"alias": null,
"args": (v2/*: any*/),
"filters": null,
"handle": "connection",
"key": "ProcessingActivitiesPage_dataProtectionImpactAssessments",
"kind": "LinkedHandle",
"name": "dataProtectionImpactAssessments"
}
],
"type": "Organization",
"abstractKey": null
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "8e3896e68907df53052a3418bf646240",
"id": null,
"metadata": {},
"name": "ProcessingActivitiesPageDPIARefetchQuery",
"operationKind": "query",
"text": "query ProcessingActivitiesPageDPIARefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ProcessingActivitiesPageDPIAFragment_2HEEH6\n id\n }\n}\n\nfragment ProcessingActivitiesPageDPIAFragment_2HEEH6 on Organization {\n id\n dataProtectionImpactAssessments(first: $first, after: $after) {\n totalCount\n edges {\n node {\n id\n description\n potentialRisk\n residualRisk\n processingActivity {\n id\n name\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
}
};
})();
(node as any).hash = "e49266b9c7b8a8b00dc43813ce499f67";
export default node;

View File

@@ -0,0 +1,256 @@
/**
* @generated SignedSource<<7f0d0a852bdb0ca1fdd8a49252654563>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ReaderFragment } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type ProcessingActivitiesPageTIAFragment$data = {
readonly id: string;
readonly transferImpactAssessments: {
readonly __id: string;
readonly edges: ReadonlyArray<{
readonly node: {
readonly createdAt: any;
readonly dataSubjects: string | null | undefined;
readonly id: string;
readonly localLawRisk: string | null | undefined;
readonly processingActivity: {
readonly id: string;
readonly name: string;
};
readonly transfer: string | null | undefined;
readonly updatedAt: any;
};
}>;
readonly pageInfo: {
readonly endCursor: any | null | undefined;
readonly hasNextPage: boolean;
};
readonly totalCount: number;
};
readonly " $fragmentType": "ProcessingActivitiesPageTIAFragment";
};
export type ProcessingActivitiesPageTIAFragment$key = {
readonly " $data"?: ProcessingActivitiesPageTIAFragment$data;
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivitiesPageTIAFragment">;
};
import ProcessingActivitiesPageTIARefetchQuery_graphql from './ProcessingActivitiesPageTIARefetchQuery.graphql';
const node: ReaderFragment = (function(){
var v0 = [
"transferImpactAssessments"
],
v1 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
};
return {
"argumentDefinitions": [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "after"
},
{
"defaultValue": 10,
"kind": "LocalArgument",
"name": "first"
}
],
"kind": "Fragment",
"metadata": {
"connection": [
{
"count": "first",
"cursor": "after",
"direction": "forward",
"path": (v0/*: any*/)
}
],
"refetch": {
"connection": {
"forward": {
"count": "first",
"cursor": "after"
},
"backward": null,
"path": (v0/*: any*/)
},
"fragmentPathInResult": [
"node"
],
"operation": ProcessingActivitiesPageTIARefetchQuery_graphql,
"identifierInfo": {
"identifierField": "id",
"identifierQueryVariableName": "id"
}
}
},
"name": "ProcessingActivitiesPageTIAFragment",
"selections": [
(v1/*: any*/),
{
"alias": "transferImpactAssessments",
"args": null,
"concreteType": "ProcessingActivityTIAConnection",
"kind": "LinkedField",
"name": "__ProcessingActivitiesPage_transferImpactAssessments_connection",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "totalCount",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityTIAEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityTIA",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "dataSubjects",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "transfer",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "localLawRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivity",
"kind": "LinkedField",
"name": "processingActivity",
"plural": false,
"selections": [
(v1/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "name",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
}
],
"storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
}
],
"storageKey": null
}
],
"type": "Organization",
"abstractKey": null
};
})();
(node as any).hash = "0262ad5df883e750870f63e6d18d2c93";
export default node;

View File

@@ -0,0 +1,296 @@
/**
* @generated SignedSource<<fa37df5257783c56111f7d5a8838b759>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type ProcessingActivitiesPageTIARefetchQuery$variables = {
after?: any | null | undefined;
first?: number | null | undefined;
id: string;
};
export type ProcessingActivitiesPageTIARefetchQuery$data = {
readonly node: {
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivitiesPageTIAFragment">;
};
};
export type ProcessingActivitiesPageTIARefetchQuery = {
response: ProcessingActivitiesPageTIARefetchQuery$data;
variables: ProcessingActivitiesPageTIARefetchQuery$variables;
};
const node: ConcreteRequest = (function(){
var v0 = [
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "after"
},
{
"defaultValue": 10,
"kind": "LocalArgument",
"name": "first"
},
{
"defaultValue": null,
"kind": "LocalArgument",
"name": "id"
}
],
v1 = [
{
"kind": "Variable",
"name": "id",
"variableName": "id"
}
],
v2 = [
{
"kind": "Variable",
"name": "after",
"variableName": "after"
},
{
"kind": "Variable",
"name": "first",
"variableName": "first"
}
],
v3 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "id",
"storageKey": null
};
return {
"fragment": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Fragment",
"metadata": null,
"name": "ProcessingActivitiesPageTIARefetchQuery",
"selections": [
{
"alias": null,
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
{
"args": (v2/*: any*/),
"kind": "FragmentSpread",
"name": "ProcessingActivitiesPageTIAFragment"
}
],
"storageKey": null
}
],
"type": "Query",
"abstractKey": null
},
"kind": "Request",
"operation": {
"argumentDefinitions": (v0/*: any*/),
"kind": "Operation",
"name": "ProcessingActivitiesPageTIARefetchQuery",
"selections": [
{
"alias": null,
"args": (v1/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v3/*: any*/),
(v4/*: any*/),
{
"kind": "InlineFragment",
"selections": [
{
"alias": null,
"args": (v2/*: any*/),
"concreteType": "ProcessingActivityTIAConnection",
"kind": "LinkedField",
"name": "transferImpactAssessments",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "totalCount",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityTIAEdge",
"kind": "LinkedField",
"name": "edges",
"plural": true,
"selections": [
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivityTIA",
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v4/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "dataSubjects",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "transfer",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "localLawRisk",
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "ProcessingActivity",
"kind": "LinkedField",
"name": "processingActivity",
"plural": false,
"selections": [
(v4/*: any*/),
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "name",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "createdAt",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "updatedAt",
"storageKey": null
},
(v3/*: any*/)
],
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "cursor",
"storageKey": null
}
],
"storageKey": null
},
{
"alias": null,
"args": null,
"concreteType": "PageInfo",
"kind": "LinkedField",
"name": "pageInfo",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "hasNextPage",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "endCursor",
"storageKey": null
}
],
"storageKey": null
},
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__id",
"storageKey": null
}
]
}
],
"storageKey": null
},
{
"alias": null,
"args": (v2/*: any*/),
"filters": null,
"handle": "connection",
"key": "ProcessingActivitiesPage_transferImpactAssessments",
"kind": "LinkedHandle",
"name": "transferImpactAssessments"
}
],
"type": "Organization",
"abstractKey": null
}
],
"storageKey": null
}
]
},
"params": {
"cacheID": "339dd59f375bcb83665bb36d05950916",
"id": null,
"metadata": {},
"name": "ProcessingActivitiesPageTIARefetchQuery",
"operationKind": "query",
"text": "query ProcessingActivitiesPageTIARefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ProcessingActivitiesPageTIAFragment_2HEEH6\n id\n }\n}\n\nfragment ProcessingActivitiesPageTIAFragment_2HEEH6 on Organization {\n id\n transferImpactAssessments(first: $first, after: $after) {\n totalCount\n edges {\n node {\n id\n dataSubjects\n transfer\n localLawRisk\n processingActivity {\n id\n name\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
}
};
})();
(node as any).hash = "0262ad5df883e750870f63e6d18d2c93";
export default node;

View File

@@ -12,6 +12,7 @@ import {
Label,
Checkbox,
Select,
Input,
} from "@probo/ui";
import { useTranslate } from "@probo/i18n";
import { z } from "zod";
@@ -19,13 +20,15 @@ import { useFormWithSchema } from "/hooks/useFormWithSchema";
import { useCreateProcessingActivity } from "../../../../hooks/graph/ProcessingActivityGraph";
import { Controller } from "react-hook-form";
import { VendorsMultiSelectField } from "/components/form/VendorsMultiSelectField";
import { formatError, type GraphQLError } from "@probo/helpers";
import { PeopleSelectField } from "/components/form/PeopleSelectField";
import { formatError, formatDatetime, type GraphQLError } from "@probo/helpers";
import {
SpecialOrCriminalDataOptions,
LawfulBasisOptions,
TransferSafeguardsOptions,
DataProtectionImpactAssessmentOptions,
TransferImpactAssessmentOptions,
RoleOptions,
} from "../../../../components/form/ProcessingActivityEnumOptions";
const schema = z.object({
@@ -44,6 +47,10 @@ const schema = z.object({
securityMeasures: z.string().optional(),
dataProtectionImpactAssessment: z.enum(["NEEDED", "NOT_NEEDED"] as const),
transferImpactAssessment: z.enum(["NEEDED", "NOT_NEEDED"] as const),
lastReviewDate: z.string().optional(),
nextReviewDate: z.string().optional(),
role: z.enum(["CONTROLLER", "PROCESSOR"] as const),
dataProtectionOfficerId: z.string().optional(),
vendorIds: z.array(z.string()).optional(),
});
@@ -83,6 +90,10 @@ export function CreateProcessingActivityDialog({
securityMeasures: "",
dataProtectionImpactAssessment: "NOT_NEEDED" as const,
transferImpactAssessment: "NOT_NEEDED" as const,
lastReviewDate: "",
nextReviewDate: "",
role: "PROCESSOR" as const,
dataProtectionOfficerId: "",
vendorIds: [],
},
});
@@ -106,6 +117,10 @@ export function CreateProcessingActivityDialog({
securityMeasures: formData.securityMeasures || undefined,
dataProtectionImpactAssessment: formData.dataProtectionImpactAssessment || undefined,
transferImpactAssessment: formData.transferImpactAssessment || undefined,
lastReviewDate: formatDatetime(formData.lastReviewDate),
nextReviewDate: formatDatetime(formData.nextReviewDate),
role: formData.role,
dataProtectionOfficerId: formData.dataProtectionOfficerId || undefined,
vendorIds: formData.vendorIds,
});
@@ -145,6 +160,28 @@ export function CreateProcessingActivityDialog({
required
/>
<div>
<Label htmlFor="role">{__("Role")}</Label>
<Controller
control={control}
name="role"
render={({ field }) => (
<Select
id="role"
placeholder={__("Select role")}
onValueChange={field.onChange}
value={field.value}
className="w-full"
>
<RoleOptions />
</Select>
)}
/>
{formState.errors.role && (
<p className="text-sm text-txt-danger mt-1">{formState.errors.role.message}</p>
)}
</div>
<div>
<Label>{__("Purpose")}</Label>
<Textarea
@@ -218,6 +255,31 @@ export function CreateProcessingActivityDialog({
<p className="text-sm text-txt-danger mt-1">{formState.errors.lawfulBasis.message}</p>
)}
</div>
<div className="space-y-2">
<Label htmlFor="lastReviewDate">{__("Last Review Date")}</Label>
<Input
id="lastReviewDate"
type="date"
{...register("lastReviewDate")}
/>
</div>
<div className="space-y-2">
<Label htmlFor="nextReviewDate">{__("Next Review Date")}</Label>
<Input
id="nextReviewDate"
type="date"
{...register("nextReviewDate")}
/>
</div>
<PeopleSelectField
organizationId={organizationId}
control={control}
name="dataProtectionOfficerId"
label={__("Data Protection Officer")}
/>
</div>
<div className="space-y-4">

File diff suppressed because it is too large Load Diff

View File

@@ -919,6 +919,7 @@ func CreateProcessingActivity(c *testutil.Client, attrs ...Attrs) string {
"internationalTransfers": a.getBool("internationalTransfers", false),
"dataProtectionImpactAssessment": a.getString("dataProtectionImpactAssessment", "NOT_NEEDED"),
"transferImpactAssessment": a.getString("transferImpactAssessment", "NOT_NEEDED"),
"role": a.getString("role", "CONTROLLER"),
}
if purpose := a.getStringPtr("purpose"); purpose != nil {
input["purpose"] = *purpose

View File

@@ -3,6 +3,11 @@ export function formatDatetime(dateString?: string | null): string | undefined {
return `${dateString}T00:00:00Z`;
}
export function toDateInput(dateString?: string | null): string {
if (!dateString) return '';
return dateString.split('T')[0];
}
export function formatDate(dateInput?: string | null): string {
if (!dateInput) return '';

View File

@@ -61,7 +61,7 @@ export {
} from "./trustCenterVisibility";
export { promisifyMutation } from "./relay";
export { fileType, fileSize } from "./file";
export { formatDatetime, formatDate } from "./date";
export { formatDatetime, formatDate, toDateInput } from "./date";
export { getTrustCenterUrl } from "./trustCenter";
export { formatError, type GraphQLError } from "./error";
export { Role, getAssignableRoles } from "./roles";

View File

@@ -45,6 +45,9 @@ const (
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"
@@ -135,6 +138,8 @@ const (
ActionCreateObligation Action = "createObligation"
ActionCreatePeople Action = "createPeople"
ActionCreateProcessingActivity Action = "createProcessingActivity"
ActionCreateProcessingActivityDPIA Action = "createProcessingActivityDPIA"
ActionCreateProcessingActivityTIA Action = "createProcessingActivityTIA"
ActionCreateRisk Action = "createRisk"
ActionCreateRiskDocumentMapping Action = "createRiskDocumentMapping"
ActionCreateRiskMeasureMapping Action = "createRiskMeasureMapping"
@@ -167,6 +172,8 @@ const (
ActionUpdateOrganization Action = "updateOrganization"
ActionUpdatePeople Action = "updatePeople"
ActionUpdateProcessingActivity Action = "updateProcessingActivity"
ActionUpdateProcessingActivityDPIA Action = "updateProcessingActivityDPIA"
ActionUpdateProcessingActivityTIA Action = "updateProcessingActivityTIA"
ActionUpdateRisk Action = "updateRisk"
ActionUpdateSAMLConfiguration Action = "updateSAMLConfiguration"
ActionUpdateTask Action = "updateTask"
@@ -204,6 +211,8 @@ const (
ActionDeleteOrganizationHorizontalLogo Action = "deleteOrganizationHorizontalLogo"
ActionDeletePeople Action = "deletePeople"
ActionDeleteProcessingActivity Action = "deleteProcessingActivity"
ActionDeleteProcessingActivityDPIA Action = "deleteProcessingActivityDPIA"
ActionDeleteProcessingActivityTIA Action = "deleteProcessingActivityTIA"
ActionDeleteRisk Action = "deleteRisk"
ActionDeleteRiskDocumentMapping Action = "deleteRiskDocumentMapping"
ActionDeleteRiskMeasureMapping Action = "deleteRiskMeasureMapping"
@@ -665,12 +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,
ActionUpdateProcessingActivity: EditRoles,
ActionDeleteProcessingActivity: EditRoles,
ActionCreateProcessingActivityDPIA: EditRoles,
ActionCreateProcessingActivityTIA: EditRoles,
},
coredata.ProcessingActivityDPIAEntityType: {
ActionGet: NonEmployeeRoles,
ActionGetOrganization: NonEmployeeRoles,
ActionListVendors: NonEmployeeRoles,
ActionUpdateProcessingActivity: EditRoles,
ActionDeleteProcessingActivity: EditRoles,
ActionCreateProcessingActivityDPIA: EditRoles,
ActionUpdateProcessingActivityDPIA: EditRoles,
ActionDeleteProcessingActivityDPIA: EditRoles,
},
coredata.ProcessingActivityTIAEntityType: {
ActionGet: NonEmployeeRoles,
ActionGetOrganization: NonEmployeeRoles,
ActionCreateProcessingActivityTIA: EditRoles,
ActionUpdateProcessingActivityTIA: EditRoles,
ActionDeleteProcessingActivityTIA: EditRoles,
},
coredata.SnapshotEntityType: {
ActionGet: NonEmployeeRoles,

View File

@@ -67,6 +67,8 @@ const (
UserAPIKeyEntityType uint16 = 43
UserAPIKeyMembershipEntityType uint16 = 44
MeetingEntityType uint16 = 45
ProcessingActivityDPIAEntityType uint16 = 46
ProcessingActivityTIAEntityType uint16 = 47
)
type EntityInfo struct {
@@ -259,6 +261,14 @@ var entityRegistry = map[uint16]EntityInfo{
Model: "Meeting",
Table: "meetings",
},
ProcessingActivityDPIAEntityType: {
Model: "ProcessingActivityDPIA",
Table: "processing_activity_data_protection_impact_assessments",
},
ProcessingActivityTIAEntityType: {
Model: "ProcessingActivityTIA",
Table: "processing_activity_transfer_impact_assessments",
},
}
func EntityTable(entityType uint16) (string, bool) {

View File

@@ -0,0 +1,62 @@
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 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;
CREATE TYPE processing_activity_dpia_residual_risk AS ENUM ('LOW', 'MEDIUM', 'HIGH');
CREATE TABLE processing_activity_data_protection_impact_assessments (
id TEXT PRIMARY KEY,
tenant_id TEXT NOT NULL,
organization_id TEXT NOT NULL,
processing_activity_id TEXT NOT NULL,
description TEXT,
necessity_and_proportionality TEXT,
potential_risk TEXT,
mitigations TEXT,
residual_risk processing_activity_dpia_residual_risk,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
CONSTRAINT processing_activity_dpia_organization_id_fkey
FOREIGN KEY (organization_id)
REFERENCES organizations(id)
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT processing_activity_dpia_processing_activity_id_fkey
FOREIGN KEY (processing_activity_id)
REFERENCES processing_activities(id)
ON UPDATE CASCADE
ON DELETE CASCADE
);
CREATE TABLE processing_activity_transfer_impact_assessments (
id TEXT PRIMARY KEY,
tenant_id TEXT NOT NULL,
organization_id TEXT NOT NULL,
processing_activity_id TEXT NOT NULL,
data_subjects TEXT,
legal_mechanism TEXT,
transfer TEXT,
local_law_risk TEXT,
supplementary_measures TEXT,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
CONSTRAINT processing_activity_tia_organization_id_fkey
FOREIGN KEY (organization_id)
REFERENCES organizations(id)
ON UPDATE CASCADE
ON DELETE CASCADE,
CONSTRAINT processing_activity_tia_processing_activity_id_fkey
FOREIGN KEY (processing_activity_id)
REFERENCES processing_activities(id)
ON UPDATE CASCADE
ON DELETE CASCADE
);

View File

@@ -47,6 +47,10 @@ type (
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"`
}
@@ -92,6 +96,10 @@ SELECT
security_measures,
data_protection_impact_assessment,
transfer_impact_assessment,
last_review_date,
next_review_date,
role,
data_protection_officer_id,
created_at,
updated_at
FROM
@@ -186,6 +194,10 @@ SELECT
security_measures,
data_protection_impact_assessment,
transfer_impact_assessment,
last_review_date,
next_review_date,
role,
data_protection_officer_id,
created_at,
updated_at
FROM
@@ -246,6 +258,10 @@ INSERT INTO processing_activities (
security_measures,
data_protection_impact_assessment,
transfer_impact_assessment,
last_review_date,
next_review_date,
role,
data_protection_officer_id,
created_at,
updated_at
) VALUES (
@@ -269,6 +285,10 @@ INSERT INTO processing_activities (
@security_measures,
@data_protection_impact_assessment,
@transfer_impact_assessment,
@last_review_date,
@next_review_date,
@role,
@data_protection_officer_id,
@created_at,
@updated_at
)
@@ -295,6 +315,10 @@ INSERT INTO processing_activities (
"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,
}
@@ -330,6 +354,10 @@ SET
security_measures = @security_measures,
data_protection_impact_assessment = @data_protection_impact_assessment,
transfer_impact_assessment = @transfer_impact_assessment,
last_review_date = @last_review_date,
next_review_date = @next_review_date,
role = @role,
data_protection_officer_id = @data_protection_officer_id,
updated_at = @updated_at
WHERE
%s
@@ -356,6 +384,10 @@ WHERE
"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,
}
maps.Copy(args, scope.SQLArguments())
@@ -435,6 +467,10 @@ INSERT INTO processing_activities (
security_measures,
data_protection_impact_assessment,
transfer_impact_assessment,
last_review_date,
next_review_date,
role,
data_protection_officer_id,
created_at,
updated_at
)
@@ -459,6 +495,10 @@ SELECT
par.security_measures,
par.data_protection_impact_assessment,
par.transfer_impact_assessment,
par.last_review_date,
par.next_review_date,
par.role,
par.data_protection_officer_id,
par.created_at,
par.updated_at
FROM processing_activities par

View File

@@ -0,0 +1,359 @@
// 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 (
"context"
"errors"
"fmt"
"maps"
"time"
"github.com/jackc/pgx/v5"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page"
)
type ErrProcessingActivityDPIANotFound struct {
Identifier string
}
func (e ErrProcessingActivityDPIANotFound) Error() string {
return fmt.Sprintf("processing activity dpia not found: %q", e.Identifier)
}
type (
ProcessingActivityDPIA struct {
ID gid.GID `db:"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"`
}
ProcessingActivityDPIAs []*ProcessingActivityDPIA
)
func (dpia *ProcessingActivityDPIA) CursorKey(field ProcessingActivityDPIAOrderField) page.CursorKey {
switch field {
case ProcessingActivityDPIAOrderFieldCreatedAt:
return page.NewCursorKey(dpia.ID, dpia.CreatedAt)
}
panic(fmt.Sprintf("unsupported order by: %s", field))
}
func (dpias *ProcessingActivityDPIAs) CountByOrganizationID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
organizationID gid.GID,
) (int, error) {
q := `
SELECT
COUNT(id)
FROM
processing_activity_data_protection_impact_assessments
WHERE
%s
AND organization_id = @organization_id
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"organization_id": organizationID}
maps.Copy(args, scope.SQLArguments())
row := conn.QueryRow(ctx, q, args)
var count int
err := row.Scan(&count)
if err != nil {
return 0, fmt.Errorf("cannot count processing activity dpias: %w", err)
}
return count, nil
}
func (dpias *ProcessingActivityDPIAs) LoadByOrganizationID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
organizationID gid.GID,
cursor *page.Cursor[ProcessingActivityDPIAOrderField],
) error {
q := `
SELECT
id,
organization_id,
processing_activity_id,
description,
necessity_and_proportionality,
potential_risk,
mitigations,
residual_risk,
created_at,
updated_at
FROM
processing_activity_data_protection_impact_assessments
WHERE
%s
AND organization_id = @organization_id
AND %s
`
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
args := pgx.StrictNamedArgs{"organization_id": organizationID}
maps.Copy(args, scope.SQLArguments())
maps.Copy(args, cursor.SQLArguments())
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity dpias: %w", err)
}
results, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ProcessingActivityDPIA])
if err != nil {
return fmt.Errorf("cannot collect processing activity dpias: %w", err)
}
*dpias = results
return nil
}
func (dpia *ProcessingActivityDPIA) LoadByID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
dpiaID gid.GID,
) error {
q := `
SELECT
id,
organization_id,
processing_activity_id,
description,
necessity_and_proportionality,
potential_risk,
mitigations,
residual_risk,
created_at,
updated_at
FROM
processing_activity_data_protection_impact_assessments
WHERE
%s
AND id = @dpia_id
LIMIT 1;
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"dpia_id": dpiaID}
maps.Copy(args, scope.SQLArguments())
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity dpia: %w", err)
}
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ProcessingActivityDPIA])
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return &ErrProcessingActivityDPIANotFound{Identifier: dpiaID.String()}
}
return fmt.Errorf("cannot collect processing activity dpia: %w", err)
}
*dpia = result
return nil
}
func (dpia *ProcessingActivityDPIA) LoadByProcessingActivityID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
processingActivityID gid.GID,
) error {
q := `
SELECT
id,
organization_id,
processing_activity_id,
description,
necessity_and_proportionality,
potential_risk,
mitigations,
residual_risk,
created_at,
updated_at
FROM
processing_activity_data_protection_impact_assessments
WHERE
%s
AND processing_activity_id = @processing_activity_id
LIMIT 1;
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"processing_activity_id": processingActivityID}
maps.Copy(args, scope.SQLArguments())
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity dpia: %w", err)
}
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ProcessingActivityDPIA])
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return &ErrProcessingActivityDPIANotFound{Identifier: processingActivityID.String()}
}
return fmt.Errorf("cannot collect processing activity dpia: %w", err)
}
*dpia = result
return nil
}
func (dpia *ProcessingActivityDPIA) Insert(
ctx context.Context,
conn pg.Conn,
scope Scoper,
) error {
q := `
INSERT INTO processing_activity_data_protection_impact_assessments (
id,
tenant_id,
organization_id,
processing_activity_id,
description,
necessity_and_proportionality,
potential_risk,
mitigations,
residual_risk,
created_at,
updated_at
) VALUES (
@id,
@tenant_id,
@organization_id,
@processing_activity_id,
@description,
@necessity_and_proportionality,
@potential_risk,
@mitigations,
@residual_risk,
@created_at,
@updated_at
)
`
args := pgx.StrictNamedArgs{
"id": dpia.ID,
"tenant_id": scope.GetTenantID(),
"organization_id": dpia.OrganizationID,
"processing_activity_id": dpia.ProcessingActivityID,
"description": dpia.Description,
"necessity_and_proportionality": dpia.NecessityAndProportionality,
"potential_risk": dpia.PotentialRisk,
"mitigations": dpia.Mitigations,
"residual_risk": dpia.ResidualRisk,
"created_at": dpia.CreatedAt,
"updated_at": dpia.UpdatedAt,
}
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot insert processing activity dpia: %w", err)
}
return nil
}
func (dpia *ProcessingActivityDPIA) Update(
ctx context.Context,
conn pg.Conn,
scope Scoper,
) error {
q := `
UPDATE processing_activity_data_protection_impact_assessments SET
description = @description,
necessity_and_proportionality = @necessity_and_proportionality,
potential_risk = @potential_risk,
mitigations = @mitigations,
residual_risk = @residual_risk,
updated_at = @updated_at
WHERE
%s
AND id = @id
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{
"id": dpia.ID,
"description": dpia.Description,
"necessity_and_proportionality": dpia.NecessityAndProportionality,
"potential_risk": dpia.PotentialRisk,
"mitigations": dpia.Mitigations,
"residual_risk": dpia.ResidualRisk,
"updated_at": dpia.UpdatedAt,
}
maps.Copy(args, scope.SQLArguments())
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot update processing activity dpia: %w", err)
}
return nil
}
func (dpia *ProcessingActivityDPIA) Delete(
ctx context.Context,
conn pg.Conn,
scope Scoper,
) error {
q := `
DELETE FROM processing_activity_data_protection_impact_assessments
WHERE
%s
AND id = @id
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"id": dpia.ID}
maps.Copy(args, scope.SQLArguments())
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot delete processing activity dpia: %w", err)
}
return nil
}

View File

@@ -0,0 +1,45 @@
// 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 "fmt"
type ProcessingActivityDPIAOrderField string
const (
ProcessingActivityDPIAOrderFieldCreatedAt ProcessingActivityDPIAOrderField = "CREATED_AT"
)
func (p ProcessingActivityDPIAOrderField) Column() string {
return string(p)
}
func (p ProcessingActivityDPIAOrderField) String() string {
return string(p)
}
func (p ProcessingActivityDPIAOrderField) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}
func (p *ProcessingActivityDPIAOrderField) UnmarshalText(text []byte) error {
val := string(text)
switch val {
case string(ProcessingActivityDPIAOrderFieldCreatedAt):
*p = ProcessingActivityDPIAOrderFieldCreatedAt
return nil
}
return fmt.Errorf("invalid ProcessingActivityDPIAOrderField value: %q", val)
}

View File

@@ -0,0 +1,68 @@
// 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

@@ -0,0 +1,64 @@
// 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 ProcessingActivityRole string
const (
ProcessingActivityRoleController ProcessingActivityRole = "CONTROLLER"
ProcessingActivityRoleProcessor ProcessingActivityRole = "PROCESSOR"
)
func ProcessingActivityRoles() []ProcessingActivityRole {
return []ProcessingActivityRole{
ProcessingActivityRoleController,
ProcessingActivityRoleProcessor,
}
}
func (p ProcessingActivityRole) String() string {
return string(p)
}
func (p *ProcessingActivityRole) 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 ProcessingActivityRole: %T", value)
}
switch s {
case "CONTROLLER":
*p = ProcessingActivityRoleController
case "PROCESSOR":
*p = ProcessingActivityRoleProcessor
default:
return fmt.Errorf("invalid ProcessingActivityRole value: %q", s)
}
return nil
}
func (p ProcessingActivityRole) Value() (driver.Value, error) {
return p.String(), nil
}

View File

@@ -0,0 +1,359 @@
// 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 (
"context"
"errors"
"fmt"
"maps"
"time"
"github.com/jackc/pgx/v5"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page"
)
type ErrProcessingActivityTIANotFound struct {
Identifier string
}
func (e ErrProcessingActivityTIANotFound) Error() string {
return fmt.Sprintf("processing activity tia not found: %q", e.Identifier)
}
type (
ProcessingActivityTIA struct {
ID gid.GID `db:"id"`
OrganizationID gid.GID `db:"organization_id"`
ProcessingActivityID gid.GID `db:"processing_activity_id"`
DataSubjects *string `db:"data_subjects"`
LegalMechanism *string `db:"legal_mechanism"`
Transfer *string `db:"transfer"`
LocalLawRisk *string `db:"local_law_risk"`
SupplementaryMeasures *string `db:"supplementary_measures"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
ProcessingActivityTIAs []*ProcessingActivityTIA
)
func (tia *ProcessingActivityTIA) CursorKey(field ProcessingActivityTIAOrderField) page.CursorKey {
switch field {
case ProcessingActivityTIAOrderFieldCreatedAt:
return page.NewCursorKey(tia.ID, tia.CreatedAt)
}
panic(fmt.Sprintf("unsupported order by: %s", field))
}
func (tias *ProcessingActivityTIAs) CountByOrganizationID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
organizationID gid.GID,
) (int, error) {
q := `
SELECT
COUNT(id)
FROM
processing_activity_transfer_impact_assessments
WHERE
%s
AND organization_id = @organization_id
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"organization_id": organizationID}
maps.Copy(args, scope.SQLArguments())
row := conn.QueryRow(ctx, q, args)
var count int
err := row.Scan(&count)
if err != nil {
return 0, fmt.Errorf("cannot count processing activity tias: %w", err)
}
return count, nil
}
func (tias *ProcessingActivityTIAs) LoadByOrganizationID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
organizationID gid.GID,
cursor *page.Cursor[ProcessingActivityTIAOrderField],
) error {
q := `
SELECT
id,
organization_id,
processing_activity_id,
data_subjects,
legal_mechanism,
transfer,
local_law_risk,
supplementary_measures,
created_at,
updated_at
FROM
processing_activity_transfer_impact_assessments
WHERE
%s
AND organization_id = @organization_id
AND %s
`
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
args := pgx.StrictNamedArgs{"organization_id": organizationID}
maps.Copy(args, scope.SQLArguments())
maps.Copy(args, cursor.SQLArguments())
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity tias: %w", err)
}
results, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ProcessingActivityTIA])
if err != nil {
return fmt.Errorf("cannot collect processing activity tias: %w", err)
}
*tias = results
return nil
}
func (tia *ProcessingActivityTIA) LoadByID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
tiaID gid.GID,
) error {
q := `
SELECT
id,
organization_id,
processing_activity_id,
data_subjects,
legal_mechanism,
transfer,
local_law_risk,
supplementary_measures,
created_at,
updated_at
FROM
processing_activity_transfer_impact_assessments
WHERE
%s
AND id = @tia_id
LIMIT 1;
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"tia_id": tiaID}
maps.Copy(args, scope.SQLArguments())
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity tia: %w", err)
}
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ProcessingActivityTIA])
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return &ErrProcessingActivityTIANotFound{Identifier: tiaID.String()}
}
return fmt.Errorf("cannot collect processing activity tia: %w", err)
}
*tia = result
return nil
}
func (tia *ProcessingActivityTIA) LoadByProcessingActivityID(
ctx context.Context,
conn pg.Conn,
scope Scoper,
processingActivityID gid.GID,
) error {
q := `
SELECT
id,
organization_id,
processing_activity_id,
data_subjects,
legal_mechanism,
transfer,
local_law_risk,
supplementary_measures,
created_at,
updated_at
FROM
processing_activity_transfer_impact_assessments
WHERE
%s
AND processing_activity_id = @processing_activity_id
LIMIT 1;
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"processing_activity_id": processingActivityID}
maps.Copy(args, scope.SQLArguments())
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query processing activity tia: %w", err)
}
result, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ProcessingActivityTIA])
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return &ErrProcessingActivityTIANotFound{Identifier: processingActivityID.String()}
}
return fmt.Errorf("cannot collect processing activity tia: %w", err)
}
*tia = result
return nil
}
func (tia *ProcessingActivityTIA) Insert(
ctx context.Context,
conn pg.Conn,
scope Scoper,
) error {
q := `
INSERT INTO processing_activity_transfer_impact_assessments (
id,
tenant_id,
organization_id,
processing_activity_id,
data_subjects,
legal_mechanism,
transfer,
local_law_risk,
supplementary_measures,
created_at,
updated_at
) VALUES (
@id,
@tenant_id,
@organization_id,
@processing_activity_id,
@data_subjects,
@legal_mechanism,
@transfer,
@local_law_risk,
@supplementary_measures,
@created_at,
@updated_at
)
`
args := pgx.StrictNamedArgs{
"id": tia.ID,
"tenant_id": scope.GetTenantID(),
"organization_id": tia.OrganizationID,
"processing_activity_id": tia.ProcessingActivityID,
"data_subjects": tia.DataSubjects,
"legal_mechanism": tia.LegalMechanism,
"transfer": tia.Transfer,
"local_law_risk": tia.LocalLawRisk,
"supplementary_measures": tia.SupplementaryMeasures,
"created_at": tia.CreatedAt,
"updated_at": tia.UpdatedAt,
}
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot insert processing activity tia: %w", err)
}
return nil
}
func (tia *ProcessingActivityTIA) Update(
ctx context.Context,
conn pg.Conn,
scope Scoper,
) error {
q := `
UPDATE processing_activity_transfer_impact_assessments SET
data_subjects = @data_subjects,
legal_mechanism = @legal_mechanism,
transfer = @transfer,
local_law_risk = @local_law_risk,
supplementary_measures = @supplementary_measures,
updated_at = @updated_at
WHERE
%s
AND id = @id
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{
"id": tia.ID,
"data_subjects": tia.DataSubjects,
"legal_mechanism": tia.LegalMechanism,
"transfer": tia.Transfer,
"local_law_risk": tia.LocalLawRisk,
"supplementary_measures": tia.SupplementaryMeasures,
"updated_at": tia.UpdatedAt,
}
maps.Copy(args, scope.SQLArguments())
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot update processing activity tia: %w", err)
}
return nil
}
func (tia *ProcessingActivityTIA) Delete(
ctx context.Context,
conn pg.Conn,
scope Scoper,
) error {
q := `
DELETE FROM processing_activity_transfer_impact_assessments
WHERE
%s
AND id = @id
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"id": tia.ID}
maps.Copy(args, scope.SQLArguments())
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot delete processing activity tia: %w", err)
}
return nil
}

View File

@@ -0,0 +1,45 @@
// 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 "fmt"
type ProcessingActivityTIAOrderField string
const (
ProcessingActivityTIAOrderFieldCreatedAt ProcessingActivityTIAOrderField = "CREATED_AT"
)
func (p ProcessingActivityTIAOrderField) Column() string {
return string(p)
}
func (p ProcessingActivityTIAOrderField) String() string {
return string(p)
}
func (p ProcessingActivityTIAOrderField) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}
func (p *ProcessingActivityTIAOrderField) UnmarshalText(text []byte) error {
val := string(text)
switch val {
case string(ProcessingActivityTIAOrderFieldCreatedAt):
*p = ProcessingActivityTIAOrderFieldCreatedAt
return nil
}
return fmt.Errorf("invalid ProcessingActivityTIAOrderField value: %q", val)
}

View File

@@ -0,0 +1,297 @@
// 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 probo
import (
"context"
"fmt"
"time"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page"
"go.probo.inc/probo/pkg/validator"
)
type ProcessingActivityDPIAService struct {
svc *TenantService
}
type (
CreateProcessingActivityDPIARequest struct {
ProcessingActivityID gid.GID
Description *string
NecessityAndProportionality *string
PotentialRisk *string
Mitigations *string
ResidualRisk *coredata.ProcessingActivityDPIAResidualRisk
}
UpdateProcessingActivityDPIARequest struct {
ID gid.GID
Description **string
NecessityAndProportionality **string
PotentialRisk **string
Mitigations **string
ResidualRisk *coredata.ProcessingActivityDPIAResidualRisk
}
)
func (req *CreateProcessingActivityDPIARequest) Validate() error {
v := validator.New()
v.Check(req.ProcessingActivityID, "processing_activity_id", validator.Required(), validator.GID(coredata.ProcessingActivityEntityType))
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()))
return v.Error()
}
func (req *UpdateProcessingActivityDPIARequest) Validate() error {
v := validator.New()
v.Check(req.ID, "id", validator.Required(), validator.GID(coredata.ProcessingActivityDPIAEntityType))
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()))
return v.Error()
}
func (s ProcessingActivityDPIAService) Get(
ctx context.Context,
dpiaID gid.GID,
) (*coredata.ProcessingActivityDPIA, error) {
dpia := &coredata.ProcessingActivityDPIA{}
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 nil
},
)
if err != nil {
return nil, err
}
return dpia, nil
}
func (s ProcessingActivityDPIAService) GetByProcessingActivityID(
ctx context.Context,
processingActivityID gid.GID,
) (*coredata.ProcessingActivityDPIA, error) {
dpia := &coredata.ProcessingActivityDPIA{}
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 nil
},
)
if err != nil {
return nil, err
}
return dpia, nil
}
func (s ProcessingActivityDPIAService) ListForOrganizationID(
ctx context.Context,
organizationID gid.GID,
cursor *page.Cursor[coredata.ProcessingActivityDPIAOrderField],
) (*page.Page[*coredata.ProcessingActivityDPIA, coredata.ProcessingActivityDPIAOrderField], error) {
var dpias coredata.ProcessingActivityDPIAs
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
err := dpias.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID, cursor)
if err != nil {
return fmt.Errorf("cannot load processing activity dpias: %w", err)
}
return nil
},
)
if err != nil {
return nil, err
}
return page.NewPage(dpias, cursor), nil
}
func (s ProcessingActivityDPIAService) CountForOrganizationID(
ctx context.Context,
organizationID gid.GID,
) (int, error) {
var count int
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) (err error) {
dpias := coredata.ProcessingActivityDPIAs{}
count, err = dpias.CountByOrganizationID(ctx, conn, s.svc.scope, organizationID)
return err
},
)
if err != nil {
return 0, err
}
return count, nil
}
func (s *ProcessingActivityDPIAService) Create(
ctx context.Context,
req *CreateProcessingActivityDPIARequest,
) (*coredata.ProcessingActivityDPIA, 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),
ProcessingActivityID: req.ProcessingActivityID,
Description: req.Description,
NecessityAndProportionality: req.NecessityAndProportionality,
PotentialRisk: req.PotentialRisk,
Mitigations: req.Mitigations,
ResidualRisk: req.ResidualRisk,
CreatedAt: now,
UpdatedAt: now,
}
err := s.svc.pg.WithTx(
ctx,
func(conn pg.Conn) error {
processingActivity := &coredata.ProcessingActivity{}
if err := processingActivity.LoadByID(ctx, conn, s.svc.scope, req.ProcessingActivityID); err != nil {
return fmt.Errorf("cannot load processing activity: %w", err)
}
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 nil
},
)
if err != nil {
return nil, err
}
return dpia, nil
}
func (s *ProcessingActivityDPIAService) Update(
ctx context.Context,
req *UpdateProcessingActivityDPIARequest,
) (*coredata.ProcessingActivityDPIA, error) {
if err := req.Validate(); err != nil {
return nil, err
}
dpia := &coredata.ProcessingActivityDPIA{}
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)
}
if req.Description != nil {
dpia.Description = *req.Description
}
if req.NecessityAndProportionality != nil {
dpia.NecessityAndProportionality = *req.NecessityAndProportionality
}
if req.PotentialRisk != nil {
dpia.PotentialRisk = *req.PotentialRisk
}
if req.Mitigations != nil {
dpia.Mitigations = *req.Mitigations
}
if req.ResidualRisk != nil {
dpia.ResidualRisk = req.ResidualRisk
}
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 nil
},
)
if err != nil {
return nil, err
}
return dpia, nil
}
func (s *ProcessingActivityDPIAService) Delete(
ctx context.Context,
dpiaID gid.GID,
) error {
err := s.svc.pg.WithTx(
ctx,
func(conn pg.Conn) error {
dpia := &coredata.ProcessingActivityDPIA{}
if err := dpia.LoadByID(ctx, conn, s.svc.scope, dpiaID); err != nil {
return fmt.Errorf("cannot load processing activity dpia: %w", err)
}
if err := dpia.Delete(ctx, conn, s.svc.scope); err != nil {
return fmt.Errorf("cannot delete processing activity dpia: %w", err)
}
return nil
},
)
return err
}

View File

@@ -48,6 +48,10 @@ type (
SecurityMeasures *string
DataProtectionImpactAssessment coredata.ProcessingActivityDataProtectionImpactAssessment
TransferImpactAssessment coredata.ProcessingActivityTransferImpactAssessment
LastReviewDate *time.Time
NextReviewDate *time.Time
Role coredata.ProcessingActivityRole
DataProtectionOfficerID *gid.GID
VendorIDs []gid.GID
}
@@ -68,6 +72,10 @@ type (
SecurityMeasures **string
DataProtectionImpactAssessment *coredata.ProcessingActivityDataProtectionImpactAssessment
TransferImpactAssessment *coredata.ProcessingActivityTransferImpactAssessment
LastReviewDate **time.Time
NextReviewDate **time.Time
Role *coredata.ProcessingActivityRole
DataProtectionOfficerID **gid.GID
VendorIDs *[]gid.GID
}
)
@@ -91,6 +99,8 @@ func (cpar *CreateProcessingActivityRequest) Validate() error {
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.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) {
v.Check(item, fmt.Sprintf("vendor_ids[%d]", index), validator.Required(), validator.GID(coredata.VendorEntityType))
})
@@ -116,6 +126,8 @@ func (upar *UpdateProcessingActivityRequest) Validate() error {
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.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) {
v.Check(item, fmt.Sprintf("vendor_ids[%d]", index), validator.GID(coredata.VendorEntityType))
})
@@ -168,6 +180,10 @@ func (s *ProcessingActivityService) Create(
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,
}
@@ -260,6 +276,18 @@ func (s *ProcessingActivityService) Update(
if req.TransferImpactAssessment != nil {
processingActivity.TransferImpactAssessment = *req.TransferImpactAssessment
}
if req.LastReviewDate != nil {
processingActivity.LastReviewDate = *req.LastReviewDate
}
if req.NextReviewDate != nil {
processingActivity.NextReviewDate = *req.NextReviewDate
}
if req.Role != nil {
processingActivity.Role = *req.Role
}
if req.DataProtectionOfficerID != nil {
processingActivity.DataProtectionOfficerID = *req.DataProtectionOfficerID
}
processingActivity.UpdatedAt = time.Now()

View File

@@ -0,0 +1,297 @@
// 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 probo
import (
"context"
"fmt"
"time"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page"
"go.probo.inc/probo/pkg/validator"
)
type ProcessingActivityTIAService struct {
svc *TenantService
}
type (
CreateProcessingActivityTIARequest struct {
ProcessingActivityID gid.GID
DataSubjects *string
LegalMechanism *string
Transfer *string
LocalLawRisk *string
SupplementaryMeasures *string
}
UpdateProcessingActivityTIARequest struct {
ID gid.GID
DataSubjects **string
LegalMechanism **string
Transfer **string
LocalLawRisk **string
SupplementaryMeasures **string
}
)
func (req *CreateProcessingActivityTIARequest) Validate() error {
v := validator.New()
v.Check(req.ProcessingActivityID, "processing_activity_id", validator.Required(), validator.GID(coredata.ProcessingActivityEntityType))
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))
v.Check(req.LocalLawRisk, "local_law_risk", validator.SafeText(ContentMaxLength))
v.Check(req.SupplementaryMeasures, "supplementary_measures", validator.SafeText(ContentMaxLength))
return v.Error()
}
func (req *UpdateProcessingActivityTIARequest) Validate() error {
v := validator.New()
v.Check(req.ID, "id", validator.Required(), validator.GID(coredata.ProcessingActivityTIAEntityType))
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))
v.Check(req.LocalLawRisk, "local_law_risk", validator.SafeText(ContentMaxLength))
v.Check(req.SupplementaryMeasures, "supplementary_measures", validator.SafeText(ContentMaxLength))
return v.Error()
}
func (s ProcessingActivityTIAService) Get(
ctx context.Context,
tiaID gid.GID,
) (*coredata.ProcessingActivityTIA, error) {
tia := &coredata.ProcessingActivityTIA{}
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 nil
},
)
if err != nil {
return nil, err
}
return tia, nil
}
func (s ProcessingActivityTIAService) GetByProcessingActivityID(
ctx context.Context,
processingActivityID gid.GID,
) (*coredata.ProcessingActivityTIA, error) {
tia := &coredata.ProcessingActivityTIA{}
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 nil
},
)
if err != nil {
return nil, err
}
return tia, nil
}
func (s ProcessingActivityTIAService) ListForOrganizationID(
ctx context.Context,
organizationID gid.GID,
cursor *page.Cursor[coredata.ProcessingActivityTIAOrderField],
) (*page.Page[*coredata.ProcessingActivityTIA, coredata.ProcessingActivityTIAOrderField], error) {
var tias coredata.ProcessingActivityTIAs
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) error {
err := tias.LoadByOrganizationID(ctx, conn, s.svc.scope, organizationID, cursor)
if err != nil {
return fmt.Errorf("cannot load processing activity tias: %w", err)
}
return nil
},
)
if err != nil {
return nil, err
}
return page.NewPage(tias, cursor), nil
}
func (s ProcessingActivityTIAService) CountForOrganizationID(
ctx context.Context,
organizationID gid.GID,
) (int, error) {
var count int
err := s.svc.pg.WithConn(
ctx,
func(conn pg.Conn) (err error) {
tias := coredata.ProcessingActivityTIAs{}
count, err = tias.CountByOrganizationID(ctx, conn, s.svc.scope, organizationID)
return err
},
)
if err != nil {
return 0, err
}
return count, nil
}
func (s *ProcessingActivityTIAService) Create(
ctx context.Context,
req *CreateProcessingActivityTIARequest,
) (*coredata.ProcessingActivityTIA, 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),
ProcessingActivityID: req.ProcessingActivityID,
DataSubjects: req.DataSubjects,
LegalMechanism: req.LegalMechanism,
Transfer: req.Transfer,
LocalLawRisk: req.LocalLawRisk,
SupplementaryMeasures: req.SupplementaryMeasures,
CreatedAt: now,
UpdatedAt: now,
}
err := s.svc.pg.WithTx(
ctx,
func(conn pg.Conn) error {
processingActivity := &coredata.ProcessingActivity{}
if err := processingActivity.LoadByID(ctx, conn, s.svc.scope, req.ProcessingActivityID); err != nil {
return fmt.Errorf("cannot load processing activity: %w", err)
}
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 nil
},
)
if err != nil {
return nil, err
}
return tia, nil
}
func (s *ProcessingActivityTIAService) Update(
ctx context.Context,
req *UpdateProcessingActivityTIARequest,
) (*coredata.ProcessingActivityTIA, error) {
if err := req.Validate(); err != nil {
return nil, err
}
tia := &coredata.ProcessingActivityTIA{}
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)
}
if req.DataSubjects != nil {
tia.DataSubjects = *req.DataSubjects
}
if req.LegalMechanism != nil {
tia.LegalMechanism = *req.LegalMechanism
}
if req.Transfer != nil {
tia.Transfer = *req.Transfer
}
if req.LocalLawRisk != nil {
tia.LocalLawRisk = *req.LocalLawRisk
}
if req.SupplementaryMeasures != nil {
tia.SupplementaryMeasures = *req.SupplementaryMeasures
}
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 nil
},
)
if err != nil {
return nil, err
}
return tia, nil
}
func (s *ProcessingActivityTIAService) Delete(
ctx context.Context,
tiaID gid.GID,
) error {
err := s.svc.pg.WithTx(
ctx,
func(conn pg.Conn) error {
tia := &coredata.ProcessingActivityTIA{}
if err := tia.LoadByID(ctx, conn, s.svc.scope, tiaID); err != nil {
return fmt.Errorf("cannot load processing activity tia: %w", err)
}
if err := tia.Delete(ctx, conn, s.svc.scope); err != nil {
return fmt.Errorf("cannot delete processing activity tia: %w", err)
}
return nil
},
)
return err
}

View File

@@ -31,9 +31,9 @@ import (
"go.probo.inc/probo/pkg/crypto/cipher"
"go.probo.inc/probo/pkg/filemanager"
"go.probo.inc/probo/pkg/filevalidation"
"go.probo.inc/probo/pkg/mail"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/html2pdf"
"go.probo.inc/probo/pkg/mail"
"go.probo.inc/probo/pkg/slack"
)
@@ -114,6 +114,8 @@ type (
Snapshots *SnapshotService
ContinualImprovements *ContinualImprovementService
ProcessingActivities *ProcessingActivityService
ProcessingActivityDPIAs *ProcessingActivityDPIAService
ProcessingActivityTIAs *ProcessingActivityTIAService
Files *FileService
CustomDomains *CustomDomainService
SlackMessages *slack.SlackMessageService
@@ -249,6 +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.Files = &FileService{svc: tenantService}
tenantService.CustomDomains = &CustomDomainService{
svc: tenantService,

View File

@@ -366,6 +366,38 @@ enum ProcessingActivityTransferImpactAssessment
)
}
enum ProcessingActivityDPIAResidualRisk
@goModel(
model: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAResidualRisk"
) {
LOW
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAResidualRiskLow"
)
MEDIUM
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAResidualRiskMedium"
)
HIGH
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAResidualRiskHigh"
)
}
enum ProcessingActivityRole
@goModel(
model: "go.probo.inc/probo/pkg/coredata.ProcessingActivityRole"
) {
CONTROLLER
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityRoleController"
)
PROCESSOR
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityRoleProcessor"
)
}
# Order Field Enums
enum UserOrderField
@goModel(model: "go.probo.inc/probo/pkg/coredata.UserOrderField") {
@@ -1047,6 +1079,26 @@ enum ProcessingActivityOrderField
)
}
enum ProcessingActivityDPIAOrderField
@goModel(
model: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAOrderField"
) {
CREATED_AT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityDPIAOrderFieldCreatedAt"
)
}
enum ProcessingActivityTIAOrderField
@goModel(
model: "go.probo.inc/probo/pkg/coredata.ProcessingActivityTIAOrderField"
) {
CREATED_AT
@goEnum(
value: "go.probo.inc/probo/pkg/coredata.ProcessingActivityTIAOrderFieldCreatedAt"
)
}
enum TrustCenterAccessOrderField
@goModel(
model: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessOrderField"
@@ -1300,6 +1352,22 @@ input ProcessingActivityOrder
field: ProcessingActivityOrderField!
}
input ProcessingActivityDPIAOrder
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ProcessingActivityDPIAOrderBy"
) {
direction: OrderDirection!
field: ProcessingActivityDPIAOrderField!
}
input ProcessingActivityTIAOrder
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ProcessingActivityTIAOrderBy"
) {
direction: OrderDirection!
field: ProcessingActivityTIAOrderField!
}
input TrustCenterAccessOrder
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterAccessOrderBy"
@@ -1660,6 +1728,22 @@ type Organization implements Node {
filter: ProcessingActivityFilter = { snapshotId: null }
): ProcessingActivityConnection! @goField(forceResolver: true)
dataProtectionImpactAssessments(
first: Int
after: CursorKey
last: Int
before: CursorKey
orderBy: ProcessingActivityDPIAOrder
): ProcessingActivityDPIAConnection! @goField(forceResolver: true)
transferImpactAssessments(
first: Int
after: CursorKey
last: Int
before: CursorKey
orderBy: ProcessingActivityTIAOrder
): ProcessingActivityTIAConnection! @goField(forceResolver: true)
snapshots(
first: Int
after: CursorKey
@@ -2252,6 +2336,10 @@ type ProcessingActivity implements Node {
securityMeasures: String
dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment!
transferImpactAssessment: ProcessingActivityTransferImpactAssessment!
lastReviewDate: Datetime
nextReviewDate: Datetime
role: ProcessingActivityRole!
dataProtectionOfficer: People @goField(forceResolver: true)
vendors(
first: Int
after: CursorKey
@@ -2259,6 +2347,34 @@ type ProcessingActivity implements Node {
before: CursorKey
orderBy: VendorOrder
): VendorConnection! @goField(forceResolver: true)
dpia: ProcessingActivityDPIA @goField(forceResolver: true)
tia: ProcessingActivityTIA @goField(forceResolver: true)
createdAt: Datetime!
updatedAt: Datetime!
}
type ProcessingActivityDPIA implements Node {
id: ID!
processingActivity: ProcessingActivity! @goField(forceResolver: true)
organization: Organization! @goField(forceResolver: true)
description: String
necessityAndProportionality: String
potentialRisk: String
mitigations: String
residualRisk: ProcessingActivityDPIAResidualRisk
createdAt: Datetime!
updatedAt: Datetime!
}
type ProcessingActivityTIA implements Node {
id: ID!
processingActivity: ProcessingActivity! @goField(forceResolver: true)
organization: Organization! @goField(forceResolver: true)
dataSubjects: String
legalMechanism: String
transfer: String
localLawRisk: String
supplementaryMeasures: String
createdAt: Datetime!
updatedAt: Datetime!
}
@@ -2767,6 +2883,34 @@ type ProcessingActivityEdge {
node: ProcessingActivity!
}
type ProcessingActivityDPIAConnection
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ProcessingActivityDPIAConnection"
) {
totalCount: Int! @goField(forceResolver: true)
edges: [ProcessingActivityDPIAEdge!]!
pageInfo: PageInfo!
}
type ProcessingActivityDPIAEdge {
cursor: CursorKey!
node: ProcessingActivityDPIA!
}
type ProcessingActivityTIAConnection
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.ProcessingActivityTIAConnection"
) {
totalCount: Int! @goField(forceResolver: true)
edges: [ProcessingActivityTIAEdge!]!
pageInfo: PageInfo!
}
type ProcessingActivityTIAEdge {
cursor: CursorKey!
node: ProcessingActivityTIA!
}
type SnapshotConnection
@goModel(
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.SnapshotConnection"
@@ -3104,6 +3248,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!
# Snapshot mutations
createSnapshot(input: CreateSnapshotInput!): CreateSnapshotPayload!
deleteSnapshot(input: DeleteSnapshotInput!): DeleteSnapshotPayload!
@@ -3874,6 +4038,10 @@ input CreateProcessingActivityInput {
securityMeasures: String
dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment!
transferImpactAssessment: ProcessingActivityTransferImpactAssessment!
lastReviewDate: Datetime
nextReviewDate: Datetime
role: ProcessingActivityRole!
dataProtectionOfficerId: ID
vendorIds: [ID!]
}
@@ -3895,6 +4063,10 @@ input UpdateProcessingActivityInput {
securityMeasures: String @goField(omittable: true)
dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment
transferImpactAssessment: ProcessingActivityTransferImpactAssessment
lastReviewDate: Datetime @goField(omittable: true)
nextReviewDate: Datetime @goField(omittable: true)
role: ProcessingActivityRole
dataProtectionOfficerId: ID @goField(omittable: true)
vendorIds: [ID!]
}
@@ -3902,6 +4074,50 @@ input DeleteProcessingActivityInput {
processingActivityId: ID!
}
input CreateProcessingActivityDPIAInput {
processingActivityId: ID!
description: String
necessityAndProportionality: String
potentialRisk: String
mitigations: String
residualRisk: ProcessingActivityDPIAResidualRisk
}
input UpdateProcessingActivityDPIAInput {
id: ID!
description: String @goField(omittable: true)
necessityAndProportionality: String @goField(omittable: true)
potentialRisk: String @goField(omittable: true)
mitigations: String @goField(omittable: true)
residualRisk: ProcessingActivityDPIAResidualRisk
}
input DeleteProcessingActivityDPIAInput {
processingActivityDpiaId: ID!
}
input CreateProcessingActivityTIAInput {
processingActivityId: ID!
dataSubjects: String
legalMechanism: String
transfer: String
localLawRisk: String
supplementaryMeasures: String
}
input UpdateProcessingActivityTIAInput {
id: ID!
dataSubjects: String @goField(omittable: true)
legalMechanism: String @goField(omittable: true)
transfer: String @goField(omittable: true)
localLawRisk: String @goField(omittable: true)
supplementaryMeasures: String @goField(omittable: true)
}
input DeleteProcessingActivityTIAInput {
processingActivityTiaId: ID!
}
input CreateSnapshotInput {
organizationId: ID!
name: String!
@@ -4766,6 +4982,30 @@ type DeleteProcessingActivityPayload {
deletedProcessingActivityId: ID!
}
type CreateProcessingActivityDPIAPayload {
processingActivityDpia: ProcessingActivityDPIA!
}
type UpdateProcessingActivityDPIAPayload {
processingActivityDpia: ProcessingActivityDPIA!
}
type DeleteProcessingActivityDPIAPayload {
deletedProcessingActivityDpiaId: ID!
}
type CreateProcessingActivityTIAPayload {
processingActivityTia: ProcessingActivityTIA!
}
type UpdateProcessingActivityTIAPayload {
processingActivityTia: ProcessingActivityTIA!
}
type DeleteProcessingActivityTIAPayload {
deletedProcessingActivityTiaId: ID!
}
type CreateSnapshotPayload {
snapshotEdge: SnapshotEdge!
}

File diff suppressed because it is too large Load Diff

View File

@@ -75,6 +75,9 @@ func NewProcessingActivity(par *coredata.ProcessingActivity) *ProcessingActivity
SecurityMeasures: par.SecurityMeasures,
DataProtectionImpactAssessment: par.DataProtectionImpactAssessment,
TransferImpactAssessment: par.TransferImpactAssessment,
LastReviewDate: par.LastReviewDate,
NextReviewDate: par.NextReviewDate,
Role: par.Role,
CreatedAt: par.CreatedAt,
UpdatedAt: par.UpdatedAt,
}

View File

@@ -0,0 +1,73 @@
// 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 types
import (
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page"
)
type (
ProcessingActivityDPIAOrderBy OrderBy[coredata.ProcessingActivityDPIAOrderField]
ProcessingActivityDPIAConnection struct {
TotalCount int
Edges []*ProcessingActivityDPIAEdge
PageInfo PageInfo
Resolver any
ParentID gid.GID
}
)
func NewProcessingActivityDPIAConnection(
p *page.Page[*coredata.ProcessingActivityDPIA, coredata.ProcessingActivityDPIAOrderField],
parentType any,
parentID gid.GID,
) *ProcessingActivityDPIAConnection {
edges := make([]*ProcessingActivityDPIAEdge, len(p.Data))
for i, dpia := range p.Data {
edges[i] = NewProcessingActivityDPIAEdge(dpia, p.Cursor.OrderBy.Field)
}
return &ProcessingActivityDPIAConnection{
Edges: edges,
PageInfo: *NewPageInfo(p),
Resolver: parentType,
ParentID: parentID,
}
}
func NewProcessingActivityDPIAEdge(dpia *coredata.ProcessingActivityDPIA, orderField coredata.ProcessingActivityDPIAOrderField) *ProcessingActivityDPIAEdge {
return &ProcessingActivityDPIAEdge{
Node: NewProcessingActivityDpia(dpia),
Cursor: dpia.CursorKey(orderField),
}
}
func NewProcessingActivityDpia(dpia *coredata.ProcessingActivityDPIA) *ProcessingActivityDpia {
return &ProcessingActivityDpia{
ID: dpia.ID,
Description: dpia.Description,
NecessityAndProportionality: dpia.NecessityAndProportionality,
PotentialRisk: dpia.PotentialRisk,
Mitigations: dpia.Mitigations,
ResidualRisk: dpia.ResidualRisk,
CreatedAt: dpia.CreatedAt,
UpdatedAt: dpia.UpdatedAt,
}
}

View File

@@ -0,0 +1,73 @@
// 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 types
import (
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page"
)
type (
ProcessingActivityTIAOrderBy OrderBy[coredata.ProcessingActivityTIAOrderField]
ProcessingActivityTIAConnection struct {
TotalCount int
Edges []*ProcessingActivityTIAEdge
PageInfo PageInfo
Resolver any
ParentID gid.GID
}
)
func NewProcessingActivityTIAConnection(
p *page.Page[*coredata.ProcessingActivityTIA, coredata.ProcessingActivityTIAOrderField],
parentType any,
parentID gid.GID,
) *ProcessingActivityTIAConnection {
edges := make([]*ProcessingActivityTIAEdge, len(p.Data))
for i, tia := range p.Data {
edges[i] = NewProcessingActivityTIAEdge(tia, p.Cursor.OrderBy.Field)
}
return &ProcessingActivityTIAConnection{
Edges: edges,
PageInfo: *NewPageInfo(p),
Resolver: parentType,
ParentID: parentID,
}
}
func NewProcessingActivityTIAEdge(tia *coredata.ProcessingActivityTIA, orderField coredata.ProcessingActivityTIAOrderField) *ProcessingActivityTIAEdge {
return &ProcessingActivityTIAEdge{
Node: NewProcessingActivityTia(tia),
Cursor: tia.CursorKey(orderField),
}
}
func NewProcessingActivityTia(tia *coredata.ProcessingActivityTIA) *ProcessingActivityTia {
return &ProcessingActivityTia{
ID: tia.ID,
DataSubjects: tia.DataSubjects,
LegalMechanism: tia.LegalMechanism,
Transfer: tia.Transfer,
LocalLawRisk: tia.LocalLawRisk,
SupplementaryMeasures: tia.SupplementaryMeasures,
CreatedAt: tia.CreatedAt,
UpdatedAt: tia.UpdatedAt,
}
}

View File

@@ -432,6 +432,19 @@ 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"`
@@ -449,6 +462,10 @@ type CreateProcessingActivityInput struct {
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"`
}
@@ -456,6 +473,19 @@ 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"`
@@ -872,6 +902,14 @@ 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"`
}
@@ -880,6 +918,14 @@ 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"`
@@ -1426,41 +1472,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"`
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 *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"`
}
func (Organization) IsNode() {}
@@ -1538,7 +1586,13 @@ type ProcessingActivity struct {
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"`
}
@@ -1546,6 +1600,27 @@ type ProcessingActivity struct {
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 ProcessingActivityEdge struct {
Cursor page.CursorKey `json:"cursor"`
Node *ProcessingActivity `json:"node"`
@@ -1555,6 +1630,27 @@ 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 PublishDocumentVersionInput struct {
DocumentID gid.GID `json:"documentId"`
Changelog *string `json:"changelog,omitempty"`
@@ -2071,6 +2167,19 @@ 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"`
@@ -2088,6 +2197,10 @@ type UpdateProcessingActivityInput struct {
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"`
}
@@ -2095,6 +2208,19 @@ 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"`

View File

@@ -4227,6 +4227,10 @@ func (r *mutationResolver) CreateProcessingActivity(ctx context.Context, input t
SecurityMeasures: input.SecurityMeasures,
DataProtectionImpactAssessment: input.DataProtectionImpactAssessment,
TransferImpactAssessment: input.TransferImpactAssessment,
LastReviewDate: input.LastReviewDate,
NextReviewDate: input.NextReviewDate,
Role: input.Role,
DataProtectionOfficerID: input.DataProtectionOfficerID,
VendorIDs: input.VendorIds,
}
@@ -4262,6 +4266,10 @@ func (r *mutationResolver) UpdateProcessingActivity(ctx context.Context, input t
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,
}
@@ -4291,6 +4299,138 @@ 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)
prb := r.ProboService(ctx, input.ProcessingActivityID.TenantID())
req := probo.CreateProcessingActivityDPIARequest{
ProcessingActivityID: input.ProcessingActivityID,
Description: input.Description,
NecessityAndProportionality: input.NecessityAndProportionality,
PotentialRisk: input.PotentialRisk,
Mitigations: input.Mitigations,
ResidualRisk: input.ResidualRisk,
}
dpia, err := prb.ProcessingActivityDPIAs.Create(ctx, &req)
if err != nil {
panic(fmt.Errorf("cannot create processing activity dpia: %w", err))
}
return &types.CreateProcessingActivityDPIAPayload{
ProcessingActivityDpia: types.NewProcessingActivityDpia(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)
prb := r.ProboService(ctx, input.ID.TenantID())
req := probo.UpdateProcessingActivityDPIARequest{
ID: input.ID,
Description: UnwrapOmittable(input.Description),
NecessityAndProportionality: UnwrapOmittable(input.NecessityAndProportionality),
PotentialRisk: UnwrapOmittable(input.PotentialRisk),
Mitigations: UnwrapOmittable(input.Mitigations),
ResidualRisk: input.ResidualRisk,
}
dpia, err := prb.ProcessingActivityDPIAs.Update(ctx, &req)
if err != nil {
panic(fmt.Errorf("cannot update processing activity dpia: %w", err))
}
return &types.UpdateProcessingActivityDPIAPayload{
ProcessingActivityDpia: types.NewProcessingActivityDpia(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)
prb := r.ProboService(ctx, input.ProcessingActivityDpiaID.TenantID())
err := prb.ProcessingActivityDPIAs.Delete(ctx, input.ProcessingActivityDpiaID)
if err != nil {
panic(fmt.Errorf("cannot delete processing activity dpia: %w", err))
}
return &types.DeleteProcessingActivityDPIAPayload{
DeletedProcessingActivityDpiaID: input.ProcessingActivityDpiaID,
}, 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)
prb := r.ProboService(ctx, input.ProcessingActivityID.TenantID())
req := probo.CreateProcessingActivityTIARequest{
ProcessingActivityID: input.ProcessingActivityID,
DataSubjects: input.DataSubjects,
LegalMechanism: input.LegalMechanism,
Transfer: input.Transfer,
LocalLawRisk: input.LocalLawRisk,
SupplementaryMeasures: input.SupplementaryMeasures,
}
tia, err := prb.ProcessingActivityTIAs.Create(ctx, &req)
if err != nil {
panic(fmt.Errorf("cannot create processing activity tia: %w", err))
}
return &types.CreateProcessingActivityTIAPayload{
ProcessingActivityTia: types.NewProcessingActivityTia(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)
prb := r.ProboService(ctx, input.ID.TenantID())
req := probo.UpdateProcessingActivityTIARequest{
ID: input.ID,
DataSubjects: UnwrapOmittable(input.DataSubjects),
LegalMechanism: UnwrapOmittable(input.LegalMechanism),
Transfer: UnwrapOmittable(input.Transfer),
LocalLawRisk: UnwrapOmittable(input.LocalLawRisk),
SupplementaryMeasures: UnwrapOmittable(input.SupplementaryMeasures),
}
tia, err := prb.ProcessingActivityTIAs.Update(ctx, &req)
if err != nil {
panic(fmt.Errorf("cannot update processing activity tia: %w", err))
}
return &types.UpdateProcessingActivityTIAPayload{
ProcessingActivityTia: types.NewProcessingActivityTia(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)
prb := r.ProboService(ctx, input.ProcessingActivityTiaID.TenantID())
err := prb.ProcessingActivityTIAs.Delete(ctx, input.ProcessingActivityTiaID)
if err != nil {
panic(fmt.Errorf("cannot delete processing activity tia: %w", err))
}
return &types.DeleteProcessingActivityTIAPayload{
DeletedProcessingActivityTiaID: input.ProcessingActivityTiaID,
}, nil
}
// CreateSnapshot is the resolver for the createSnapshot field.
func (r *mutationResolver) CreateSnapshot(ctx context.Context, input types.CreateSnapshotInput) (*types.CreateSnapshotPayload, error) {
r.MustBeAuthorized(ctx, input.OrganizationID, authz.ActionCreateSnapshot)
@@ -5390,6 +5530,62 @@ func (r *organizationResolver) ProcessingActivities(ctx context.Context, obj *ty
return types.NewProcessingActivityConnection(page, r, obj.ID, filter), nil
}
// 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) (*types.ProcessingActivityDPIAConnection, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionListProcessingActivities)
prb := r.ProboService(ctx, obj.ID.TenantID())
pageOrderBy := page.OrderBy[coredata.ProcessingActivityDPIAOrderField]{
Field: coredata.ProcessingActivityDPIAOrderFieldCreatedAt,
Direction: page.OrderDirectionDesc,
}
if orderBy != nil {
pageOrderBy = page.OrderBy[coredata.ProcessingActivityDPIAOrderField]{
Field: orderBy.Field,
Direction: orderBy.Direction,
}
}
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
page, err := prb.ProcessingActivityDPIAs.ListForOrganizationID(ctx, obj.ID, cursor)
if err != nil {
panic(fmt.Errorf("cannot list organization data protection impact assessments: %w", err))
}
return types.NewProcessingActivityDPIAConnection(page, r, obj.ID), 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) (*types.ProcessingActivityTIAConnection, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionListProcessingActivities)
prb := r.ProboService(ctx, obj.ID.TenantID())
pageOrderBy := page.OrderBy[coredata.ProcessingActivityTIAOrderField]{
Field: coredata.ProcessingActivityTIAOrderFieldCreatedAt,
Direction: page.OrderDirectionDesc,
}
if orderBy != nil {
pageOrderBy = page.OrderBy[coredata.ProcessingActivityTIAOrderField]{
Field: orderBy.Field,
Direction: orderBy.Direction,
}
}
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
page, err := prb.ProcessingActivityTIAs.ListForOrganizationID(ctx, obj.ID, cursor)
if err != nil {
panic(fmt.Errorf("cannot list organization transfer impact assessments: %w", err))
}
return types.NewProcessingActivityTIAConnection(page, r, obj.ID), nil
}
// Snapshots is the resolver for the snapshots field.
func (r *organizationResolver) Snapshots(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.SnapshotOrderBy) (*types.SnapshotConnection, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionListSnapshots)
@@ -5541,6 +5737,29 @@ func (r *processingActivityResolver) Organization(ctx context.Context, obj *type
return types.NewOrganization(organization), nil
}
// DataProtectionOfficer is the resolver for the dataProtectionOfficer field.
func (r *processingActivityResolver) DataProtectionOfficer(ctx context.Context, obj *types.ProcessingActivity) (*types.People, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetDataProtectionOfficer)
prb := r.ProboService(ctx, obj.ID.TenantID())
processingActivity, err := prb.ProcessingActivities.Get(ctx, obj.ID)
if err != nil {
panic(fmt.Errorf("cannot get processing activity: %w", err))
}
if processingActivity.DataProtectionOfficerID == nil {
return nil, nil
}
people, err := prb.Peoples.Get(ctx, *processingActivity.DataProtectionOfficerID)
if err != nil {
panic(fmt.Errorf("cannot get data protection officer: %w", err))
}
return types.NewPeople(people), nil
}
// Vendors is the resolver for the vendors field.
func (r *processingActivityResolver) Vendors(ctx context.Context, obj *types.ProcessingActivity, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.VendorOrderBy) (*types.VendorConnection, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionListVendors)
@@ -5568,6 +5787,42 @@ 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)
prb := r.ProboService(ctx, obj.ID.TenantID())
dpia, err := prb.ProcessingActivityDPIAs.GetByProcessingActivityID(ctx, obj.ID)
if err != nil {
var errNotFound *coredata.ErrProcessingActivityDPIANotFound
if errors.As(err, &errNotFound) {
return nil, nil
}
panic(fmt.Errorf("cannot get processing activity dpia: %w", err))
}
return types.NewProcessingActivityDpia(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)
prb := r.ProboService(ctx, obj.ID.TenantID())
tia, err := prb.ProcessingActivityTIAs.GetByProcessingActivityID(ctx, obj.ID)
if err != nil {
var errNotFound *coredata.ErrProcessingActivityTIANotFound
if errors.As(err, &errNotFound) {
return nil, nil
}
panic(fmt.Errorf("cannot get processing activity tia: %w", err))
}
return types.NewProcessingActivityTia(tia), nil
}
// TotalCount is the resolver for the totalCount field.
func (r *processingActivityConnectionResolver) TotalCount(ctx context.Context, obj *types.ProcessingActivityConnection) (int, error) {
r.MustBeAuthorized(ctx, obj.ParentID, authz.ActionTotalCount)
@@ -5591,6 +5846,126 @@ 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)
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)
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)
@@ -5797,6 +6172,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)
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)
if err != nil {
panic(fmt.Errorf("cannot get processing activity tia: %w", err))
}
return types.NewProcessingActivityTia(tia), nil
case coredata.SnapshotEntityType:
snapshot, err := prb.Snapshots.Get(ctx, id)
if err != nil {
@@ -7396,6 +7785,26 @@ 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} }
@@ -7546,6 +7955,10 @@ 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 }