@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<e5b5af0abe1d8af6f97da741084f1b16>>
|
||||
* @generated SignedSource<<c2504ebd6a90f696d2068c03294d0c53>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,7 +9,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type SnapshotsType = "ASSETS" | "COMPLIANCE_REGISTRIES" | "CONTINUAL_IMPROVEMENT_REGISTRIES" | "DATA" | "NONCONFORMITY_REGISTRIES" | "PROCESSING_ACTIVITY_REGISTRIES" | "RISKS" | "VENDORS";
|
||||
export type SnapshotsType = "ASSETS" | "CONTINUAL_IMPROVEMENTS" | "DATA" | "NONCONFORMITIES" | "OBLIGATIONS" | "PROCESSING_ACTIVITIES" | "RISKS" | "VENDORS";
|
||||
export type SnapshotBannerQuery$variables = {
|
||||
snapshotId: string;
|
||||
};
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { Option } from "@probo/ui";
|
||||
import type {
|
||||
ProcessingActivityRegistrySpecialOrCriminalData,
|
||||
ProcessingActivityRegistryLawfulBasis,
|
||||
ProcessingActivityRegistryDataProtectionImpactAssessment,
|
||||
ProcessingActivityRegistryTransferImpactAssessment,
|
||||
} from "../../hooks/graph/__generated__/ProcessingActivityRegistryGraphCreateMutation.graphql";
|
||||
ProcessingActivitySpecialOrCriminalData,
|
||||
ProcessingActivityLawfulBasis,
|
||||
ProcessingActivityDataProtectionImpactAssessment,
|
||||
ProcessingActivityTransferImpactAssessment,
|
||||
} from "../../hooks/graph/__generated__/ProcessingActivityGraphCreateMutation.graphql";
|
||||
|
||||
export function SpecialOrCriminalDataOptions() {
|
||||
const { __ } = useTranslate();
|
||||
|
||||
const options: Array<{
|
||||
value: ProcessingActivityRegistrySpecialOrCriminalData;
|
||||
value: ProcessingActivitySpecialOrCriminalData;
|
||||
label: string;
|
||||
}> = [
|
||||
{ value: "YES", label: __("Yes") },
|
||||
@@ -34,7 +34,7 @@ export function LawfulBasisOptions() {
|
||||
const { __ } = useTranslate();
|
||||
|
||||
const options: Array<{
|
||||
value: ProcessingActivityRegistryLawfulBasis;
|
||||
value: ProcessingActivityLawfulBasis;
|
||||
label: string;
|
||||
}> = [
|
||||
{ value: "CONSENT", label: __("Consent") },
|
||||
@@ -56,7 +56,7 @@ export function LawfulBasisOptions() {
|
||||
);
|
||||
}
|
||||
|
||||
export function getLawfulBasisLabel(value: ProcessingActivityRegistryLawfulBasis | null | undefined, __: (key: string) => string): string {
|
||||
export function getLawfulBasisLabel(value: ProcessingActivityLawfulBasis | null | undefined, __: (key: string) => string): string {
|
||||
if (!value) return "-";
|
||||
|
||||
const labels = {
|
||||
@@ -102,7 +102,7 @@ export function DataProtectionImpactAssessmentOptions() {
|
||||
const { __ } = useTranslate();
|
||||
|
||||
const options: Array<{
|
||||
value: ProcessingActivityRegistryDataProtectionImpactAssessment;
|
||||
value: ProcessingActivityDataProtectionImpactAssessment;
|
||||
label: string;
|
||||
}> = [
|
||||
{ value: "NEEDED", label: __("Needed") },
|
||||
@@ -124,7 +124,7 @@ export function TransferImpactAssessmentOptions() {
|
||||
const { __ } = useTranslate();
|
||||
|
||||
const options: Array<{
|
||||
value: ProcessingActivityRegistryTransferImpactAssessment;
|
||||
value: ProcessingActivityTransferImpactAssessment;
|
||||
label: string;
|
||||
}> = [
|
||||
{ value: "NEEDED", label: __("Needed") },
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<449a3fe1cc57900bccd7085aa6c4eae8>>
|
||||
* @generated SignedSource<<0b0392559fe2c7b5b92bec1b1131f9c6>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,7 +9,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type SnapshotsType = "ASSETS" | "COMPLIANCE_REGISTRIES" | "CONTINUAL_IMPROVEMENT_REGISTRIES" | "DATA" | "NONCONFORMITY_REGISTRIES" | "PROCESSING_ACTIVITY_REGISTRIES" | "RISKS" | "VENDORS";
|
||||
export type SnapshotsType = "ASSETS" | "CONTINUAL_IMPROVEMENTS" | "DATA" | "NONCONFORMITIES" | "OBLIGATIONS" | "PROCESSING_ACTIVITIES" | "RISKS" | "VENDORS";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type LinkedSnapshotsCardFragment$data = {
|
||||
readonly createdAt: any;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<aaed837d3d9cdc303e3096ea7a467bd9>>
|
||||
* @generated SignedSource<<21edb2424074940efad82c63929642c8>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,7 +9,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type SnapshotsType = "ASSETS" | "COMPLIANCE_REGISTRIES" | "CONTINUAL_IMPROVEMENT_REGISTRIES" | "DATA" | "NONCONFORMITY_REGISTRIES" | "PROCESSING_ACTIVITY_REGISTRIES" | "RISKS" | "VENDORS";
|
||||
export type SnapshotsType = "ASSETS" | "CONTINUAL_IMPROVEMENTS" | "DATA" | "NONCONFORMITIES" | "OBLIGATIONS" | "PROCESSING_ACTIVITIES" | "RISKS" | "VENDORS";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type LinkedSnapshotsDialogFragment$data = {
|
||||
readonly id: string;
|
||||
|
||||
@@ -5,22 +5,22 @@ import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
export const ContinualImprovementRegistriesConnectionKey = "ContinualImprovementRegistriesPage_continualImprovementRegistries";
|
||||
export const ContinualImprovementsConnectionKey = "ContinualImprovementsPage_continualImprovements";
|
||||
|
||||
export const continualImprovementRegistriesQuery = graphql`
|
||||
query ContinualImprovementRegistryGraphListQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
export const continualImprovementsQuery = graphql`
|
||||
query ContinualImprovementGraphListQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
node(id: $organizationId) {
|
||||
... on Organization {
|
||||
...ContinualImprovementRegistriesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
...ContinualImprovementsPageFragment @arguments(snapshotId: $snapshotId)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const continualImprovementRegistryNodeQuery = graphql`
|
||||
query ContinualImprovementRegistryGraphNodeQuery($continualImprovementRegistryId: ID!) {
|
||||
node(id: $continualImprovementRegistryId) {
|
||||
... on ContinualImprovementRegistry {
|
||||
export const continualImprovementNodeQuery = graphql`
|
||||
query ContinualImprovementGraphNodeQuery($continualImprovementId: ID!) {
|
||||
node(id: $continualImprovementId) {
|
||||
... on ContinualImprovement {
|
||||
id
|
||||
snapshotId
|
||||
sourceId
|
||||
@@ -45,13 +45,13 @@ export const continualImprovementRegistryNodeQuery = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const createContinualImprovementRegistryMutation = graphql`
|
||||
mutation ContinualImprovementRegistryGraphCreateMutation(
|
||||
$input: CreateContinualImprovementRegistryInput!
|
||||
export const createContinualImprovementMutation = graphql`
|
||||
mutation ContinualImprovementGraphCreateMutation(
|
||||
$input: CreateContinualImprovementInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
createContinualImprovementRegistry(input: $input) {
|
||||
continualImprovementRegistryEdge @prependEdge(connections: $connections) {
|
||||
createContinualImprovement(input: $input) {
|
||||
continualImprovementEdge @prependEdge(connections: $connections) {
|
||||
node {
|
||||
id
|
||||
referenceId
|
||||
@@ -71,10 +71,10 @@ export const createContinualImprovementRegistryMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const updateContinualImprovementRegistryMutation = graphql`
|
||||
mutation ContinualImprovementRegistryGraphUpdateMutation($input: UpdateContinualImprovementRegistryInput!) {
|
||||
updateContinualImprovementRegistry(input: $input) {
|
||||
continualImprovementRegistry {
|
||||
export const updateContinualImprovementMutation = graphql`
|
||||
mutation ContinualImprovementGraphUpdateMutation($input: UpdateContinualImprovementInput!) {
|
||||
updateContinualImprovement(input: $input) {
|
||||
continualImprovement {
|
||||
id
|
||||
referenceId
|
||||
description
|
||||
@@ -92,25 +92,25 @@ export const updateContinualImprovementRegistryMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const deleteContinualImprovementRegistryMutation = graphql`
|
||||
mutation ContinualImprovementRegistryGraphDeleteMutation(
|
||||
$input: DeleteContinualImprovementRegistryInput!
|
||||
export const deleteContinualImprovementMutation = graphql`
|
||||
mutation ContinualImprovementGraphDeleteMutation(
|
||||
$input: DeleteContinualImprovementInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteContinualImprovementRegistry(input: $input) {
|
||||
deletedContinualImprovementRegistryId @deleteEdge(connections: $connections)
|
||||
deleteContinualImprovement(input: $input) {
|
||||
deletedContinualImprovementId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const useDeleteContinualImprovementRegistry = (
|
||||
registry: { id: string; referenceId: string },
|
||||
export const useDeleteContinualImprovement = (
|
||||
improvement: { id: string; referenceId: string },
|
||||
connectionId: string
|
||||
) => {
|
||||
const { __ } = useTranslate();
|
||||
const [mutate] = useMutationWithToasts(deleteContinualImprovementRegistryMutation, {
|
||||
successMessage: __("Continual improvement registry entry deleted successfully"),
|
||||
errorMessage: __("Failed to delete continual improvement registry entry"),
|
||||
const [mutate] = useMutationWithToasts(deleteContinualImprovementMutation, {
|
||||
successMessage: __("Continual improvement deleted successfully"),
|
||||
errorMessage: __("Failed to delete continual improvement"),
|
||||
});
|
||||
const confirm = useConfirm();
|
||||
|
||||
@@ -120,7 +120,7 @@ export const useDeleteContinualImprovementRegistry = (
|
||||
mutate({
|
||||
variables: {
|
||||
input: {
|
||||
continualImprovementRegistryId: registry.id,
|
||||
continualImprovementId: improvement.id,
|
||||
},
|
||||
connections: [connectionId],
|
||||
},
|
||||
@@ -128,17 +128,17 @@ export const useDeleteContinualImprovementRegistry = (
|
||||
{
|
||||
message: sprintf(
|
||||
__(
|
||||
"This will permanently delete the continual improvement registry entry %s. This action cannot be undone."
|
||||
"This will permanently delete the continual improvement %s. This action cannot be undone."
|
||||
),
|
||||
registry.referenceId
|
||||
improvement.referenceId
|
||||
),
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
export const useCreateContinualImprovementRegistry = (connectionId: string) => {
|
||||
const [mutate] = useMutation(createContinualImprovementRegistryMutation);
|
||||
export const useCreateContinualImprovement = (connectionId: string) => {
|
||||
const [mutate] = useMutation(createContinualImprovementMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -152,13 +152,13 @@ export const useCreateContinualImprovementRegistry = (connectionId: string) => {
|
||||
priority: string;
|
||||
}) => {
|
||||
if (!input.organizationId) {
|
||||
return alert(__("Failed to create continual improvement registry entry: organization is required"));
|
||||
return alert(__("Failed to create continual improvement: organization is required"));
|
||||
}
|
||||
if (!input.referenceId) {
|
||||
return alert(__("Failed to create continual improvement registry entry: reference ID is required"));
|
||||
return alert(__("Failed to create continual improvement: reference ID is required"));
|
||||
}
|
||||
if (!input.ownerId) {
|
||||
return alert(__("Failed to create continual improvement registry entry: owner is required"));
|
||||
return alert(__("Failed to create continual improvement: owner is required"));
|
||||
}
|
||||
|
||||
return promisifyMutation(mutate)({
|
||||
@@ -179,8 +179,8 @@ export const useCreateContinualImprovementRegistry = (connectionId: string) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const useUpdateContinualImprovementRegistry = () => {
|
||||
const [mutate] = useMutation(updateContinualImprovementRegistryMutation);
|
||||
export const useUpdateContinualImprovement = () => {
|
||||
const [mutate] = useMutation(updateContinualImprovementMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -194,7 +194,7 @@ export const useUpdateContinualImprovementRegistry = () => {
|
||||
priority?: string;
|
||||
}) => {
|
||||
if (!input.id) {
|
||||
return alert(__("Failed to update continual improvement registry entry: registry ID is required"));
|
||||
return alert(__("Failed to update continual improvement: ID is required"));
|
||||
}
|
||||
|
||||
return promisifyMutation(mutate)({
|
||||
@@ -5,22 +5,22 @@ import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
export const RegistriesConnectionKey = "RegistriesPage_nonconformityRegistries";
|
||||
export const NonconformitiesConnectionKey = "NonconformitiesPage_nonconformities";
|
||||
|
||||
export const nonconformityRegistriesQuery = graphql`
|
||||
query NonconformityRegistryGraphListQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
export const nonconformitiesQuery = graphql`
|
||||
query NonconformityGraphListQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
node(id: $organizationId) {
|
||||
... on Organization {
|
||||
...NonconformityRegistriesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
...NonconformitiesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const nonconformityRegistryNodeQuery = graphql`
|
||||
query NonconformityRegistryGraphNodeQuery($nonconformityRegistryId: ID!) {
|
||||
node(id: $nonconformityRegistryId) {
|
||||
... on NonconformityRegistry {
|
||||
export const nonconformityNodeQuery = graphql`
|
||||
query NonconformityGraphNodeQuery($nonconformityId: ID!) {
|
||||
node(id: $nonconformityId) {
|
||||
... on Nonconformity {
|
||||
id
|
||||
snapshotId
|
||||
referenceId
|
||||
@@ -53,13 +53,13 @@ export const nonconformityRegistryNodeQuery = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const createNonconformityRegistryMutation = graphql`
|
||||
mutation NonconformityRegistryGraphCreateMutation(
|
||||
$input: CreateNonconformityRegistryInput!
|
||||
export const createNonconformityMutation = graphql`
|
||||
mutation NonconformityGraphCreateMutation(
|
||||
$input: CreateNonconformityInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
createNonconformityRegistry(input: $input) {
|
||||
nonconformityRegistryEdge @prependEdge(connections: $connections) {
|
||||
createNonconformity(input: $input) {
|
||||
nonconformityEdge @prependEdge(connections: $connections) {
|
||||
node {
|
||||
id
|
||||
referenceId
|
||||
@@ -85,10 +85,10 @@ export const createNonconformityRegistryMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const updateNonconformityRegistryMutation = graphql`
|
||||
mutation NonconformityRegistryGraphUpdateMutation($input: UpdateNonconformityRegistryInput!) {
|
||||
updateNonconformityRegistry(input: $input) {
|
||||
nonconformityRegistry {
|
||||
export const updateNonconformityMutation = graphql`
|
||||
mutation NonconformityGraphUpdateMutation($input: UpdateNonconformityInput!) {
|
||||
updateNonconformity(input: $input) {
|
||||
nonconformity {
|
||||
id
|
||||
referenceId
|
||||
description
|
||||
@@ -115,25 +115,25 @@ export const updateNonconformityRegistryMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const deleteNonconformityRegistryMutation = graphql`
|
||||
mutation NonconformityRegistryGraphDeleteMutation(
|
||||
$input: DeleteNonconformityRegistryInput!
|
||||
export const deleteNonconformityMutation = graphql`
|
||||
mutation NonconformityGraphDeleteMutation(
|
||||
$input: DeleteNonconformityInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteNonconformityRegistry(input: $input) {
|
||||
deletedNonconformityRegistryId @deleteEdge(connections: $connections)
|
||||
deleteNonconformity(input: $input) {
|
||||
deletedNonconformityId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const useDeleteNonconformityRegistry = (
|
||||
registry: { id: string; referenceId: string },
|
||||
export const useDeleteNonconformity = (
|
||||
nonconformity: { id: string; referenceId: string },
|
||||
connectionId: string
|
||||
) => {
|
||||
const { __ } = useTranslate();
|
||||
const [mutate] = useMutationWithToasts(deleteNonconformityRegistryMutation, {
|
||||
successMessage: __("Non conformity registry entry deleted successfully"),
|
||||
errorMessage: __("Failed to delete non conformity registry entry"),
|
||||
const [mutate] = useMutationWithToasts(deleteNonconformityMutation, {
|
||||
successMessage: __("Nonconformity deleted successfully"),
|
||||
errorMessage: __("Failed to delete nonconformity"),
|
||||
});
|
||||
const confirm = useConfirm();
|
||||
|
||||
@@ -143,7 +143,7 @@ export const useDeleteNonconformityRegistry = (
|
||||
mutate({
|
||||
variables: {
|
||||
input: {
|
||||
nonconformityRegistryId: registry.id,
|
||||
nonconformityId: nonconformity.id,
|
||||
},
|
||||
connections: [connectionId],
|
||||
},
|
||||
@@ -151,17 +151,17 @@ export const useDeleteNonconformityRegistry = (
|
||||
{
|
||||
message: sprintf(
|
||||
__(
|
||||
"This will permanently delete the non conformity registry entry %s. This action cannot be undone."
|
||||
"This will permanently delete the nonconformity %s. This action cannot be undone."
|
||||
),
|
||||
registry.referenceId
|
||||
nonconformity.referenceId
|
||||
),
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
export const useCreateNonconformityRegistry = (connectionId: string) => {
|
||||
const [mutate] = useMutation(createNonconformityRegistryMutation);
|
||||
export const useCreateNonconformity = (connectionId: string) => {
|
||||
const [mutate] = useMutation(createNonconformityMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -178,19 +178,19 @@ export const useCreateNonconformityRegistry = (connectionId: string) => {
|
||||
effectivenessCheck?: string;
|
||||
}) => {
|
||||
if (!input.organizationId) {
|
||||
return alert(__("Failed to create non conformity registry entry: organization is required"));
|
||||
return alert(__("Failed to create nonconformity: organization is required"));
|
||||
}
|
||||
if (!input.referenceId) {
|
||||
return alert(__("Failed to create non conformity registry entry: reference ID is required"));
|
||||
return alert(__("Failed to create nonconformity: reference ID is required"));
|
||||
}
|
||||
if (!input.auditId) {
|
||||
return alert(__("Failed to create non conformity registry entry: audit is required"));
|
||||
return alert(__("Failed to create nonconformity: audit is required"));
|
||||
}
|
||||
if (!input.ownerId) {
|
||||
return alert(__("Failed to create non conformity registry entry: owner is required"));
|
||||
return alert(__("Failed to create nonconformity: owner is required"));
|
||||
}
|
||||
if (!input.rootCause) {
|
||||
return alert(__("Failed to create non conformity registry entry: root cause is required"));
|
||||
return alert(__("Failed to create nonconformity: root cause is required"));
|
||||
}
|
||||
|
||||
return promisifyMutation(mutate)({
|
||||
@@ -214,8 +214,8 @@ export const useCreateNonconformityRegistry = (connectionId: string) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const useUpdateNonconformityRegistry = () => {
|
||||
const [mutate] = useMutation(updateNonconformityRegistryMutation);
|
||||
export const useUpdateNonconformity = () => {
|
||||
const [mutate] = useMutation(updateNonconformityMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -232,7 +232,7 @@ export const useUpdateNonconformityRegistry = () => {
|
||||
effectivenessCheck?: string;
|
||||
}) => {
|
||||
if (!input.id) {
|
||||
return alert(__("Failed to update non conformity registry entry: registry ID is required"));
|
||||
return alert(__("Failed to update nonconformity: ID is required"));
|
||||
}
|
||||
|
||||
return promisifyMutation(mutate)({
|
||||
@@ -5,22 +5,22 @@ import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
export const ComplianceRegistriesConnectionKey = "ComplianceRegistriesPage_complianceRegistries";
|
||||
export const ObligationsConnectionKey = "ObligationsPage_obligations";
|
||||
|
||||
export const complianceRegistriesQuery = graphql`
|
||||
query ComplianceRegistryGraphListQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
export const obligationsQuery = graphql`
|
||||
query ObligationGraphListQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
node(id: $organizationId) {
|
||||
... on Organization {
|
||||
...ComplianceRegistriesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
...ObligationsPageFragment @arguments(snapshotId: $snapshotId)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const complianceRegistryNodeQuery = graphql`
|
||||
query ComplianceRegistryGraphNodeQuery($complianceRegistryId: ID!) {
|
||||
node(id: $complianceRegistryId) {
|
||||
... on ComplianceRegistry {
|
||||
export const obligationNodeQuery = graphql`
|
||||
query ObligationGraphNodeQuery($obligationId: ID!) {
|
||||
node(id: $obligationId) {
|
||||
... on Obligation {
|
||||
id
|
||||
snapshotId
|
||||
sourceId
|
||||
@@ -48,13 +48,13 @@ export const complianceRegistryNodeQuery = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const createComplianceRegistryMutation = graphql`
|
||||
mutation ComplianceRegistryGraphCreateMutation(
|
||||
$input: CreateComplianceRegistryInput!
|
||||
export const createObligationMutation = graphql`
|
||||
mutation ObligationGraphCreateMutation(
|
||||
$input: CreateObligationInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
createComplianceRegistry(input: $input) {
|
||||
complianceRegistryEdge @prependEdge(connections: $connections) {
|
||||
createObligation(input: $input) {
|
||||
obligationEdge @prependEdge(connections: $connections) {
|
||||
node {
|
||||
id
|
||||
referenceId
|
||||
@@ -77,10 +77,10 @@ export const createComplianceRegistryMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const updateComplianceRegistryMutation = graphql`
|
||||
mutation ComplianceRegistryGraphUpdateMutation($input: UpdateComplianceRegistryInput!) {
|
||||
updateComplianceRegistry(input: $input) {
|
||||
complianceRegistry {
|
||||
export const updateObligationMutation = graphql`
|
||||
mutation ObligationGraphUpdateMutation($input: UpdateObligationInput!) {
|
||||
updateObligation(input: $input) {
|
||||
obligation {
|
||||
id
|
||||
referenceId
|
||||
area
|
||||
@@ -101,25 +101,25 @@ export const updateComplianceRegistryMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const deleteComplianceRegistryMutation = graphql`
|
||||
mutation ComplianceRegistryGraphDeleteMutation(
|
||||
$input: DeleteComplianceRegistryInput!
|
||||
export const deleteObligationMutation = graphql`
|
||||
mutation ObligationGraphDeleteMutation(
|
||||
$input: DeleteObligationInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteComplianceRegistry(input: $input) {
|
||||
deletedComplianceRegistryId @deleteEdge(connections: $connections)
|
||||
deleteObligation(input: $input) {
|
||||
deletedObligationId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const useDeleteComplianceRegistry = (
|
||||
registry: { id: string; referenceId: string },
|
||||
export const useDeleteObligation = (
|
||||
obligation: { id: string; referenceId: string },
|
||||
connectionId: string
|
||||
) => {
|
||||
const { __ } = useTranslate();
|
||||
const [mutate] = useMutationWithToasts(deleteComplianceRegistryMutation, {
|
||||
successMessage: __("Compliance registry entry deleted successfully"),
|
||||
errorMessage: __("Failed to delete compliance registry entry"),
|
||||
const [mutate] = useMutationWithToasts(deleteObligationMutation, {
|
||||
successMessage: __("Obligation deleted successfully"),
|
||||
errorMessage: __("Failed to delete obligation"),
|
||||
});
|
||||
const confirm = useConfirm();
|
||||
|
||||
@@ -129,7 +129,7 @@ export const useDeleteComplianceRegistry = (
|
||||
mutate({
|
||||
variables: {
|
||||
input: {
|
||||
complianceRegistryId: registry.id,
|
||||
obligationId: obligation.id,
|
||||
},
|
||||
connections: [connectionId],
|
||||
},
|
||||
@@ -137,17 +137,17 @@ export const useDeleteComplianceRegistry = (
|
||||
{
|
||||
message: sprintf(
|
||||
__(
|
||||
"This will permanently delete the compliance registry entry %s. This action cannot be undone."
|
||||
"This will permanently delete the obligation %s. This action cannot be undone."
|
||||
),
|
||||
registry.referenceId
|
||||
obligation.referenceId
|
||||
),
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
export const useCreateComplianceRegistry = (connectionId: string) => {
|
||||
const [mutate] = useMutation(createComplianceRegistryMutation);
|
||||
export const useCreateObligation = (connectionId: string) => {
|
||||
const [mutate] = useMutation(createObligationMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -164,13 +164,13 @@ export const useCreateComplianceRegistry = (connectionId: string) => {
|
||||
status: string;
|
||||
}) => {
|
||||
if (!input.organizationId) {
|
||||
return alert(__("Failed to create compliance registry entry: organization is required"));
|
||||
return alert(__("Failed to create obligation: organization is required"));
|
||||
}
|
||||
if (!input.referenceId) {
|
||||
return alert(__("Failed to create compliance registry entry: reference ID is required"));
|
||||
return alert(__("Failed to create obligation: reference ID is required"));
|
||||
}
|
||||
if (!input.ownerId) {
|
||||
return alert(__("Failed to create compliance registry entry: owner is required"));
|
||||
return alert(__("Failed to create obligation: owner is required"));
|
||||
}
|
||||
|
||||
return promisifyMutation(mutate)({
|
||||
@@ -194,8 +194,8 @@ export const useCreateComplianceRegistry = (connectionId: string) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const useUpdateComplianceRegistry = () => {
|
||||
const [mutate] = useMutation(updateComplianceRegistryMutation);
|
||||
export const useUpdateObligation = () => {
|
||||
const [mutate] = useMutation(updateObligationMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -212,7 +212,7 @@ export const useUpdateComplianceRegistry = () => {
|
||||
status?: string;
|
||||
}) => {
|
||||
if (!input.id) {
|
||||
return alert(__("Failed to update compliance registry entry: registry ID is required"));
|
||||
return alert(__("Failed to update obligation: ID is required"));
|
||||
}
|
||||
|
||||
return promisifyMutation(mutate)({
|
||||
@@ -5,22 +5,22 @@ import { useTranslate } from "@probo/i18n";
|
||||
import { promisifyMutation, sprintf } from "@probo/helpers";
|
||||
import { useMutationWithToasts } from "../useMutationWithToasts";
|
||||
|
||||
export const ProcessingActivityRegistriesConnectionKey = "ProcessingActivityRegistriesPage_processingActivityRegistries";
|
||||
export const ProcessingActivitiesConnectionKey = "ProcessingActivitiesPage_processingActivities";
|
||||
|
||||
export const processingActivityRegistriesQuery = graphql`
|
||||
query ProcessingActivityRegistryGraphListQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
export const processingActivitiesQuery = graphql`
|
||||
query ProcessingActivityGraphListQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
node(id: $organizationId) {
|
||||
... on Organization {
|
||||
...ProcessingActivityRegistriesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
...ProcessingActivitiesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const processingActivityRegistryNodeQuery = graphql`
|
||||
query ProcessingActivityRegistryGraphNodeQuery($processingActivityRegistryId: ID!) {
|
||||
node(id: $processingActivityRegistryId) {
|
||||
... on ProcessingActivityRegistry {
|
||||
export const processingActivityNodeQuery = graphql`
|
||||
query ProcessingActivityGraphNodeQuery($processingActivityId: ID!) {
|
||||
node(id: $processingActivityId) {
|
||||
... on ProcessingActivity {
|
||||
id
|
||||
snapshotId
|
||||
name
|
||||
@@ -49,13 +49,13 @@ export const processingActivityRegistryNodeQuery = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const createProcessingActivityRegistryMutation = graphql`
|
||||
mutation ProcessingActivityRegistryGraphCreateMutation(
|
||||
$input: CreateProcessingActivityRegistryInput!
|
||||
export const createProcessingActivityMutation = graphql`
|
||||
mutation ProcessingActivityGraphCreateMutation(
|
||||
$input: CreateProcessingActivityInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
createProcessingActivityRegistry(input: $input) {
|
||||
processingActivityRegistryEdge @prependEdge(connections: $connections) {
|
||||
createProcessingActivity(input: $input) {
|
||||
processingActivityEdge @prependEdge(connections: $connections) {
|
||||
node {
|
||||
id
|
||||
name
|
||||
@@ -80,10 +80,10 @@ export const createProcessingActivityRegistryMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const updateProcessingActivityRegistryMutation = graphql`
|
||||
mutation ProcessingActivityRegistryGraphUpdateMutation($input: UpdateProcessingActivityRegistryInput!) {
|
||||
updateProcessingActivityRegistry(input: $input) {
|
||||
processingActivityRegistry {
|
||||
export const updateProcessingActivityMutation = graphql`
|
||||
mutation ProcessingActivityGraphUpdateMutation($input: UpdateProcessingActivityInput!) {
|
||||
updateProcessingActivity(input: $input) {
|
||||
processingActivity {
|
||||
id
|
||||
name
|
||||
purpose
|
||||
@@ -106,25 +106,25 @@ export const updateProcessingActivityRegistryMutation = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export const deleteProcessingActivityRegistryMutation = graphql`
|
||||
mutation ProcessingActivityRegistryGraphDeleteMutation(
|
||||
$input: DeleteProcessingActivityRegistryInput!
|
||||
export const deleteProcessingActivityMutation = graphql`
|
||||
mutation ProcessingActivityGraphDeleteMutation(
|
||||
$input: DeleteProcessingActivityInput!
|
||||
$connections: [ID!]!
|
||||
) {
|
||||
deleteProcessingActivityRegistry(input: $input) {
|
||||
deletedProcessingActivityRegistryId @deleteEdge(connections: $connections)
|
||||
deleteProcessingActivity(input: $input) {
|
||||
deletedProcessingActivityId @deleteEdge(connections: $connections)
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const useDeleteProcessingActivityRegistry = (
|
||||
registry: { id: string; name: string },
|
||||
export const useDeleteProcessingActivity = (
|
||||
processingActivity: { id: string; name: string },
|
||||
connectionId: string
|
||||
) => {
|
||||
const { __ } = useTranslate();
|
||||
const [mutate] = useMutationWithToasts(deleteProcessingActivityRegistryMutation, {
|
||||
successMessage: __("Processing activity registry entry deleted successfully"),
|
||||
errorMessage: __("Failed to delete processing activity registry entry"),
|
||||
const [mutate] = useMutationWithToasts(deleteProcessingActivityMutation, {
|
||||
successMessage: __("Processing activity deleted successfully"),
|
||||
errorMessage: __("Failed to delete processing activity"),
|
||||
});
|
||||
const confirm = useConfirm();
|
||||
|
||||
@@ -134,7 +134,7 @@ export const useDeleteProcessingActivityRegistry = (
|
||||
mutate({
|
||||
variables: {
|
||||
input: {
|
||||
processingActivityRegistryId: registry.id,
|
||||
processingActivityId: processingActivity.id,
|
||||
},
|
||||
connections: [connectionId],
|
||||
},
|
||||
@@ -142,17 +142,17 @@ export const useDeleteProcessingActivityRegistry = (
|
||||
{
|
||||
message: sprintf(
|
||||
__(
|
||||
"This will permanently delete the processing activity registry entry %s. This action cannot be undone."
|
||||
"This will permanently delete the processing activity %s. This action cannot be undone."
|
||||
),
|
||||
registry.name
|
||||
processingActivity.name
|
||||
),
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
export const useCreateProcessingActivityRegistry = (connectionId?: string) => {
|
||||
const [mutate] = useMutation(createProcessingActivityRegistryMutation);
|
||||
export const useCreateProcessingActivity = (connectionId?: string) => {
|
||||
const [mutate] = useMutation(createProcessingActivityMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -174,10 +174,10 @@ export const useCreateProcessingActivityRegistry = (connectionId?: string) => {
|
||||
transferImpactAssessment?: string;
|
||||
}) => {
|
||||
if (!input.organizationId) {
|
||||
return alert(__("Failed to create processing activity registry entry: organization is required"));
|
||||
return alert(__("Failed to create processing activity: organization is required"));
|
||||
}
|
||||
if (!input.name) {
|
||||
return alert(__("Failed to create processing activity registry entry: name is required"));
|
||||
return alert(__("Failed to create processing activity: name is required"));
|
||||
}
|
||||
|
||||
return promisifyMutation(mutate)({
|
||||
@@ -206,8 +206,8 @@ export const useCreateProcessingActivityRegistry = (connectionId?: string) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const useUpdateProcessingActivityRegistry = () => {
|
||||
const [mutate] = useMutation(updateProcessingActivityRegistryMutation);
|
||||
export const useUpdateProcessingActivity = () => {
|
||||
const [mutate] = useMutation(updateProcessingActivityMutation);
|
||||
const { __ } = useTranslate();
|
||||
|
||||
return (input: {
|
||||
@@ -229,7 +229,7 @@ export const useUpdateProcessingActivityRegistry = () => {
|
||||
transferImpactAssessment?: string;
|
||||
}) => {
|
||||
if (!input.id) {
|
||||
return alert(__("Failed to update processing activity registry entry: registry ID is required"));
|
||||
return alert(__("Failed to update processing activity: ID is required"));
|
||||
}
|
||||
|
||||
return promisifyMutation(mutate)({
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<66b92b83fa5be4a0dcc2e7f11ad162b6>>
|
||||
* @generated SignedSource<<05cc2f7b3bf513e9a1f1e192950c011e>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,25 +9,25 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type ContinualImprovementRegistriesPriority = "HIGH" | "LOW" | "MEDIUM";
|
||||
export type ContinualImprovementRegistriesStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type CreateContinualImprovementRegistryInput = {
|
||||
export type ContinualImprovementPriority = "HIGH" | "LOW" | "MEDIUM";
|
||||
export type ContinualImprovementStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type CreateContinualImprovementInput = {
|
||||
description?: string | null | undefined;
|
||||
organizationId: string;
|
||||
ownerId: string;
|
||||
priority: ContinualImprovementRegistriesPriority;
|
||||
priority: ContinualImprovementPriority;
|
||||
referenceId: string;
|
||||
source?: string | null | undefined;
|
||||
status: ContinualImprovementRegistriesStatus;
|
||||
status: ContinualImprovementStatus;
|
||||
targetDate?: any | null | undefined;
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphCreateMutation$variables = {
|
||||
export type ContinualImprovementGraphCreateMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: CreateContinualImprovementRegistryInput;
|
||||
input: CreateContinualImprovementInput;
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphCreateMutation$data = {
|
||||
readonly createContinualImprovementRegistry: {
|
||||
readonly continualImprovementRegistryEdge: {
|
||||
export type ContinualImprovementGraphCreateMutation$data = {
|
||||
readonly createContinualImprovement: {
|
||||
readonly continualImprovementEdge: {
|
||||
readonly node: {
|
||||
readonly createdAt: any;
|
||||
readonly description: string | null | undefined;
|
||||
@@ -36,18 +36,18 @@ export type ContinualImprovementRegistryGraphCreateMutation$data = {
|
||||
readonly fullName: string;
|
||||
readonly id: string;
|
||||
};
|
||||
readonly priority: ContinualImprovementRegistriesPriority;
|
||||
readonly priority: ContinualImprovementPriority;
|
||||
readonly referenceId: string;
|
||||
readonly source: string | null | undefined;
|
||||
readonly status: ContinualImprovementRegistriesStatus;
|
||||
readonly status: ContinualImprovementStatus;
|
||||
readonly targetDate: any | null | undefined;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphCreateMutation = {
|
||||
response: ContinualImprovementRegistryGraphCreateMutation$data;
|
||||
variables: ContinualImprovementRegistryGraphCreateMutation$variables;
|
||||
export type ContinualImprovementGraphCreateMutation = {
|
||||
response: ContinualImprovementGraphCreateMutation$data;
|
||||
variables: ContinualImprovementGraphCreateMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -78,15 +78,15 @@ v3 = {
|
||||
v4 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ContinualImprovementRegistryEdge",
|
||||
"concreteType": "ContinualImprovementEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "continualImprovementRegistryEdge",
|
||||
"name": "continualImprovementEdge",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ContinualImprovementRegistry",
|
||||
"concreteType": "ContinualImprovement",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -174,14 +174,14 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ContinualImprovementRegistryGraphCreateMutation",
|
||||
"name": "ContinualImprovementGraphCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateContinualImprovementRegistryPayload",
|
||||
"concreteType": "CreateContinualImprovementPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createContinualImprovementRegistry",
|
||||
"name": "createContinualImprovement",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v4/*: any*/)
|
||||
@@ -199,14 +199,14 @@ return {
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "ContinualImprovementRegistryGraphCreateMutation",
|
||||
"name": "ContinualImprovementGraphCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateContinualImprovementRegistryPayload",
|
||||
"concreteType": "CreateContinualImprovementPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createContinualImprovementRegistry",
|
||||
"name": "createContinualImprovement",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v4/*: any*/),
|
||||
@@ -217,7 +217,7 @@ return {
|
||||
"handle": "prependEdge",
|
||||
"key": "",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "continualImprovementRegistryEdge",
|
||||
"name": "continualImprovementEdge",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
@@ -232,16 +232,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "7d03cdc29b6ecb916bf8bdf5ea1df737",
|
||||
"cacheID": "8789a6fab51997d85cbc98481c047b9c",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ContinualImprovementRegistryGraphCreateMutation",
|
||||
"name": "ContinualImprovementGraphCreateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation ContinualImprovementRegistryGraphCreateMutation(\n $input: CreateContinualImprovementRegistryInput!\n) {\n createContinualImprovementRegistry(input: $input) {\n continualImprovementRegistryEdge {\n node {\n id\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n createdAt\n }\n }\n }\n}\n"
|
||||
"text": "mutation ContinualImprovementGraphCreateMutation(\n $input: CreateContinualImprovementInput!\n) {\n createContinualImprovement(input: $input) {\n continualImprovementEdge {\n node {\n id\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n createdAt\n }\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "c2acef94a51f4ae101d7d115aa9761bf";
|
||||
(node as any).hash = "6c6ed7efdb1ebe213fd9e43111f06c7e";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<eb0bdb8e311cea402d1aa11b79c2c1a5>>
|
||||
* @generated SignedSource<<7e00cc82c493f1f051c9673fb95c6217>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,21 +9,21 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DeleteNonconformityRegistryInput = {
|
||||
nonconformityRegistryId: string;
|
||||
export type DeleteContinualImprovementInput = {
|
||||
continualImprovementId: string;
|
||||
};
|
||||
export type NonconformityRegistryGraphDeleteMutation$variables = {
|
||||
export type ContinualImprovementGraphDeleteMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: DeleteNonconformityRegistryInput;
|
||||
input: DeleteContinualImprovementInput;
|
||||
};
|
||||
export type NonconformityRegistryGraphDeleteMutation$data = {
|
||||
readonly deleteNonconformityRegistry: {
|
||||
readonly deletedNonconformityRegistryId: string;
|
||||
export type ContinualImprovementGraphDeleteMutation$data = {
|
||||
readonly deleteContinualImprovement: {
|
||||
readonly deletedContinualImprovementId: string;
|
||||
};
|
||||
};
|
||||
export type NonconformityRegistryGraphDeleteMutation = {
|
||||
response: NonconformityRegistryGraphDeleteMutation$data;
|
||||
variables: NonconformityRegistryGraphDeleteMutation$variables;
|
||||
export type ContinualImprovementGraphDeleteMutation = {
|
||||
response: ContinualImprovementGraphDeleteMutation$data;
|
||||
variables: ContinualImprovementGraphDeleteMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -48,7 +48,7 @@ v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "deletedNonconformityRegistryId",
|
||||
"name": "deletedContinualImprovementId",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
@@ -59,14 +59,14 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "NonconformityRegistryGraphDeleteMutation",
|
||||
"name": "ContinualImprovementGraphDeleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteNonconformityRegistryPayload",
|
||||
"concreteType": "DeleteContinualImprovementPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteNonconformityRegistry",
|
||||
"name": "deleteContinualImprovement",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/)
|
||||
@@ -84,14 +84,14 @@ return {
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "NonconformityRegistryGraphDeleteMutation",
|
||||
"name": "ContinualImprovementGraphDeleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteNonconformityRegistryPayload",
|
||||
"concreteType": "DeleteContinualImprovementPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteNonconformityRegistry",
|
||||
"name": "deleteContinualImprovement",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
@@ -102,7 +102,7 @@ return {
|
||||
"handle": "deleteEdge",
|
||||
"key": "",
|
||||
"kind": "ScalarHandle",
|
||||
"name": "deletedNonconformityRegistryId",
|
||||
"name": "deletedContinualImprovementId",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
@@ -117,16 +117,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "733821706945a20396447b1134615a0e",
|
||||
"cacheID": "aaa3d35494c0b1bcaca143cdbc6b7143",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "NonconformityRegistryGraphDeleteMutation",
|
||||
"name": "ContinualImprovementGraphDeleteMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation NonconformityRegistryGraphDeleteMutation(\n $input: DeleteNonconformityRegistryInput!\n) {\n deleteNonconformityRegistry(input: $input) {\n deletedNonconformityRegistryId\n }\n}\n"
|
||||
"text": "mutation ContinualImprovementGraphDeleteMutation(\n $input: DeleteContinualImprovementInput!\n) {\n deleteContinualImprovement(input: $input) {\n deletedContinualImprovementId\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "99bc5c0c79ffa8de365ab541c960fc84";
|
||||
(node as any).hash = "5474ad4a9bdc5ee4bd70f7289944079e";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<32acc7b83177d41eb30081c290ba1393>>
|
||||
* @generated SignedSource<<bf69bf053e5fe5b3c0cc88a80e164325>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,18 +10,18 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ContinualImprovementRegistriesPageQuery$variables = {
|
||||
export type ContinualImprovementGraphListQuery$variables = {
|
||||
organizationId: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type ContinualImprovementRegistriesPageQuery$data = {
|
||||
export type ContinualImprovementGraphListQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ContinualImprovementRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ContinualImprovementsPageFragment">;
|
||||
};
|
||||
};
|
||||
export type ContinualImprovementRegistriesPageQuery = {
|
||||
response: ContinualImprovementRegistriesPageQuery$data;
|
||||
variables: ContinualImprovementRegistriesPageQuery$variables;
|
||||
export type ContinualImprovementGraphListQuery = {
|
||||
response: ContinualImprovementGraphListQuery$data;
|
||||
variables: ContinualImprovementGraphListQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -82,7 +82,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ContinualImprovementRegistriesPageQuery",
|
||||
"name": "ContinualImprovementGraphListQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -98,7 +98,7 @@ return {
|
||||
{
|
||||
"args": (v2/*: any*/),
|
||||
"kind": "FragmentSpread",
|
||||
"name": "ContinualImprovementRegistriesPageFragment"
|
||||
"name": "ContinualImprovementsPageFragment"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -115,7 +115,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ContinualImprovementRegistriesPageQuery",
|
||||
"name": "ContinualImprovementGraphListQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -133,9 +133,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"concreteType": "ContinualImprovementRegistryConnection",
|
||||
"concreteType": "ContinualImprovementConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "continualImprovementRegistries",
|
||||
"name": "continualImprovements",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -148,7 +148,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ContinualImprovementRegistryEdge",
|
||||
"concreteType": "ContinualImprovementEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -156,7 +156,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ContinualImprovementRegistry",
|
||||
"concreteType": "ContinualImprovement",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -312,9 +312,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "ContinualImprovementRegistriesPage_continualImprovementRegistries",
|
||||
"key": "ContinualImprovementsPage_continualImprovements",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "continualImprovementRegistries"
|
||||
"name": "continualImprovements"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -326,16 +326,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "8cf92f4e9c75b4a42350503ae2d30cae",
|
||||
"cacheID": "b1263b33f1cc0a63fd27a238626279c8",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ContinualImprovementRegistriesPageQuery",
|
||||
"name": "ContinualImprovementGraphListQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ContinualImprovementRegistriesPageQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ContinualImprovementRegistriesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ContinualImprovementRegistriesPageFragment_3iomuz on Organization {\n id\n continualImprovementRegistries(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
"text": "query ContinualImprovementGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ContinualImprovementsPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ContinualImprovementsPageFragment_3iomuz on Organization {\n id\n continualImprovements(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\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 = "506a807c01116d1b5622ac2624d5bf1b";
|
||||
(node as any).hash = "8636ad035074fdb0e5b95362ea343eb1";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<9992eeb0b74e7015c5f4d3520a87a402>>
|
||||
* @generated SignedSource<<69ae0bb47f8fefd6ded7233a78427acc>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,12 +9,12 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type ContinualImprovementRegistriesPriority = "HIGH" | "LOW" | "MEDIUM";
|
||||
export type ContinualImprovementRegistriesStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type ContinualImprovementRegistryGraphNodeQuery$variables = {
|
||||
continualImprovementRegistryId: string;
|
||||
export type ContinualImprovementPriority = "HIGH" | "LOW" | "MEDIUM";
|
||||
export type ContinualImprovementStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type ContinualImprovementGraphNodeQuery$variables = {
|
||||
continualImprovementId: string;
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphNodeQuery$data = {
|
||||
export type ContinualImprovementGraphNodeQuery$data = {
|
||||
readonly node: {
|
||||
readonly createdAt?: any;
|
||||
readonly description?: string | null | undefined;
|
||||
@@ -27,19 +27,19 @@ export type ContinualImprovementRegistryGraphNodeQuery$data = {
|
||||
readonly fullName: string;
|
||||
readonly id: string;
|
||||
};
|
||||
readonly priority?: ContinualImprovementRegistriesPriority;
|
||||
readonly priority?: ContinualImprovementPriority;
|
||||
readonly referenceId?: string;
|
||||
readonly snapshotId?: string | null | undefined;
|
||||
readonly source?: string | null | undefined;
|
||||
readonly sourceId?: string | null | undefined;
|
||||
readonly status?: ContinualImprovementRegistriesStatus;
|
||||
readonly status?: ContinualImprovementStatus;
|
||||
readonly targetDate?: any | null | undefined;
|
||||
readonly updatedAt?: any;
|
||||
};
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphNodeQuery = {
|
||||
response: ContinualImprovementRegistryGraphNodeQuery$data;
|
||||
variables: ContinualImprovementRegistryGraphNodeQuery$variables;
|
||||
export type ContinualImprovementGraphNodeQuery = {
|
||||
response: ContinualImprovementGraphNodeQuery$data;
|
||||
variables: ContinualImprovementGraphNodeQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -47,14 +47,14 @@ var v0 = [
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "continualImprovementRegistryId"
|
||||
"name": "continualImprovementId"
|
||||
}
|
||||
],
|
||||
v1 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "id",
|
||||
"variableName": "continualImprovementRegistryId"
|
||||
"variableName": "continualImprovementId"
|
||||
}
|
||||
],
|
||||
v2 = {
|
||||
@@ -177,7 +177,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ContinualImprovementRegistryGraphNodeQuery",
|
||||
"name": "ContinualImprovementGraphNodeQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -204,7 +204,7 @@ return {
|
||||
(v13/*: any*/),
|
||||
(v14/*: any*/)
|
||||
],
|
||||
"type": "ContinualImprovementRegistry",
|
||||
"type": "ContinualImprovement",
|
||||
"abstractKey": null
|
||||
}
|
||||
],
|
||||
@@ -218,7 +218,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ContinualImprovementRegistryGraphNodeQuery",
|
||||
"name": "ContinualImprovementGraphNodeQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -252,7 +252,7 @@ return {
|
||||
(v13/*: any*/),
|
||||
(v14/*: any*/)
|
||||
],
|
||||
"type": "ContinualImprovementRegistry",
|
||||
"type": "ContinualImprovement",
|
||||
"abstractKey": null
|
||||
}
|
||||
],
|
||||
@@ -261,16 +261,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "dc67877ad1fe94bfeb50490a9ca6692b",
|
||||
"cacheID": "51e532cd66309a275af46ecaca65f0a6",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ContinualImprovementRegistryGraphNodeQuery",
|
||||
"name": "ContinualImprovementGraphNodeQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ContinualImprovementRegistryGraphNodeQuery(\n $continualImprovementRegistryId: ID!\n) {\n node(id: $continualImprovementRegistryId) {\n __typename\n ... on ContinualImprovementRegistry {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
|
||||
"text": "query ContinualImprovementGraphNodeQuery(\n $continualImprovementId: ID!\n) {\n node(id: $continualImprovementId) {\n __typename\n ... on ContinualImprovement {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "659dd712ecf01765f6d5ef0f9d7d2a08";
|
||||
(node as any).hash = "f5ce017ad11fcee598ae3116b668f4b2";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<0f5c8a4c09725f287ec32e2366f5d829>>
|
||||
* @generated SignedSource<<ee5765584398e50a4997f7cd1e75759d>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,42 +9,42 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type ContinualImprovementRegistriesPriority = "HIGH" | "LOW" | "MEDIUM";
|
||||
export type ContinualImprovementRegistriesStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type UpdateContinualImprovementRegistryInput = {
|
||||
export type ContinualImprovementPriority = "HIGH" | "LOW" | "MEDIUM";
|
||||
export type ContinualImprovementStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type UpdateContinualImprovementInput = {
|
||||
description?: string | null | undefined;
|
||||
id: string;
|
||||
ownerId?: string | null | undefined;
|
||||
priority?: ContinualImprovementRegistriesPriority | null | undefined;
|
||||
priority?: ContinualImprovementPriority | null | undefined;
|
||||
referenceId?: string | null | undefined;
|
||||
source?: string | null | undefined;
|
||||
status?: ContinualImprovementRegistriesStatus | null | undefined;
|
||||
status?: ContinualImprovementStatus | null | undefined;
|
||||
targetDate?: any | null | undefined;
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphUpdateMutation$variables = {
|
||||
input: UpdateContinualImprovementRegistryInput;
|
||||
export type ContinualImprovementGraphUpdateMutation$variables = {
|
||||
input: UpdateContinualImprovementInput;
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphUpdateMutation$data = {
|
||||
readonly updateContinualImprovementRegistry: {
|
||||
readonly continualImprovementRegistry: {
|
||||
export type ContinualImprovementGraphUpdateMutation$data = {
|
||||
readonly updateContinualImprovement: {
|
||||
readonly continualImprovement: {
|
||||
readonly description: string | null | undefined;
|
||||
readonly id: string;
|
||||
readonly owner: {
|
||||
readonly fullName: string;
|
||||
readonly id: string;
|
||||
};
|
||||
readonly priority: ContinualImprovementRegistriesPriority;
|
||||
readonly priority: ContinualImprovementPriority;
|
||||
readonly referenceId: string;
|
||||
readonly source: string | null | undefined;
|
||||
readonly status: ContinualImprovementRegistriesStatus;
|
||||
readonly status: ContinualImprovementStatus;
|
||||
readonly targetDate: any | null | undefined;
|
||||
readonly updatedAt: any;
|
||||
};
|
||||
};
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphUpdateMutation = {
|
||||
response: ContinualImprovementRegistryGraphUpdateMutation$data;
|
||||
variables: ContinualImprovementRegistryGraphUpdateMutation$variables;
|
||||
export type ContinualImprovementGraphUpdateMutation = {
|
||||
response: ContinualImprovementGraphUpdateMutation$data;
|
||||
variables: ContinualImprovementGraphUpdateMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -72,17 +72,17 @@ v2 = [
|
||||
"variableName": "input"
|
||||
}
|
||||
],
|
||||
"concreteType": "UpdateContinualImprovementRegistryPayload",
|
||||
"concreteType": "UpdateContinualImprovementPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "updateContinualImprovementRegistry",
|
||||
"name": "updateContinualImprovement",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ContinualImprovementRegistry",
|
||||
"concreteType": "ContinualImprovement",
|
||||
"kind": "LinkedField",
|
||||
"name": "continualImprovementRegistry",
|
||||
"name": "continualImprovement",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
@@ -166,7 +166,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ContinualImprovementRegistryGraphUpdateMutation",
|
||||
"name": "ContinualImprovementGraphUpdateMutation",
|
||||
"selections": (v2/*: any*/),
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
@@ -175,20 +175,20 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ContinualImprovementRegistryGraphUpdateMutation",
|
||||
"name": "ContinualImprovementGraphUpdateMutation",
|
||||
"selections": (v2/*: any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "4fa7e841eea92d03f30fadf630135159",
|
||||
"cacheID": "437d2ec2228356103e851f53d9edb577",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ContinualImprovementRegistryGraphUpdateMutation",
|
||||
"name": "ContinualImprovementGraphUpdateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation ContinualImprovementRegistryGraphUpdateMutation(\n $input: UpdateContinualImprovementRegistryInput!\n) {\n updateContinualImprovementRegistry(input: $input) {\n continualImprovementRegistry {\n id\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n updatedAt\n }\n }\n}\n"
|
||||
"text": "mutation ContinualImprovementGraphUpdateMutation(\n $input: UpdateContinualImprovementInput!\n) {\n updateContinualImprovement(input: $input) {\n continualImprovement {\n id\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n updatedAt\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "82fad800ffad42813aeceda43c3304a3";
|
||||
(node as any).hash = "75ef82d455a038a7c60852b7e849284d";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<a656bb20110ce8110b251091f80f27c0>>
|
||||
* @generated SignedSource<<a7d4ac5eee7f07fadad4e2c1f25e87e5>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,8 +9,8 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type NonconformityRegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type CreateNonconformityRegistryInput = {
|
||||
export type NonconformityStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type CreateNonconformityInput = {
|
||||
auditId: string;
|
||||
correctiveAction?: string | null | undefined;
|
||||
dateIdentified?: any | null | undefined;
|
||||
@@ -21,15 +21,15 @@ export type CreateNonconformityRegistryInput = {
|
||||
ownerId: string;
|
||||
referenceId: string;
|
||||
rootCause: string;
|
||||
status: NonconformityRegistryStatus;
|
||||
status: NonconformityStatus;
|
||||
};
|
||||
export type NonconformityRegistryGraphCreateMutation$variables = {
|
||||
export type NonconformityGraphCreateMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: CreateNonconformityRegistryInput;
|
||||
input: CreateNonconformityInput;
|
||||
};
|
||||
export type NonconformityRegistryGraphCreateMutation$data = {
|
||||
readonly createNonconformityRegistry: {
|
||||
readonly nonconformityRegistryEdge: {
|
||||
export type NonconformityGraphCreateMutation$data = {
|
||||
readonly createNonconformity: {
|
||||
readonly nonconformityEdge: {
|
||||
readonly node: {
|
||||
readonly audit: {
|
||||
readonly framework: {
|
||||
@@ -48,14 +48,14 @@ export type NonconformityRegistryGraphCreateMutation$data = {
|
||||
};
|
||||
readonly referenceId: string;
|
||||
readonly rootCause: string;
|
||||
readonly status: NonconformityRegistryStatus;
|
||||
readonly status: NonconformityStatus;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
export type NonconformityRegistryGraphCreateMutation = {
|
||||
response: NonconformityRegistryGraphCreateMutation$data;
|
||||
variables: NonconformityRegistryGraphCreateMutation$variables;
|
||||
export type NonconformityGraphCreateMutation = {
|
||||
response: NonconformityGraphCreateMutation$data;
|
||||
variables: NonconformityGraphCreateMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -166,28 +166,28 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "NonconformityRegistryGraphCreateMutation",
|
||||
"name": "NonconformityGraphCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateNonconformityRegistryPayload",
|
||||
"concreteType": "CreateNonconformityPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createNonconformityRegistry",
|
||||
"name": "createNonconformity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistryEdge",
|
||||
"concreteType": "NonconformityEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "nonconformityRegistryEdge",
|
||||
"name": "nonconformityEdge",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistry",
|
||||
"concreteType": "Nonconformity",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -245,28 +245,28 @@ return {
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "NonconformityRegistryGraphCreateMutation",
|
||||
"name": "NonconformityGraphCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateNonconformityRegistryPayload",
|
||||
"concreteType": "CreateNonconformityPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createNonconformityRegistry",
|
||||
"name": "createNonconformity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistryEdge",
|
||||
"concreteType": "NonconformityEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "nonconformityRegistryEdge",
|
||||
"name": "nonconformityEdge",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistry",
|
||||
"concreteType": "Nonconformity",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -318,7 +318,7 @@ return {
|
||||
"handle": "prependEdge",
|
||||
"key": "",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "nonconformityRegistryEdge",
|
||||
"name": "nonconformityEdge",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
@@ -333,16 +333,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "de251873fde439228e9a1db5928682d3",
|
||||
"cacheID": "ad0967f3684a882d198eaa853a691d34",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "NonconformityRegistryGraphCreateMutation",
|
||||
"name": "NonconformityGraphCreateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation NonconformityRegistryGraphCreateMutation(\n $input: CreateNonconformityRegistryInput!\n) {\n createNonconformityRegistry(input: $input) {\n nonconformityRegistryEdge {\n node {\n id\n referenceId\n description\n status\n dateIdentified\n dueDate\n rootCause\n audit {\n id\n framework {\n name\n id\n }\n }\n owner {\n id\n fullName\n }\n createdAt\n }\n }\n }\n}\n"
|
||||
"text": "mutation NonconformityGraphCreateMutation(\n $input: CreateNonconformityInput!\n) {\n createNonconformity(input: $input) {\n nonconformityEdge {\n node {\n id\n referenceId\n description\n status\n dateIdentified\n dueDate\n rootCause\n audit {\n id\n framework {\n name\n id\n }\n }\n owner {\n id\n fullName\n }\n createdAt\n }\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "249806dbd8c7c28908461d20b3a0ec52";
|
||||
(node as any).hash = "2a62fc6f16eb6677eecd1cd35de01a16";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<11633889a4d61df894b88dd483687cf9>>
|
||||
* @generated SignedSource<<5b430cf79f9527c247a0262d039f9603>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,21 +9,21 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DeleteProcessingActivityRegistryInput = {
|
||||
processingActivityRegistryId: string;
|
||||
export type DeleteNonconformityInput = {
|
||||
nonconformityId: string;
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphDeleteMutation$variables = {
|
||||
export type NonconformityGraphDeleteMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: DeleteProcessingActivityRegistryInput;
|
||||
input: DeleteNonconformityInput;
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphDeleteMutation$data = {
|
||||
readonly deleteProcessingActivityRegistry: {
|
||||
readonly deletedProcessingActivityRegistryId: string;
|
||||
export type NonconformityGraphDeleteMutation$data = {
|
||||
readonly deleteNonconformity: {
|
||||
readonly deletedNonconformityId: string;
|
||||
};
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphDeleteMutation = {
|
||||
response: ProcessingActivityRegistryGraphDeleteMutation$data;
|
||||
variables: ProcessingActivityRegistryGraphDeleteMutation$variables;
|
||||
export type NonconformityGraphDeleteMutation = {
|
||||
response: NonconformityGraphDeleteMutation$data;
|
||||
variables: NonconformityGraphDeleteMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -48,7 +48,7 @@ v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "deletedProcessingActivityRegistryId",
|
||||
"name": "deletedNonconformityId",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
@@ -59,14 +59,14 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ProcessingActivityRegistryGraphDeleteMutation",
|
||||
"name": "NonconformityGraphDeleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteProcessingActivityRegistryPayload",
|
||||
"concreteType": "DeleteNonconformityPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteProcessingActivityRegistry",
|
||||
"name": "deleteNonconformity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/)
|
||||
@@ -84,14 +84,14 @@ return {
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "ProcessingActivityRegistryGraphDeleteMutation",
|
||||
"name": "NonconformityGraphDeleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteProcessingActivityRegistryPayload",
|
||||
"concreteType": "DeleteNonconformityPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteProcessingActivityRegistry",
|
||||
"name": "deleteNonconformity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
@@ -102,7 +102,7 @@ return {
|
||||
"handle": "deleteEdge",
|
||||
"key": "",
|
||||
"kind": "ScalarHandle",
|
||||
"name": "deletedProcessingActivityRegistryId",
|
||||
"name": "deletedNonconformityId",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
@@ -117,16 +117,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "7550d138c9636bbe930a5cdad260156b",
|
||||
"cacheID": "2e421cc7eb59884d8eeb7b8856f36142",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ProcessingActivityRegistryGraphDeleteMutation",
|
||||
"name": "NonconformityGraphDeleteMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation ProcessingActivityRegistryGraphDeleteMutation(\n $input: DeleteProcessingActivityRegistryInput!\n) {\n deleteProcessingActivityRegistry(input: $input) {\n deletedProcessingActivityRegistryId\n }\n}\n"
|
||||
"text": "mutation NonconformityGraphDeleteMutation(\n $input: DeleteNonconformityInput!\n) {\n deleteNonconformity(input: $input) {\n deletedNonconformityId\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "8492e778e152e5910ee4c09c34ea4e68";
|
||||
(node as any).hash = "d9d2303a4235301061e976771043d18a";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<5e78749bb635e7aa478ad7efb8f5e01b>>
|
||||
* @generated SignedSource<<8cce006e13ed2bf7b80b12faab4034c0>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,18 +10,18 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type NonconformityRegistriesPageQuery$variables = {
|
||||
export type NonconformityGraphListQuery$variables = {
|
||||
organizationId: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type NonconformityRegistriesPageQuery$data = {
|
||||
export type NonconformityGraphListQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"NonconformityRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"NonconformitiesPageFragment">;
|
||||
};
|
||||
};
|
||||
export type NonconformityRegistriesPageQuery = {
|
||||
response: NonconformityRegistriesPageQuery$data;
|
||||
variables: NonconformityRegistriesPageQuery$variables;
|
||||
export type NonconformityGraphListQuery = {
|
||||
response: NonconformityGraphListQuery$data;
|
||||
variables: NonconformityGraphListQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -89,7 +89,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "NonconformityRegistriesPageQuery",
|
||||
"name": "NonconformityGraphListQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -105,7 +105,7 @@ return {
|
||||
{
|
||||
"args": (v2/*: any*/),
|
||||
"kind": "FragmentSpread",
|
||||
"name": "NonconformityRegistriesPageFragment"
|
||||
"name": "NonconformitiesPageFragment"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -122,7 +122,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "NonconformityRegistriesPageQuery",
|
||||
"name": "NonconformityGraphListQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -140,9 +140,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"concreteType": "NonconformityRegistryConnection",
|
||||
"concreteType": "NonconformityConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "nonconformityRegistries",
|
||||
"name": "nonconformities",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -155,7 +155,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistryEdge",
|
||||
"concreteType": "NonconformityEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -163,7 +163,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistry",
|
||||
"concreteType": "Nonconformity",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -352,9 +352,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "RegistriesPage_nonconformityRegistries",
|
||||
"key": "NonconformitiesPage_nonconformities",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "nonconformityRegistries"
|
||||
"name": "nonconformities"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -366,16 +366,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "fc70ce5fd4a22cc2bc0d9a63d476008f",
|
||||
"cacheID": "59c8bf68d04fd47f3d5e3e7d452e2e5e",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "NonconformityRegistriesPageQuery",
|
||||
"name": "NonconformityGraphListQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query NonconformityRegistriesPageQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...NonconformityRegistriesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment NonconformityRegistriesPageFragment_3iomuz on Organization {\n id\n nonconformityRegistries(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n referenceId\n snapshotId\n description\n status\n dateIdentified\n dueDate\n rootCause\n correctiveAction\n effectivenessCheck\n audit {\n id\n name\n framework {\n id\n name\n }\n }\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
"text": "query NonconformityGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...NonconformitiesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment NonconformitiesPageFragment_3iomuz on Organization {\n id\n nonconformities(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n referenceId\n snapshotId\n description\n status\n dateIdentified\n dueDate\n rootCause\n correctiveAction\n effectivenessCheck\n audit {\n id\n name\n framework {\n id\n name\n }\n }\n owner {\n id\n fullName\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 = "180821c7fad7b6071d78444e1eac0742";
|
||||
(node as any).hash = "4b416f25dfb07189adceb1cdec2df4e3";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<4ea62d99e8a73491f8125cb3e8d8e4b5>>
|
||||
* @generated SignedSource<<125cf1d460b37ac442d0f30c14e5af11>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,11 +9,11 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type NonconformityRegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type NonconformityRegistryGraphNodeQuery$variables = {
|
||||
nonconformityRegistryId: string;
|
||||
export type NonconformityStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type NonconformityGraphNodeQuery$variables = {
|
||||
nonconformityId: string;
|
||||
};
|
||||
export type NonconformityRegistryGraphNodeQuery$data = {
|
||||
export type NonconformityGraphNodeQuery$data = {
|
||||
readonly node: {
|
||||
readonly audit?: {
|
||||
readonly framework: {
|
||||
@@ -40,13 +40,13 @@ export type NonconformityRegistryGraphNodeQuery$data = {
|
||||
readonly referenceId?: string;
|
||||
readonly rootCause?: string;
|
||||
readonly snapshotId?: string | null | undefined;
|
||||
readonly status?: NonconformityRegistryStatus;
|
||||
readonly status?: NonconformityStatus;
|
||||
readonly updatedAt?: any;
|
||||
};
|
||||
};
|
||||
export type NonconformityRegistryGraphNodeQuery = {
|
||||
response: NonconformityRegistryGraphNodeQuery$data;
|
||||
variables: NonconformityRegistryGraphNodeQuery$variables;
|
||||
export type NonconformityGraphNodeQuery = {
|
||||
response: NonconformityGraphNodeQuery$data;
|
||||
variables: NonconformityGraphNodeQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -54,14 +54,14 @@ var v0 = [
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "nonconformityRegistryId"
|
||||
"name": "nonconformityId"
|
||||
}
|
||||
],
|
||||
v1 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "id",
|
||||
"variableName": "nonconformityRegistryId"
|
||||
"variableName": "nonconformityId"
|
||||
}
|
||||
],
|
||||
v2 = {
|
||||
@@ -214,7 +214,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "NonconformityRegistryGraphNodeQuery",
|
||||
"name": "NonconformityGraphNodeQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -243,7 +243,7 @@ return {
|
||||
(v16/*: any*/),
|
||||
(v17/*: any*/)
|
||||
],
|
||||
"type": "NonconformityRegistry",
|
||||
"type": "Nonconformity",
|
||||
"abstractKey": null
|
||||
}
|
||||
],
|
||||
@@ -257,7 +257,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "NonconformityRegistryGraphNodeQuery",
|
||||
"name": "NonconformityGraphNodeQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -293,7 +293,7 @@ return {
|
||||
(v16/*: any*/),
|
||||
(v17/*: any*/)
|
||||
],
|
||||
"type": "NonconformityRegistry",
|
||||
"type": "Nonconformity",
|
||||
"abstractKey": null
|
||||
}
|
||||
],
|
||||
@@ -302,16 +302,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "ab9100da91dff02cc103e6cf3f04b9e2",
|
||||
"cacheID": "e394317a8e7661c374224c08c6fd5b0b",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "NonconformityRegistryGraphNodeQuery",
|
||||
"name": "NonconformityGraphNodeQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query NonconformityRegistryGraphNodeQuery(\n $nonconformityRegistryId: ID!\n) {\n node(id: $nonconformityRegistryId) {\n __typename\n ... on NonconformityRegistry {\n id\n snapshotId\n referenceId\n description\n dateIdentified\n rootCause\n correctiveAction\n dueDate\n status\n effectivenessCheck\n audit {\n id\n framework {\n id\n name\n }\n }\n owner {\n id\n fullName\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
|
||||
"text": "query NonconformityGraphNodeQuery(\n $nonconformityId: ID!\n) {\n node(id: $nonconformityId) {\n __typename\n ... on Nonconformity {\n id\n snapshotId\n referenceId\n description\n dateIdentified\n rootCause\n correctiveAction\n dueDate\n status\n effectivenessCheck\n audit {\n id\n framework {\n id\n name\n }\n }\n owner {\n id\n fullName\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "207465c315f95b9b26e7687c4ef17cbf";
|
||||
(node as any).hash = "e57a600fda9f0f5a0178818df75b0436";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<19732d1bd6a2a118a8e813058693bad0>>
|
||||
* @generated SignedSource<<9c7a235f3dc4f691c8f9d036536cf272>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,8 +9,8 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type NonconformityRegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type UpdateNonconformityRegistryInput = {
|
||||
export type NonconformityStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type UpdateNonconformityInput = {
|
||||
auditId?: string | null | undefined;
|
||||
correctiveAction?: string | null | undefined;
|
||||
dateIdentified?: any | null | undefined;
|
||||
@@ -21,14 +21,14 @@ export type UpdateNonconformityRegistryInput = {
|
||||
ownerId?: string | null | undefined;
|
||||
referenceId?: string | null | undefined;
|
||||
rootCause?: string | null | undefined;
|
||||
status?: NonconformityRegistryStatus | null | undefined;
|
||||
status?: NonconformityStatus | null | undefined;
|
||||
};
|
||||
export type NonconformityRegistryGraphUpdateMutation$variables = {
|
||||
input: UpdateNonconformityRegistryInput;
|
||||
export type NonconformityGraphUpdateMutation$variables = {
|
||||
input: UpdateNonconformityInput;
|
||||
};
|
||||
export type NonconformityRegistryGraphUpdateMutation$data = {
|
||||
readonly updateNonconformityRegistry: {
|
||||
readonly nonconformityRegistry: {
|
||||
export type NonconformityGraphUpdateMutation$data = {
|
||||
readonly updateNonconformity: {
|
||||
readonly nonconformity: {
|
||||
readonly audit: {
|
||||
readonly framework: {
|
||||
readonly id: string;
|
||||
@@ -48,14 +48,14 @@ export type NonconformityRegistryGraphUpdateMutation$data = {
|
||||
};
|
||||
readonly referenceId: string;
|
||||
readonly rootCause: string;
|
||||
readonly status: NonconformityRegistryStatus;
|
||||
readonly status: NonconformityStatus;
|
||||
readonly updatedAt: any;
|
||||
};
|
||||
};
|
||||
};
|
||||
export type NonconformityRegistryGraphUpdateMutation = {
|
||||
response: NonconformityRegistryGraphUpdateMutation$data;
|
||||
variables: NonconformityRegistryGraphUpdateMutation$variables;
|
||||
export type NonconformityGraphUpdateMutation = {
|
||||
response: NonconformityGraphUpdateMutation$data;
|
||||
variables: NonconformityGraphUpdateMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -83,17 +83,17 @@ v2 = [
|
||||
"variableName": "input"
|
||||
}
|
||||
],
|
||||
"concreteType": "UpdateNonconformityRegistryPayload",
|
||||
"concreteType": "UpdateNonconformityPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "updateNonconformityRegistry",
|
||||
"name": "updateNonconformity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistry",
|
||||
"concreteType": "Nonconformity",
|
||||
"kind": "LinkedField",
|
||||
"name": "nonconformityRegistry",
|
||||
"name": "nonconformity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
@@ -222,7 +222,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "NonconformityRegistryGraphUpdateMutation",
|
||||
"name": "NonconformityGraphUpdateMutation",
|
||||
"selections": (v2/*: any*/),
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
@@ -231,20 +231,20 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "NonconformityRegistryGraphUpdateMutation",
|
||||
"name": "NonconformityGraphUpdateMutation",
|
||||
"selections": (v2/*: any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "a76545f5642f914e8e8206160e1d8839",
|
||||
"cacheID": "db365ab97fb067ad2e9b1daa68f64ed9",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "NonconformityRegistryGraphUpdateMutation",
|
||||
"name": "NonconformityGraphUpdateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation NonconformityRegistryGraphUpdateMutation(\n $input: UpdateNonconformityRegistryInput!\n) {\n updateNonconformityRegistry(input: $input) {\n nonconformityRegistry {\n id\n referenceId\n description\n dateIdentified\n rootCause\n correctiveAction\n dueDate\n status\n effectivenessCheck\n owner {\n id\n fullName\n }\n audit {\n id\n framework {\n id\n name\n }\n }\n updatedAt\n }\n }\n}\n"
|
||||
"text": "mutation NonconformityGraphUpdateMutation(\n $input: UpdateNonconformityInput!\n) {\n updateNonconformity(input: $input) {\n nonconformity {\n id\n referenceId\n description\n dateIdentified\n rootCause\n correctiveAction\n dueDate\n status\n effectivenessCheck\n owner {\n id\n fullName\n }\n audit {\n id\n framework {\n id\n name\n }\n }\n updatedAt\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "456b4f3b6f36c0b518bd3eb870e0d2c5";
|
||||
(node as any).hash = "5803de6f6f017148cca1e3066a6b3967";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<4cd5e6a5205e9438408c95bba2378cde>>
|
||||
* @generated SignedSource<<0d77e4f7fb508d1c181575a45f0938d6>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,8 +9,8 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type ComplianceRegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type CreateComplianceRegistryInput = {
|
||||
export type ObligationStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type CreateObligationInput = {
|
||||
actionsToBeImplemented?: string | null | undefined;
|
||||
area?: string | null | undefined;
|
||||
dueDate?: any | null | undefined;
|
||||
@@ -21,15 +21,15 @@ export type CreateComplianceRegistryInput = {
|
||||
regulator?: string | null | undefined;
|
||||
requirement?: string | null | undefined;
|
||||
source?: string | null | undefined;
|
||||
status: ComplianceRegistryStatus;
|
||||
status: ObligationStatus;
|
||||
};
|
||||
export type ComplianceRegistryGraphCreateMutation$variables = {
|
||||
export type ObligationGraphCreateMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: CreateComplianceRegistryInput;
|
||||
input: CreateObligationInput;
|
||||
};
|
||||
export type ComplianceRegistryGraphCreateMutation$data = {
|
||||
readonly createComplianceRegistry: {
|
||||
readonly complianceRegistryEdge: {
|
||||
export type ObligationGraphCreateMutation$data = {
|
||||
readonly createObligation: {
|
||||
readonly obligationEdge: {
|
||||
readonly node: {
|
||||
readonly actionsToBeImplemented: string | null | undefined;
|
||||
readonly area: string | null | undefined;
|
||||
@@ -45,14 +45,14 @@ export type ComplianceRegistryGraphCreateMutation$data = {
|
||||
readonly regulator: string | null | undefined;
|
||||
readonly requirement: string | null | undefined;
|
||||
readonly source: string | null | undefined;
|
||||
readonly status: ComplianceRegistryStatus;
|
||||
readonly status: ObligationStatus;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
export type ComplianceRegistryGraphCreateMutation = {
|
||||
response: ComplianceRegistryGraphCreateMutation$data;
|
||||
variables: ComplianceRegistryGraphCreateMutation$variables;
|
||||
export type ObligationGraphCreateMutation = {
|
||||
response: ObligationGraphCreateMutation$data;
|
||||
variables: ObligationGraphCreateMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -83,15 +83,15 @@ v3 = {
|
||||
v4 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ComplianceRegistryEdge",
|
||||
"concreteType": "ObligationEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "complianceRegistryEdge",
|
||||
"name": "obligationEdge",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ComplianceRegistry",
|
||||
"concreteType": "Obligation",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -200,14 +200,14 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ComplianceRegistryGraphCreateMutation",
|
||||
"name": "ObligationGraphCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateComplianceRegistryPayload",
|
||||
"concreteType": "CreateObligationPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createComplianceRegistry",
|
||||
"name": "createObligation",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v4/*: any*/)
|
||||
@@ -225,14 +225,14 @@ return {
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "ComplianceRegistryGraphCreateMutation",
|
||||
"name": "ObligationGraphCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateComplianceRegistryPayload",
|
||||
"concreteType": "CreateObligationPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createComplianceRegistry",
|
||||
"name": "createObligation",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v4/*: any*/),
|
||||
@@ -243,7 +243,7 @@ return {
|
||||
"handle": "prependEdge",
|
||||
"key": "",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "complianceRegistryEdge",
|
||||
"name": "obligationEdge",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
@@ -258,16 +258,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "01d9290d9f4bb8162a0d18ab3c72bdaf",
|
||||
"cacheID": "8b01fc75c0c24f32a7892b7b8e38be72",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ComplianceRegistryGraphCreateMutation",
|
||||
"name": "ObligationGraphCreateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation ComplianceRegistryGraphCreateMutation(\n $input: CreateComplianceRegistryInput!\n) {\n createComplianceRegistry(input: $input) {\n complianceRegistryEdge {\n node {\n id\n referenceId\n area\n source\n requirement\n actionsToBeImplemented\n regulator\n lastReviewDate\n dueDate\n status\n owner {\n id\n fullName\n }\n createdAt\n }\n }\n }\n}\n"
|
||||
"text": "mutation ObligationGraphCreateMutation(\n $input: CreateObligationInput!\n) {\n createObligation(input: $input) {\n obligationEdge {\n node {\n id\n referenceId\n area\n source\n requirement\n actionsToBeImplemented\n regulator\n lastReviewDate\n dueDate\n status\n owner {\n id\n fullName\n }\n createdAt\n }\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "c203076113948b2c59dddad5577e1c13";
|
||||
(node as any).hash = "67433dcbb82e3abbde25e2a8105c2789";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<55e8b0de5cb20c0a479bb4862aab4677>>
|
||||
* @generated SignedSource<<0966beeae022283847f20f63c3303ee2>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,21 +9,21 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DeleteContinualImprovementRegistryInput = {
|
||||
continualImprovementRegistryId: string;
|
||||
export type DeleteObligationInput = {
|
||||
obligationId: string;
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphDeleteMutation$variables = {
|
||||
export type ObligationGraphDeleteMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: DeleteContinualImprovementRegistryInput;
|
||||
input: DeleteObligationInput;
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphDeleteMutation$data = {
|
||||
readonly deleteContinualImprovementRegistry: {
|
||||
readonly deletedContinualImprovementRegistryId: string;
|
||||
export type ObligationGraphDeleteMutation$data = {
|
||||
readonly deleteObligation: {
|
||||
readonly deletedObligationId: string;
|
||||
};
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphDeleteMutation = {
|
||||
response: ContinualImprovementRegistryGraphDeleteMutation$data;
|
||||
variables: ContinualImprovementRegistryGraphDeleteMutation$variables;
|
||||
export type ObligationGraphDeleteMutation = {
|
||||
response: ObligationGraphDeleteMutation$data;
|
||||
variables: ObligationGraphDeleteMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -48,7 +48,7 @@ v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "deletedContinualImprovementRegistryId",
|
||||
"name": "deletedObligationId",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
@@ -59,14 +59,14 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ContinualImprovementRegistryGraphDeleteMutation",
|
||||
"name": "ObligationGraphDeleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteContinualImprovementRegistryPayload",
|
||||
"concreteType": "DeleteObligationPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteContinualImprovementRegistry",
|
||||
"name": "deleteObligation",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/)
|
||||
@@ -84,14 +84,14 @@ return {
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "ContinualImprovementRegistryGraphDeleteMutation",
|
||||
"name": "ObligationGraphDeleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteContinualImprovementRegistryPayload",
|
||||
"concreteType": "DeleteObligationPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteContinualImprovementRegistry",
|
||||
"name": "deleteObligation",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
@@ -102,7 +102,7 @@ return {
|
||||
"handle": "deleteEdge",
|
||||
"key": "",
|
||||
"kind": "ScalarHandle",
|
||||
"name": "deletedContinualImprovementRegistryId",
|
||||
"name": "deletedObligationId",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
@@ -117,16 +117,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "1f973509e72c6a1a729e98a8b4240b25",
|
||||
"cacheID": "d54295be0ffd5722cf2e5408a62be33d",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ContinualImprovementRegistryGraphDeleteMutation",
|
||||
"name": "ObligationGraphDeleteMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation ContinualImprovementRegistryGraphDeleteMutation(\n $input: DeleteContinualImprovementRegistryInput!\n) {\n deleteContinualImprovementRegistry(input: $input) {\n deletedContinualImprovementRegistryId\n }\n}\n"
|
||||
"text": "mutation ObligationGraphDeleteMutation(\n $input: DeleteObligationInput!\n) {\n deleteObligation(input: $input) {\n deletedObligationId\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "7c7512a398e2391d5f7f083395cc6395";
|
||||
(node as any).hash = "224562b4db5e07b2a11aebda97cd0732";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<794221c1dbbf8fd2d1808863d55d2c05>>
|
||||
* @generated SignedSource<<7d2959d10f1bc8e80f8ab1d1ea4cb45f>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,18 +10,18 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ComplianceRegistriesPageQuery$variables = {
|
||||
export type ObligationGraphListQuery$variables = {
|
||||
organizationId: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type ComplianceRegistriesPageQuery$data = {
|
||||
export type ObligationGraphListQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ComplianceRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ObligationsPageFragment">;
|
||||
};
|
||||
};
|
||||
export type ComplianceRegistriesPageQuery = {
|
||||
response: ComplianceRegistriesPageQuery$data;
|
||||
variables: ComplianceRegistriesPageQuery$variables;
|
||||
export type ObligationGraphListQuery = {
|
||||
response: ObligationGraphListQuery$data;
|
||||
variables: ObligationGraphListQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -82,7 +82,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ComplianceRegistriesPageQuery",
|
||||
"name": "ObligationGraphListQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -98,7 +98,7 @@ return {
|
||||
{
|
||||
"args": (v2/*: any*/),
|
||||
"kind": "FragmentSpread",
|
||||
"name": "ComplianceRegistriesPageFragment"
|
||||
"name": "ObligationsPageFragment"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -115,7 +115,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ComplianceRegistriesPageQuery",
|
||||
"name": "ObligationGraphListQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -133,9 +133,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"concreteType": "ComplianceRegistryConnection",
|
||||
"concreteType": "ObligationConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "complianceRegistries",
|
||||
"name": "obligations",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -148,7 +148,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ComplianceRegistryEdge",
|
||||
"concreteType": "ObligationEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -156,7 +156,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ComplianceRegistry",
|
||||
"concreteType": "Obligation",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -333,9 +333,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "ComplianceRegistriesPage_complianceRegistries",
|
||||
"key": "ObligationsPage_obligations",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "complianceRegistries"
|
||||
"name": "obligations"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -347,16 +347,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "b63e74cea7f47c7e4f735ad2b52e1765",
|
||||
"cacheID": "1d94cb0e6a84428954ab8402ed2ca0ef",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ComplianceRegistriesPageQuery",
|
||||
"name": "ObligationGraphListQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ComplianceRegistriesPageQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ComplianceRegistriesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ComplianceRegistriesPageFragment_3iomuz on Organization {\n id\n complianceRegistries(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n area\n source\n requirement\n status\n lastReviewDate\n dueDate\n actionsToBeImplemented\n regulator\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
"text": "query ObligationGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ObligationsPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ObligationsPageFragment_3iomuz on Organization {\n id\n obligations(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n area\n source\n requirement\n status\n lastReviewDate\n dueDate\n actionsToBeImplemented\n regulator\n owner {\n id\n fullName\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 = "f0064c0d6d6e628923be30edb4b249db";
|
||||
(node as any).hash = "f86996b031e65cde72543c222caf243f";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<ec60b0715df426d6819f03f6e1597fef>>
|
||||
* @generated SignedSource<<dcd6c4da574c7104ae239d1da692f71a>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,11 +9,11 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type ComplianceRegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type ComplianceRegistryGraphNodeQuery$variables = {
|
||||
complianceRegistryId: string;
|
||||
export type ObligationStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type ObligationGraphNodeQuery$variables = {
|
||||
obligationId: string;
|
||||
};
|
||||
export type ComplianceRegistryGraphNodeQuery$data = {
|
||||
export type ObligationGraphNodeQuery$data = {
|
||||
readonly node: {
|
||||
readonly actionsToBeImplemented?: string | null | undefined;
|
||||
readonly area?: string | null | undefined;
|
||||
@@ -35,13 +35,13 @@ export type ComplianceRegistryGraphNodeQuery$data = {
|
||||
readonly snapshotId?: string | null | undefined;
|
||||
readonly source?: string | null | undefined;
|
||||
readonly sourceId?: string | null | undefined;
|
||||
readonly status?: ComplianceRegistryStatus;
|
||||
readonly status?: ObligationStatus;
|
||||
readonly updatedAt?: any;
|
||||
};
|
||||
};
|
||||
export type ComplianceRegistryGraphNodeQuery = {
|
||||
response: ComplianceRegistryGraphNodeQuery$data;
|
||||
variables: ComplianceRegistryGraphNodeQuery$variables;
|
||||
export type ObligationGraphNodeQuery = {
|
||||
response: ObligationGraphNodeQuery$data;
|
||||
variables: ObligationGraphNodeQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -49,14 +49,14 @@ var v0 = [
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "complianceRegistryId"
|
||||
"name": "obligationId"
|
||||
}
|
||||
],
|
||||
v1 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "id",
|
||||
"variableName": "complianceRegistryId"
|
||||
"variableName": "obligationId"
|
||||
}
|
||||
],
|
||||
v2 = {
|
||||
@@ -200,7 +200,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ComplianceRegistryGraphNodeQuery",
|
||||
"name": "ObligationGraphNodeQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -230,7 +230,7 @@ return {
|
||||
(v16/*: any*/),
|
||||
(v17/*: any*/)
|
||||
],
|
||||
"type": "ComplianceRegistry",
|
||||
"type": "Obligation",
|
||||
"abstractKey": null
|
||||
}
|
||||
],
|
||||
@@ -244,7 +244,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ComplianceRegistryGraphNodeQuery",
|
||||
"name": "ObligationGraphNodeQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -281,7 +281,7 @@ return {
|
||||
(v16/*: any*/),
|
||||
(v17/*: any*/)
|
||||
],
|
||||
"type": "ComplianceRegistry",
|
||||
"type": "Obligation",
|
||||
"abstractKey": null
|
||||
}
|
||||
],
|
||||
@@ -290,16 +290,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "2c4649d3258530fd79420bc2ed8fd14a",
|
||||
"cacheID": "1cc13435272f22a8167b370cca105184",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ComplianceRegistryGraphNodeQuery",
|
||||
"name": "ObligationGraphNodeQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ComplianceRegistryGraphNodeQuery(\n $complianceRegistryId: ID!\n) {\n node(id: $complianceRegistryId) {\n __typename\n ... on ComplianceRegistry {\n id\n snapshotId\n sourceId\n referenceId\n area\n source\n requirement\n actionsToBeImplemented\n regulator\n lastReviewDate\n dueDate\n status\n owner {\n id\n fullName\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
|
||||
"text": "query ObligationGraphNodeQuery(\n $obligationId: ID!\n) {\n node(id: $obligationId) {\n __typename\n ... on Obligation {\n id\n snapshotId\n sourceId\n referenceId\n area\n source\n requirement\n actionsToBeImplemented\n regulator\n lastReviewDate\n dueDate\n status\n owner {\n id\n fullName\n }\n organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "b290ce12f57b586e64bac227777bc294";
|
||||
(node as any).hash = "f7c98b6669bae79c42892dd296e9dd07";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<833c870a75dfe52e076fd57045cf1acd>>
|
||||
* @generated SignedSource<<7978f1bb5fdbb6129f0e6217574af621>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,8 +9,8 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type ComplianceRegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type UpdateComplianceRegistryInput = {
|
||||
export type ObligationStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type UpdateObligationInput = {
|
||||
actionsToBeImplemented?: string | null | undefined;
|
||||
area?: string | null | undefined;
|
||||
dueDate?: any | null | undefined;
|
||||
@@ -21,14 +21,14 @@ export type UpdateComplianceRegistryInput = {
|
||||
regulator?: string | null | undefined;
|
||||
requirement?: string | null | undefined;
|
||||
source?: string | null | undefined;
|
||||
status?: ComplianceRegistryStatus | null | undefined;
|
||||
status?: ObligationStatus | null | undefined;
|
||||
};
|
||||
export type ComplianceRegistryGraphUpdateMutation$variables = {
|
||||
input: UpdateComplianceRegistryInput;
|
||||
export type ObligationGraphUpdateMutation$variables = {
|
||||
input: UpdateObligationInput;
|
||||
};
|
||||
export type ComplianceRegistryGraphUpdateMutation$data = {
|
||||
readonly updateComplianceRegistry: {
|
||||
readonly complianceRegistry: {
|
||||
export type ObligationGraphUpdateMutation$data = {
|
||||
readonly updateObligation: {
|
||||
readonly obligation: {
|
||||
readonly actionsToBeImplemented: string | null | undefined;
|
||||
readonly area: string | null | undefined;
|
||||
readonly dueDate: any | null | undefined;
|
||||
@@ -42,14 +42,14 @@ export type ComplianceRegistryGraphUpdateMutation$data = {
|
||||
readonly regulator: string | null | undefined;
|
||||
readonly requirement: string | null | undefined;
|
||||
readonly source: string | null | undefined;
|
||||
readonly status: ComplianceRegistryStatus;
|
||||
readonly status: ObligationStatus;
|
||||
readonly updatedAt: any;
|
||||
};
|
||||
};
|
||||
};
|
||||
export type ComplianceRegistryGraphUpdateMutation = {
|
||||
response: ComplianceRegistryGraphUpdateMutation$data;
|
||||
variables: ComplianceRegistryGraphUpdateMutation$variables;
|
||||
export type ObligationGraphUpdateMutation = {
|
||||
response: ObligationGraphUpdateMutation$data;
|
||||
variables: ObligationGraphUpdateMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -77,17 +77,17 @@ v2 = [
|
||||
"variableName": "input"
|
||||
}
|
||||
],
|
||||
"concreteType": "UpdateComplianceRegistryPayload",
|
||||
"concreteType": "UpdateObligationPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "updateComplianceRegistry",
|
||||
"name": "updateObligation",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ComplianceRegistry",
|
||||
"concreteType": "Obligation",
|
||||
"kind": "LinkedField",
|
||||
"name": "complianceRegistry",
|
||||
"name": "obligation",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
@@ -192,7 +192,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ComplianceRegistryGraphUpdateMutation",
|
||||
"name": "ObligationGraphUpdateMutation",
|
||||
"selections": (v2/*: any*/),
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
@@ -201,20 +201,20 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ComplianceRegistryGraphUpdateMutation",
|
||||
"name": "ObligationGraphUpdateMutation",
|
||||
"selections": (v2/*: any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "d6a24a6f7a42eceab325fb186e1bf7fa",
|
||||
"cacheID": "f3f7c1657e914067e7543bf98c91c2d0",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ComplianceRegistryGraphUpdateMutation",
|
||||
"name": "ObligationGraphUpdateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation ComplianceRegistryGraphUpdateMutation(\n $input: UpdateComplianceRegistryInput!\n) {\n updateComplianceRegistry(input: $input) {\n complianceRegistry {\n id\n referenceId\n area\n source\n requirement\n actionsToBeImplemented\n regulator\n lastReviewDate\n dueDate\n status\n owner {\n id\n fullName\n }\n updatedAt\n }\n }\n}\n"
|
||||
"text": "mutation ObligationGraphUpdateMutation(\n $input: UpdateObligationInput!\n) {\n updateObligation(input: $input) {\n obligation {\n id\n referenceId\n area\n source\n requirement\n actionsToBeImplemented\n regulator\n lastReviewDate\n dueDate\n status\n owner {\n id\n fullName\n }\n updatedAt\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "607857e9f72cf13338ea52813c035e06";
|
||||
(node as any).hash = "4de068d83b83280ea680aad303c84098";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<0eb58c6c3650563cef060921b0d7f65c>>
|
||||
* @generated SignedSource<<d19bc7dbb1b1ec90138ba9e902dadd4a>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,17 +9,17 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type ProcessingActivityRegistryDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityRegistryLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS";
|
||||
export type ProcessingActivityRegistrySpecialOrCriminalData = "NO" | "POSSIBLE" | "YES";
|
||||
export type ProcessingActivityRegistryTransferImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityRegistryTransferSafeguards = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES";
|
||||
export type CreateProcessingActivityRegistryInput = {
|
||||
export type ProcessingActivityDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS";
|
||||
export type ProcessingActivitySpecialOrCriminalData = "NO" | "POSSIBLE" | "YES";
|
||||
export type ProcessingActivityTransferImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityTransferSafeguards = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES";
|
||||
export type CreateProcessingActivityInput = {
|
||||
consentEvidenceLink?: string | null | undefined;
|
||||
dataProtectionImpactAssessment: ProcessingActivityRegistryDataProtectionImpactAssessment;
|
||||
dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment;
|
||||
dataSubjectCategory?: string | null | undefined;
|
||||
internationalTransfers: boolean;
|
||||
lawfulBasis: ProcessingActivityRegistryLawfulBasis;
|
||||
lawfulBasis: ProcessingActivityLawfulBasis;
|
||||
location?: string | null | undefined;
|
||||
name: string;
|
||||
organizationId: string;
|
||||
@@ -28,25 +28,25 @@ export type CreateProcessingActivityRegistryInput = {
|
||||
recipients?: string | null | undefined;
|
||||
retentionPeriod?: string | null | undefined;
|
||||
securityMeasures?: string | null | undefined;
|
||||
specialOrCriminalData: ProcessingActivityRegistrySpecialOrCriminalData;
|
||||
transferImpactAssessment: ProcessingActivityRegistryTransferImpactAssessment;
|
||||
transferSafeguards?: ProcessingActivityRegistryTransferSafeguards | null | undefined;
|
||||
specialOrCriminalData: ProcessingActivitySpecialOrCriminalData;
|
||||
transferImpactAssessment: ProcessingActivityTransferImpactAssessment;
|
||||
transferSafeguards?: ProcessingActivityTransferSafeguards | null | undefined;
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphCreateMutation$variables = {
|
||||
export type ProcessingActivityGraphCreateMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: CreateProcessingActivityRegistryInput;
|
||||
input: CreateProcessingActivityInput;
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphCreateMutation$data = {
|
||||
readonly createProcessingActivityRegistry: {
|
||||
readonly processingActivityRegistryEdge: {
|
||||
export type ProcessingActivityGraphCreateMutation$data = {
|
||||
readonly createProcessingActivity: {
|
||||
readonly processingActivityEdge: {
|
||||
readonly node: {
|
||||
readonly consentEvidenceLink: string | null | undefined;
|
||||
readonly createdAt: any;
|
||||
readonly dataProtectionImpactAssessment: ProcessingActivityRegistryDataProtectionImpactAssessment;
|
||||
readonly dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment;
|
||||
readonly dataSubjectCategory: string | null | undefined;
|
||||
readonly id: string;
|
||||
readonly internationalTransfers: boolean;
|
||||
readonly lawfulBasis: ProcessingActivityRegistryLawfulBasis;
|
||||
readonly lawfulBasis: ProcessingActivityLawfulBasis;
|
||||
readonly location: string | null | undefined;
|
||||
readonly name: string;
|
||||
readonly personalDataCategory: string | null | undefined;
|
||||
@@ -54,16 +54,16 @@ export type ProcessingActivityRegistryGraphCreateMutation$data = {
|
||||
readonly recipients: string | null | undefined;
|
||||
readonly retentionPeriod: string | null | undefined;
|
||||
readonly securityMeasures: string | null | undefined;
|
||||
readonly specialOrCriminalData: ProcessingActivityRegistrySpecialOrCriminalData;
|
||||
readonly transferImpactAssessment: ProcessingActivityRegistryTransferImpactAssessment;
|
||||
readonly transferSafeguards: ProcessingActivityRegistryTransferSafeguards | null | undefined;
|
||||
readonly specialOrCriminalData: ProcessingActivitySpecialOrCriminalData;
|
||||
readonly transferImpactAssessment: ProcessingActivityTransferImpactAssessment;
|
||||
readonly transferSafeguards: ProcessingActivityTransferSafeguards | null | undefined;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphCreateMutation = {
|
||||
response: ProcessingActivityRegistryGraphCreateMutation$data;
|
||||
variables: ProcessingActivityRegistryGraphCreateMutation$variables;
|
||||
export type ProcessingActivityGraphCreateMutation = {
|
||||
response: ProcessingActivityGraphCreateMutation$data;
|
||||
variables: ProcessingActivityGraphCreateMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -87,15 +87,15 @@ v2 = [
|
||||
v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ProcessingActivityRegistryEdge",
|
||||
"concreteType": "ProcessingActivityEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "processingActivityRegistryEdge",
|
||||
"name": "processingActivityEdge",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ProcessingActivityRegistry",
|
||||
"concreteType": "ProcessingActivity",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -233,14 +233,14 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ProcessingActivityRegistryGraphCreateMutation",
|
||||
"name": "ProcessingActivityGraphCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateProcessingActivityRegistryPayload",
|
||||
"concreteType": "CreateProcessingActivityPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createProcessingActivityRegistry",
|
||||
"name": "createProcessingActivity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/)
|
||||
@@ -258,14 +258,14 @@ return {
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "ProcessingActivityRegistryGraphCreateMutation",
|
||||
"name": "ProcessingActivityGraphCreateMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "CreateProcessingActivityRegistryPayload",
|
||||
"concreteType": "CreateProcessingActivityPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "createProcessingActivityRegistry",
|
||||
"name": "createProcessingActivity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
@@ -276,7 +276,7 @@ return {
|
||||
"handle": "prependEdge",
|
||||
"key": "",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "processingActivityRegistryEdge",
|
||||
"name": "processingActivityEdge",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
@@ -291,16 +291,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "22dc5c717c1e1de0a4bc8399a8e4f2eb",
|
||||
"cacheID": "3a675caa3773822d9b478ad1669eb69f",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ProcessingActivityRegistryGraphCreateMutation",
|
||||
"name": "ProcessingActivityGraphCreateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation ProcessingActivityRegistryGraphCreateMutation(\n $input: CreateProcessingActivityRegistryInput!\n) {\n createProcessingActivityRegistry(input: $input) {\n processingActivityRegistryEdge {\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 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 createdAt\n }\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "000dcbeea412bc2b3863a37f58135df3";
|
||||
(node as any).hash = "bd2e03818df99d5b692216d738b18583";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<0d815d748a76df90cc5305fa28913125>>
|
||||
* @generated SignedSource<<a6cfe48929d6439d3dee377f49f161e0>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,21 +9,21 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type DeleteComplianceRegistryInput = {
|
||||
complianceRegistryId: string;
|
||||
export type DeleteProcessingActivityInput = {
|
||||
processingActivityId: string;
|
||||
};
|
||||
export type ComplianceRegistryGraphDeleteMutation$variables = {
|
||||
export type ProcessingActivityGraphDeleteMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
input: DeleteComplianceRegistryInput;
|
||||
input: DeleteProcessingActivityInput;
|
||||
};
|
||||
export type ComplianceRegistryGraphDeleteMutation$data = {
|
||||
readonly deleteComplianceRegistry: {
|
||||
readonly deletedComplianceRegistryId: string;
|
||||
export type ProcessingActivityGraphDeleteMutation$data = {
|
||||
readonly deleteProcessingActivity: {
|
||||
readonly deletedProcessingActivityId: string;
|
||||
};
|
||||
};
|
||||
export type ComplianceRegistryGraphDeleteMutation = {
|
||||
response: ComplianceRegistryGraphDeleteMutation$data;
|
||||
variables: ComplianceRegistryGraphDeleteMutation$variables;
|
||||
export type ProcessingActivityGraphDeleteMutation = {
|
||||
response: ProcessingActivityGraphDeleteMutation$data;
|
||||
variables: ProcessingActivityGraphDeleteMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -48,7 +48,7 @@ v3 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "deletedComplianceRegistryId",
|
||||
"name": "deletedProcessingActivityId",
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
@@ -59,14 +59,14 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ComplianceRegistryGraphDeleteMutation",
|
||||
"name": "ProcessingActivityGraphDeleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteComplianceRegistryPayload",
|
||||
"concreteType": "DeleteProcessingActivityPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteComplianceRegistry",
|
||||
"name": "deleteProcessingActivity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/)
|
||||
@@ -84,14 +84,14 @@ return {
|
||||
(v0/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "ComplianceRegistryGraphDeleteMutation",
|
||||
"name": "ProcessingActivityGraphDeleteMutation",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v2/*: any*/),
|
||||
"concreteType": "DeleteComplianceRegistryPayload",
|
||||
"concreteType": "DeleteProcessingActivityPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "deleteComplianceRegistry",
|
||||
"name": "deleteProcessingActivity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v3/*: any*/),
|
||||
@@ -102,7 +102,7 @@ return {
|
||||
"handle": "deleteEdge",
|
||||
"key": "",
|
||||
"kind": "ScalarHandle",
|
||||
"name": "deletedComplianceRegistryId",
|
||||
"name": "deletedProcessingActivityId",
|
||||
"handleArgs": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
@@ -117,16 +117,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "4ee4b9ffa6ea477c93a0ba80b8295a44",
|
||||
"cacheID": "302c79f7bfa307aa484acccab48c8591",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ComplianceRegistryGraphDeleteMutation",
|
||||
"name": "ProcessingActivityGraphDeleteMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation ComplianceRegistryGraphDeleteMutation(\n $input: DeleteComplianceRegistryInput!\n) {\n deleteComplianceRegistry(input: $input) {\n deletedComplianceRegistryId\n }\n}\n"
|
||||
"text": "mutation ProcessingActivityGraphDeleteMutation(\n $input: DeleteProcessingActivityInput!\n) {\n deleteProcessingActivity(input: $input) {\n deletedProcessingActivityId\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "c979ce19185e3d4c20c8a952b5245993";
|
||||
(node as any).hash = "a8724b743deef9c8889ae937311338c3";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<e77ebb6a609b6122e9c6927f4e00acc4>>
|
||||
* @generated SignedSource<<cdb6464dd05ef3e28af38bf6552c1f51>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,18 +10,18 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ProcessingActivityRegistriesPageQuery$variables = {
|
||||
export type ProcessingActivityGraphListQuery$variables = {
|
||||
organizationId: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type ProcessingActivityRegistriesPageQuery$data = {
|
||||
export type ProcessingActivityGraphListQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivityRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivitiesPageFragment">;
|
||||
};
|
||||
};
|
||||
export type ProcessingActivityRegistriesPageQuery = {
|
||||
response: ProcessingActivityRegistriesPageQuery$data;
|
||||
variables: ProcessingActivityRegistriesPageQuery$variables;
|
||||
export type ProcessingActivityGraphListQuery = {
|
||||
response: ProcessingActivityGraphListQuery$data;
|
||||
variables: ProcessingActivityGraphListQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -82,7 +82,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ProcessingActivityRegistriesPageQuery",
|
||||
"name": "ProcessingActivityGraphListQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -98,7 +98,7 @@ return {
|
||||
{
|
||||
"args": (v2/*: any*/),
|
||||
"kind": "FragmentSpread",
|
||||
"name": "ProcessingActivityRegistriesPageFragment"
|
||||
"name": "ProcessingActivitiesPageFragment"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -115,7 +115,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ProcessingActivityRegistriesPageQuery",
|
||||
"name": "ProcessingActivityGraphListQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -133,9 +133,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"concreteType": "ProcessingActivityRegistryConnection",
|
||||
"concreteType": "ProcessingActivityConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "processingActivityRegistries",
|
||||
"name": "processingActivities",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -148,7 +148,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ProcessingActivityRegistryEdge",
|
||||
"concreteType": "ProcessingActivityEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -156,7 +156,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ProcessingActivityRegistry",
|
||||
"concreteType": "ProcessingActivity",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -300,9 +300,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "ProcessingActivityRegistriesPage_processingActivityRegistries",
|
||||
"key": "ProcessingActivitiesPage_processingActivities",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "processingActivityRegistries"
|
||||
"name": "processingActivities"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -314,16 +314,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "2b5cf834c7b4f34bb4a8e74705d1e530",
|
||||
"cacheID": "5b9b9ab3b28fe10be6f1e57f3756187a",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ProcessingActivityRegistriesPageQuery",
|
||||
"name": "ProcessingActivityGraphListQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ProcessingActivityRegistriesPageQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ProcessingActivityRegistriesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ProcessingActivityRegistriesPageFragment_3iomuz on Organization {\n id\n processingActivityRegistries(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 }\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"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "a4030e6ab7ce0351b431ce90d0440135";
|
||||
(node as any).hash = "4daedd61c0ba271c6d37811cef029da8";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<676223ac3bde5a9edf7e3d68fe3ed981>>
|
||||
* @generated SignedSource<<a78af4956f20232f8c6084f66ee6aac5>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,23 +9,23 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type ProcessingActivityRegistryDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityRegistryLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS";
|
||||
export type ProcessingActivityRegistrySpecialOrCriminalData = "NO" | "POSSIBLE" | "YES";
|
||||
export type ProcessingActivityRegistryTransferImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityRegistryTransferSafeguards = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES";
|
||||
export type ProcessingActivityRegistryGraphNodeQuery$variables = {
|
||||
processingActivityRegistryId: string;
|
||||
export type ProcessingActivityDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS";
|
||||
export type ProcessingActivitySpecialOrCriminalData = "NO" | "POSSIBLE" | "YES";
|
||||
export type ProcessingActivityTransferImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityTransferSafeguards = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES";
|
||||
export type ProcessingActivityGraphNodeQuery$variables = {
|
||||
processingActivityId: string;
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphNodeQuery$data = {
|
||||
export type ProcessingActivityGraphNodeQuery$data = {
|
||||
readonly node: {
|
||||
readonly consentEvidenceLink?: string | null | undefined;
|
||||
readonly createdAt?: any;
|
||||
readonly dataProtectionImpactAssessment?: ProcessingActivityRegistryDataProtectionImpactAssessment;
|
||||
readonly dataProtectionImpactAssessment?: ProcessingActivityDataProtectionImpactAssessment;
|
||||
readonly dataSubjectCategory?: string | null | undefined;
|
||||
readonly id?: string;
|
||||
readonly internationalTransfers?: boolean;
|
||||
readonly lawfulBasis?: ProcessingActivityRegistryLawfulBasis;
|
||||
readonly lawfulBasis?: ProcessingActivityLawfulBasis;
|
||||
readonly location?: string | null | undefined;
|
||||
readonly name?: string;
|
||||
readonly organization?: {
|
||||
@@ -38,15 +38,15 @@ export type ProcessingActivityRegistryGraphNodeQuery$data = {
|
||||
readonly retentionPeriod?: string | null | undefined;
|
||||
readonly securityMeasures?: string | null | undefined;
|
||||
readonly snapshotId?: string | null | undefined;
|
||||
readonly specialOrCriminalData?: ProcessingActivityRegistrySpecialOrCriminalData;
|
||||
readonly transferImpactAssessment?: ProcessingActivityRegistryTransferImpactAssessment;
|
||||
readonly transferSafeguards?: ProcessingActivityRegistryTransferSafeguards | null | undefined;
|
||||
readonly specialOrCriminalData?: ProcessingActivitySpecialOrCriminalData;
|
||||
readonly transferImpactAssessment?: ProcessingActivityTransferImpactAssessment;
|
||||
readonly transferSafeguards?: ProcessingActivityTransferSafeguards | null | undefined;
|
||||
readonly updatedAt?: any;
|
||||
};
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphNodeQuery = {
|
||||
response: ProcessingActivityRegistryGraphNodeQuery$data;
|
||||
variables: ProcessingActivityRegistryGraphNodeQuery$variables;
|
||||
export type ProcessingActivityGraphNodeQuery = {
|
||||
response: ProcessingActivityGraphNodeQuery$data;
|
||||
variables: ProcessingActivityGraphNodeQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -54,14 +54,14 @@ var v0 = [
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "processingActivityRegistryId"
|
||||
"name": "processingActivityId"
|
||||
}
|
||||
],
|
||||
v1 = [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "id",
|
||||
"variableName": "processingActivityRegistryId"
|
||||
"variableName": "processingActivityId"
|
||||
}
|
||||
],
|
||||
v2 = {
|
||||
@@ -215,7 +215,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ProcessingActivityRegistryGraphNodeQuery",
|
||||
"name": "ProcessingActivityGraphNodeQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -249,7 +249,7 @@ return {
|
||||
(v20/*: any*/),
|
||||
(v21/*: any*/)
|
||||
],
|
||||
"type": "ProcessingActivityRegistry",
|
||||
"type": "ProcessingActivity",
|
||||
"abstractKey": null
|
||||
}
|
||||
],
|
||||
@@ -263,7 +263,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ProcessingActivityRegistryGraphNodeQuery",
|
||||
"name": "ProcessingActivityGraphNodeQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -304,7 +304,7 @@ return {
|
||||
(v20/*: any*/),
|
||||
(v21/*: any*/)
|
||||
],
|
||||
"type": "ProcessingActivityRegistry",
|
||||
"type": "ProcessingActivity",
|
||||
"abstractKey": null
|
||||
}
|
||||
],
|
||||
@@ -313,16 +313,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "10b9608f3b93e930c05f415a0ac9fbec",
|
||||
"cacheID": "b2dd76939002ce8c523c7ac5a49c29f5",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ProcessingActivityRegistryGraphNodeQuery",
|
||||
"name": "ProcessingActivityGraphNodeQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ProcessingActivityRegistryGraphNodeQuery(\n $processingActivityRegistryId: ID!\n) {\n node(id: $processingActivityRegistryId) {\n __typename\n ... on ProcessingActivityRegistry {\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 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 organization {\n id\n name\n }\n createdAt\n updatedAt\n }\n id\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "c1728cff79a3773498b383bb32728cf6";
|
||||
(node as any).hash = "7beac09f84d60e20e73a5b8e958908dd";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<86ea716b0545bec9ee5eabbc2bf35b74>>
|
||||
* @generated SignedSource<<48427eb821d3a0f4e53430bb384d0305>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,18 +9,18 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type ProcessingActivityRegistryDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityRegistryLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS";
|
||||
export type ProcessingActivityRegistrySpecialOrCriminalData = "NO" | "POSSIBLE" | "YES";
|
||||
export type ProcessingActivityRegistryTransferImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityRegistryTransferSafeguards = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES";
|
||||
export type UpdateProcessingActivityRegistryInput = {
|
||||
export type ProcessingActivityDataProtectionImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS";
|
||||
export type ProcessingActivitySpecialOrCriminalData = "NO" | "POSSIBLE" | "YES";
|
||||
export type ProcessingActivityTransferImpactAssessment = "NEEDED" | "NOT_NEEDED";
|
||||
export type ProcessingActivityTransferSafeguards = "ADEQUACY_DECISION" | "BINDING_CORPORATE_RULES" | "CERTIFICATION_MECHANISMS" | "CODES_OF_CONDUCT" | "DEROGATIONS" | "STANDARD_CONTRACTUAL_CLAUSES";
|
||||
export type UpdateProcessingActivityInput = {
|
||||
consentEvidenceLink?: string | null | undefined;
|
||||
dataProtectionImpactAssessment?: ProcessingActivityRegistryDataProtectionImpactAssessment | null | undefined;
|
||||
dataProtectionImpactAssessment?: ProcessingActivityDataProtectionImpactAssessment | null | undefined;
|
||||
dataSubjectCategory?: string | null | undefined;
|
||||
id: string;
|
||||
internationalTransfers?: boolean | null | undefined;
|
||||
lawfulBasis?: ProcessingActivityRegistryLawfulBasis | null | undefined;
|
||||
lawfulBasis?: ProcessingActivityLawfulBasis | null | undefined;
|
||||
location?: string | null | undefined;
|
||||
name?: string | null | undefined;
|
||||
personalDataCategory?: string | null | undefined;
|
||||
@@ -28,22 +28,22 @@ export type UpdateProcessingActivityRegistryInput = {
|
||||
recipients?: string | null | undefined;
|
||||
retentionPeriod?: string | null | undefined;
|
||||
securityMeasures?: string | null | undefined;
|
||||
specialOrCriminalData?: ProcessingActivityRegistrySpecialOrCriminalData | null | undefined;
|
||||
transferImpactAssessment?: ProcessingActivityRegistryTransferImpactAssessment | null | undefined;
|
||||
transferSafeguards?: ProcessingActivityRegistryTransferSafeguards | null | undefined;
|
||||
specialOrCriminalData?: ProcessingActivitySpecialOrCriminalData | null | undefined;
|
||||
transferImpactAssessment?: ProcessingActivityTransferImpactAssessment | null | undefined;
|
||||
transferSafeguards?: ProcessingActivityTransferSafeguards | null | undefined;
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphUpdateMutation$variables = {
|
||||
input: UpdateProcessingActivityRegistryInput;
|
||||
export type ProcessingActivityGraphUpdateMutation$variables = {
|
||||
input: UpdateProcessingActivityInput;
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphUpdateMutation$data = {
|
||||
readonly updateProcessingActivityRegistry: {
|
||||
readonly processingActivityRegistry: {
|
||||
export type ProcessingActivityGraphUpdateMutation$data = {
|
||||
readonly updateProcessingActivity: {
|
||||
readonly processingActivity: {
|
||||
readonly consentEvidenceLink: string | null | undefined;
|
||||
readonly dataProtectionImpactAssessment: ProcessingActivityRegistryDataProtectionImpactAssessment;
|
||||
readonly dataProtectionImpactAssessment: ProcessingActivityDataProtectionImpactAssessment;
|
||||
readonly dataSubjectCategory: string | null | undefined;
|
||||
readonly id: string;
|
||||
readonly internationalTransfers: boolean;
|
||||
readonly lawfulBasis: ProcessingActivityRegistryLawfulBasis;
|
||||
readonly lawfulBasis: ProcessingActivityLawfulBasis;
|
||||
readonly location: string | null | undefined;
|
||||
readonly name: string;
|
||||
readonly personalDataCategory: string | null | undefined;
|
||||
@@ -51,16 +51,16 @@ export type ProcessingActivityRegistryGraphUpdateMutation$data = {
|
||||
readonly recipients: string | null | undefined;
|
||||
readonly retentionPeriod: string | null | undefined;
|
||||
readonly securityMeasures: string | null | undefined;
|
||||
readonly specialOrCriminalData: ProcessingActivityRegistrySpecialOrCriminalData;
|
||||
readonly transferImpactAssessment: ProcessingActivityRegistryTransferImpactAssessment;
|
||||
readonly transferSafeguards: ProcessingActivityRegistryTransferSafeguards | null | undefined;
|
||||
readonly specialOrCriminalData: ProcessingActivitySpecialOrCriminalData;
|
||||
readonly transferImpactAssessment: ProcessingActivityTransferImpactAssessment;
|
||||
readonly transferSafeguards: ProcessingActivityTransferSafeguards | null | undefined;
|
||||
readonly updatedAt: any;
|
||||
};
|
||||
};
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphUpdateMutation = {
|
||||
response: ProcessingActivityRegistryGraphUpdateMutation$data;
|
||||
variables: ProcessingActivityRegistryGraphUpdateMutation$variables;
|
||||
export type ProcessingActivityGraphUpdateMutation = {
|
||||
response: ProcessingActivityGraphUpdateMutation$data;
|
||||
variables: ProcessingActivityGraphUpdateMutation$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -81,17 +81,17 @@ v1 = [
|
||||
"variableName": "input"
|
||||
}
|
||||
],
|
||||
"concreteType": "UpdateProcessingActivityRegistryPayload",
|
||||
"concreteType": "UpdateProcessingActivityPayload",
|
||||
"kind": "LinkedField",
|
||||
"name": "updateProcessingActivityRegistry",
|
||||
"name": "updateProcessingActivity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ProcessingActivityRegistry",
|
||||
"concreteType": "ProcessingActivity",
|
||||
"kind": "LinkedField",
|
||||
"name": "processingActivityRegistry",
|
||||
"name": "processingActivity",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -225,7 +225,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ProcessingActivityRegistryGraphUpdateMutation",
|
||||
"name": "ProcessingActivityGraphUpdateMutation",
|
||||
"selections": (v1/*: any*/),
|
||||
"type": "Mutation",
|
||||
"abstractKey": null
|
||||
@@ -234,20 +234,20 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ProcessingActivityRegistryGraphUpdateMutation",
|
||||
"name": "ProcessingActivityGraphUpdateMutation",
|
||||
"selections": (v1/*: any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "d4baf575ac4c35aab308228550cc6474",
|
||||
"cacheID": "9ede6451e111196c25a7a4cee9ad86bf",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ProcessingActivityRegistryGraphUpdateMutation",
|
||||
"name": "ProcessingActivityGraphUpdateMutation",
|
||||
"operationKind": "mutation",
|
||||
"text": "mutation ProcessingActivityRegistryGraphUpdateMutation(\n $input: UpdateProcessingActivityRegistryInput!\n) {\n updateProcessingActivityRegistry(input: $input) {\n processingActivityRegistry {\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 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 updatedAt\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "2a6f14684cad524d383d66421354d6c7";
|
||||
(node as any).hash = "ee0c2f6027edae2b80f603503f5f3815";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<8b949b0eacdf3d9aa1bbd71cbe6af5b0>>
|
||||
* @generated SignedSource<<11dd6f7de6693a626306b674bb8cc4f0>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,7 +9,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type SnapshotsType = "ASSETS" | "COMPLIANCE_REGISTRIES" | "CONTINUAL_IMPROVEMENT_REGISTRIES" | "DATA" | "NONCONFORMITY_REGISTRIES" | "PROCESSING_ACTIVITY_REGISTRIES" | "RISKS" | "VENDORS";
|
||||
export type SnapshotsType = "ASSETS" | "CONTINUAL_IMPROVEMENTS" | "DATA" | "NONCONFORMITIES" | "OBLIGATIONS" | "PROCESSING_ACTIVITIES" | "RISKS" | "VENDORS";
|
||||
export type CreateSnapshotInput = {
|
||||
description?: string | null | undefined;
|
||||
name: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<a8ffaeebdff333e49715088203906cdb>>
|
||||
* @generated SignedSource<<d6dc9bf5a6c36f140bb864def22c0134>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,7 +9,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type SnapshotsType = "ASSETS" | "COMPLIANCE_REGISTRIES" | "CONTINUAL_IMPROVEMENT_REGISTRIES" | "DATA" | "NONCONFORMITY_REGISTRIES" | "PROCESSING_ACTIVITY_REGISTRIES" | "RISKS" | "VENDORS";
|
||||
export type SnapshotsType = "ASSETS" | "CONTINUAL_IMPROVEMENTS" | "DATA" | "NONCONFORMITIES" | "OBLIGATIONS" | "PROCESSING_ACTIVITIES" | "RISKS" | "VENDORS";
|
||||
export type SnapshotGraphNodeQuery$variables = {
|
||||
snapshotId: string;
|
||||
};
|
||||
|
||||
@@ -144,24 +144,24 @@ export function MainLayout() {
|
||||
to={`${prefix}/audits`}
|
||||
/>
|
||||
<SidebarItem
|
||||
label={__("Nonconformity Registries")}
|
||||
label={__("Nonconformities")}
|
||||
icon={IconCrossLargeX}
|
||||
to={`${prefix}/nonconformity-registries`}
|
||||
to={`${prefix}/nonconformities`}
|
||||
/>
|
||||
<SidebarItem
|
||||
label={__("Compliance Registries")}
|
||||
label={__("Obligations")}
|
||||
icon={IconBook}
|
||||
to={`${prefix}/compliance-registries`}
|
||||
to={`${prefix}/obligations`}
|
||||
/>
|
||||
<SidebarItem
|
||||
label={__("Continual Improvement Registries")}
|
||||
label={__("Continual Improvements")}
|
||||
icon={IconRotateCw}
|
||||
to={`${prefix}/continual-improvement-registries`}
|
||||
to={`${prefix}/continual-improvements`}
|
||||
/>
|
||||
<SidebarItem
|
||||
label={__("Processing Activity Registries")}
|
||||
label={__("Processing Activities")}
|
||||
icon={IconCircleProgress}
|
||||
to={`${prefix}/processing-activity-registries`}
|
||||
to={`${prefix}/processing-activities`}
|
||||
/>
|
||||
<SidebarItem
|
||||
label={__("Snapshots")}
|
||||
|
||||
@@ -4,11 +4,11 @@ import {
|
||||
type PreloadedQuery,
|
||||
} from "react-relay";
|
||||
import {
|
||||
continualImprovementRegistryNodeQuery,
|
||||
useDeleteContinualImprovementRegistry,
|
||||
useUpdateContinualImprovementRegistry,
|
||||
ContinualImprovementRegistriesConnectionKey,
|
||||
} from "../../../hooks/graph/ContinualImprovementRegistryGraph";
|
||||
continualImprovementNodeQuery,
|
||||
useDeleteContinualImprovement,
|
||||
useUpdateContinualImprovement,
|
||||
ContinualImprovementsConnectionKey,
|
||||
} from "../../../hooks/graph/ContinualImprovementGraph";
|
||||
import {
|
||||
ActionDropdown,
|
||||
Badge,
|
||||
@@ -33,9 +33,9 @@ import { Controller } from "react-hook-form";
|
||||
import z from "zod";
|
||||
import { getStatusVariant, getStatusLabel, formatDatetime, validateSnapshotConsistency } from "@probo/helpers";
|
||||
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||
import type { ContinualImprovementRegistryGraphNodeQuery } from "/hooks/graph/__generated__/ContinualImprovementRegistryGraphNodeQuery.graphql";
|
||||
import type { ContinualImprovementGraphNodeQuery } from "/hooks/graph/__generated__/ContinualImprovementGraphNodeQuery.graphql";
|
||||
|
||||
const updateRegistrySchema = z.object({
|
||||
const updateImprovementSchema = z.object({
|
||||
referenceId: z.string().min(1, "Reference ID is required"),
|
||||
description: z.string().optional(),
|
||||
source: z.string().optional(),
|
||||
@@ -46,55 +46,55 @@ const updateRegistrySchema = z.object({
|
||||
});
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<ContinualImprovementRegistryGraphNodeQuery>;
|
||||
queryRef: PreloadedQuery<ContinualImprovementGraphNodeQuery>;
|
||||
};
|
||||
|
||||
export default function ContinualImprovementRegistryDetailsPage(props: Props) {
|
||||
const data = usePreloadedQuery<ContinualImprovementRegistryGraphNodeQuery>(continualImprovementRegistryNodeQuery, props.queryRef);
|
||||
const registry = data.node;
|
||||
export default function ContinualImprovementDetailsPage(props: Props) {
|
||||
const data = usePreloadedQuery<ContinualImprovementGraphNodeQuery>(continualImprovementNodeQuery, props.queryRef);
|
||||
const improvement = data.node;
|
||||
const { __ } = useTranslate();
|
||||
const { toast } = useToast();
|
||||
const organizationId = useOrganizationId();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
|
||||
if (!registry) {
|
||||
return <div>{__("Continual improvement registry entry not found")}</div>;
|
||||
if (!improvement) {
|
||||
return <div>{__("Continual improvement entry not found")}</div>;
|
||||
}
|
||||
|
||||
validateSnapshotConsistency(registry, snapshotId);
|
||||
validateSnapshotConsistency(improvement, snapshotId);
|
||||
|
||||
const updateRegistry = useUpdateContinualImprovementRegistry();
|
||||
const updateImprovement = useUpdateContinualImprovement();
|
||||
|
||||
const connectionId = ConnectionHandler.getConnectionID(
|
||||
organizationId,
|
||||
ContinualImprovementRegistriesConnectionKey,
|
||||
ContinualImprovementsConnectionKey,
|
||||
{ filter: { snapshotId: snapshotId || null } }
|
||||
);
|
||||
|
||||
const deleteRegistry = useDeleteContinualImprovementRegistry({ id: registry.id!, referenceId: registry.referenceId! }, connectionId);
|
||||
const deleteImprovement = useDeleteContinualImprovement({ id: improvement.id!, referenceId: improvement.referenceId! }, connectionId);
|
||||
|
||||
const { register, handleSubmit, formState, control } = useFormWithSchema(
|
||||
updateRegistrySchema,
|
||||
updateImprovementSchema,
|
||||
{
|
||||
defaultValues: {
|
||||
referenceId: registry.referenceId || "",
|
||||
description: registry.description || "",
|
||||
source: registry.source || "",
|
||||
targetDate: registry.targetDate
|
||||
? new Date(registry.targetDate).toISOString().split("T")[0]
|
||||
referenceId: improvement.referenceId || "",
|
||||
description: improvement.description || "",
|
||||
source: improvement.source || "",
|
||||
targetDate: improvement.targetDate
|
||||
? new Date(improvement.targetDate).toISOString().split("T")[0]
|
||||
: "",
|
||||
status: registry.status || "OPEN",
|
||||
priority: registry.priority || "MEDIUM",
|
||||
ownerId: registry.owner?.id || "",
|
||||
status: improvement.status || "OPEN",
|
||||
priority: improvement.priority || "MEDIUM",
|
||||
ownerId: improvement.owner?.id || "",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const onSubmit = handleSubmit(async (formData) => {
|
||||
try {
|
||||
await updateRegistry({
|
||||
id: registry.id!,
|
||||
await updateImprovement({
|
||||
id: improvement.id!,
|
||||
referenceId: formData.referenceId,
|
||||
description: formData.description || undefined,
|
||||
source: formData.source || undefined,
|
||||
@@ -107,13 +107,13 @@ export default function ContinualImprovementRegistryDetailsPage(props: Props) {
|
||||
|
||||
toast({
|
||||
title: __("Success"),
|
||||
description: __("Continual improvement registry entry updated successfully"),
|
||||
description: __("Continual improvement entry updated successfully"),
|
||||
variant: "success",
|
||||
});
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: __("Failed to update continual improvement registry entry"),
|
||||
description: __("Failed to update continual improvement entry"),
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
@@ -131,9 +131,9 @@ export default function ContinualImprovementRegistryDetailsPage(props: Props) {
|
||||
{ value: "HIGH", label: __("High") },
|
||||
];
|
||||
|
||||
const breadcrumbRegistriesUrl = isSnapshotMode
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/continual-improvement-registries`
|
||||
: `/organizations/${organizationId}/continual-improvement-registries`;
|
||||
const breadcrumbImprovementsUrl = isSnapshotMode
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/continual-improvements`
|
||||
: `/organizations/${organizationId}/continual-improvements`;
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
@@ -143,13 +143,13 @@ export default function ContinualImprovementRegistryDetailsPage(props: Props) {
|
||||
<div className="flex items-center justify-between">
|
||||
<Breadcrumb
|
||||
items={[
|
||||
{ label: __("Continual Improvement Registries"), to: breadcrumbRegistriesUrl },
|
||||
{ label: registry.referenceId! },
|
||||
{ label: __("Continual Improvements"), to: breadcrumbImprovementsUrl },
|
||||
{ label: improvement.referenceId! },
|
||||
]}
|
||||
/>
|
||||
{!isSnapshotMode && (
|
||||
<ActionDropdown>
|
||||
<DropdownItem onClick={deleteRegistry} variant="danger">
|
||||
<DropdownItem onClick={deleteImprovement} variant="danger">
|
||||
{__("Delete")}
|
||||
</DropdownItem>
|
||||
</ActionDropdown>
|
||||
@@ -160,12 +160,12 @@ export default function ContinualImprovementRegistryDetailsPage(props: Props) {
|
||||
<div className="p-6">
|
||||
<div className="mb-6">
|
||||
<div className="flex items-center gap-4">
|
||||
<h1 className="text-2xl font-bold">{registry.referenceId}</h1>
|
||||
<Badge variant={getStatusVariant(registry.status || "OPEN")}>
|
||||
{getStatusLabel(registry.status || "OPEN")}
|
||||
<h1 className="text-2xl font-bold">{improvement.referenceId}</h1>
|
||||
<Badge variant={getStatusVariant(improvement.status || "OPEN")}>
|
||||
{getStatusLabel(improvement.status || "OPEN")}
|
||||
</Badge>
|
||||
<Badge variant={registry.priority === "HIGH" ? "danger" : registry.priority === "MEDIUM" ? "warning" : "success"}>
|
||||
{registry.priority === "HIGH" ? __("High") : registry.priority === "MEDIUM" ? __("Medium") : __("Low")}
|
||||
<Badge variant={improvement.priority === "HIGH" ? "danger" : improvement.priority === "MEDIUM" ? "warning" : "success"}>
|
||||
{improvement.priority === "HIGH" ? __("High") : improvement.priority === "MEDIUM" ? __("Medium") : __("Low")}
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
@@ -27,36 +27,36 @@ import {
|
||||
} from "react-relay";
|
||||
import { useOrganizationId } from "/hooks/useOrganizationId";
|
||||
import { useParams } from "react-router";
|
||||
import { CreateContinualImprovementRegistryDialog } from "./dialogs/CreateContinualImprovementRegistryDialog";
|
||||
import { deleteContinualImprovementRegistryMutation, ContinualImprovementRegistriesConnectionKey } from "../../../hooks/graph/ContinualImprovementRegistryGraph";
|
||||
import { CreateContinualImprovementDialog } from "./dialogs/CreateContinualImprovementDialog";
|
||||
import { deleteContinualImprovementMutation, ContinualImprovementsConnectionKey } from "../../../hooks/graph/ContinualImprovementGraph";
|
||||
import { sprintf, promisifyMutation, getStatusVariant, getStatusLabel } from "@probo/helpers";
|
||||
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||
import type { NodeOf } from "/types";
|
||||
import type { ContinualImprovementRegistriesPageQuery } from "./__generated__/ContinualImprovementRegistriesPageQuery.graphql";
|
||||
import type { ContinualImprovementsPageQuery } from "./__generated__/ContinualImprovementsPageQuery.graphql";
|
||||
import type {
|
||||
ContinualImprovementRegistriesPageFragment$key,
|
||||
ContinualImprovementRegistriesPageFragment$data,
|
||||
} from "./__generated__/ContinualImprovementRegistriesPageFragment.graphql";
|
||||
ContinualImprovementsPageFragment$key,
|
||||
ContinualImprovementsPageFragment$data,
|
||||
} from "./__generated__/ContinualImprovementsPageFragment.graphql";
|
||||
|
||||
interface ContinualImprovementRegistriesPageProps {
|
||||
queryRef: PreloadedQuery<ContinualImprovementRegistriesPageQuery>;
|
||||
interface ContinualImprovementsPageProps {
|
||||
queryRef: PreloadedQuery<ContinualImprovementsPageQuery>;
|
||||
}
|
||||
|
||||
const continualImprovementRegistriesPageFragment = graphql`
|
||||
fragment ContinualImprovementRegistriesPageFragment on Organization
|
||||
@refetchable(queryName: "ContinualImprovementRegistriesPageRefetchQuery")
|
||||
const continualImprovementsPageFragment = graphql`
|
||||
fragment ContinualImprovementsPageFragment on Organization
|
||||
@refetchable(queryName: "ContinualImprovementsPageRefetchQuery")
|
||||
@argumentDefinitions(
|
||||
first: { type: "Int", defaultValue: 10 }
|
||||
after: { type: "CursorKey" }
|
||||
snapshotId: { type: "ID", defaultValue: null }
|
||||
) {
|
||||
id
|
||||
continualImprovementRegistries(
|
||||
continualImprovements(
|
||||
first: $first
|
||||
after: $after
|
||||
filter: { snapshotId: $snapshotId }
|
||||
)
|
||||
@connection(key: "ContinualImprovementRegistriesPage_continualImprovementRegistries", filters: ["filter"]) {
|
||||
@connection(key: "ContinualImprovementsPage_continualImprovements", filters: ["filter"]) {
|
||||
__id
|
||||
totalCount
|
||||
edges {
|
||||
@@ -86,20 +86,20 @@ const continualImprovementRegistriesPageFragment = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export default function ContinualImprovementRegistriesPage({ queryRef }: ContinualImprovementRegistriesPageProps) {
|
||||
export default function ContinualImprovementsPage({ queryRef }: ContinualImprovementsPageProps) {
|
||||
const { __ } = useTranslate();
|
||||
const organizationId = useOrganizationId();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
|
||||
usePageTitle(__("Continual Improvement Registries"));
|
||||
usePageTitle(__("Continual Improvements"));
|
||||
|
||||
const organization = usePreloadedQuery(
|
||||
graphql`
|
||||
query ContinualImprovementRegistriesPageQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
query ContinualImprovementsPageQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
node(id: $organizationId) {
|
||||
... on Organization {
|
||||
...ContinualImprovementRegistriesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
...ContinualImprovementsPageFragment @arguments(snapshotId: $snapshotId)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,39 +113,39 @@ export default function ContinualImprovementRegistriesPage({ queryRef }: Continu
|
||||
hasNext,
|
||||
isLoadingNext,
|
||||
} = usePaginationFragment<
|
||||
ContinualImprovementRegistriesPageQuery,
|
||||
ContinualImprovementRegistriesPageFragment$key
|
||||
>(continualImprovementRegistriesPageFragment, organization.node);
|
||||
ContinualImprovementsPageQuery,
|
||||
ContinualImprovementsPageFragment$key
|
||||
>(continualImprovementsPageFragment, organization.node);
|
||||
if (!data) {
|
||||
return <div>{__("Organization not found")}</div>;
|
||||
}
|
||||
|
||||
const connectionId = ConnectionHandler.getConnectionID(
|
||||
organizationId,
|
||||
ContinualImprovementRegistriesConnectionKey,
|
||||
ContinualImprovementsConnectionKey,
|
||||
{ filter: { snapshotId: snapshotId || null } }
|
||||
);
|
||||
const registries = data?.continualImprovementRegistries?.edges?.map((edge) => edge.node) ?? [];
|
||||
const improvements = data?.continualImprovements?.edges?.map((edge) => edge.node) ?? [];
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{isSnapshotMode && snapshotId && (
|
||||
<SnapshotBanner snapshotId={snapshotId} />
|
||||
)}
|
||||
<PageHeader title={__("Continual Improvement Registries")} description={__("Manage your continual improvement registry entries")}>
|
||||
<PageHeader title={__("Continual Improvements")} description={__("Manage your continual improvements.")}>
|
||||
{!isSnapshotMode && (
|
||||
<CreateContinualImprovementRegistryDialog
|
||||
<CreateContinualImprovementDialog
|
||||
organizationId={organizationId}
|
||||
connectionId={connectionId}
|
||||
>
|
||||
<Button icon={IconPlusLarge}>
|
||||
{__("Add continual improvement registry")}
|
||||
{__("Add continual improvement")}
|
||||
</Button>
|
||||
</CreateContinualImprovementRegistryDialog>
|
||||
</CreateContinualImprovementDialog>
|
||||
)}
|
||||
</PageHeader>
|
||||
|
||||
{registries.length > 0 ? (
|
||||
{improvements.length > 0 ? (
|
||||
<Card>
|
||||
<Table>
|
||||
<Thead>
|
||||
@@ -160,10 +160,10 @@ export default function ContinualImprovementRegistriesPage({ queryRef }: Continu
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
{registries.map((registry) => (
|
||||
<RegistryRow
|
||||
key={registry.id}
|
||||
registry={registry}
|
||||
{improvements.map((improvement) => (
|
||||
<ImprovementRow
|
||||
key={improvement.id}
|
||||
improvement={improvement}
|
||||
connectionId={connectionId}
|
||||
snapshotId={snapshotId}
|
||||
/>
|
||||
@@ -187,10 +187,10 @@ export default function ContinualImprovementRegistriesPage({ queryRef }: Continu
|
||||
<Card padded>
|
||||
<div className="text-center py-12">
|
||||
<h3 className="text-lg font-semibold mb-2">
|
||||
{__("No continual improvement registry entries yet")}
|
||||
{__("No continual improvements yet")}
|
||||
</h3>
|
||||
<p className="text-txt-tertiary mb-4">
|
||||
{__("Create your first continual improvement registry entry to get started.")}
|
||||
{__("Create your first continual improvement to get started.")}
|
||||
</p>
|
||||
</div>
|
||||
</Card>
|
||||
@@ -199,18 +199,18 @@ export default function ContinualImprovementRegistriesPage({ queryRef }: Continu
|
||||
);
|
||||
}
|
||||
|
||||
function RegistryRow({
|
||||
registry,
|
||||
function ImprovementRow({
|
||||
improvement,
|
||||
connectionId,
|
||||
snapshotId,
|
||||
}: {
|
||||
registry: NodeOf<NonNullable<ContinualImprovementRegistriesPageFragment$data['continualImprovementRegistries']>>;
|
||||
improvement: NodeOf<NonNullable<ContinualImprovementsPageFragment$data['continualImprovements']>>;
|
||||
connectionId: string;
|
||||
snapshotId?: string;
|
||||
}) {
|
||||
const organizationId = useOrganizationId();
|
||||
const { __ } = useTranslate();
|
||||
const [deleteRegistry] = useMutation(deleteContinualImprovementRegistryMutation);
|
||||
const [deleteImprovement] = useMutation(deleteContinualImprovementMutation);
|
||||
const confirm = useConfirm();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
|
||||
@@ -221,10 +221,10 @@ function RegistryRow({
|
||||
const handleDelete = () => {
|
||||
confirm(
|
||||
() =>
|
||||
promisifyMutation(deleteRegistry)({
|
||||
promisifyMutation(deleteImprovement)({
|
||||
variables: {
|
||||
input: {
|
||||
continualImprovementRegistryId: registry.id,
|
||||
continualImprovementId: improvement.id,
|
||||
},
|
||||
connections: [connectionId],
|
||||
},
|
||||
@@ -232,39 +232,39 @@ function RegistryRow({
|
||||
{
|
||||
message: sprintf(
|
||||
__(
|
||||
"This will permanently delete the continual improvement registry entry %s. This action cannot be undone."
|
||||
"This will permanently delete the continual improvement entry %s. This action cannot be undone."
|
||||
),
|
||||
registry.referenceId
|
||||
improvement.referenceId
|
||||
),
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const detailsUrl = isSnapshotMode
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/continual-improvement-registries/${registry.id}`
|
||||
: `/organizations/${organizationId}/continual-improvement-registries/${registry.id}`;
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/continual-improvements/${improvement.id}`
|
||||
: `/organizations/${organizationId}/continual-improvements/${improvement.id}`;
|
||||
|
||||
return (
|
||||
<Tr to={detailsUrl}>
|
||||
<Td>
|
||||
<span className="font-mono text-sm">{registry.referenceId}</span>
|
||||
<span className="font-mono text-sm">{improvement.referenceId}</span>
|
||||
</Td>
|
||||
<Td>{registry.description || "-"}</Td>
|
||||
<Td>{improvement.description || "-"}</Td>
|
||||
<Td>
|
||||
<Badge variant={getStatusVariant(registry.status)}>
|
||||
{getStatusLabel(registry.status)}
|
||||
<Badge variant={getStatusVariant(improvement.status)}>
|
||||
{getStatusLabel(improvement.status)}
|
||||
</Badge>
|
||||
</Td>
|
||||
<Td>
|
||||
<Badge variant={registry.priority === "HIGH" ? "danger" : registry.priority === "MEDIUM" ? "warning" : "success"}>
|
||||
{registry.priority === "HIGH" ? __("High") : registry.priority === "MEDIUM" ? __("Medium") : __("Low")}
|
||||
<Badge variant={improvement.priority === "HIGH" ? "danger" : improvement.priority === "MEDIUM" ? "warning" : "success"}>
|
||||
{improvement.priority === "HIGH" ? __("High") : improvement.priority === "MEDIUM" ? __("Medium") : __("Low")}
|
||||
</Badge>
|
||||
</Td>
|
||||
<Td>{registry.owner?.fullName || "-"}</Td>
|
||||
<Td>{improvement.owner?.fullName || "-"}</Td>
|
||||
<Td>
|
||||
{registry.targetDate ? (
|
||||
<time dateTime={registry.targetDate}>
|
||||
{formatDate(registry.targetDate)}
|
||||
{improvement.targetDate ? (
|
||||
<time dateTime={improvement.targetDate}>
|
||||
{formatDate(improvement.targetDate)}
|
||||
</time>
|
||||
) : (
|
||||
<span className="text-txt-tertiary">{__("No target date")}</span>
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<a7cefedfe9ee9d485354882888556f20>>
|
||||
* @generated SignedSource<<3065b6b41135aa2dcbb45cdafae94503>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,11 +9,11 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type ContinualImprovementRegistriesPriority = "HIGH" | "LOW" | "MEDIUM";
|
||||
export type ContinualImprovementRegistriesStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type ContinualImprovementPriority = "HIGH" | "LOW" | "MEDIUM";
|
||||
export type ContinualImprovementStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ContinualImprovementRegistriesPageFragment$data = {
|
||||
readonly continualImprovementRegistries: {
|
||||
export type ContinualImprovementsPageFragment$data = {
|
||||
readonly continualImprovements: {
|
||||
readonly __id: string;
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
@@ -24,12 +24,12 @@ export type ContinualImprovementRegistriesPageFragment$data = {
|
||||
readonly fullName: string;
|
||||
readonly id: string;
|
||||
};
|
||||
readonly priority: ContinualImprovementRegistriesPriority;
|
||||
readonly priority: ContinualImprovementPriority;
|
||||
readonly referenceId: string;
|
||||
readonly snapshotId: string | null | undefined;
|
||||
readonly source: string | null | undefined;
|
||||
readonly sourceId: string | null | undefined;
|
||||
readonly status: ContinualImprovementRegistriesStatus;
|
||||
readonly status: ContinualImprovementStatus;
|
||||
readonly targetDate: any | null | undefined;
|
||||
readonly updatedAt: any;
|
||||
};
|
||||
@@ -41,18 +41,18 @@ export type ContinualImprovementRegistriesPageFragment$data = {
|
||||
readonly totalCount: number;
|
||||
};
|
||||
readonly id: string;
|
||||
readonly " $fragmentType": "ContinualImprovementRegistriesPageFragment";
|
||||
readonly " $fragmentType": "ContinualImprovementsPageFragment";
|
||||
};
|
||||
export type ContinualImprovementRegistriesPageFragment$key = {
|
||||
readonly " $data"?: ContinualImprovementRegistriesPageFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ContinualImprovementRegistriesPageFragment">;
|
||||
export type ContinualImprovementsPageFragment$key = {
|
||||
readonly " $data"?: ContinualImprovementsPageFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ContinualImprovementsPageFragment">;
|
||||
};
|
||||
|
||||
import ContinualImprovementRegistriesPageRefetchQuery_graphql from './ContinualImprovementRegistriesPageRefetchQuery.graphql';
|
||||
import ContinualImprovementsPageRefetchQuery_graphql from './ContinualImprovementsPageRefetchQuery.graphql';
|
||||
|
||||
const node: ReaderFragment = (function(){
|
||||
var v0 = [
|
||||
"continualImprovementRegistries"
|
||||
"continualImprovements"
|
||||
],
|
||||
v1 = {
|
||||
"alias": null,
|
||||
@@ -101,18 +101,18 @@ return {
|
||||
"fragmentPathInResult": [
|
||||
"node"
|
||||
],
|
||||
"operation": ContinualImprovementRegistriesPageRefetchQuery_graphql,
|
||||
"operation": ContinualImprovementsPageRefetchQuery_graphql,
|
||||
"identifierInfo": {
|
||||
"identifierField": "id",
|
||||
"identifierQueryVariableName": "id"
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": "ContinualImprovementRegistriesPageFragment",
|
||||
"name": "ContinualImprovementsPageFragment",
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
{
|
||||
"alias": "continualImprovementRegistries",
|
||||
"alias": "continualImprovements",
|
||||
"args": [
|
||||
{
|
||||
"fields": [
|
||||
@@ -126,9 +126,9 @@ return {
|
||||
"name": "filter"
|
||||
}
|
||||
],
|
||||
"concreteType": "ContinualImprovementRegistryConnection",
|
||||
"concreteType": "ContinualImprovementConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "__ContinualImprovementRegistriesPage_continualImprovementRegistries_connection",
|
||||
"name": "__ContinualImprovementsPage_continualImprovements_connection",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -141,7 +141,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ContinualImprovementRegistryEdge",
|
||||
"concreteType": "ContinualImprovementEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -149,7 +149,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ContinualImprovementRegistry",
|
||||
"concreteType": "ContinualImprovement",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -310,6 +310,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "9e11628f65527ac1ff8974faa1855280";
|
||||
(node as any).hash = "44e30d3febc79c6df7236567d85e9ca8";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<95ba9ae06f433c92486e63832eb9166d>>
|
||||
* @generated SignedSource<<ea405e491a67747f288e05da62524468>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,18 +10,18 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ContinualImprovementRegistryGraphListQuery$variables = {
|
||||
export type ContinualImprovementsPageQuery$variables = {
|
||||
organizationId: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphListQuery$data = {
|
||||
export type ContinualImprovementsPageQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ContinualImprovementRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ContinualImprovementsPageFragment">;
|
||||
};
|
||||
};
|
||||
export type ContinualImprovementRegistryGraphListQuery = {
|
||||
response: ContinualImprovementRegistryGraphListQuery$data;
|
||||
variables: ContinualImprovementRegistryGraphListQuery$variables;
|
||||
export type ContinualImprovementsPageQuery = {
|
||||
response: ContinualImprovementsPageQuery$data;
|
||||
variables: ContinualImprovementsPageQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -82,7 +82,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ContinualImprovementRegistryGraphListQuery",
|
||||
"name": "ContinualImprovementsPageQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -98,7 +98,7 @@ return {
|
||||
{
|
||||
"args": (v2/*: any*/),
|
||||
"kind": "FragmentSpread",
|
||||
"name": "ContinualImprovementRegistriesPageFragment"
|
||||
"name": "ContinualImprovementsPageFragment"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -115,7 +115,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ContinualImprovementRegistryGraphListQuery",
|
||||
"name": "ContinualImprovementsPageQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -133,9 +133,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"concreteType": "ContinualImprovementRegistryConnection",
|
||||
"concreteType": "ContinualImprovementConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "continualImprovementRegistries",
|
||||
"name": "continualImprovements",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -148,7 +148,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ContinualImprovementRegistryEdge",
|
||||
"concreteType": "ContinualImprovementEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -156,7 +156,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ContinualImprovementRegistry",
|
||||
"concreteType": "ContinualImprovement",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -312,9 +312,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "ContinualImprovementRegistriesPage_continualImprovementRegistries",
|
||||
"key": "ContinualImprovementsPage_continualImprovements",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "continualImprovementRegistries"
|
||||
"name": "continualImprovements"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -326,16 +326,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "b629619a1e2a00d3e58ae908977124b0",
|
||||
"cacheID": "7213a2ee3776522282ddbc3c46b4002b",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ContinualImprovementRegistryGraphListQuery",
|
||||
"name": "ContinualImprovementsPageQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ContinualImprovementRegistryGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ContinualImprovementRegistriesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ContinualImprovementRegistriesPageFragment_3iomuz on Organization {\n id\n continualImprovementRegistries(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
"text": "query ContinualImprovementsPageQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ContinualImprovementsPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ContinualImprovementsPageFragment_3iomuz on Organization {\n id\n continualImprovements(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\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 = "46857b16d3bdb52307eacf7c4e607d2f";
|
||||
(node as any).hash = "7baadd4791b1c26eb7315a7755e28a08";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<7edb3bd39c98d7799e4b5eabccb36175>>
|
||||
* @generated SignedSource<<908fcf894c6d8a46a122991d388a4cb7>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,20 +10,20 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ContinualImprovementRegistriesPageRefetchQuery$variables = {
|
||||
export type ContinualImprovementsPageRefetchQuery$variables = {
|
||||
after?: any | null | undefined;
|
||||
first?: number | null | undefined;
|
||||
id: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type ContinualImprovementRegistriesPageRefetchQuery$data = {
|
||||
export type ContinualImprovementsPageRefetchQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ContinualImprovementRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ContinualImprovementsPageFragment">;
|
||||
};
|
||||
};
|
||||
export type ContinualImprovementRegistriesPageRefetchQuery = {
|
||||
response: ContinualImprovementRegistriesPageRefetchQuery$data;
|
||||
variables: ContinualImprovementRegistriesPageRefetchQuery$variables;
|
||||
export type ContinualImprovementsPageRefetchQuery = {
|
||||
response: ContinualImprovementsPageRefetchQuery$data;
|
||||
variables: ContinualImprovementsPageRefetchQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -104,7 +104,7 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ContinualImprovementRegistriesPageRefetchQuery",
|
||||
"name": "ContinualImprovementsPageRefetchQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -121,7 +121,7 @@ return {
|
||||
(v7/*: any*/)
|
||||
],
|
||||
"kind": "FragmentSpread",
|
||||
"name": "ContinualImprovementRegistriesPageFragment"
|
||||
"name": "ContinualImprovementsPageFragment"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -139,7 +139,7 @@ return {
|
||||
(v2/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "ContinualImprovementRegistriesPageRefetchQuery",
|
||||
"name": "ContinualImprovementsPageRefetchQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -157,9 +157,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"concreteType": "ContinualImprovementRegistryConnection",
|
||||
"concreteType": "ContinualImprovementConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "continualImprovementRegistries",
|
||||
"name": "continualImprovements",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -172,7 +172,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ContinualImprovementRegistryEdge",
|
||||
"concreteType": "ContinualImprovementEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -180,7 +180,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ContinualImprovementRegistry",
|
||||
"concreteType": "ContinualImprovement",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -336,9 +336,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "ContinualImprovementRegistriesPage_continualImprovementRegistries",
|
||||
"key": "ContinualImprovementsPage_continualImprovements",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "continualImprovementRegistries"
|
||||
"name": "continualImprovements"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -350,16 +350,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "eb4f60205ab9cae8aeb307e2fc1a8b68",
|
||||
"cacheID": "277ed3aedb8b99e9ec291997ba0d0943",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ContinualImprovementRegistriesPageRefetchQuery",
|
||||
"name": "ContinualImprovementsPageRefetchQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ContinualImprovementRegistriesPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ContinualImprovementRegistriesPageFragment_35e0S5\n id\n }\n}\n\nfragment ContinualImprovementRegistriesPageFragment_35e0S5 on Organization {\n id\n continualImprovementRegistries(first: $first, after: $after, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
"text": "query ContinualImprovementsPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ContinualImprovementsPageFragment_35e0S5\n id\n }\n}\n\nfragment ContinualImprovementsPageFragment_35e0S5 on Organization {\n id\n continualImprovements(first: $first, after: $after, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n description\n source\n targetDate\n status\n priority\n owner {\n id\n fullName\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 = "9e11628f65527ac1ff8974faa1855280";
|
||||
(node as any).hash = "44e30d3febc79c6df7236567d85e9ca8";
|
||||
|
||||
export default node;
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { z } from "zod";
|
||||
import { useFormWithSchema } from "/hooks/useFormWithSchema";
|
||||
import { useCreateContinualImprovementRegistry } from "../../../../hooks/graph/ContinualImprovementRegistryGraph";
|
||||
import { useCreateContinualImprovement } from "../../../../hooks/graph/ContinualImprovementGraph";
|
||||
import { PeopleSelectField } from "/components/form/PeopleSelectField";
|
||||
import { Controller } from "react-hook-form";
|
||||
import { formatDatetime } from "@probo/helpers";
|
||||
@@ -34,22 +34,22 @@ const schema = z.object({
|
||||
|
||||
type FormData = z.infer<typeof schema>;
|
||||
|
||||
interface CreateContinualImprovementRegistryDialogProps {
|
||||
interface CreateContinualImprovementDialogProps {
|
||||
children: ReactNode;
|
||||
organizationId: string;
|
||||
connectionId?: string;
|
||||
}
|
||||
|
||||
export function CreateContinualImprovementRegistryDialog({
|
||||
export function CreateContinualImprovementDialog({
|
||||
children,
|
||||
organizationId,
|
||||
connectionId,
|
||||
}: CreateContinualImprovementRegistryDialogProps) {
|
||||
}: CreateContinualImprovementDialogProps) {
|
||||
const { __ } = useTranslate();
|
||||
const { toast } = useToast();
|
||||
const dialogRef = useDialogRef();
|
||||
|
||||
const createRegistry = useCreateContinualImprovementRegistry(connectionId || "");
|
||||
const createImprovement = useCreateContinualImprovement(connectionId || "");
|
||||
|
||||
const { register, handleSubmit, formState, reset, control } = useFormWithSchema(schema, {
|
||||
defaultValues: {
|
||||
@@ -65,7 +65,7 @@ export function CreateContinualImprovementRegistryDialog({
|
||||
|
||||
const onSubmit = handleSubmit(async (formData: FormData) => {
|
||||
try {
|
||||
await createRegistry({
|
||||
await createImprovement({
|
||||
organizationId,
|
||||
referenceId: formData.referenceId,
|
||||
description: formData.description || undefined,
|
||||
@@ -78,7 +78,7 @@ export function CreateContinualImprovementRegistryDialog({
|
||||
|
||||
toast({
|
||||
title: __("Success"),
|
||||
description: __("Continual improvement registry entry created successfully"),
|
||||
description: __("Continual improvement entry created successfully"),
|
||||
variant: "success",
|
||||
});
|
||||
|
||||
@@ -87,7 +87,7 @@ export function CreateContinualImprovementRegistryDialog({
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: __("Failed to create continual improvement registry entry"),
|
||||
description: __("Failed to create continual improvement entry"),
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
@@ -109,7 +109,7 @@ export function CreateContinualImprovementRegistryDialog({
|
||||
<Dialog
|
||||
ref={dialogRef}
|
||||
trigger={children}
|
||||
title={<Breadcrumb items={[__("Registries"), __("Create Continual Improvement Entry")]} />}
|
||||
title={<Breadcrumb items={[__("Continual Improvements"), __("Create Entry")]} />}
|
||||
className="max-w-2xl"
|
||||
>
|
||||
<form onSubmit={onSubmit}>
|
||||
@@ -26,38 +26,38 @@ import {
|
||||
type PreloadedQuery,
|
||||
} from "react-relay";
|
||||
import { useOrganizationId } from "/hooks/useOrganizationId";
|
||||
import { CreateNonconformityRegistryDialog } from "./dialogs/CreateNonconformityRegistryDialog";
|
||||
import { deleteNonconformityRegistryMutation, RegistriesConnectionKey } from "../../../hooks/graph/NonconformityRegistryGraph";
|
||||
import { CreateNonconformityDialog } from "./dialogs/CreateNonconformityDialog";
|
||||
import { deleteNonconformityMutation, NonconformitiesConnectionKey } from "../../../hooks/graph/NonconformityGraph";
|
||||
import { sprintf, promisifyMutation, getStatusVariant, getStatusLabel } from "@probo/helpers";
|
||||
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||
import { useParams } from "react-router";
|
||||
import type { NonconformityRegistriesPageQuery } from "./__generated__/NonconformityRegistriesPageQuery.graphql";
|
||||
import type { NonconformitiesPageQuery } from "./__generated__/NonconformitiesPageQuery.graphql";
|
||||
import type {
|
||||
NonconformityRegistriesPageFragment$key,
|
||||
NonconformityRegistriesPageFragment$data,
|
||||
} from "./__generated__/NonconformityRegistriesPageFragment.graphql";
|
||||
NonconformitiesPageFragment$key,
|
||||
NonconformitiesPageFragment$data,
|
||||
} from "./__generated__/NonconformitiesPageFragment.graphql";
|
||||
|
||||
type NonconformityRegistry = NonconformityRegistriesPageFragment$data['nonconformityRegistries']['edges'][number]['node'];
|
||||
type Nonconformity = NonconformitiesPageFragment$data['nonconformities']['edges'][number]['node'];
|
||||
|
||||
interface NonconformityRegistriesPageProps {
|
||||
queryRef: PreloadedQuery<NonconformityRegistriesPageQuery>;
|
||||
interface NonconformitiesPageProps {
|
||||
queryRef: PreloadedQuery<NonconformitiesPageQuery>;
|
||||
}
|
||||
|
||||
const nonconformityRegistriesPageFragment = graphql`
|
||||
fragment NonconformityRegistriesPageFragment on Organization
|
||||
@refetchable(queryName: "NonconformityRegistriesPageRefetchQuery")
|
||||
const nonconformitiesPageFragment = graphql`
|
||||
fragment NonconformitiesPageFragment on Organization
|
||||
@refetchable(queryName: "NonconformitiesPageRefetchQuery")
|
||||
@argumentDefinitions(
|
||||
first: { type: "Int", defaultValue: 10 }
|
||||
after: { type: "CursorKey" }
|
||||
snapshotId: { type: "ID", defaultValue: null }
|
||||
) {
|
||||
id
|
||||
nonconformityRegistries(
|
||||
nonconformities(
|
||||
first: $first
|
||||
after: $after
|
||||
filter: { snapshotId: $snapshotId }
|
||||
)
|
||||
@connection(key: "RegistriesPage_nonconformityRegistries", filters: ["filter"]) {
|
||||
@connection(key: "NonconformitiesPage_nonconformities", filters: ["filter"]) {
|
||||
__id
|
||||
totalCount
|
||||
edges {
|
||||
@@ -96,20 +96,20 @@ const nonconformityRegistriesPageFragment = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export default function NonconformityRegistriesPage({ queryRef }: NonconformityRegistriesPageProps) {
|
||||
export default function NonconformitiesPage({ queryRef }: NonconformitiesPageProps) {
|
||||
const { __ } = useTranslate();
|
||||
const organizationId = useOrganizationId();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
|
||||
usePageTitle(__("Nonconformity Registries"));
|
||||
usePageTitle(__("Nonconformities"));
|
||||
|
||||
const organization = usePreloadedQuery(
|
||||
graphql`
|
||||
query NonconformityRegistriesPageQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
query NonconformitiesPageQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
node(id: $organizationId) {
|
||||
... on Organization {
|
||||
...NonconformityRegistriesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
...NonconformitiesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,17 +117,17 @@ export default function NonconformityRegistriesPage({ queryRef }: NonconformityR
|
||||
queryRef
|
||||
);
|
||||
|
||||
const { data: registriesData, loadNext, hasNext } = usePaginationFragment(
|
||||
nonconformityRegistriesPageFragment,
|
||||
organization.node as NonconformityRegistriesPageFragment$key
|
||||
const { data: nonconformitiesData, loadNext, hasNext } = usePaginationFragment(
|
||||
nonconformitiesPageFragment,
|
||||
organization.node as NonconformitiesPageFragment$key
|
||||
);
|
||||
|
||||
const connectionId = ConnectionHandler.getConnectionID(
|
||||
organizationId,
|
||||
RegistriesConnectionKey,
|
||||
NonconformitiesConnectionKey,
|
||||
{ filter: { snapshotId: snapshotId || null } }
|
||||
);
|
||||
const registries: NonconformityRegistry[] = registriesData?.nonconformityRegistries?.edges?.map((edge) => edge.node) ?? [];
|
||||
const nonconformities: Nonconformity[] = nonconformitiesData?.nonconformities?.edges?.map((edge) => edge.node) ?? [];
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
@@ -135,26 +135,26 @@ export default function NonconformityRegistriesPage({ queryRef }: NonconformityR
|
||||
<SnapshotBanner snapshotId={snapshotId!} />
|
||||
)}
|
||||
<PageHeader
|
||||
title={__("Nonconformity Registries")}
|
||||
title={__("Nonconformities")}
|
||||
description={__(
|
||||
"Manage your organization's non conformity registries."
|
||||
"Manage your organization's non conformities."
|
||||
)}
|
||||
>
|
||||
{!isSnapshotMode && (
|
||||
<CreateNonconformityRegistryDialog organizationId={organizationId} connection={connectionId}>
|
||||
<Button icon={IconPlusLarge}>{__("Add nonconformity registry")}</Button>
|
||||
</CreateNonconformityRegistryDialog>
|
||||
<CreateNonconformityDialog organizationId={organizationId} connection={connectionId}>
|
||||
<Button icon={IconPlusLarge}>{__("Add nonconformity")}</Button>
|
||||
</CreateNonconformityDialog>
|
||||
)}
|
||||
</PageHeader>
|
||||
|
||||
{registries.length === 0 ? (
|
||||
{nonconformities.length === 0 ? (
|
||||
<Card padded>
|
||||
<div className="text-center py-12">
|
||||
<h3 className="text-lg font-semibold mb-2">
|
||||
{__("No nonconformity registry entries yet")}
|
||||
{__("No nonconformities yet")}
|
||||
</h3>
|
||||
<p className="text-txt-tertiary mb-4">
|
||||
{__("Create your first nonconformity registry entry to get started.")}
|
||||
{__("Create your first nonconformity to get started.")}
|
||||
</p>
|
||||
</div>
|
||||
</Card>
|
||||
@@ -173,10 +173,10 @@ export default function NonconformityRegistriesPage({ queryRef }: NonconformityR
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
{registries.map((registry) => (
|
||||
<RegistryRow
|
||||
key={registry.id}
|
||||
registry={registry}
|
||||
{nonconformities.map((nonconformity) => (
|
||||
<NonconformityRow
|
||||
key={nonconformity.id}
|
||||
nonconformity={nonconformity}
|
||||
connectionId={connectionId}
|
||||
isSnapshotMode={isSnapshotMode}
|
||||
snapshotId={snapshotId}
|
||||
@@ -204,13 +204,13 @@ export default function NonconformityRegistriesPage({ queryRef }: NonconformityR
|
||||
);
|
||||
}
|
||||
|
||||
function RegistryRow({
|
||||
registry,
|
||||
function NonconformityRow({
|
||||
nonconformity,
|
||||
connectionId,
|
||||
isSnapshotMode,
|
||||
snapshotId,
|
||||
}: {
|
||||
registry: NonconformityRegistry;
|
||||
nonconformity: Nonconformity;
|
||||
connectionId: string;
|
||||
isSnapshotMode: boolean;
|
||||
snapshotId?: string;
|
||||
@@ -218,25 +218,25 @@ function RegistryRow({
|
||||
const organizationId = useOrganizationId();
|
||||
const { __ } = useTranslate();
|
||||
const confirm = useConfirm();
|
||||
const [deleteRegistry] = useMutation(deleteNonconformityRegistryMutation);
|
||||
const [deleteNonconformity] = useMutation(deleteNonconformityMutation);
|
||||
|
||||
const formatDate = (dateString: string) => {
|
||||
return new Date(dateString).toLocaleDateString();
|
||||
};
|
||||
|
||||
const registryDetailUrl = isSnapshotMode
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/nonconformity-registries/${registry.id}`
|
||||
: `/organizations/${organizationId}/nonconformity-registries/${registry.id}`;
|
||||
const nonconformityDetailUrl = isSnapshotMode
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/nonconformities/${nonconformity.id}`
|
||||
: `/organizations/${organizationId}/nonconformities/${nonconformity.id}`;
|
||||
|
||||
const handleDeleteRegistry = (registry: NonconformityRegistry) => {
|
||||
const handleDeleteNonconformity = (nonconformity: Nonconformity) => {
|
||||
if (!connectionId) return;
|
||||
|
||||
confirm(
|
||||
() => {
|
||||
return promisifyMutation(deleteRegistry)({
|
||||
return promisifyMutation(deleteNonconformity)({
|
||||
variables: {
|
||||
input: {
|
||||
nonconformityRegistryId: registry.id,
|
||||
nonconformityId: nonconformity.id,
|
||||
},
|
||||
connections: [connectionId],
|
||||
},
|
||||
@@ -245,42 +245,42 @@ function RegistryRow({
|
||||
{
|
||||
message: sprintf(
|
||||
__(
|
||||
"This will permanently delete the registry entry %s. This action cannot be undone."
|
||||
"This will permanently delete the nonconformity %s. This action cannot be undone."
|
||||
),
|
||||
registry.referenceId
|
||||
nonconformity.referenceId
|
||||
),
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<Tr to={registryDetailUrl}>
|
||||
<Tr to={nonconformityDetailUrl}>
|
||||
<Td>
|
||||
<span className="font-mono text-sm">{registry.referenceId}</span>
|
||||
<span className="font-mono text-sm">{nonconformity.referenceId}</span>
|
||||
</Td>
|
||||
<Td>
|
||||
<div className="min-w-0">
|
||||
<p className="whitespace-pre-wrap break-words">
|
||||
{registry.description || __("No description")}
|
||||
{nonconformity.description || __("No description")}
|
||||
</p>
|
||||
</div>
|
||||
</Td>
|
||||
<Td>
|
||||
<Badge variant={getStatusVariant(registry.status)}>
|
||||
{getStatusLabel(registry.status)}
|
||||
<Badge variant={getStatusVariant(nonconformity.status)}>
|
||||
{getStatusLabel(nonconformity.status)}
|
||||
</Badge>
|
||||
</Td>
|
||||
<Td>
|
||||
{registry.audit.name
|
||||
? `${registry.audit.framework.name} - ${registry.audit.name}`
|
||||
: registry.audit.framework.name
|
||||
{nonconformity.audit.name
|
||||
? `${nonconformity.audit.framework.name} - ${nonconformity.audit.name}`
|
||||
: nonconformity.audit.framework.name
|
||||
}
|
||||
</Td>
|
||||
<Td>{registry.owner.fullName}</Td>
|
||||
<Td>{nonconformity.owner.fullName}</Td>
|
||||
<Td>
|
||||
{registry.dueDate ? (
|
||||
<time dateTime={registry.dueDate}>
|
||||
{formatDate(registry.dueDate)}
|
||||
{nonconformity.dueDate ? (
|
||||
<time dateTime={nonconformity.dueDate}>
|
||||
{formatDate(nonconformity.dueDate)}
|
||||
</time>
|
||||
) : (
|
||||
<span className="text-txt-tertiary">{__("No due date")}</span>
|
||||
@@ -291,7 +291,7 @@ function RegistryRow({
|
||||
<DropdownItem
|
||||
icon={IconTrashCan}
|
||||
variant="danger"
|
||||
onSelect={() => handleDeleteRegistry(registry)}
|
||||
onSelect={() => handleDeleteNonconformity(nonconformity)}
|
||||
>
|
||||
{__("Delete")}
|
||||
</DropdownItem>
|
||||
@@ -4,11 +4,11 @@ import {
|
||||
type PreloadedQuery,
|
||||
} from "react-relay";
|
||||
import {
|
||||
nonconformityRegistryNodeQuery,
|
||||
useDeleteNonconformityRegistry,
|
||||
useUpdateNonconformityRegistry,
|
||||
RegistriesConnectionKey,
|
||||
} from "../../../hooks/graph/NonconformityRegistryGraph";
|
||||
nonconformityNodeQuery,
|
||||
useDeleteNonconformity,
|
||||
useUpdateNonconformity,
|
||||
NonconformitiesConnectionKey,
|
||||
} from "../../../hooks/graph/NonconformityGraph";
|
||||
import {
|
||||
ActionDropdown,
|
||||
Badge,
|
||||
@@ -32,10 +32,10 @@ import { PeopleSelectField } from "/components/form/PeopleSelectField";
|
||||
import { AuditSelectField } from "/components/form/AuditSelectField";
|
||||
import { useFormWithSchema } from "/hooks/useFormWithSchema";
|
||||
import z from "zod";
|
||||
import { getStatusVariant, getStatusLabel, formatDatetime, getNonconformityRegistryStatusOptions, validateSnapshotConsistency } from "@probo/helpers";
|
||||
import type { NonconformityRegistryGraphNodeQuery } from "/hooks/graph/__generated__/NonconformityRegistryGraphNodeQuery.graphql";
|
||||
import { getStatusVariant, getStatusLabel, formatDatetime, validateSnapshotConsistency, getStatusOptions } from "@probo/helpers";
|
||||
import type { NonconformityGraphNodeQuery } from "/hooks/graph/__generated__/NonconformityGraphNodeQuery.graphql";
|
||||
|
||||
const updateRegistrySchema = z.object({
|
||||
const updateNonconformitySchema = z.object({
|
||||
referenceId: z.string().min(1, "Reference ID is required"),
|
||||
description: z.string().optional(),
|
||||
dateIdentified: z.string().optional(),
|
||||
@@ -49,58 +49,58 @@ const updateRegistrySchema = z.object({
|
||||
});
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<NonconformityRegistryGraphNodeQuery>;
|
||||
queryRef: PreloadedQuery<NonconformityGraphNodeQuery>;
|
||||
};
|
||||
|
||||
export default function NonconformityRegistryDetailsPage(props: Props) {
|
||||
const data = usePreloadedQuery<NonconformityRegistryGraphNodeQuery>(
|
||||
nonconformityRegistryNodeQuery,
|
||||
export default function NonconformityDetailsPage(props: Props) {
|
||||
const data = usePreloadedQuery<NonconformityGraphNodeQuery>(
|
||||
nonconformityNodeQuery,
|
||||
props.queryRef
|
||||
);
|
||||
const registry = data.node;
|
||||
const nonconformity = data.node;
|
||||
const { __ } = useTranslate();
|
||||
const organizationId = useOrganizationId();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
|
||||
validateSnapshotConsistency(registry, snapshotId);
|
||||
validateSnapshotConsistency(nonconformity, snapshotId);
|
||||
|
||||
const deleteRegistry = useDeleteNonconformityRegistry(
|
||||
{ id: registry.id!, referenceId: registry.referenceId! },
|
||||
const deleteNonconformity = useDeleteNonconformity(
|
||||
{ id: nonconformity.id!, referenceId: nonconformity.referenceId! },
|
||||
ConnectionHandler.getConnectionID(
|
||||
organizationId,
|
||||
RegistriesConnectionKey,
|
||||
NonconformitiesConnectionKey,
|
||||
{ filter: { snapshotId: snapshotId || null } }
|
||||
)
|
||||
);
|
||||
|
||||
const { control, formState, handleSubmit, register, reset } = useFormWithSchema(
|
||||
updateRegistrySchema,
|
||||
updateNonconformitySchema,
|
||||
{
|
||||
defaultValues: {
|
||||
referenceId: registry.referenceId || "",
|
||||
description: registry.description || "",
|
||||
dateIdentified: registry.dateIdentified?.split('T')[0] || "",
|
||||
dueDate: registry.dueDate?.split('T')[0] || "",
|
||||
rootCause: registry.rootCause || "",
|
||||
correctiveAction: registry.correctiveAction || "",
|
||||
effectivenessCheck: registry.effectivenessCheck || "",
|
||||
status: registry.status || "OPEN",
|
||||
ownerId: registry.owner?.id || "",
|
||||
auditId: registry.audit?.id || "",
|
||||
referenceId: nonconformity.referenceId || "",
|
||||
description: nonconformity.description || "",
|
||||
dateIdentified: nonconformity.dateIdentified?.split('T')[0] || "",
|
||||
dueDate: nonconformity.dueDate?.split('T')[0] || "",
|
||||
rootCause: nonconformity.rootCause || "",
|
||||
correctiveAction: nonconformity.correctiveAction || "",
|
||||
effectivenessCheck: nonconformity.effectivenessCheck || "",
|
||||
status: nonconformity.status || "OPEN",
|
||||
ownerId: nonconformity.owner?.id || "",
|
||||
auditId: nonconformity.audit?.id || "",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const updateRegistry = useUpdateNonconformityRegistry();
|
||||
const updateNonconformity = useUpdateNonconformity();
|
||||
const { toast } = useToast();
|
||||
|
||||
const onSubmit = handleSubmit(async (formData) => {
|
||||
if (!registry.id) return;
|
||||
if (!nonconformity.id) return;
|
||||
|
||||
try {
|
||||
await updateRegistry({
|
||||
id: registry.id,
|
||||
await updateNonconformity({
|
||||
id: nonconformity.id,
|
||||
referenceId: formData.referenceId,
|
||||
description: formData.description,
|
||||
dateIdentified: formatDatetime(formData.dateIdentified),
|
||||
@@ -115,23 +115,23 @@ export default function NonconformityRegistryDetailsPage(props: Props) {
|
||||
reset(formData);
|
||||
toast({
|
||||
title: __("Success"),
|
||||
description: __("Non conformity registry entry updated successfully"),
|
||||
description: __("Nonconformity updated successfully"),
|
||||
variant: "success",
|
||||
});
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: error instanceof Error ? error.message : __("Failed to update non conformity registry entry"),
|
||||
description: error instanceof Error ? error.message : __("Failed to update nonconformity"),
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const statusOptions = getNonconformityRegistryStatusOptions(__);
|
||||
const statusOptions = getStatusOptions(__);
|
||||
|
||||
const breadcrumbNonconformityRegistriesUrl = isSnapshotMode
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/nonconformity-registries`
|
||||
: `/organizations/${organizationId}/nonconformity-registries`;
|
||||
const breadcrumbNonconformitiesUrl = isSnapshotMode
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/nonconformities`
|
||||
: `/organizations/${organizationId}/nonconformities`;
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
@@ -141,11 +141,11 @@ export default function NonconformityRegistryDetailsPage(props: Props) {
|
||||
<Breadcrumb
|
||||
items={[
|
||||
{
|
||||
label: __("Nonconformity Registries"),
|
||||
to: breadcrumbNonconformityRegistriesUrl,
|
||||
label: __("Nonconformities"),
|
||||
to: breadcrumbNonconformitiesUrl,
|
||||
},
|
||||
{
|
||||
label: registry.referenceId || __("Unknown Nonconformity Registry"),
|
||||
label: nonconformity.referenceId || __("Unknown Nonconformity"),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
@@ -153,10 +153,10 @@ export default function NonconformityRegistryDetailsPage(props: Props) {
|
||||
<div className="flex justify-between items-start">
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="text-2xl font-semibold">
|
||||
{registry.referenceId}
|
||||
{nonconformity.referenceId}
|
||||
</div>
|
||||
<Badge variant={getStatusVariant(registry.status || "OPEN")}>
|
||||
{getStatusLabel(registry.status || "OPEN")}
|
||||
<Badge variant={getStatusVariant(nonconformity.status || "OPEN")}>
|
||||
{getStatusLabel(nonconformity.status || "OPEN")}
|
||||
</Badge>
|
||||
</div>
|
||||
{!isSnapshotMode && (
|
||||
@@ -164,7 +164,7 @@ export default function NonconformityRegistryDetailsPage(props: Props) {
|
||||
<DropdownItem
|
||||
variant="danger"
|
||||
icon={IconTrashCan}
|
||||
onClick={deleteRegistry}
|
||||
onClick={deleteNonconformity}
|
||||
>
|
||||
{__("Delete")}
|
||||
</DropdownItem>
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<7ec3fc6b9ecb6302152fe0031e791682>>
|
||||
* @generated SignedSource<<b53ef2729d5b435baeb0d3b068be8cef>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,11 +9,11 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type NonconformityRegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type NonconformityStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type NonconformityRegistriesPageFragment$data = {
|
||||
export type NonconformitiesPageFragment$data = {
|
||||
readonly id: string;
|
||||
readonly nonconformityRegistries: {
|
||||
readonly nonconformities: {
|
||||
readonly __id: string;
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
@@ -39,7 +39,7 @@ export type NonconformityRegistriesPageFragment$data = {
|
||||
readonly referenceId: string;
|
||||
readonly rootCause: string;
|
||||
readonly snapshotId: string | null | undefined;
|
||||
readonly status: NonconformityRegistryStatus;
|
||||
readonly status: NonconformityStatus;
|
||||
readonly updatedAt: any;
|
||||
};
|
||||
}>;
|
||||
@@ -49,18 +49,18 @@ export type NonconformityRegistriesPageFragment$data = {
|
||||
};
|
||||
readonly totalCount: number;
|
||||
};
|
||||
readonly " $fragmentType": "NonconformityRegistriesPageFragment";
|
||||
readonly " $fragmentType": "NonconformitiesPageFragment";
|
||||
};
|
||||
export type NonconformityRegistriesPageFragment$key = {
|
||||
readonly " $data"?: NonconformityRegistriesPageFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"NonconformityRegistriesPageFragment">;
|
||||
export type NonconformitiesPageFragment$key = {
|
||||
readonly " $data"?: NonconformitiesPageFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"NonconformitiesPageFragment">;
|
||||
};
|
||||
|
||||
import NonconformityRegistriesPageRefetchQuery_graphql from './NonconformityRegistriesPageRefetchQuery.graphql';
|
||||
import NonconformitiesPageRefetchQuery_graphql from './NonconformitiesPageRefetchQuery.graphql';
|
||||
|
||||
const node: ReaderFragment = (function(){
|
||||
var v0 = [
|
||||
"nonconformityRegistries"
|
||||
"nonconformities"
|
||||
],
|
||||
v1 = {
|
||||
"alias": null,
|
||||
@@ -116,18 +116,18 @@ return {
|
||||
"fragmentPathInResult": [
|
||||
"node"
|
||||
],
|
||||
"operation": NonconformityRegistriesPageRefetchQuery_graphql,
|
||||
"operation": NonconformitiesPageRefetchQuery_graphql,
|
||||
"identifierInfo": {
|
||||
"identifierField": "id",
|
||||
"identifierQueryVariableName": "id"
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": "NonconformityRegistriesPageFragment",
|
||||
"name": "NonconformitiesPageFragment",
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
{
|
||||
"alias": "nonconformityRegistries",
|
||||
"alias": "nonconformities",
|
||||
"args": [
|
||||
{
|
||||
"fields": [
|
||||
@@ -141,9 +141,9 @@ return {
|
||||
"name": "filter"
|
||||
}
|
||||
],
|
||||
"concreteType": "NonconformityRegistryConnection",
|
||||
"concreteType": "NonconformityConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "__RegistriesPage_nonconformityRegistries_connection",
|
||||
"name": "__NonconformitiesPage_nonconformities_connection",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -156,7 +156,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistryEdge",
|
||||
"concreteType": "NonconformityEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -164,7 +164,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistry",
|
||||
"concreteType": "Nonconformity",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -358,6 +358,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "36f3622d63ddf02a2703a2c8428f4268";
|
||||
(node as any).hash = "0043855d2410d9ab1fd8fceda53f7c5a";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<725635dc6b9b06340cfc49b9b75d509c>>
|
||||
* @generated SignedSource<<3292b0059f82a3a5c1316f9312379621>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,18 +10,18 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type NonconformityRegistryGraphListQuery$variables = {
|
||||
export type NonconformitiesPageQuery$variables = {
|
||||
organizationId: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type NonconformityRegistryGraphListQuery$data = {
|
||||
export type NonconformitiesPageQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"NonconformityRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"NonconformitiesPageFragment">;
|
||||
};
|
||||
};
|
||||
export type NonconformityRegistryGraphListQuery = {
|
||||
response: NonconformityRegistryGraphListQuery$data;
|
||||
variables: NonconformityRegistryGraphListQuery$variables;
|
||||
export type NonconformitiesPageQuery = {
|
||||
response: NonconformitiesPageQuery$data;
|
||||
variables: NonconformitiesPageQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -89,7 +89,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "NonconformityRegistryGraphListQuery",
|
||||
"name": "NonconformitiesPageQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -105,7 +105,7 @@ return {
|
||||
{
|
||||
"args": (v2/*: any*/),
|
||||
"kind": "FragmentSpread",
|
||||
"name": "NonconformityRegistriesPageFragment"
|
||||
"name": "NonconformitiesPageFragment"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -122,7 +122,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "NonconformityRegistryGraphListQuery",
|
||||
"name": "NonconformitiesPageQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -140,9 +140,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"concreteType": "NonconformityRegistryConnection",
|
||||
"concreteType": "NonconformityConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "nonconformityRegistries",
|
||||
"name": "nonconformities",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -155,7 +155,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistryEdge",
|
||||
"concreteType": "NonconformityEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -163,7 +163,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistry",
|
||||
"concreteType": "Nonconformity",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -352,9 +352,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "RegistriesPage_nonconformityRegistries",
|
||||
"key": "NonconformitiesPage_nonconformities",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "nonconformityRegistries"
|
||||
"name": "nonconformities"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -366,16 +366,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "f788ee5c51814a5f68795aaca97cb971",
|
||||
"cacheID": "b4f53542e4ea747099f28629d5e8a0bb",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "NonconformityRegistryGraphListQuery",
|
||||
"name": "NonconformitiesPageQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query NonconformityRegistryGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...NonconformityRegistriesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment NonconformityRegistriesPageFragment_3iomuz on Organization {\n id\n nonconformityRegistries(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n referenceId\n snapshotId\n description\n status\n dateIdentified\n dueDate\n rootCause\n correctiveAction\n effectivenessCheck\n audit {\n id\n name\n framework {\n id\n name\n }\n }\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
"text": "query NonconformitiesPageQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...NonconformitiesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment NonconformitiesPageFragment_3iomuz on Organization {\n id\n nonconformities(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n referenceId\n snapshotId\n description\n status\n dateIdentified\n dueDate\n rootCause\n correctiveAction\n effectivenessCheck\n audit {\n id\n name\n framework {\n id\n name\n }\n }\n owner {\n id\n fullName\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 = "2bb77e5c9adce5860e4dd2c31f1155e4";
|
||||
(node as any).hash = "af4a93239b6065756759b4958980b846";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<d47034189b16b400cc098c230ea062c1>>
|
||||
* @generated SignedSource<<5e8c575bf254c267b0694d9c7dd20a82>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,20 +10,20 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type NonconformityRegistriesPageRefetchQuery$variables = {
|
||||
export type NonconformitiesPageRefetchQuery$variables = {
|
||||
after?: any | null | undefined;
|
||||
first?: number | null | undefined;
|
||||
id: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type NonconformityRegistriesPageRefetchQuery$data = {
|
||||
export type NonconformitiesPageRefetchQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"NonconformityRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"NonconformitiesPageFragment">;
|
||||
};
|
||||
};
|
||||
export type NonconformityRegistriesPageRefetchQuery = {
|
||||
response: NonconformityRegistriesPageRefetchQuery$data;
|
||||
variables: NonconformityRegistriesPageRefetchQuery$variables;
|
||||
export type NonconformitiesPageRefetchQuery = {
|
||||
response: NonconformitiesPageRefetchQuery$data;
|
||||
variables: NonconformitiesPageRefetchQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -111,7 +111,7 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "NonconformityRegistriesPageRefetchQuery",
|
||||
"name": "NonconformitiesPageRefetchQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -128,7 +128,7 @@ return {
|
||||
(v7/*: any*/)
|
||||
],
|
||||
"kind": "FragmentSpread",
|
||||
"name": "NonconformityRegistriesPageFragment"
|
||||
"name": "NonconformitiesPageFragment"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -146,7 +146,7 @@ return {
|
||||
(v2/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "NonconformityRegistriesPageRefetchQuery",
|
||||
"name": "NonconformitiesPageRefetchQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -164,9 +164,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"concreteType": "NonconformityRegistryConnection",
|
||||
"concreteType": "NonconformityConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "nonconformityRegistries",
|
||||
"name": "nonconformities",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -179,7 +179,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistryEdge",
|
||||
"concreteType": "NonconformityEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -187,7 +187,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "NonconformityRegistry",
|
||||
"concreteType": "Nonconformity",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -376,9 +376,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "RegistriesPage_nonconformityRegistries",
|
||||
"key": "NonconformitiesPage_nonconformities",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "nonconformityRegistries"
|
||||
"name": "nonconformities"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -390,16 +390,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "c8a936f15b58d1f1d51984f692b0bba5",
|
||||
"cacheID": "d0fe732fcd104cafd8dec7748d5f3971",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "NonconformityRegistriesPageRefetchQuery",
|
||||
"name": "NonconformitiesPageRefetchQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query NonconformityRegistriesPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...NonconformityRegistriesPageFragment_35e0S5\n id\n }\n}\n\nfragment NonconformityRegistriesPageFragment_35e0S5 on Organization {\n id\n nonconformityRegistries(first: $first, after: $after, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n referenceId\n snapshotId\n description\n status\n dateIdentified\n dueDate\n rootCause\n correctiveAction\n effectivenessCheck\n audit {\n id\n name\n framework {\n id\n name\n }\n }\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
"text": "query NonconformitiesPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...NonconformitiesPageFragment_35e0S5\n id\n }\n}\n\nfragment NonconformitiesPageFragment_35e0S5 on Organization {\n id\n nonconformities(first: $first, after: $after, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n referenceId\n snapshotId\n description\n status\n dateIdentified\n dueDate\n rootCause\n correctiveAction\n effectivenessCheck\n audit {\n id\n name\n framework {\n id\n name\n }\n }\n owner {\n id\n fullName\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 = "36f3622d63ddf02a2703a2c8428f4268";
|
||||
(node as any).hash = "0043855d2410d9ab1fd8fceda53f7c5a";
|
||||
|
||||
export default node;
|
||||
@@ -17,13 +17,11 @@ import {
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { z } from "zod";
|
||||
import { useFormWithSchema } from "/hooks/useFormWithSchema";
|
||||
import { useCreateNonconformityRegistry } from "../../../../hooks/graph/NonconformityRegistryGraph";
|
||||
import { useCreateNonconformity } from "../../../../hooks/graph/NonconformityGraph";
|
||||
import { PeopleSelectField } from "/components/form/PeopleSelectField";
|
||||
import { AuditSelectField } from "/components/form/AuditSelectField";
|
||||
import { Controller } from "react-hook-form";
|
||||
import { formatDatetime, getNonconformityRegistryStatusOptions } from "@probo/helpers";
|
||||
|
||||
|
||||
import { formatDatetime, getStatusOptions } from "@probo/helpers";
|
||||
|
||||
const schema = z.object({
|
||||
referenceId: z.string().min(1, "Reference ID is required"),
|
||||
@@ -40,23 +38,23 @@ const schema = z.object({
|
||||
|
||||
type FormData = z.infer<typeof schema>;
|
||||
|
||||
interface CreateNonconformityRegistryDialogProps {
|
||||
interface CreateNonconformityDialogProps {
|
||||
children: ReactNode;
|
||||
connection?: string;
|
||||
organizationId: string;
|
||||
}
|
||||
|
||||
export function CreateNonconformityRegistryDialog({
|
||||
export function CreateNonconformityDialog({
|
||||
children,
|
||||
organizationId,
|
||||
connection,
|
||||
}: CreateNonconformityRegistryDialogProps) {
|
||||
}: CreateNonconformityDialogProps) {
|
||||
const { __ } = useTranslate();
|
||||
const { toast } = useToast();
|
||||
const dialogRef = useDialogRef();
|
||||
|
||||
const createRegistry = useCreateNonconformityRegistry(connection || "");
|
||||
const statusOptions = getNonconformityRegistryStatusOptions(__);
|
||||
const createNonconformity = useCreateNonconformity(connection || "");
|
||||
const statusOptions = getStatusOptions(__);
|
||||
|
||||
const { register, handleSubmit, formState, reset, control } = useFormWithSchema(schema, {
|
||||
defaultValues: {
|
||||
@@ -75,7 +73,7 @@ export function CreateNonconformityRegistryDialog({
|
||||
|
||||
const onSubmit = handleSubmit(async (formData: FormData) => {
|
||||
try {
|
||||
await createRegistry({
|
||||
await createNonconformity({
|
||||
organizationId,
|
||||
referenceId: formData.referenceId,
|
||||
description: formData.description || undefined,
|
||||
@@ -91,7 +89,7 @@ export function CreateNonconformityRegistryDialog({
|
||||
|
||||
toast({
|
||||
title: __("Success"),
|
||||
description: __("Non conformity registry entry created successfully"),
|
||||
description: __("Nonconformity created successfully"),
|
||||
variant: "success",
|
||||
});
|
||||
|
||||
@@ -100,7 +98,7 @@ export function CreateNonconformityRegistryDialog({
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: __("Failed to create non conformity registry entry"),
|
||||
description: __("Failed to create nonconformity"),
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
@@ -110,7 +108,7 @@ export function CreateNonconformityRegistryDialog({
|
||||
<Dialog
|
||||
ref={dialogRef}
|
||||
trigger={children}
|
||||
title={<Breadcrumb items={[__("Registries"), __("Create Entry")]} />}
|
||||
title={<Breadcrumb items={[__("Nonconformities"), __("Create")]} />}
|
||||
className="max-w-2xl"
|
||||
>
|
||||
<form onSubmit={onSubmit}>
|
||||
@@ -240,7 +238,7 @@ export function CreateNonconformityRegistryDialog({
|
||||
|
||||
<DialogFooter>
|
||||
<Button type="submit" disabled={formState.isSubmitting}>
|
||||
{formState.isSubmitting ? __("Creating...") : __("Create Nonconformity Registry Entry")}
|
||||
{formState.isSubmitting ? __("Creating...") : __("Create Nonconformity")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
@@ -4,11 +4,11 @@ import {
|
||||
type PreloadedQuery,
|
||||
} from "react-relay";
|
||||
import {
|
||||
complianceRegistryNodeQuery,
|
||||
useDeleteComplianceRegistry,
|
||||
useUpdateComplianceRegistry,
|
||||
ComplianceRegistriesConnectionKey,
|
||||
} from "../../../hooks/graph/ComplianceRegistryGraph";
|
||||
obligationNodeQuery,
|
||||
useDeleteObligation,
|
||||
useUpdateObligation,
|
||||
ObligationsConnectionKey,
|
||||
} from "../../../hooks/graph/ObligationGraph";
|
||||
import {
|
||||
ActionDropdown,
|
||||
Badge,
|
||||
@@ -31,11 +31,11 @@ import { PeopleSelectField } from "/components/form/PeopleSelectField";
|
||||
import { useFormWithSchema } from "/hooks/useFormWithSchema";
|
||||
import { Controller } from "react-hook-form";
|
||||
import z from "zod";
|
||||
import { getStatusVariant, getStatusLabel, formatDatetime, getComplianceRegistryStatusOptions, validateSnapshotConsistency } from "@probo/helpers";
|
||||
import { getStatusVariant, getStatusLabel, formatDatetime, getStatusOptions, validateSnapshotConsistency } from "@probo/helpers";
|
||||
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||
import type { ComplianceRegistryGraphNodeQuery } from "/hooks/graph/__generated__/ComplianceRegistryGraphNodeQuery.graphql";
|
||||
import type { ObligationGraphNodeQuery } from "/hooks/graph/__generated__/ObligationGraphNodeQuery.graphql";
|
||||
|
||||
const updateRegistrySchema = z.object({
|
||||
const updateObligationSchema = z.object({
|
||||
referenceId: z.string().min(1, "Reference ID is required"),
|
||||
area: z.string().optional(),
|
||||
source: z.string().optional(),
|
||||
@@ -49,60 +49,63 @@ const updateRegistrySchema = z.object({
|
||||
});
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<ComplianceRegistryGraphNodeQuery>;
|
||||
queryRef: PreloadedQuery<ObligationGraphNodeQuery>;
|
||||
};
|
||||
|
||||
export default function ComplianceRegistryDetailsPage(props: Props) {
|
||||
const data = usePreloadedQuery<ComplianceRegistryGraphNodeQuery>(complianceRegistryNodeQuery, props.queryRef);
|
||||
const registry = data.node;
|
||||
export default function ObligationDetailsPage(props: Props) {
|
||||
const data = usePreloadedQuery<ObligationGraphNodeQuery>(obligationNodeQuery, props.queryRef);
|
||||
const obligation = data.node;
|
||||
const { __ } = useTranslate();
|
||||
const { toast } = useToast();
|
||||
const organizationId = useOrganizationId();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
|
||||
if (!registry) {
|
||||
return <div>{__("Compliance registry entry not found")}</div>;
|
||||
if (!obligation) {
|
||||
return <div>{__("Obligation not found")}</div>;
|
||||
}
|
||||
|
||||
validateSnapshotConsistency(registry, snapshotId);
|
||||
validateSnapshotConsistency(obligation, snapshotId);
|
||||
|
||||
const updateRegistry = useUpdateComplianceRegistry();
|
||||
const statusOptions = getComplianceRegistryStatusOptions(__);
|
||||
const updateObligation = useUpdateObligation();
|
||||
const statusOptions = getStatusOptions(__);
|
||||
|
||||
const connectionId = ConnectionHandler.getConnectionID(
|
||||
organizationId,
|
||||
ComplianceRegistriesConnectionKey
|
||||
ObligationsConnectionKey
|
||||
);
|
||||
|
||||
const deleteRegistry = useDeleteComplianceRegistry({ id: registry.id!, referenceId: registry.referenceId! }, connectionId);
|
||||
const deleteObligation = useDeleteObligation(
|
||||
{ id: obligation?.id!, referenceId: obligation?.referenceId! },
|
||||
connectionId
|
||||
);
|
||||
|
||||
const { register, handleSubmit, formState, control } = useFormWithSchema(
|
||||
updateRegistrySchema,
|
||||
updateObligationSchema,
|
||||
{
|
||||
defaultValues: {
|
||||
referenceId: registry.referenceId || "",
|
||||
area: registry.area || "",
|
||||
source: registry.source || "",
|
||||
requirement: registry.requirement || "",
|
||||
actionsToBeImplemented: registry.actionsToBeImplemented || "",
|
||||
regulator: registry.regulator || "",
|
||||
lastReviewDate: registry.lastReviewDate
|
||||
? new Date(registry.lastReviewDate).toISOString().split("T")[0]
|
||||
referenceId: obligation?.referenceId || "",
|
||||
area: obligation?.area || "",
|
||||
source: obligation?.source || "",
|
||||
requirement: obligation?.requirement || "",
|
||||
actionsToBeImplemented: obligation?.actionsToBeImplemented || "",
|
||||
regulator: obligation?.regulator || "",
|
||||
lastReviewDate: obligation?.lastReviewDate
|
||||
? new Date(obligation.lastReviewDate).toISOString().split("T")[0]
|
||||
: "",
|
||||
dueDate: registry.dueDate
|
||||
? new Date(registry.dueDate).toISOString().split("T")[0]
|
||||
dueDate: obligation?.dueDate
|
||||
? new Date(obligation.dueDate).toISOString().split("T")[0]
|
||||
: "",
|
||||
status: registry.status || "OPEN",
|
||||
ownerId: registry.owner?.id || "",
|
||||
status: obligation?.status || "OPEN",
|
||||
ownerId: obligation?.owner?.id || "",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const onSubmit = handleSubmit(async (formData) => {
|
||||
try {
|
||||
await updateRegistry({
|
||||
id: registry.id!,
|
||||
await updateObligation({
|
||||
id: obligation.id!,
|
||||
referenceId: formData.referenceId,
|
||||
area: formData.area || undefined,
|
||||
source: formData.source || undefined,
|
||||
@@ -118,21 +121,21 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
||||
|
||||
toast({
|
||||
title: __("Success"),
|
||||
description: __("Compliance registry entry updated successfully"),
|
||||
description: __("Obligation updated successfully"),
|
||||
variant: "success",
|
||||
});
|
||||
} catch (error) {
|
||||
} catch {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: __("Failed to update compliance registry entry"),
|
||||
description: __("Failed to update obligation"),
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const breadcrumbComplianceRegistriesUrl = isSnapshotMode
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/compliance-registries`
|
||||
: `/organizations/${organizationId}/compliance-registries`;
|
||||
const breadcrumbObligationsUrl = isSnapshotMode
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/obligations`
|
||||
: `/organizations/${organizationId}/obligations`;
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
@@ -143,21 +146,21 @@ export default function ComplianceRegistryDetailsPage(props: Props) {
|
||||
<div>
|
||||
<Breadcrumb
|
||||
items={[
|
||||
{ label: __("Compliance Registries"), to: breadcrumbComplianceRegistriesUrl },
|
||||
{ label: registry.referenceId! },
|
||||
{ label: __("Obligations"), to: breadcrumbObligationsUrl },
|
||||
{ label: obligation.referenceId! },
|
||||
]}
|
||||
/>
|
||||
<div className="flex items-center gap-3 mt-2">
|
||||
<h1 className="text-2xl font-bold">{registry.referenceId}</h1>
|
||||
<Badge variant={getStatusVariant(registry.status || "OPEN")}>
|
||||
{getStatusLabel(registry.status || "OPEN")}
|
||||
<h1 className="text-2xl font-bold">{obligation.referenceId}</h1>
|
||||
<Badge variant={getStatusVariant(obligation.status || "OPEN")}>
|
||||
{getStatusLabel(obligation.status || "OPEN")}
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!isSnapshotMode && (
|
||||
<ActionDropdown>
|
||||
<DropdownItem icon={IconTrashCan} onClick={deleteRegistry}>
|
||||
<DropdownItem icon={IconTrashCan} onClick={deleteObligation}>
|
||||
{__("Delete")}
|
||||
</DropdownItem>
|
||||
</ActionDropdown>
|
||||
@@ -26,37 +26,37 @@ import {
|
||||
} from "react-relay";
|
||||
import { useParams } from "react-router";
|
||||
import { useOrganizationId } from "/hooks/useOrganizationId";
|
||||
import { CreateComplianceRegistryDialog } from "./dialogs/CreateComplianceRegistryDialog";
|
||||
import { deleteComplianceRegistryMutation } from "../../../hooks/graph/ComplianceRegistryGraph";
|
||||
import { CreateObligationDialog } from "./dialogs/CreateObligationDialog";
|
||||
import { deleteObligationMutation } from "../../../hooks/graph/ObligationGraph";
|
||||
import { sprintf, promisifyMutation, getStatusVariant, getStatusLabel } from "@probo/helpers";
|
||||
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||
import type { ComplianceRegistriesPageQuery } from "./__generated__/ComplianceRegistriesPageQuery.graphql";
|
||||
import type { ObligationsPageQuery } from "./__generated__/ObligationsPageQuery.graphql";
|
||||
import type {
|
||||
ComplianceRegistriesPageFragment$key,
|
||||
ComplianceRegistriesPageFragment$data,
|
||||
} from "./__generated__/ComplianceRegistriesPageFragment.graphql";
|
||||
ObligationsPageFragment$key,
|
||||
ObligationsPageFragment$data,
|
||||
} from "./__generated__/ObligationsPageFragment.graphql";
|
||||
|
||||
type ComplianceRegistry = ComplianceRegistriesPageFragment$data['complianceRegistries']['edges'][number]['node'];
|
||||
type Obligation = ObligationsPageFragment$data['obligations']['edges'][number]['node'];
|
||||
|
||||
interface ComplianceRegistriesPageProps {
|
||||
queryRef: PreloadedQuery<ComplianceRegistriesPageQuery>;
|
||||
interface ObligationsPageProps {
|
||||
queryRef: PreloadedQuery<ObligationsPageQuery>;
|
||||
}
|
||||
|
||||
const complianceRegistriesPageFragment = graphql`
|
||||
fragment ComplianceRegistriesPageFragment on Organization
|
||||
@refetchable(queryName: "ComplianceRegistriesPageRefetchQuery")
|
||||
const obligationsPageFragment = graphql`
|
||||
fragment ObligationsPageFragment on Organization
|
||||
@refetchable(queryName: "ObligationsPageRefetchQuery")
|
||||
@argumentDefinitions(
|
||||
first: { type: "Int", defaultValue: 10 }
|
||||
after: { type: "CursorKey" }
|
||||
snapshotId: { type: "ID", defaultValue: null }
|
||||
) {
|
||||
id
|
||||
complianceRegistries(
|
||||
obligations(
|
||||
first: $first
|
||||
after: $after
|
||||
filter: { snapshotId: $snapshotId }
|
||||
)
|
||||
@connection(key: "ComplianceRegistriesPage_complianceRegistries", filters: ["filter"]) {
|
||||
@connection(key: "ObligationsPage_obligations", filters: ["filter"]) {
|
||||
__id
|
||||
totalCount
|
||||
edges {
|
||||
@@ -89,20 +89,20 @@ const complianceRegistriesPageFragment = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export default function ComplianceRegistriesPage({ queryRef }: ComplianceRegistriesPageProps) {
|
||||
export default function ObligationsPage({ queryRef }: ObligationsPageProps) {
|
||||
const { __ } = useTranslate();
|
||||
const organizationId = useOrganizationId();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
|
||||
usePageTitle(__("Compliance Registries"));
|
||||
usePageTitle(__("Obligations"));
|
||||
|
||||
const organization = usePreloadedQuery(
|
||||
graphql`
|
||||
query ComplianceRegistriesPageQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
query ObligationsPageQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
node(id: $organizationId) {
|
||||
... on Organization {
|
||||
...ComplianceRegistriesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
...ObligationsPageFragment @arguments(snapshotId: $snapshotId)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,13 +110,13 @@ export default function ComplianceRegistriesPage({ queryRef }: ComplianceRegistr
|
||||
queryRef
|
||||
);
|
||||
|
||||
const { data: registriesData, loadNext, hasNext } = usePaginationFragment(
|
||||
complianceRegistriesPageFragment,
|
||||
organization.node as ComplianceRegistriesPageFragment$key
|
||||
const { data: obligationsData, loadNext, hasNext } = usePaginationFragment(
|
||||
obligationsPageFragment,
|
||||
organization.node as ObligationsPageFragment$key
|
||||
);
|
||||
|
||||
const connectionId = registriesData?.complianceRegistries?.__id || "";
|
||||
const registries: ComplianceRegistry[] = registriesData?.complianceRegistries?.edges?.map((edge) => edge.node) ?? [];
|
||||
const connectionId = obligationsData?.obligations?.__id || "";
|
||||
const obligations: Obligation[] = obligationsData?.obligations?.edges?.map((edge) => edge.node) ?? [];
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
@@ -124,26 +124,26 @@ export default function ComplianceRegistriesPage({ queryRef }: ComplianceRegistr
|
||||
<SnapshotBanner snapshotId={snapshotId} />
|
||||
)}
|
||||
<PageHeader
|
||||
title={__("Compliance Registries")}
|
||||
title={__("Obligations")}
|
||||
description={__(
|
||||
"Manage your organization's compliance registry entries."
|
||||
"Manage your organization's obligations."
|
||||
)}
|
||||
>
|
||||
{!snapshotId && (
|
||||
<CreateComplianceRegistryDialog organizationId={organizationId} connection={connectionId}>
|
||||
<Button icon={IconPlusLarge}>{__("Add compliance registry")}</Button>
|
||||
</CreateComplianceRegistryDialog>
|
||||
<CreateObligationDialog organizationId={organizationId} connection={connectionId}>
|
||||
<Button icon={IconPlusLarge}>{__("Add obligation")}</Button>
|
||||
</CreateObligationDialog>
|
||||
)}
|
||||
</PageHeader>
|
||||
|
||||
{registries.length === 0 ? (
|
||||
{obligations.length === 0 ? (
|
||||
<Card padded>
|
||||
<div className="text-center py-12">
|
||||
<h3 className="text-lg font-semibold mb-2">
|
||||
{__("No compliance registry entries yet")}
|
||||
{__("No obligations yet")}
|
||||
</h3>
|
||||
<p className="text-txt-tertiary mb-4">
|
||||
{__("Create your first compliance registry entry to get started.")}
|
||||
{__("Create your first obligation to get started.")}
|
||||
</p>
|
||||
</div>
|
||||
</Card>
|
||||
@@ -162,10 +162,10 @@ export default function ComplianceRegistriesPage({ queryRef }: ComplianceRegistr
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
{registries.map((registry) => (
|
||||
<RegistryRow
|
||||
key={registry.id}
|
||||
registry={registry}
|
||||
{obligations.map((obligation) => (
|
||||
<ObligationRow
|
||||
key={obligation.id}
|
||||
obligation={obligation}
|
||||
connectionId={connectionId}
|
||||
snapshotId={snapshotId}
|
||||
/>
|
||||
@@ -190,18 +190,18 @@ export default function ComplianceRegistriesPage({ queryRef }: ComplianceRegistr
|
||||
);
|
||||
}
|
||||
|
||||
function RegistryRow({
|
||||
registry,
|
||||
function ObligationRow({
|
||||
obligation,
|
||||
connectionId,
|
||||
snapshotId,
|
||||
}: {
|
||||
registry: ComplianceRegistry;
|
||||
obligation: Obligation;
|
||||
connectionId: string;
|
||||
snapshotId?: string;
|
||||
}) {
|
||||
const organizationId = useOrganizationId();
|
||||
const { __ } = useTranslate();
|
||||
const [deleteRegistry] = useMutation(deleteComplianceRegistryMutation);
|
||||
const [deleteObligation] = useMutation(deleteObligationMutation);
|
||||
const confirm = useConfirm();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
|
||||
@@ -212,10 +212,10 @@ function RegistryRow({
|
||||
const handleDelete = () => {
|
||||
confirm(
|
||||
() =>
|
||||
promisifyMutation(deleteRegistry)({
|
||||
promisifyMutation(deleteObligation)({
|
||||
variables: {
|
||||
input: {
|
||||
complianceRegistryId: registry.id,
|
||||
obligationId: obligation.id,
|
||||
},
|
||||
connections: [connectionId],
|
||||
},
|
||||
@@ -223,35 +223,35 @@ function RegistryRow({
|
||||
{
|
||||
message: sprintf(
|
||||
__(
|
||||
"This will permanently delete the compliance registry entry %s. This action cannot be undone."
|
||||
"This will permanently delete the obligation %s. This action cannot be undone."
|
||||
),
|
||||
registry.referenceId
|
||||
obligation.referenceId
|
||||
),
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const detailsUrl = isSnapshotMode
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/compliance-registries/${registry.id}`
|
||||
: `/organizations/${organizationId}/compliance-registries/${registry.id}`;
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/obligations/${obligation.id}`
|
||||
: `/organizations/${organizationId}/obligations/${obligation.id}`;
|
||||
|
||||
return (
|
||||
<Tr to={detailsUrl}>
|
||||
<Td>
|
||||
<span className="font-mono text-sm">{registry.referenceId}</span>
|
||||
<span className="font-mono text-sm">{obligation.referenceId}</span>
|
||||
</Td>
|
||||
<Td>{registry.area || "-"}</Td>
|
||||
<Td>{registry.source || "-"}</Td>
|
||||
<Td>{obligation.area || "-"}</Td>
|
||||
<Td>{obligation.source || "-"}</Td>
|
||||
<Td>
|
||||
<Badge variant={getStatusVariant(registry.status || "OPEN")}>
|
||||
{getStatusLabel(registry.status || "OPEN")}
|
||||
<Badge variant={getStatusVariant(obligation.status || "OPEN")}>
|
||||
{getStatusLabel(obligation.status || "OPEN")}
|
||||
</Badge>
|
||||
</Td>
|
||||
<Td>{registry.owner?.fullName || "-"}</Td>
|
||||
<Td>{obligation.owner?.fullName || "-"}</Td>
|
||||
<Td>
|
||||
{registry.dueDate ? (
|
||||
<time dateTime={registry.dueDate}>
|
||||
{formatDate(registry.dueDate)}
|
||||
{obligation.dueDate ? (
|
||||
<time dateTime={obligation.dueDate}>
|
||||
{formatDate(obligation.dueDate)}
|
||||
</time>
|
||||
) : (
|
||||
<span className="text-txt-tertiary">{__("No due date")}</span>
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<db8b4530d56ae89fa8e332555a85eb33>>
|
||||
* @generated SignedSource<<5f839350ed835351175b07d38512ba37>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,10 +9,11 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type ComplianceRegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type ObligationStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ComplianceRegistriesPageFragment$data = {
|
||||
readonly complianceRegistries: {
|
||||
export type ObligationsPageFragment$data = {
|
||||
readonly id: string;
|
||||
readonly obligations: {
|
||||
readonly __id: string;
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
@@ -32,7 +33,7 @@ export type ComplianceRegistriesPageFragment$data = {
|
||||
readonly snapshotId: string | null | undefined;
|
||||
readonly source: string | null | undefined;
|
||||
readonly sourceId: string | null | undefined;
|
||||
readonly status: ComplianceRegistryStatus;
|
||||
readonly status: ObligationStatus;
|
||||
readonly updatedAt: any;
|
||||
};
|
||||
}>;
|
||||
@@ -42,19 +43,18 @@ export type ComplianceRegistriesPageFragment$data = {
|
||||
};
|
||||
readonly totalCount: number;
|
||||
};
|
||||
readonly id: string;
|
||||
readonly " $fragmentType": "ComplianceRegistriesPageFragment";
|
||||
readonly " $fragmentType": "ObligationsPageFragment";
|
||||
};
|
||||
export type ComplianceRegistriesPageFragment$key = {
|
||||
readonly " $data"?: ComplianceRegistriesPageFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ComplianceRegistriesPageFragment">;
|
||||
export type ObligationsPageFragment$key = {
|
||||
readonly " $data"?: ObligationsPageFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ObligationsPageFragment">;
|
||||
};
|
||||
|
||||
import ComplianceRegistriesPageRefetchQuery_graphql from './ComplianceRegistriesPageRefetchQuery.graphql';
|
||||
import ObligationsPageRefetchQuery_graphql from './ObligationsPageRefetchQuery.graphql';
|
||||
|
||||
const node: ReaderFragment = (function(){
|
||||
var v0 = [
|
||||
"complianceRegistries"
|
||||
"obligations"
|
||||
],
|
||||
v1 = {
|
||||
"alias": null,
|
||||
@@ -103,18 +103,18 @@ return {
|
||||
"fragmentPathInResult": [
|
||||
"node"
|
||||
],
|
||||
"operation": ComplianceRegistriesPageRefetchQuery_graphql,
|
||||
"operation": ObligationsPageRefetchQuery_graphql,
|
||||
"identifierInfo": {
|
||||
"identifierField": "id",
|
||||
"identifierQueryVariableName": "id"
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": "ComplianceRegistriesPageFragment",
|
||||
"name": "ObligationsPageFragment",
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
{
|
||||
"alias": "complianceRegistries",
|
||||
"alias": "obligations",
|
||||
"args": [
|
||||
{
|
||||
"fields": [
|
||||
@@ -128,9 +128,9 @@ return {
|
||||
"name": "filter"
|
||||
}
|
||||
],
|
||||
"concreteType": "ComplianceRegistryConnection",
|
||||
"concreteType": "ObligationConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "__ComplianceRegistriesPage_complianceRegistries_connection",
|
||||
"name": "__ObligationsPage_obligations_connection",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -143,7 +143,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ComplianceRegistryEdge",
|
||||
"concreteType": "ObligationEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -151,7 +151,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ComplianceRegistry",
|
||||
"concreteType": "Obligation",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -333,6 +333,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "b22ac157b9ba89ab14fe8363e56957ef";
|
||||
(node as any).hash = "0d7452faf6e02f97885a65819dfb112b";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<41975a1dcc769268a6255ea703ff26fe>>
|
||||
* @generated SignedSource<<f54af2ebc7ab4d39662c5619a23532ac>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,18 +10,18 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ComplianceRegistryGraphListQuery$variables = {
|
||||
export type ObligationsPageQuery$variables = {
|
||||
organizationId: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type ComplianceRegistryGraphListQuery$data = {
|
||||
export type ObligationsPageQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ComplianceRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ObligationsPageFragment">;
|
||||
};
|
||||
};
|
||||
export type ComplianceRegistryGraphListQuery = {
|
||||
response: ComplianceRegistryGraphListQuery$data;
|
||||
variables: ComplianceRegistryGraphListQuery$variables;
|
||||
export type ObligationsPageQuery = {
|
||||
response: ObligationsPageQuery$data;
|
||||
variables: ObligationsPageQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -82,7 +82,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ComplianceRegistryGraphListQuery",
|
||||
"name": "ObligationsPageQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -98,7 +98,7 @@ return {
|
||||
{
|
||||
"args": (v2/*: any*/),
|
||||
"kind": "FragmentSpread",
|
||||
"name": "ComplianceRegistriesPageFragment"
|
||||
"name": "ObligationsPageFragment"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -115,7 +115,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ComplianceRegistryGraphListQuery",
|
||||
"name": "ObligationsPageQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -133,9 +133,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"concreteType": "ComplianceRegistryConnection",
|
||||
"concreteType": "ObligationConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "complianceRegistries",
|
||||
"name": "obligations",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -148,7 +148,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ComplianceRegistryEdge",
|
||||
"concreteType": "ObligationEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -156,7 +156,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ComplianceRegistry",
|
||||
"concreteType": "Obligation",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -333,9 +333,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "ComplianceRegistriesPage_complianceRegistries",
|
||||
"key": "ObligationsPage_obligations",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "complianceRegistries"
|
||||
"name": "obligations"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -347,16 +347,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "d578089841a93f60ae9ba5bc6e9175b0",
|
||||
"cacheID": "7e61419b20d9cf30e5dd31b4500bc324",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ComplianceRegistryGraphListQuery",
|
||||
"name": "ObligationsPageQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ComplianceRegistryGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ComplianceRegistriesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ComplianceRegistriesPageFragment_3iomuz on Organization {\n id\n complianceRegistries(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n area\n source\n requirement\n status\n lastReviewDate\n dueDate\n actionsToBeImplemented\n regulator\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
"text": "query ObligationsPageQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ObligationsPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ObligationsPageFragment_3iomuz on Organization {\n id\n obligations(first: 10, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n area\n source\n requirement\n status\n lastReviewDate\n dueDate\n actionsToBeImplemented\n regulator\n owner {\n id\n fullName\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 = "2c50dd58eb2d72e49bce300726f35a34";
|
||||
(node as any).hash = "720209ab225ef7a42f1edb96e5d58aa1";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<af4b3139bff8ab757fa1876aa4be4bb1>>
|
||||
* @generated SignedSource<<c1ff0a7d2abc83b2111d20abecaf6baf>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,20 +10,20 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ComplianceRegistriesPageRefetchQuery$variables = {
|
||||
export type ObligationsPageRefetchQuery$variables = {
|
||||
after?: any | null | undefined;
|
||||
first?: number | null | undefined;
|
||||
id: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type ComplianceRegistriesPageRefetchQuery$data = {
|
||||
export type ObligationsPageRefetchQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ComplianceRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ObligationsPageFragment">;
|
||||
};
|
||||
};
|
||||
export type ComplianceRegistriesPageRefetchQuery = {
|
||||
response: ComplianceRegistriesPageRefetchQuery$data;
|
||||
variables: ComplianceRegistriesPageRefetchQuery$variables;
|
||||
export type ObligationsPageRefetchQuery = {
|
||||
response: ObligationsPageRefetchQuery$data;
|
||||
variables: ObligationsPageRefetchQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -104,7 +104,7 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ComplianceRegistriesPageRefetchQuery",
|
||||
"name": "ObligationsPageRefetchQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -121,7 +121,7 @@ return {
|
||||
(v7/*: any*/)
|
||||
],
|
||||
"kind": "FragmentSpread",
|
||||
"name": "ComplianceRegistriesPageFragment"
|
||||
"name": "ObligationsPageFragment"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -139,7 +139,7 @@ return {
|
||||
(v2/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "ComplianceRegistriesPageRefetchQuery",
|
||||
"name": "ObligationsPageRefetchQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -157,9 +157,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"concreteType": "ComplianceRegistryConnection",
|
||||
"concreteType": "ObligationConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "complianceRegistries",
|
||||
"name": "obligations",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -172,7 +172,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ComplianceRegistryEdge",
|
||||
"concreteType": "ObligationEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -180,7 +180,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ComplianceRegistry",
|
||||
"concreteType": "Obligation",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -357,9 +357,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "ComplianceRegistriesPage_complianceRegistries",
|
||||
"key": "ObligationsPage_obligations",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "complianceRegistries"
|
||||
"name": "obligations"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -371,16 +371,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "d14ed4a195ca3b570ad5ecd255cf17e8",
|
||||
"cacheID": "f34cf1412b7ff3e92971dfac07ca06ac",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ComplianceRegistriesPageRefetchQuery",
|
||||
"name": "ObligationsPageRefetchQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ComplianceRegistriesPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ComplianceRegistriesPageFragment_35e0S5\n id\n }\n}\n\nfragment ComplianceRegistriesPageFragment_35e0S5 on Organization {\n id\n complianceRegistries(first: $first, after: $after, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n area\n source\n requirement\n status\n lastReviewDate\n dueDate\n actionsToBeImplemented\n regulator\n owner {\n id\n fullName\n }\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}\n"
|
||||
"text": "query ObligationsPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ObligationsPageFragment_35e0S5\n id\n }\n}\n\nfragment ObligationsPageFragment_35e0S5 on Organization {\n id\n obligations(first: $first, after: $after, filter: {snapshotId: $snapshotId}) {\n totalCount\n edges {\n node {\n id\n snapshotId\n sourceId\n referenceId\n area\n source\n requirement\n status\n lastReviewDate\n dueDate\n actionsToBeImplemented\n regulator\n owner {\n id\n fullName\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 = "b22ac157b9ba89ab14fe8363e56957ef";
|
||||
(node as any).hash = "0d7452faf6e02f97885a65819dfb112b";
|
||||
|
||||
export default node;
|
||||
@@ -17,10 +17,10 @@ import {
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { z } from "zod";
|
||||
import { useFormWithSchema } from "/hooks/useFormWithSchema";
|
||||
import { useCreateComplianceRegistry } from "../../../../hooks/graph/ComplianceRegistryGraph";
|
||||
import { useCreateObligation } from "../../../../hooks/graph/ObligationGraph";
|
||||
import { PeopleSelectField } from "/components/form/PeopleSelectField";
|
||||
import { Controller } from "react-hook-form";
|
||||
import { formatDatetime, getComplianceRegistryStatusOptions } from "@probo/helpers";
|
||||
import { formatDatetime, getStatusOptions } from "@probo/helpers";
|
||||
|
||||
const schema = z.object({
|
||||
referenceId: z.string().min(1, "Reference ID is required"),
|
||||
@@ -37,23 +37,23 @@ const schema = z.object({
|
||||
|
||||
type FormData = z.infer<typeof schema>;
|
||||
|
||||
interface CreateComplianceRegistryDialogProps {
|
||||
interface CreateObligationDialogProps {
|
||||
children: ReactNode;
|
||||
organizationId: string;
|
||||
connection?: string;
|
||||
}
|
||||
|
||||
export function CreateComplianceRegistryDialog({
|
||||
export function CreateObligationDialog({
|
||||
children,
|
||||
organizationId,
|
||||
connection,
|
||||
}: CreateComplianceRegistryDialogProps) {
|
||||
}: CreateObligationDialogProps) {
|
||||
const { __ } = useTranslate();
|
||||
const { toast } = useToast();
|
||||
const dialogRef = useDialogRef();
|
||||
|
||||
const createRegistry = useCreateComplianceRegistry(connection || "");
|
||||
const statusOptions = getComplianceRegistryStatusOptions(__);
|
||||
const createObligation = useCreateObligation(connection || "");
|
||||
const statusOptions = getStatusOptions(__);
|
||||
|
||||
const { register, handleSubmit, formState, reset, control } = useFormWithSchema(schema, {
|
||||
defaultValues: {
|
||||
@@ -72,7 +72,7 @@ export function CreateComplianceRegistryDialog({
|
||||
|
||||
const onSubmit = handleSubmit(async (formData: FormData) => {
|
||||
try {
|
||||
await createRegistry({
|
||||
await createObligation({
|
||||
organizationId,
|
||||
referenceId: formData.referenceId,
|
||||
area: formData.area || undefined,
|
||||
@@ -88,16 +88,16 @@ export function CreateComplianceRegistryDialog({
|
||||
|
||||
toast({
|
||||
title: __("Success"),
|
||||
description: __("Compliance registry entry created successfully"),
|
||||
description: __("Obligation created successfully"),
|
||||
variant: "success",
|
||||
});
|
||||
|
||||
reset();
|
||||
dialogRef.current?.close();
|
||||
} catch (error) {
|
||||
} catch {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: __("Failed to create compliance registry entry"),
|
||||
description: __("Failed to create obligation"),
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
@@ -107,7 +107,7 @@ export function CreateComplianceRegistryDialog({
|
||||
<Dialog
|
||||
ref={dialogRef}
|
||||
trigger={children}
|
||||
title={<Breadcrumb items={[__("Registries"), __("Create Compliance Entry")]} />}
|
||||
title={<Breadcrumb items={[__("Obligations"), __("Create Obligation")]} />}
|
||||
className="max-w-2xl"
|
||||
>
|
||||
<form onSubmit={onSubmit}>
|
||||
@@ -230,7 +230,7 @@ export function CreateComplianceRegistryDialog({
|
||||
|
||||
<DialogFooter>
|
||||
<Button type="submit" disabled={formState.isSubmitting}>
|
||||
{formState.isSubmitting ? __("Creating...") : __("Create Compliance Registry Entry")}
|
||||
{formState.isSubmitting ? __("Creating...") : __("Create Obligation")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
} from "@probo/ui";
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { usePageTitle } from "@probo/hooks";
|
||||
import { getLawfulBasisLabel } from "../../../components/form/ProcessingActivityRegistryEnumOptions";
|
||||
import { getLawfulBasisLabel } from "../../../components/form/ProcessingActivityEnumOptions";
|
||||
import {
|
||||
ConnectionHandler,
|
||||
graphql,
|
||||
@@ -28,36 +28,36 @@ import {
|
||||
} from "react-relay";
|
||||
import { useOrganizationId } from "/hooks/useOrganizationId";
|
||||
import { useParams } from "react-router";
|
||||
import { CreateProcessingActivityRegistryDialog } from "./dialogs/CreateProcessingActivityRegistryDialog";
|
||||
import { deleteProcessingActivityRegistryMutation, ProcessingActivityRegistriesConnectionKey } from "../../../hooks/graph/ProcessingActivityRegistryGraph";
|
||||
import { CreateProcessingActivityDialog } from "./dialogs/CreateProcessingActivityDialog";
|
||||
import { deleteProcessingActivityMutation, ProcessingActivitiesConnectionKey } from "../../../hooks/graph/ProcessingActivityGraph";
|
||||
import { sprintf, promisifyMutation } from "@probo/helpers";
|
||||
import { SnapshotBanner } from "/components/SnapshotBanner";
|
||||
import type { NodeOf } from "/types";
|
||||
import type { ProcessingActivityRegistriesPageQuery } from "./__generated__/ProcessingActivityRegistriesPageQuery.graphql";
|
||||
import type { ProcessingActivitiesPageQuery } from "./__generated__/ProcessingActivitiesPageQuery.graphql";
|
||||
import type {
|
||||
ProcessingActivityRegistriesPageFragment$key,
|
||||
ProcessingActivityRegistriesPageFragment$data,
|
||||
} from "./__generated__/ProcessingActivityRegistriesPageFragment.graphql";
|
||||
ProcessingActivitiesPageFragment$key,
|
||||
ProcessingActivitiesPageFragment$data,
|
||||
} from "./__generated__/ProcessingActivitiesPageFragment.graphql";
|
||||
|
||||
interface ProcessingActivityRegistriesPageProps {
|
||||
queryRef: PreloadedQuery<ProcessingActivityRegistriesPageQuery>;
|
||||
interface ProcessingActivitiesPageProps {
|
||||
queryRef: PreloadedQuery<ProcessingActivitiesPageQuery>;
|
||||
}
|
||||
|
||||
const processingActivityRegistriesPageFragment = graphql`
|
||||
fragment ProcessingActivityRegistriesPageFragment on Organization
|
||||
@refetchable(queryName: "ProcessingActivityRegistriesPageRefetchQuery")
|
||||
const processingActivitiesPageFragment = graphql`
|
||||
fragment ProcessingActivitiesPageFragment on Organization
|
||||
@refetchable(queryName: "ProcessingActivitiesPageRefetchQuery")
|
||||
@argumentDefinitions(
|
||||
first: { type: "Int", defaultValue: 10 }
|
||||
after: { type: "CursorKey" }
|
||||
snapshotId: { type: "ID", defaultValue: null }
|
||||
) {
|
||||
id
|
||||
processingActivityRegistries(
|
||||
processingActivities(
|
||||
first: $first
|
||||
after: $after
|
||||
filter: { snapshotId: $snapshotId }
|
||||
)
|
||||
@connection(key: "ProcessingActivityRegistriesPage_processingActivityRegistries", filters: ["filter"]) {
|
||||
@connection(key: "ProcessingActivitiesPage_processingActivities", filters: ["filter"]) {
|
||||
__id
|
||||
totalCount
|
||||
edges {
|
||||
@@ -84,21 +84,21 @@ const processingActivityRegistriesPageFragment = graphql`
|
||||
}
|
||||
`;
|
||||
|
||||
export default function ProcessingActivityRegistriesPage({ queryRef }: ProcessingActivityRegistriesPageProps) {
|
||||
export default function ProcessingActivitiesPage({ queryRef }: ProcessingActivitiesPageProps) {
|
||||
const { __ } = useTranslate();
|
||||
const organizationId = useOrganizationId();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
|
||||
|
||||
usePageTitle(__("Processing Activity Registries"));
|
||||
usePageTitle(__("Processing Activities"));
|
||||
|
||||
const organization = usePreloadedQuery(
|
||||
graphql`
|
||||
query ProcessingActivityRegistriesPageQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
query ProcessingActivitiesPageQuery($organizationId: ID!, $snapshotId: ID) {
|
||||
node(id: $organizationId) {
|
||||
... on Organization {
|
||||
...ProcessingActivityRegistriesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
...ProcessingActivitiesPageFragment @arguments(snapshotId: $snapshotId)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,39 +112,39 @@ export default function ProcessingActivityRegistriesPage({ queryRef }: Processin
|
||||
hasNext,
|
||||
isLoadingNext,
|
||||
} = usePaginationFragment<
|
||||
ProcessingActivityRegistriesPageQuery,
|
||||
ProcessingActivityRegistriesPageFragment$key
|
||||
>(processingActivityRegistriesPageFragment, organization.node);
|
||||
ProcessingActivitiesPageQuery,
|
||||
ProcessingActivitiesPageFragment$key
|
||||
>(processingActivitiesPageFragment, organization.node);
|
||||
if (!data) {
|
||||
return <div>{__("Organization not found")}</div>;
|
||||
}
|
||||
|
||||
const connectionId = ConnectionHandler.getConnectionID(
|
||||
organizationId,
|
||||
ProcessingActivityRegistriesConnectionKey,
|
||||
ProcessingActivitiesConnectionKey,
|
||||
{ filter: { snapshotId: snapshotId || null } }
|
||||
);
|
||||
const registries = data?.processingActivityRegistries?.edges?.map((edge) => edge.node) ?? [];
|
||||
const activities = data?.processingActivities?.edges?.map((edge) => edge.node) ?? [];
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{isSnapshotMode && snapshotId && (
|
||||
<SnapshotBanner snapshotId={snapshotId} />
|
||||
)}
|
||||
<PageHeader title={__("Processing Activity Registries")} description={__("Manage your processing activity registry entries under GDPR")}>
|
||||
<PageHeader title={__("Processing Activities")} description={__("Manage your processing activities under GDPR")}>
|
||||
{!isSnapshotMode && (
|
||||
<CreateProcessingActivityRegistryDialog
|
||||
<CreateProcessingActivityDialog
|
||||
organizationId={organizationId}
|
||||
connectionId={connectionId}
|
||||
>
|
||||
<Button icon={IconPlusLarge}>
|
||||
{__("Add processing activity registry")}
|
||||
{__("Add processing activity")}
|
||||
</Button>
|
||||
</CreateProcessingActivityRegistryDialog>
|
||||
</CreateProcessingActivityDialog>
|
||||
)}
|
||||
</PageHeader>
|
||||
|
||||
{registries.length > 0 ? (
|
||||
{activities.length > 0 ? (
|
||||
<Card>
|
||||
<Table>
|
||||
<Thead>
|
||||
@@ -159,10 +159,10 @@ export default function ProcessingActivityRegistriesPage({ queryRef }: Processin
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
{registries.map((registry) => (
|
||||
<RegistryRow
|
||||
key={registry.id}
|
||||
registry={registry}
|
||||
{activities.map((activity) => (
|
||||
<ActivityRow
|
||||
key={activity.id}
|
||||
activity={activity}
|
||||
connectionId={connectionId}
|
||||
/>
|
||||
))}
|
||||
@@ -185,10 +185,10 @@ export default function ProcessingActivityRegistriesPage({ queryRef }: Processin
|
||||
<Card padded>
|
||||
<div className="text-center py-12">
|
||||
<h3 className="text-lg font-semibold mb-2">
|
||||
{__("No processing activity registry entries yet")}
|
||||
{__("No processing activities yet")}
|
||||
</h3>
|
||||
<p className="text-txt-tertiary mb-4">
|
||||
{__("Create your first processing activity registry entry to get started with GDPR compliance.")}
|
||||
{__("Create your first processing activity to get started with GDPR compliance.")}
|
||||
</p>
|
||||
</div>
|
||||
</Card>
|
||||
@@ -197,27 +197,27 @@ export default function ProcessingActivityRegistriesPage({ queryRef }: Processin
|
||||
);
|
||||
}
|
||||
|
||||
function RegistryRow({
|
||||
registry,
|
||||
function ActivityRow({
|
||||
activity,
|
||||
connectionId,
|
||||
}: {
|
||||
registry: NodeOf<NonNullable<ProcessingActivityRegistriesPageFragment$data['processingActivityRegistries']>>;
|
||||
activity: NodeOf<NonNullable<ProcessingActivitiesPageFragment$data['processingActivities']>>;
|
||||
connectionId: string;
|
||||
}) {
|
||||
const organizationId = useOrganizationId();
|
||||
const { __ } = useTranslate();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
const [deleteRegistry] = useMutation(deleteProcessingActivityRegistryMutation);
|
||||
const [deleteActivity] = useMutation(deleteProcessingActivityMutation);
|
||||
const confirm = useConfirm();
|
||||
|
||||
const handleDelete = () => {
|
||||
confirm(
|
||||
() =>
|
||||
promisifyMutation(deleteRegistry)({
|
||||
promisifyMutation(deleteActivity)({
|
||||
variables: {
|
||||
input: {
|
||||
processingActivityRegistryId: registry.id,
|
||||
processingActivityId: activity.id,
|
||||
},
|
||||
connections: [connectionId],
|
||||
},
|
||||
@@ -225,34 +225,34 @@ function RegistryRow({
|
||||
{
|
||||
message: sprintf(
|
||||
__(
|
||||
"This will permanently delete the processing activity registry entry %s. This action cannot be undone."
|
||||
"This will permanently delete the processing activity %s. This action cannot be undone."
|
||||
),
|
||||
registry.name
|
||||
activity.name
|
||||
),
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const registryUrl = isSnapshotMode && snapshotId
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/processing-activity-registries/${registry.id}`
|
||||
: `/organizations/${organizationId}/processing-activity-registries/${registry.id}`;
|
||||
const activityUrl = isSnapshotMode && snapshotId
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/processing-activities/${activity.id}`
|
||||
: `/organizations/${organizationId}/processing-activities/${activity.id}`;
|
||||
|
||||
return (
|
||||
<Tr to={registryUrl}>
|
||||
<Tr to={activityUrl}>
|
||||
<Td>
|
||||
<span className="font-semibold">{registry.name}</span>
|
||||
<span className="font-semibold">{activity.name}</span>
|
||||
</Td>
|
||||
<Td>
|
||||
<span className="text-sm text-txt-secondary">
|
||||
{registry.purpose || "-"}
|
||||
{activity.purpose || "-"}
|
||||
</span>
|
||||
</Td>
|
||||
<Td>{registry.dataSubjectCategory || "-"}</Td>
|
||||
<Td>{getLawfulBasisLabel(registry.lawfulBasis, __)}</Td>
|
||||
<Td>{registry.location || "-"}</Td>
|
||||
<Td>{activity.dataSubjectCategory || "-"}</Td>
|
||||
<Td>{getLawfulBasisLabel(activity.lawfulBasis, __)}</Td>
|
||||
<Td>{activity.location || "-"}</Td>
|
||||
<Td>
|
||||
<Badge variant={registry.internationalTransfers ? "warning" : "success"}>
|
||||
{registry.internationalTransfers ? __("Yes") : __("No")}
|
||||
<Badge variant={activity.internationalTransfers ? "warning" : "success"}>
|
||||
{activity.internationalTransfers ? __("Yes") : __("No")}
|
||||
</Badge>
|
||||
</Td>
|
||||
{!isSnapshotMode && (
|
||||
@@ -4,11 +4,11 @@ import {
|
||||
type PreloadedQuery,
|
||||
} from "react-relay";
|
||||
import {
|
||||
processingActivityRegistryNodeQuery,
|
||||
useDeleteProcessingActivityRegistry,
|
||||
useUpdateProcessingActivityRegistry,
|
||||
ProcessingActivityRegistriesConnectionKey,
|
||||
} from "../../../hooks/graph/ProcessingActivityRegistryGraph";
|
||||
processingActivityNodeQuery,
|
||||
useDeleteProcessingActivity,
|
||||
useUpdateProcessingActivity,
|
||||
ProcessingActivitiesConnectionKey,
|
||||
} from "../../../hooks/graph/ProcessingActivityGraph";
|
||||
import {
|
||||
ActionDropdown,
|
||||
Breadcrumb,
|
||||
@@ -36,11 +36,11 @@ import {
|
||||
TransferSafeguardsOptions,
|
||||
DataProtectionImpactAssessmentOptions,
|
||||
TransferImpactAssessmentOptions,
|
||||
} from "../../../components/form/ProcessingActivityRegistryEnumOptions";
|
||||
} from "../../../components/form/ProcessingActivityEnumOptions";
|
||||
|
||||
import type { ProcessingActivityRegistryGraphNodeQuery } from "/hooks/graph/__generated__/ProcessingActivityRegistryGraphNodeQuery.graphql";
|
||||
import type { ProcessingActivityGraphNodeQuery } from "/hooks/graph/__generated__/ProcessingActivityGraphNodeQuery.graphql";
|
||||
|
||||
const updateRegistrySchema = z.object({
|
||||
const updateProcessingActivitySchema = z.object({
|
||||
name: z.string().min(1, "Name is required"),
|
||||
purpose: z.string().optional(),
|
||||
dataSubjectCategory: z.string().optional(),
|
||||
@@ -59,61 +59,61 @@ const updateRegistrySchema = z.object({
|
||||
});
|
||||
|
||||
type Props = {
|
||||
queryRef: PreloadedQuery<ProcessingActivityRegistryGraphNodeQuery>;
|
||||
queryRef: PreloadedQuery<ProcessingActivityGraphNodeQuery>;
|
||||
};
|
||||
|
||||
export default function ProcessingActivityRegistryDetailsPage(props: Props) {
|
||||
const data = usePreloadedQuery<ProcessingActivityRegistryGraphNodeQuery>(processingActivityRegistryNodeQuery, props.queryRef);
|
||||
const registry = data.node;
|
||||
export default function ProcessingActivityDetailsPage(props: Props) {
|
||||
const data = usePreloadedQuery<ProcessingActivityGraphNodeQuery>(processingActivityNodeQuery, props.queryRef);
|
||||
const activity = data.node;
|
||||
const { __ } = useTranslate();
|
||||
const { toast } = useToast();
|
||||
const organizationId = useOrganizationId();
|
||||
const { snapshotId } = useParams<{ snapshotId?: string }>();
|
||||
const isSnapshotMode = Boolean(snapshotId);
|
||||
|
||||
if (!registry) {
|
||||
return <div>{__("Processing activity registry entry not found")}</div>;
|
||||
if (!activity) {
|
||||
return <div>{__("Processing activity not found")}</div>;
|
||||
}
|
||||
|
||||
validateSnapshotConsistency(registry, snapshotId);
|
||||
validateSnapshotConsistency(activity, snapshotId);
|
||||
|
||||
const updateRegistry = useUpdateProcessingActivityRegistry();
|
||||
const updateActivity = useUpdateProcessingActivity();
|
||||
|
||||
const connectionId = ConnectionHandler.getConnectionID(
|
||||
organizationId,
|
||||
ProcessingActivityRegistriesConnectionKey,
|
||||
ProcessingActivitiesConnectionKey,
|
||||
{ filter: { snapshotId: snapshotId || null } }
|
||||
);
|
||||
|
||||
const deleteRegistry = useDeleteProcessingActivityRegistry({ id: registry.id!, name: registry.name! }, connectionId);
|
||||
const deleteActivity = useDeleteProcessingActivity({ id: activity.id!, name: activity.name! }, connectionId);
|
||||
|
||||
const { register, handleSubmit, formState, control } = useFormWithSchema(
|
||||
updateRegistrySchema,
|
||||
updateProcessingActivitySchema,
|
||||
{
|
||||
defaultValues: {
|
||||
name: registry.name || "",
|
||||
purpose: registry.purpose || "",
|
||||
dataSubjectCategory: registry.dataSubjectCategory || "",
|
||||
personalDataCategory: registry.personalDataCategory || "",
|
||||
specialOrCriminalData: registry.specialOrCriminalData || "NO" as const,
|
||||
consentEvidenceLink: registry.consentEvidenceLink || "",
|
||||
lawfulBasis: registry.lawfulBasis || "LEGITIMATE_INTEREST" as const,
|
||||
recipients: registry.recipients || "",
|
||||
location: registry.location || "",
|
||||
internationalTransfers: registry.internationalTransfers || false,
|
||||
transferSafeguards: registry.transferSafeguards || "__NONE__",
|
||||
retentionPeriod: registry.retentionPeriod || "",
|
||||
securityMeasures: registry.securityMeasures || "",
|
||||
dataProtectionImpactAssessment: registry.dataProtectionImpactAssessment || "NOT_NEEDED" as const,
|
||||
transferImpactAssessment: registry.transferImpactAssessment || "NOT_NEEDED" as const,
|
||||
name: activity.name || "",
|
||||
purpose: activity.purpose || "",
|
||||
dataSubjectCategory: activity.dataSubjectCategory || "",
|
||||
personalDataCategory: activity.personalDataCategory || "",
|
||||
specialOrCriminalData: activity.specialOrCriminalData || "NO" as const,
|
||||
consentEvidenceLink: activity.consentEvidenceLink || "",
|
||||
lawfulBasis: activity.lawfulBasis || "LEGITIMATE_INTEREST" as const,
|
||||
recipients: activity.recipients || "",
|
||||
location: activity.location || "",
|
||||
internationalTransfers: activity.internationalTransfers || false,
|
||||
transferSafeguards: activity.transferSafeguards || "__NONE__",
|
||||
retentionPeriod: activity.retentionPeriod || "",
|
||||
securityMeasures: activity.securityMeasures || "",
|
||||
dataProtectionImpactAssessment: activity.dataProtectionImpactAssessment || "NOT_NEEDED" as const,
|
||||
transferImpactAssessment: activity.transferImpactAssessment || "NOT_NEEDED" as const,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const onSubmit = handleSubmit(async (formData) => {
|
||||
try {
|
||||
await updateRegistry({
|
||||
id: registry.id!,
|
||||
await updateActivity({
|
||||
id: activity.id!,
|
||||
name: formData.name,
|
||||
purpose: formData.purpose || undefined,
|
||||
dataSubjectCategory: formData.dataSubjectCategory || undefined,
|
||||
@@ -133,21 +133,21 @@ export default function ProcessingActivityRegistryDetailsPage(props: Props) {
|
||||
|
||||
toast({
|
||||
title: __("Success"),
|
||||
description: __("Processing activity registry entry updated successfully"),
|
||||
description: __("Processing activity updated successfully"),
|
||||
variant: "success",
|
||||
});
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: __("Failed to update processing activity registry entry"),
|
||||
description: __("Failed to update processing activity"),
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const breadcrumbRegistriesUrl = isSnapshotMode && snapshotId
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/processing-activity-registries`
|
||||
: `/organizations/${organizationId}/processing-activity-registries`;
|
||||
const breadcrumbProcessingActivitiesUrl = isSnapshotMode && snapshotId
|
||||
? `/organizations/${organizationId}/snapshots/${snapshotId}/processing-activities`
|
||||
: `/organizations/${organizationId}/processing-activities`;
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
@@ -157,13 +157,13 @@ export default function ProcessingActivityRegistryDetailsPage(props: Props) {
|
||||
<div className="flex items-center justify-between">
|
||||
<Breadcrumb
|
||||
items={[
|
||||
{ label: __("Processing Activity Registries"), to: breadcrumbRegistriesUrl },
|
||||
{ label: registry.name! },
|
||||
{ label: __("Processing Activities"), to: breadcrumbProcessingActivitiesUrl },
|
||||
{ label: activity.name! },
|
||||
]}
|
||||
/>
|
||||
{!isSnapshotMode && (
|
||||
<ActionDropdown>
|
||||
<DropdownItem onClick={deleteRegistry} variant="danger">
|
||||
<DropdownItem onClick={deleteActivity} variant="danger">
|
||||
{__("Delete")}
|
||||
</DropdownItem>
|
||||
</ActionDropdown>
|
||||
@@ -174,7 +174,7 @@ export default function ProcessingActivityRegistryDetailsPage(props: Props) {
|
||||
<div className="p-6">
|
||||
<div className="mb-6">
|
||||
<div className="flex items-center gap-4">
|
||||
<h1 className="text-2xl font-bold">{registry.name}</h1>
|
||||
<h1 className="text-2xl font-bold">{activity.name}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<138a897eea1aa78073db58d717fe2947>>
|
||||
* @generated SignedSource<<720ca14096de267a177e9f8e4b549036>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,11 +9,11 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type ProcessingActivityRegistryLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS";
|
||||
export type ProcessingActivityLawfulBasis = "CONSENT" | "CONTRACTUAL_NECESSITY" | "LEGAL_OBLIGATION" | "LEGITIMATE_INTEREST" | "PUBLIC_TASK" | "VITAL_INTERESTS";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ProcessingActivityRegistriesPageFragment$data = {
|
||||
export type ProcessingActivitiesPageFragment$data = {
|
||||
readonly id: string;
|
||||
readonly processingActivityRegistries: {
|
||||
readonly processingActivities: {
|
||||
readonly __id: string;
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
@@ -21,7 +21,7 @@ export type ProcessingActivityRegistriesPageFragment$data = {
|
||||
readonly dataSubjectCategory: string | null | undefined;
|
||||
readonly id: string;
|
||||
readonly internationalTransfers: boolean;
|
||||
readonly lawfulBasis: ProcessingActivityRegistryLawfulBasis;
|
||||
readonly lawfulBasis: ProcessingActivityLawfulBasis;
|
||||
readonly location: string | null | undefined;
|
||||
readonly name: string;
|
||||
readonly personalDataCategory: string | null | undefined;
|
||||
@@ -37,18 +37,18 @@ export type ProcessingActivityRegistriesPageFragment$data = {
|
||||
};
|
||||
readonly totalCount: number;
|
||||
};
|
||||
readonly " $fragmentType": "ProcessingActivityRegistriesPageFragment";
|
||||
readonly " $fragmentType": "ProcessingActivitiesPageFragment";
|
||||
};
|
||||
export type ProcessingActivityRegistriesPageFragment$key = {
|
||||
readonly " $data"?: ProcessingActivityRegistriesPageFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivityRegistriesPageFragment">;
|
||||
export type ProcessingActivitiesPageFragment$key = {
|
||||
readonly " $data"?: ProcessingActivitiesPageFragment$data;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivitiesPageFragment">;
|
||||
};
|
||||
|
||||
import ProcessingActivityRegistriesPageRefetchQuery_graphql from './ProcessingActivityRegistriesPageRefetchQuery.graphql';
|
||||
import ProcessingActivitiesPageRefetchQuery_graphql from './ProcessingActivitiesPageRefetchQuery.graphql';
|
||||
|
||||
const node: ReaderFragment = (function(){
|
||||
var v0 = [
|
||||
"processingActivityRegistries"
|
||||
"processingActivities"
|
||||
],
|
||||
v1 = {
|
||||
"alias": null,
|
||||
@@ -97,18 +97,18 @@ return {
|
||||
"fragmentPathInResult": [
|
||||
"node"
|
||||
],
|
||||
"operation": ProcessingActivityRegistriesPageRefetchQuery_graphql,
|
||||
"operation": ProcessingActivitiesPageRefetchQuery_graphql,
|
||||
"identifierInfo": {
|
||||
"identifierField": "id",
|
||||
"identifierQueryVariableName": "id"
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": "ProcessingActivityRegistriesPageFragment",
|
||||
"name": "ProcessingActivitiesPageFragment",
|
||||
"selections": [
|
||||
(v1/*: any*/),
|
||||
{
|
||||
"alias": "processingActivityRegistries",
|
||||
"alias": "processingActivities",
|
||||
"args": [
|
||||
{
|
||||
"fields": [
|
||||
@@ -122,9 +122,9 @@ return {
|
||||
"name": "filter"
|
||||
}
|
||||
],
|
||||
"concreteType": "ProcessingActivityRegistryConnection",
|
||||
"concreteType": "ProcessingActivityConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "__ProcessingActivityRegistriesPage_processingActivityRegistries_connection",
|
||||
"name": "__ProcessingActivitiesPage_processingActivities_connection",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -137,7 +137,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ProcessingActivityRegistryEdge",
|
||||
"concreteType": "ProcessingActivityEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -145,7 +145,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ProcessingActivityRegistry",
|
||||
"concreteType": "ProcessingActivity",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -294,6 +294,6 @@ return {
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "a31cad7de09ddd436e7fa9068d53e05e";
|
||||
(node as any).hash = "e60b3eb3cf3d172625c2873cb05039bd";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<c9fc3a1c4c1b2b41057496949cfea3bb>>
|
||||
* @generated SignedSource<<f85f96db81638fcf82015c2a936d6ed0>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,18 +10,18 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ProcessingActivityRegistryGraphListQuery$variables = {
|
||||
export type ProcessingActivitiesPageQuery$variables = {
|
||||
organizationId: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphListQuery$data = {
|
||||
export type ProcessingActivitiesPageQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivityRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivitiesPageFragment">;
|
||||
};
|
||||
};
|
||||
export type ProcessingActivityRegistryGraphListQuery = {
|
||||
response: ProcessingActivityRegistryGraphListQuery$data;
|
||||
variables: ProcessingActivityRegistryGraphListQuery$variables;
|
||||
export type ProcessingActivitiesPageQuery = {
|
||||
response: ProcessingActivitiesPageQuery$data;
|
||||
variables: ProcessingActivitiesPageQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -82,7 +82,7 @@ return {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ProcessingActivityRegistryGraphListQuery",
|
||||
"name": "ProcessingActivitiesPageQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -98,7 +98,7 @@ return {
|
||||
{
|
||||
"args": (v2/*: any*/),
|
||||
"kind": "FragmentSpread",
|
||||
"name": "ProcessingActivityRegistriesPageFragment"
|
||||
"name": "ProcessingActivitiesPageFragment"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -115,7 +115,7 @@ return {
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "ProcessingActivityRegistryGraphListQuery",
|
||||
"name": "ProcessingActivitiesPageQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -133,9 +133,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v5/*: any*/),
|
||||
"concreteType": "ProcessingActivityRegistryConnection",
|
||||
"concreteType": "ProcessingActivityConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "processingActivityRegistries",
|
||||
"name": "processingActivities",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -148,7 +148,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ProcessingActivityRegistryEdge",
|
||||
"concreteType": "ProcessingActivityEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -156,7 +156,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ProcessingActivityRegistry",
|
||||
"concreteType": "ProcessingActivity",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -300,9 +300,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "ProcessingActivityRegistriesPage_processingActivityRegistries",
|
||||
"key": "ProcessingActivitiesPage_processingActivities",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "processingActivityRegistries"
|
||||
"name": "processingActivities"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -314,16 +314,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "47f8a2cccc6749482bf09e1a1a57271d",
|
||||
"cacheID": "dfb1835056b3e318e7d1b8a9e351dcaf",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ProcessingActivityRegistryGraphListQuery",
|
||||
"name": "ProcessingActivitiesPageQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ProcessingActivityRegistryGraphListQuery(\n $organizationId: ID!\n $snapshotId: ID\n) {\n node(id: $organizationId) {\n __typename\n ... on Organization {\n ...ProcessingActivityRegistriesPageFragment_3iomuz\n }\n id\n }\n}\n\nfragment ProcessingActivityRegistriesPageFragment_3iomuz on Organization {\n id\n processingActivityRegistries(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 ProcessingActivitiesPageQuery(\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"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "5b5316031782bbd4db8109a18b307430";
|
||||
(node as any).hash = "68aa1223c7d37dec18879900c126bd42";
|
||||
|
||||
export default node;
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<fc4bc917b12579179eb09cc4919b1b57>>
|
||||
* @generated SignedSource<<38414e52b180db9b290d16231a2c69ef>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,20 +10,20 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type ProcessingActivityRegistriesPageRefetchQuery$variables = {
|
||||
export type ProcessingActivitiesPageRefetchQuery$variables = {
|
||||
after?: any | null | undefined;
|
||||
first?: number | null | undefined;
|
||||
id: string;
|
||||
snapshotId?: string | null | undefined;
|
||||
};
|
||||
export type ProcessingActivityRegistriesPageRefetchQuery$data = {
|
||||
export type ProcessingActivitiesPageRefetchQuery$data = {
|
||||
readonly node: {
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivityRegistriesPageFragment">;
|
||||
readonly " $fragmentSpreads": FragmentRefs<"ProcessingActivitiesPageFragment">;
|
||||
};
|
||||
};
|
||||
export type ProcessingActivityRegistriesPageRefetchQuery = {
|
||||
response: ProcessingActivityRegistriesPageRefetchQuery$data;
|
||||
variables: ProcessingActivityRegistriesPageRefetchQuery$variables;
|
||||
export type ProcessingActivitiesPageRefetchQuery = {
|
||||
response: ProcessingActivitiesPageRefetchQuery$data;
|
||||
variables: ProcessingActivitiesPageRefetchQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
@@ -104,7 +104,7 @@ return {
|
||||
],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "ProcessingActivityRegistriesPageRefetchQuery",
|
||||
"name": "ProcessingActivitiesPageRefetchQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -121,7 +121,7 @@ return {
|
||||
(v7/*: any*/)
|
||||
],
|
||||
"kind": "FragmentSpread",
|
||||
"name": "ProcessingActivityRegistriesPageFragment"
|
||||
"name": "ProcessingActivitiesPageFragment"
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
@@ -139,7 +139,7 @@ return {
|
||||
(v2/*: any*/)
|
||||
],
|
||||
"kind": "Operation",
|
||||
"name": "ProcessingActivityRegistriesPageRefetchQuery",
|
||||
"name": "ProcessingActivitiesPageRefetchQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
@@ -157,9 +157,9 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": (v10/*: any*/),
|
||||
"concreteType": "ProcessingActivityRegistryConnection",
|
||||
"concreteType": "ProcessingActivityConnection",
|
||||
"kind": "LinkedField",
|
||||
"name": "processingActivityRegistries",
|
||||
"name": "processingActivities",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
@@ -172,7 +172,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ProcessingActivityRegistryEdge",
|
||||
"concreteType": "ProcessingActivityEdge",
|
||||
"kind": "LinkedField",
|
||||
"name": "edges",
|
||||
"plural": true,
|
||||
@@ -180,7 +180,7 @@ return {
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "ProcessingActivityRegistry",
|
||||
"concreteType": "ProcessingActivity",
|
||||
"kind": "LinkedField",
|
||||
"name": "node",
|
||||
"plural": false,
|
||||
@@ -324,9 +324,9 @@ return {
|
||||
"filter"
|
||||
],
|
||||
"handle": "connection",
|
||||
"key": "ProcessingActivityRegistriesPage_processingActivityRegistries",
|
||||
"key": "ProcessingActivitiesPage_processingActivities",
|
||||
"kind": "LinkedHandle",
|
||||
"name": "processingActivityRegistries"
|
||||
"name": "processingActivities"
|
||||
}
|
||||
],
|
||||
"type": "Organization",
|
||||
@@ -338,16 +338,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "f6f29dda67221647df6a500c124091a2",
|
||||
"cacheID": "bf2fb9a8eb709e64268710ca36f86a72",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "ProcessingActivityRegistriesPageRefetchQuery",
|
||||
"name": "ProcessingActivitiesPageRefetchQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query ProcessingActivityRegistriesPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ProcessingActivityRegistriesPageFragment_35e0S5\n id\n }\n}\n\nfragment ProcessingActivityRegistriesPageFragment_35e0S5 on Organization {\n id\n processingActivityRegistries(first: $first, after: $after, 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 ProcessingActivitiesPageRefetchQuery(\n $after: CursorKey\n $first: Int = 10\n $snapshotId: ID = null\n $id: ID!\n) {\n node(id: $id) {\n __typename\n ...ProcessingActivitiesPageFragment_35e0S5\n id\n }\n}\n\nfragment ProcessingActivitiesPageFragment_35e0S5 on Organization {\n id\n processingActivities(first: $first, after: $after, 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"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "a31cad7de09ddd436e7fa9068d53e05e";
|
||||
(node as any).hash = "e60b3eb3cf3d172625c2873cb05039bd";
|
||||
|
||||
export default node;
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
import { useTranslate } from "@probo/i18n";
|
||||
import { z } from "zod";
|
||||
import { useFormWithSchema } from "/hooks/useFormWithSchema";
|
||||
import { useCreateProcessingActivityRegistry } from "../../../../hooks/graph/ProcessingActivityRegistryGraph";
|
||||
import { useCreateProcessingActivity } from "../../../../hooks/graph/ProcessingActivityGraph";
|
||||
import { Controller } from "react-hook-form";
|
||||
import {
|
||||
SpecialOrCriminalDataOptions,
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
TransferSafeguardsOptions,
|
||||
DataProtectionImpactAssessmentOptions,
|
||||
TransferImpactAssessmentOptions,
|
||||
} from "../../../../components/form/ProcessingActivityRegistryEnumOptions";
|
||||
} from "../../../../components/form/ProcessingActivityEnumOptions";
|
||||
|
||||
const schema = z.object({
|
||||
name: z.string().min(1, "Name is required"),
|
||||
@@ -46,22 +46,22 @@ const schema = z.object({
|
||||
|
||||
type FormData = z.infer<typeof schema>;
|
||||
|
||||
interface CreateProcessingActivityRegistryDialogProps {
|
||||
interface CreateProcessingActivityDialogProps {
|
||||
children: ReactNode;
|
||||
organizationId: string;
|
||||
connectionId?: string;
|
||||
}
|
||||
|
||||
export function CreateProcessingActivityRegistryDialog({
|
||||
export function CreateProcessingActivityDialog({
|
||||
children,
|
||||
organizationId,
|
||||
connectionId,
|
||||
}: CreateProcessingActivityRegistryDialogProps) {
|
||||
}: CreateProcessingActivityDialogProps) {
|
||||
const { __ } = useTranslate();
|
||||
const { toast } = useToast();
|
||||
const dialogRef = useDialogRef();
|
||||
|
||||
const createRegistry = useCreateProcessingActivityRegistry(connectionId);
|
||||
const createProcessingActivity = useCreateProcessingActivity(connectionId);
|
||||
|
||||
const { register, handleSubmit, formState, reset, control } = useFormWithSchema(schema, {
|
||||
defaultValues: {
|
||||
@@ -85,7 +85,7 @@ export function CreateProcessingActivityRegistryDialog({
|
||||
|
||||
const onSubmit = handleSubmit(async (formData: FormData) => {
|
||||
try {
|
||||
await createRegistry({
|
||||
await createProcessingActivity({
|
||||
organizationId,
|
||||
name: formData.name,
|
||||
purpose: formData.purpose || undefined,
|
||||
@@ -106,7 +106,7 @@ export function CreateProcessingActivityRegistryDialog({
|
||||
|
||||
toast({
|
||||
title: __("Success"),
|
||||
description: __("Processing activity registry entry created successfully"),
|
||||
description: __("Processing activity created successfully"),
|
||||
variant: "success",
|
||||
});
|
||||
|
||||
@@ -115,7 +115,7 @@ export function CreateProcessingActivityRegistryDialog({
|
||||
} catch (error) {
|
||||
toast({
|
||||
title: __("Error"),
|
||||
description: __("Failed to create processing activity registry entry"),
|
||||
description: __("Failed to create processing activity"),
|
||||
variant: "error",
|
||||
});
|
||||
}
|
||||
@@ -125,7 +125,7 @@ export function CreateProcessingActivityRegistryDialog({
|
||||
<Dialog
|
||||
ref={dialogRef}
|
||||
trigger={children}
|
||||
title={<Breadcrumb items={[__("Registries"), __("Create Processing Activity Entry")]} />}
|
||||
title={<Breadcrumb items={[__("Processing Activities"), __("Create Processing Activity")]} />}
|
||||
className="max-w-4xl"
|
||||
>
|
||||
<form onSubmit={onSubmit}>
|
||||
@@ -338,7 +338,7 @@ export function CreateProcessingActivityRegistryDialog({
|
||||
variant="primary"
|
||||
disabled={formState.isSubmitting}
|
||||
>
|
||||
{formState.isSubmitting ? __("Creating...") : __("Create Entry")}
|
||||
{formState.isSubmitting ? __("Creating...") : __("Create Processing Activity")}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<dc710d55da977c21a12e3e21f29fbe94>>
|
||||
* @generated SignedSource<<79d48ab0fd5b269022244b0777eac279>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,7 +9,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ReaderFragment } from 'relay-runtime';
|
||||
export type SnapshotsType = "ASSETS" | "COMPLIANCE_REGISTRIES" | "CONTINUAL_IMPROVEMENT_REGISTRIES" | "DATA" | "NONCONFORMITY_REGISTRIES" | "PROCESSING_ACTIVITY_REGISTRIES" | "RISKS" | "VENDORS";
|
||||
export type SnapshotsType = "ASSETS" | "CONTINUAL_IMPROVEMENTS" | "DATA" | "NONCONFORMITIES" | "OBLIGATIONS" | "PROCESSING_ACTIVITIES" | "RISKS" | "VENDORS";
|
||||
import { FragmentRefs } from "relay-runtime";
|
||||
export type SnapshotsPageFragment$data = {
|
||||
readonly snapshots: {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<50dda5d856ca750f1e85a8c1d2935c9c>>
|
||||
* @generated SignedSource<<4a28eec1f25c5d290bc070a534042521>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -9,7 +9,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type SnapshotsType = "ASSETS" | "COMPLIANCE_REGISTRIES" | "CONTINUAL_IMPROVEMENT_REGISTRIES" | "DATA" | "NONCONFORMITY_REGISTRIES" | "PROCESSING_ACTIVITY_REGISTRIES" | "RISKS" | "VENDORS";
|
||||
export type SnapshotsType = "ASSETS" | "CONTINUAL_IMPROVEMENTS" | "DATA" | "NONCONFORMITIES" | "OBLIGATIONS" | "PROCESSING_ACTIVITIES" | "RISKS" | "VENDORS";
|
||||
export type CreateSnapshotInput = {
|
||||
description?: string | null | undefined;
|
||||
name: string;
|
||||
|
||||
@@ -29,11 +29,11 @@ import { dataRoutes } from "./routes/dataRoutes.ts";
|
||||
import { assetRoutes } from "./routes/assetRoutes.ts";
|
||||
import { auditRoutes } from "./routes/auditRoutes.ts";
|
||||
import { trustCenterRoutes } from "./routes/trustCenterRoutes.ts";
|
||||
import { nonconformityRegistryRoutes } from "./routes/nonconformityRegistryRoutes.ts";
|
||||
import { complianceRegistryRoutes } from "./routes/complianceRegistryRoutes.ts";
|
||||
import { nonconformityRoutes } from "./routes/nonconformityRoutes.ts";
|
||||
import { obligationRoutes } from "./routes/obligationRoutes.ts";
|
||||
import { snapshotsRoutes } from "./routes/snapshotsRoutes.ts";
|
||||
import { continualImprovementRegistryRoutes } from "./routes/continualImprovementRegistryRoutes.ts";
|
||||
import { processingActivityRegistryRoutes } from "./routes/processingActivityRegistryRoutes.ts";
|
||||
import { continualImprovementRoutes } from "./routes/continualImprovementRoutes.ts";
|
||||
import { processingActivityRoutes } from "./routes/processingActivityRoutes.ts";
|
||||
import { lazy } from "@probo/react-lazy";
|
||||
|
||||
export type AppRoute = Omit<RouteObject, "Component" | "children"> & {
|
||||
@@ -154,10 +154,10 @@ const routes = [
|
||||
...assetRoutes,
|
||||
...dataRoutes,
|
||||
...auditRoutes,
|
||||
...nonconformityRegistryRoutes,
|
||||
...complianceRegistryRoutes,
|
||||
...continualImprovementRegistryRoutes,
|
||||
...processingActivityRegistryRoutes,
|
||||
...nonconformityRoutes,
|
||||
...obligationRoutes,
|
||||
...continualImprovementRoutes,
|
||||
...processingActivityRoutes,
|
||||
...snapshotsRoutes,
|
||||
...trustCenterRoutes,
|
||||
{
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
import { loadQuery } from "react-relay";
|
||||
import { relayEnvironment } from "/providers/RelayProviders";
|
||||
import { PageSkeleton } from "/components/skeletons/PageSkeleton";
|
||||
import { lazy } from "@probo/react-lazy";
|
||||
import { complianceRegistriesQuery, complianceRegistryNodeQuery } from "/hooks/graph/ComplianceRegistryGraph";
|
||||
import type { AppRoute } from "/routes";
|
||||
|
||||
export const complianceRegistryRoutes = [
|
||||
{
|
||||
path: "compliance-registries",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, complianceRegistriesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: null
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/complianceRegistries/ComplianceRegistriesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/compliance-registries",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, complianceRegistriesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: params.snapshotId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/complianceRegistries/ComplianceRegistriesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "compliance-registries/:registryId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, complianceRegistryNodeQuery, {
|
||||
complianceRegistryId: params.registryId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/complianceRegistries/ComplianceRegistryDetailsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/compliance-registries/:registryId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, complianceRegistryNodeQuery, {
|
||||
complianceRegistryId: params.registryId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/complianceRegistries/ComplianceRegistryDetailsPage")
|
||||
),
|
||||
},
|
||||
] satisfies AppRoute[];
|
||||
@@ -1,55 +0,0 @@
|
||||
import { loadQuery } from "react-relay";
|
||||
import { relayEnvironment } from "/providers/RelayProviders";
|
||||
import { PageSkeleton } from "/components/skeletons/PageSkeleton";
|
||||
import { lazy } from "@probo/react-lazy";
|
||||
import { continualImprovementRegistriesQuery, continualImprovementRegistryNodeQuery } from "/hooks/graph/ContinualImprovementRegistryGraph";
|
||||
import type { AppRoute } from "/routes";
|
||||
|
||||
export const continualImprovementRegistryRoutes = [
|
||||
{
|
||||
path: "continual-improvement-registries",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, continualImprovementRegistriesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: null
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/continualImprovementRegistries/ContinualImprovementRegistriesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/continual-improvement-registries",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, continualImprovementRegistriesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: params.snapshotId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/continualImprovementRegistries/ContinualImprovementRegistriesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "continual-improvement-registries/:registryId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, continualImprovementRegistryNodeQuery, {
|
||||
continualImprovementRegistryId: params.registryId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/continualImprovementRegistries/ContinualImprovementRegistryDetailsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/continual-improvement-registries/:registryId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, continualImprovementRegistryNodeQuery, {
|
||||
continualImprovementRegistryId: params.registryId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/continualImprovementRegistries/ContinualImprovementRegistryDetailsPage")
|
||||
),
|
||||
},
|
||||
] satisfies AppRoute[];
|
||||
55
apps/console/src/routes/continualImprovementRoutes.ts
Normal file
55
apps/console/src/routes/continualImprovementRoutes.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { loadQuery } from "react-relay";
|
||||
import { relayEnvironment } from "/providers/RelayProviders";
|
||||
import { PageSkeleton } from "/components/skeletons/PageSkeleton";
|
||||
import { lazy } from "@probo/react-lazy";
|
||||
import { continualImprovementsQuery, continualImprovementNodeQuery } from "/hooks/graph/ContinualImprovementGraph";
|
||||
import type { AppRoute } from "/routes";
|
||||
|
||||
export const continualImprovementRoutes = [
|
||||
{
|
||||
path: "continual-improvements",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, continualImprovementsQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: null
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/continualImprovements/ContinualImprovementsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/continual-improvements",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, continualImprovementsQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: params.snapshotId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/continualImprovements/ContinualImprovementsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "continual-improvements/:improvementId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, continualImprovementNodeQuery, {
|
||||
continualImprovementId: params.improvementId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/continualImprovements/ContinualImprovementDetailsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/continual-improvements/:improvementId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, continualImprovementNodeQuery, {
|
||||
continualImprovementId: params.improvementId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/continualImprovements/ContinualImprovementDetailsPage")
|
||||
),
|
||||
},
|
||||
] satisfies AppRoute[];
|
||||
@@ -1,55 +0,0 @@
|
||||
import { loadQuery } from "react-relay";
|
||||
import { relayEnvironment } from "/providers/RelayProviders";
|
||||
import { PageSkeleton } from "/components/skeletons/PageSkeleton";
|
||||
import { lazy } from "@probo/react-lazy";
|
||||
import { nonconformityRegistriesQuery, nonconformityRegistryNodeQuery } from "/hooks/graph/NonconformityRegistryGraph";
|
||||
import type { AppRoute } from "/routes";
|
||||
|
||||
export const nonconformityRegistryRoutes= [
|
||||
{
|
||||
path: "nonconformity-registries",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, nonconformityRegistriesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: null
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/nonconformityRegistries/NonconformityRegistriesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/nonconformity-registries",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, nonconformityRegistriesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: params.snapshotId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/nonconformityRegistries/NonconformityRegistriesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "nonconformity-registries/:registryId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, nonconformityRegistryNodeQuery, {
|
||||
nonconformityRegistryId: params.registryId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/nonconformityRegistries/NonconformityRegistryDetailsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/nonconformity-registries/:registryId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, nonconformityRegistryNodeQuery, {
|
||||
nonconformityRegistryId: params.registryId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/nonconformityRegistries/NonconformityRegistryDetailsPage")
|
||||
),
|
||||
},
|
||||
] satisfies AppRoute[];
|
||||
55
apps/console/src/routes/nonconformityRoutes.ts
Normal file
55
apps/console/src/routes/nonconformityRoutes.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { loadQuery } from "react-relay";
|
||||
import { relayEnvironment } from "/providers/RelayProviders";
|
||||
import { PageSkeleton } from "/components/skeletons/PageSkeleton";
|
||||
import { lazy } from "@probo/react-lazy";
|
||||
import { nonconformitiesQuery, nonconformityNodeQuery } from "../hooks/graph/NonconformityGraph";
|
||||
import type { AppRoute } from "/routes";
|
||||
|
||||
export const nonconformityRoutes= [
|
||||
{
|
||||
path: "nonconformities",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, nonconformitiesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: null
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("../pages/organizations/nonconformities/NonconformitiesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/nonconformities",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, nonconformitiesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: params.snapshotId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("../pages/organizations/nonconformities/NonconformitiesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "nonconformities/:nonconformityId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, nonconformityNodeQuery, {
|
||||
nonconformityId: params.nonconformityId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("../pages/organizations/nonconformities/NonconformityDetailsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/nonconformities/:nonconformityId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, nonconformityNodeQuery, {
|
||||
nonconformityId: params.nonconformityId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("../pages/organizations/nonconformities/NonconformityDetailsPage")
|
||||
),
|
||||
},
|
||||
] satisfies AppRoute[];
|
||||
55
apps/console/src/routes/obligationRoutes.ts
Normal file
55
apps/console/src/routes/obligationRoutes.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { loadQuery } from "react-relay";
|
||||
import { relayEnvironment } from "/providers/RelayProviders";
|
||||
import { PageSkeleton } from "/components/skeletons/PageSkeleton";
|
||||
import { lazy } from "@probo/react-lazy";
|
||||
import { obligationsQuery, obligationNodeQuery } from "/hooks/graph/ObligationGraph";
|
||||
import type { AppRoute } from "/routes";
|
||||
|
||||
export const obligationRoutes = [
|
||||
{
|
||||
path: "obligations",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, obligationsQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: null
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/obligations/ObligationsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/obligations",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, obligationsQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: params.snapshotId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/obligations/ObligationsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "obligations/:obligationId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, obligationNodeQuery, {
|
||||
obligationId: params.obligationId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/obligations/ObligationDetailsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/obligations/:obligationId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, obligationNodeQuery, {
|
||||
obligationId: params.obligationId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/obligations/ObligationDetailsPage")
|
||||
),
|
||||
},
|
||||
] satisfies AppRoute[];
|
||||
@@ -1,55 +0,0 @@
|
||||
import { loadQuery } from "react-relay";
|
||||
import { relayEnvironment } from "/providers/RelayProviders";
|
||||
import { PageSkeleton } from "/components/skeletons/PageSkeleton";
|
||||
import { lazy } from "@probo/react-lazy";
|
||||
import { processingActivityRegistriesQuery, processingActivityRegistryNodeQuery } from "/hooks/graph/ProcessingActivityRegistryGraph";
|
||||
import type { AppRoute } from "/routes";
|
||||
|
||||
export const processingActivityRegistryRoutes = [
|
||||
{
|
||||
path: "processing-activity-registries",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, processingActivityRegistriesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: null
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/processingActivityRegistries/ProcessingActivityRegistriesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/processing-activity-registries",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, processingActivityRegistriesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: params.snapshotId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/processingActivityRegistries/ProcessingActivityRegistriesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "processing-activity-registries/:registryId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, processingActivityRegistryNodeQuery, {
|
||||
processingActivityRegistryId: params.registryId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/processingActivityRegistries/ProcessingActivityRegistryDetailsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/processing-activity-registries/:registryId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, processingActivityRegistryNodeQuery, {
|
||||
processingActivityRegistryId: params.registryId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/processingActivityRegistries/ProcessingActivityRegistryDetailsPage")
|
||||
),
|
||||
},
|
||||
] satisfies AppRoute[];
|
||||
55
apps/console/src/routes/processingActivityRoutes.ts
Normal file
55
apps/console/src/routes/processingActivityRoutes.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { loadQuery } from "react-relay";
|
||||
import { relayEnvironment } from "/providers/RelayProviders";
|
||||
import { PageSkeleton } from "/components/skeletons/PageSkeleton";
|
||||
import { lazy } from "@probo/react-lazy";
|
||||
import { processingActivitiesQuery, processingActivityNodeQuery } from "/hooks/graph/ProcessingActivityGraph";
|
||||
import type { AppRoute } from "/routes";
|
||||
|
||||
export const processingActivityRoutes = [
|
||||
{
|
||||
path: "processing-activities",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, processingActivitiesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: null
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/processingActivities/ProcessingActivitiesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/processing-activities",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, processingActivitiesQuery, {
|
||||
organizationId: params.organizationId,
|
||||
snapshotId: params.snapshotId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/processingActivities/ProcessingActivitiesPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "processing-activities/:activityId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, processingActivityNodeQuery, {
|
||||
processingActivityId: params.activityId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/processingActivities/ProcessingActivityDetailsPage")
|
||||
),
|
||||
},
|
||||
{
|
||||
path: "snapshots/:snapshotId/processing-activities/:activityId",
|
||||
fallback: PageSkeleton,
|
||||
queryLoader: (params: Record<string, string>) =>
|
||||
loadQuery(relayEnvironment, processingActivityNodeQuery, {
|
||||
processingActivityId: params.activityId
|
||||
}),
|
||||
Component: lazy(
|
||||
() => import("/pages/organizations/processingActivities/ProcessingActivityDetailsPage")
|
||||
),
|
||||
},
|
||||
] satisfies AppRoute[];
|
||||
@@ -17,7 +17,7 @@ export { getDocumentTypeLabel, documentTypes } from "./documents";
|
||||
export { getAssetTypeVariant, getCriticityVariant } from "./assets";
|
||||
export { getSnapshotTypeLabel, getSnapshotTypeUrlPath, snapshotTypes, validateSnapshotConsistency } from "./snapshots";
|
||||
export { getAuditStateLabel, getAuditStateVariant, auditStates } from "./audits";
|
||||
export { getStatusVariant, getStatusLabel, getNonconformityRegistryStatusOptions, getComplianceRegistryStatusOptions, registryStatuses } from "./registryStatus";
|
||||
export { getStatusVariant, getStatusLabel, getStatusOptions } from "./registryStatus";
|
||||
export { promisifyMutation } from "./relay";
|
||||
export { fileType, fileSize } from "./file";
|
||||
export { formatDatetime } from "./date";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
type Translator = (s: string) => string;
|
||||
|
||||
export type NonconformityRegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type ComplianceRegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
export type RegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
|
||||
|
||||
export const registryStatuses = [
|
||||
"OPEN",
|
||||
@@ -9,7 +8,7 @@ export const registryStatuses = [
|
||||
"CLOSED",
|
||||
] as const;
|
||||
|
||||
export const getStatusVariant = (status: NonconformityRegistryStatus | ComplianceRegistryStatus) => {
|
||||
export const getStatusVariant = (status: RegistryStatus) => {
|
||||
switch (status) {
|
||||
case "OPEN":
|
||||
return "danger" as const;
|
||||
@@ -22,7 +21,7 @@ export const getStatusVariant = (status: NonconformityRegistryStatus | Complianc
|
||||
}
|
||||
};
|
||||
|
||||
export const getStatusLabel = (status: NonconformityRegistryStatus | ComplianceRegistryStatus) => {
|
||||
export const getStatusLabel = (status: RegistryStatus) => {
|
||||
switch (status) {
|
||||
case "OPEN":
|
||||
return "Open";
|
||||
@@ -35,18 +34,7 @@ export const getStatusLabel = (status: NonconformityRegistryStatus | ComplianceR
|
||||
}
|
||||
};
|
||||
|
||||
export function getNonconformityRegistryStatusOptions(__: Translator) {
|
||||
return registryStatuses.map((status) => ({
|
||||
value: status,
|
||||
label: __({
|
||||
"OPEN": "Open",
|
||||
"IN_PROGRESS": "In Progress",
|
||||
"CLOSED": "Closed",
|
||||
}[status]),
|
||||
}));
|
||||
}
|
||||
|
||||
export function getComplianceRegistryStatusOptions(__: Translator) {
|
||||
export function getStatusOptions(__: Translator) {
|
||||
return registryStatuses.map((status) => ({
|
||||
value: status,
|
||||
label: __({
|
||||
|
||||
@@ -5,10 +5,10 @@ export const snapshotTypes = [
|
||||
"VENDORS",
|
||||
"ASSETS",
|
||||
"DATA",
|
||||
"NONCONFORMITY_REGISTRIES",
|
||||
"COMPLIANCE_REGISTRIES",
|
||||
"CONTINUAL_IMPROVEMENT_REGISTRIES",
|
||||
"PROCESSING_ACTIVITY_REGISTRIES",
|
||||
"NONCONFORMITIES",
|
||||
"OBLIGATIONS",
|
||||
"CONTINUAL_IMPROVEMENTS",
|
||||
"PROCESSING_ACTIVITIES",
|
||||
] as const;
|
||||
|
||||
export function getSnapshotTypeLabel(__: Translator, type: string | null | undefined) {
|
||||
@@ -25,14 +25,14 @@ export function getSnapshotTypeLabel(__: Translator, type: string | null | undef
|
||||
return __("Assets");
|
||||
case "DATA":
|
||||
return __("Data");
|
||||
case "NONCONFORMITY_REGISTRIES":
|
||||
return __("Nonconformity Registries");
|
||||
case "COMPLIANCE_REGISTRIES":
|
||||
return __("Compliance Registries");
|
||||
case "CONTINUAL_IMPROVEMENT_REGISTRIES":
|
||||
return __("Continual Improvement Registries");
|
||||
case "PROCESSING_ACTIVITY_REGISTRIES":
|
||||
return __("Processing Activity Registries");
|
||||
case "NONCONFORMITIES":
|
||||
return __("Nonconformities");
|
||||
case "OBLIGATIONS":
|
||||
return __("Obligations");
|
||||
case "CONTINUAL_IMPROVEMENTS":
|
||||
return __("Continual Improvements");
|
||||
case "PROCESSING_ACTIVITIES":
|
||||
return __("Processing Activities");
|
||||
default:
|
||||
return __("Unknown");
|
||||
}
|
||||
@@ -48,14 +48,14 @@ export function getSnapshotTypeUrlPath(type?: string): string {
|
||||
return "/assets";
|
||||
case "DATA":
|
||||
return "/data";
|
||||
case "NONCONFORMITY_REGISTRIES":
|
||||
return "/nonconformity-registries";
|
||||
case "COMPLIANCE_REGISTRIES":
|
||||
return "/compliance-registries";
|
||||
case "CONTINUAL_IMPROVEMENT_REGISTRIES":
|
||||
return "/continual-improvement-registries";
|
||||
case "PROCESSING_ACTIVITY_REGISTRIES":
|
||||
return "/processing-activity-registries";
|
||||
case "NONCONFORMITIES":
|
||||
return "/nonconformities";
|
||||
case "OBLIGATIONS":
|
||||
return "/obligations";
|
||||
case "CONTINUAL_IMPROVEMENTS":
|
||||
return "/continual-improvements";
|
||||
case "PROCESSING_ACTIVITIES":
|
||||
return "/processing-activities";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export function Sidebar({ children }: PropsWithChildren) {
|
||||
<aside
|
||||
className={clsx(
|
||||
"border-r border-border-solid relative pt-16 flex-none",
|
||||
open ? "px-4 w-[330px]" : "px-2",
|
||||
open ? "px-4 w-[260px]" : "px-2",
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
|
||||
@@ -1,421 +0,0 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"maps"
|
||||
"time"
|
||||
|
||||
"github.com/getprobo/probo/pkg/gid"
|
||||
"github.com/getprobo/probo/pkg/page"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"go.gearno.de/kit/pg"
|
||||
)
|
||||
|
||||
type (
|
||||
ComplianceRegistry struct {
|
||||
ID gid.GID `db:"id"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
ReferenceID string `db:"reference_id"`
|
||||
Area *string `db:"area"`
|
||||
Source *string `db:"source"`
|
||||
Requirement *string `db:"requirement"`
|
||||
ActionsToBeImplemented *string `db:"actions_to_be_implemented"`
|
||||
Regulator *string `db:"regulator"`
|
||||
OwnerID gid.GID `db:"owner_id"`
|
||||
LastReviewDate *time.Time `db:"last_review_date"`
|
||||
DueDate *time.Time `db:"due_date"`
|
||||
Status ComplianceRegistryStatus `db:"status"`
|
||||
SnapshotID *gid.GID `db:"snapshot_id"`
|
||||
SourceID *gid.GID `db:"source_id"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
ComplianceRegistries []*ComplianceRegistry
|
||||
)
|
||||
|
||||
func (cr *ComplianceRegistry) CursorKey(field ComplianceRegistryOrderField) page.CursorKey {
|
||||
switch field {
|
||||
case ComplianceRegistryOrderFieldCreatedAt:
|
||||
return page.NewCursorKey(cr.ID, cr.CreatedAt)
|
||||
case ComplianceRegistryOrderFieldLastReviewDate:
|
||||
return page.NewCursorKey(cr.ID, cr.LastReviewDate)
|
||||
case ComplianceRegistryOrderFieldDueDate:
|
||||
return page.NewCursorKey(cr.ID, cr.DueDate)
|
||||
case ComplianceRegistryOrderFieldStatus:
|
||||
return page.NewCursorKey(cr.ID, cr.Status)
|
||||
case ComplianceRegistryOrderFieldReferenceId:
|
||||
return page.NewCursorKey(cr.ID, cr.ReferenceID)
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf("unsupported order by: %s", field))
|
||||
}
|
||||
|
||||
func (cr *ComplianceRegistry) LoadByID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
complianceRegistryID gid.GID,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
reference_id,
|
||||
area,
|
||||
source,
|
||||
requirement,
|
||||
actions_to_be_implemented,
|
||||
regulator,
|
||||
owner_id,
|
||||
last_review_date,
|
||||
due_date,
|
||||
status,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
compliance_registries
|
||||
WHERE
|
||||
%s
|
||||
AND id = @compliance_registry_id
|
||||
LIMIT 1;
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"compliance_registry_id": complianceRegistryID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query compliance registry: %w", err)
|
||||
}
|
||||
|
||||
registry, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ComplianceRegistry])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect compliance registry: %w", err)
|
||||
}
|
||||
|
||||
*cr = registry
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (crs *ComplianceRegistries) CountByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
filter *ComplianceRegistryFilter,
|
||||
) (int, error) {
|
||||
q := `
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM
|
||||
compliance_registries
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
|
||||
row := conn.QueryRow(ctx, q, args)
|
||||
|
||||
var count int
|
||||
err := row.Scan(&count)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("cannot count compliance registries: %w", err)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (crs *ComplianceRegistries) LoadByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
cursor *page.Cursor[ComplianceRegistryOrderField],
|
||||
filter *ComplianceRegistryFilter,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
area,
|
||||
source,
|
||||
requirement,
|
||||
actions_to_be_implemented,
|
||||
regulator,
|
||||
owner_id,
|
||||
last_review_date,
|
||||
due_date,
|
||||
status,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
compliance_registries
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment(), cursor.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
maps.Copy(args, cursor.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query compliance registries: %w", err)
|
||||
}
|
||||
|
||||
registries, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ComplianceRegistry])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect compliance registries: %w", err)
|
||||
}
|
||||
|
||||
*crs = registries
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cr *ComplianceRegistry) Insert(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
INSERT INTO compliance_registries (
|
||||
id,
|
||||
tenant_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
area,
|
||||
source,
|
||||
requirement,
|
||||
actions_to_be_implemented,
|
||||
regulator,
|
||||
owner_id,
|
||||
last_review_date,
|
||||
due_date,
|
||||
status,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
created_at,
|
||||
updated_at
|
||||
) VALUES (
|
||||
@id,
|
||||
@tenant_id,
|
||||
@organization_id,
|
||||
@reference_id,
|
||||
@area,
|
||||
@source,
|
||||
@requirement,
|
||||
@actions_to_be_implemented,
|
||||
@regulator,
|
||||
@owner_id,
|
||||
@last_review_date,
|
||||
@due_date,
|
||||
@status,
|
||||
@snapshot_id,
|
||||
@source_id,
|
||||
@created_at,
|
||||
@updated_at
|
||||
)
|
||||
`
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": cr.ID,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"organization_id": cr.OrganizationID,
|
||||
"reference_id": cr.ReferenceID,
|
||||
"area": cr.Area,
|
||||
"source": cr.Source,
|
||||
"requirement": cr.Requirement,
|
||||
"actions_to_be_implemented": cr.ActionsToBeImplemented,
|
||||
"regulator": cr.Regulator,
|
||||
"owner_id": cr.OwnerID,
|
||||
"last_review_date": cr.LastReviewDate,
|
||||
"due_date": cr.DueDate,
|
||||
"status": cr.Status,
|
||||
"snapshot_id": cr.SnapshotID,
|
||||
"source_id": cr.SourceID,
|
||||
"created_at": cr.CreatedAt,
|
||||
"updated_at": cr.UpdatedAt,
|
||||
}
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert compliance registry: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cr *ComplianceRegistry) Update(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
UPDATE compliance_registries SET
|
||||
reference_id = @reference_id,
|
||||
area = @area,
|
||||
source = @source,
|
||||
requirement = @requirement,
|
||||
actions_to_be_implemented = @actions_to_be_implemented,
|
||||
regulator = @regulator,
|
||||
owner_id = @owner_id,
|
||||
last_review_date = @last_review_date,
|
||||
due_date = @due_date,
|
||||
status = @status,
|
||||
updated_at = @updated_at
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
AND snapshot_id IS NULL
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": cr.ID,
|
||||
"reference_id": cr.ReferenceID,
|
||||
"area": cr.Area,
|
||||
"source": cr.Source,
|
||||
"requirement": cr.Requirement,
|
||||
"actions_to_be_implemented": cr.ActionsToBeImplemented,
|
||||
"regulator": cr.Regulator,
|
||||
"owner_id": cr.OwnerID,
|
||||
"last_review_date": cr.LastReviewDate,
|
||||
"due_date": cr.DueDate,
|
||||
"status": cr.Status,
|
||||
"updated_at": cr.UpdatedAt,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot update compliance registry: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cr *ComplianceRegistry) Delete(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
DELETE FROM compliance_registries
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
AND snapshot_id IS NULL
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"id": cr.ID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot delete compliance registry: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (crs ComplianceRegistries) Snapshot(ctx context.Context, conn pg.Conn, scope Scoper, organizationID, snapshotID gid.GID) error {
|
||||
query := `
|
||||
INSERT INTO compliance_registries (
|
||||
id,
|
||||
tenant_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
area,
|
||||
source,
|
||||
requirement,
|
||||
actions_to_be_implemented,
|
||||
regulator,
|
||||
owner_id,
|
||||
last_review_date,
|
||||
due_date,
|
||||
status,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
SELECT
|
||||
generate_gid(decode_base64_unpadded(@tenant_id), @compliance_registry_entity_type),
|
||||
@tenant_id,
|
||||
@snapshot_id,
|
||||
r.id,
|
||||
r.organization_id,
|
||||
r.reference_id,
|
||||
r.area,
|
||||
r.source,
|
||||
r.requirement,
|
||||
r.actions_to_be_implemented,
|
||||
r.regulator,
|
||||
r.owner_id,
|
||||
r.last_review_date,
|
||||
r.due_date,
|
||||
r.status,
|
||||
r.created_at,
|
||||
r.updated_at
|
||||
FROM compliance_registries r
|
||||
WHERE %s AND r.organization_id = @organization_id AND r.snapshot_id IS NULL
|
||||
`
|
||||
|
||||
query = fmt.Sprintf(query, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"snapshot_id": snapshotID,
|
||||
"organization_id": organizationID,
|
||||
"compliance_registry_entity_type": ComplianceRegistryEntityType,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, query, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert compliance registry snapshots: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ComplianceRegistryOrderField string
|
||||
|
||||
const (
|
||||
ComplianceRegistryOrderFieldCreatedAt ComplianceRegistryOrderField = "CREATED_AT"
|
||||
ComplianceRegistryOrderFieldLastReviewDate ComplianceRegistryOrderField = "LAST_REVIEW_DATE"
|
||||
ComplianceRegistryOrderFieldDueDate ComplianceRegistryOrderField = "DUE_DATE"
|
||||
ComplianceRegistryOrderFieldStatus ComplianceRegistryOrderField = "STATUS"
|
||||
ComplianceRegistryOrderFieldReferenceId ComplianceRegistryOrderField = "REFERENCE_ID"
|
||||
)
|
||||
|
||||
func (p ComplianceRegistryOrderField) Column() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p ComplianceRegistryOrderField) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p ComplianceRegistryOrderField) MarshalText() ([]byte, error) {
|
||||
return []byte(p.String()), nil
|
||||
}
|
||||
|
||||
func (p *ComplianceRegistryOrderField) UnmarshalText(text []byte) error {
|
||||
val := string(text)
|
||||
switch val {
|
||||
case string(ComplianceRegistryOrderFieldCreatedAt),
|
||||
string(ComplianceRegistryOrderFieldLastReviewDate),
|
||||
string(ComplianceRegistryOrderFieldDueDate),
|
||||
string(ComplianceRegistryOrderFieldStatus),
|
||||
string(ComplianceRegistryOrderFieldReferenceId):
|
||||
*p = ComplianceRegistryOrderField(val)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("invalid ComplianceRegistryOrderField value: %q", val)
|
||||
}
|
||||
@@ -20,18 +20,18 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
NonconformityRegistryFilter struct {
|
||||
ContinualImprovementFilter struct {
|
||||
snapshotID **gid.GID
|
||||
}
|
||||
)
|
||||
|
||||
func NewNonconformityRegistryFilter(snapshotID **gid.GID) *NonconformityRegistryFilter {
|
||||
return &NonconformityRegistryFilter{
|
||||
func NewContinualImprovementFilter(snapshotID **gid.GID) *ContinualImprovementFilter {
|
||||
return &ContinualImprovementFilter{
|
||||
snapshotID: snapshotID,
|
||||
}
|
||||
}
|
||||
|
||||
func (f *NonconformityRegistryFilter) SQLArguments() pgx.NamedArgs {
|
||||
func (f *ContinualImprovementFilter) SQLArguments() pgx.NamedArgs {
|
||||
args := pgx.NamedArgs{}
|
||||
|
||||
if f.snapshotID != nil && *f.snapshotID != nil {
|
||||
@@ -41,7 +41,7 @@ func (f *NonconformityRegistryFilter) SQLArguments() pgx.NamedArgs {
|
||||
return args
|
||||
}
|
||||
|
||||
func (f *NonconformityRegistryFilter) SQLFragment() string {
|
||||
func (f *ContinualImprovementFilter) SQLFragment() string {
|
||||
if f.snapshotID == nil {
|
||||
return "TRUE"
|
||||
}
|
||||
55
pkg/coredata/continual_improvement_order_field.go
Normal file
55
pkg/coredata/continual_improvement_order_field.go
Normal file
@@ -0,0 +1,55 @@
|
||||
// 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 ContinualImprovementOrderField string
|
||||
|
||||
const (
|
||||
ContinualImprovementOrderFieldCreatedAt ContinualImprovementOrderField = "CREATED_AT"
|
||||
ContinualImprovementOrderFieldTargetDate ContinualImprovementOrderField = "TARGET_DATE"
|
||||
ContinualImprovementOrderFieldStatus ContinualImprovementOrderField = "STATUS"
|
||||
ContinualImprovementOrderFieldPriority ContinualImprovementOrderField = "PRIORITY"
|
||||
ContinualImprovementOrderFieldReferenceId ContinualImprovementOrderField = "REFERENCE_ID"
|
||||
)
|
||||
|
||||
func (p ContinualImprovementOrderField) Column() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p ContinualImprovementOrderField) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p ContinualImprovementOrderField) MarshalText() ([]byte, error) {
|
||||
return []byte(p.String()), nil
|
||||
}
|
||||
|
||||
func (p *ContinualImprovementOrderField) UnmarshalText(text []byte) error {
|
||||
val := string(text)
|
||||
switch val {
|
||||
case string(ContinualImprovementOrderFieldCreatedAt),
|
||||
string(ContinualImprovementOrderFieldTargetDate),
|
||||
string(ContinualImprovementOrderFieldStatus),
|
||||
string(ContinualImprovementOrderFieldPriority),
|
||||
string(ContinualImprovementOrderFieldReferenceId):
|
||||
*p = ContinualImprovementOrderField(val)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("invalid ContinualImprovementOrderField value: %q", val)
|
||||
}
|
||||
@@ -19,19 +19,19 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ContinualImprovementRegistriesPriority string
|
||||
type ContinualImprovementPriority string
|
||||
|
||||
const (
|
||||
ContinualImprovementRegistriesPriorityLow ContinualImprovementRegistriesPriority = "LOW"
|
||||
ContinualImprovementRegistriesPriorityMedium ContinualImprovementRegistriesPriority = "MEDIUM"
|
||||
ContinualImprovementRegistriesPriorityHigh ContinualImprovementRegistriesPriority = "HIGH"
|
||||
ContinualImprovementPriorityLow ContinualImprovementPriority = "LOW"
|
||||
ContinualImprovementPriorityMedium ContinualImprovementPriority = "MEDIUM"
|
||||
ContinualImprovementPriorityHigh ContinualImprovementPriority = "HIGH"
|
||||
)
|
||||
|
||||
func (cirp ContinualImprovementRegistriesPriority) String() string {
|
||||
return string(cirp)
|
||||
func (cip ContinualImprovementPriority) String() string {
|
||||
return string(cip)
|
||||
}
|
||||
|
||||
func (cirp *ContinualImprovementRegistriesPriority) Scan(value any) error {
|
||||
func (cip *ContinualImprovementPriority) Scan(value any) error {
|
||||
var s string
|
||||
switch v := value.(type) {
|
||||
case string:
|
||||
@@ -39,22 +39,22 @@ func (cirp *ContinualImprovementRegistriesPriority) Scan(value any) error {
|
||||
case []byte:
|
||||
s = string(v)
|
||||
default:
|
||||
return fmt.Errorf("unsupported type for ContinualImprovementRegistriesPriority: %T", value)
|
||||
return fmt.Errorf("unsupported type for ContinualImprovementPriority: %T", value)
|
||||
}
|
||||
|
||||
switch s {
|
||||
case "LOW":
|
||||
*cirp = ContinualImprovementRegistriesPriorityLow
|
||||
*cip = ContinualImprovementPriorityLow
|
||||
case "MEDIUM":
|
||||
*cirp = ContinualImprovementRegistriesPriorityMedium
|
||||
*cip = ContinualImprovementPriorityMedium
|
||||
case "HIGH":
|
||||
*cirp = ContinualImprovementRegistriesPriorityHigh
|
||||
*cip = ContinualImprovementPriorityHigh
|
||||
default:
|
||||
return fmt.Errorf("invalid ContinualImprovementRegistriesPriority value: %q", s)
|
||||
return fmt.Errorf("invalid ContinualImprovementPriority value: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cirp ContinualImprovementRegistriesPriority) Value() (driver.Value, error) {
|
||||
return cirp.String(), nil
|
||||
func (cip ContinualImprovementPriority) Value() (driver.Value, error) {
|
||||
return cip.String(), nil
|
||||
}
|
||||
@@ -1,383 +0,0 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"maps"
|
||||
"time"
|
||||
|
||||
"github.com/getprobo/probo/pkg/gid"
|
||||
"github.com/getprobo/probo/pkg/page"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"go.gearno.de/kit/pg"
|
||||
)
|
||||
|
||||
type (
|
||||
ContinualImprovementRegistry struct {
|
||||
ID gid.GID `db:"id"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
ReferenceID string `db:"reference_id"`
|
||||
Description *string `db:"description"`
|
||||
Source *string `db:"source"`
|
||||
OwnerID gid.GID `db:"owner_id"`
|
||||
TargetDate *time.Time `db:"target_date"`
|
||||
Status ContinualImprovementRegistriesStatus `db:"status"`
|
||||
Priority ContinualImprovementRegistriesPriority `db:"priority"`
|
||||
SnapshotID *gid.GID `db:"snapshot_id"`
|
||||
SourceID *gid.GID `db:"source_id"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
ContinualImprovementRegistries []*ContinualImprovementRegistry
|
||||
)
|
||||
|
||||
func (cir *ContinualImprovementRegistry) CursorKey(field ContinualImprovementRegistriesOrderField) page.CursorKey {
|
||||
switch field {
|
||||
case ContinualImprovementRegistriesOrderFieldCreatedAt:
|
||||
return page.NewCursorKey(cir.ID, cir.CreatedAt)
|
||||
case ContinualImprovementRegistriesOrderFieldTargetDate:
|
||||
return page.NewCursorKey(cir.ID, cir.TargetDate)
|
||||
case ContinualImprovementRegistriesOrderFieldStatus:
|
||||
return page.NewCursorKey(cir.ID, cir.Status)
|
||||
case ContinualImprovementRegistriesOrderFieldPriority:
|
||||
return page.NewCursorKey(cir.ID, cir.Priority)
|
||||
case ContinualImprovementRegistriesOrderFieldReferenceId:
|
||||
return page.NewCursorKey(cir.ID, cir.ReferenceID)
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf("unsupported order by: %s", field))
|
||||
}
|
||||
|
||||
func (cir *ContinualImprovementRegistry) LoadByID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
continualImprovementRegistryID gid.GID,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
source,
|
||||
owner_id,
|
||||
target_date,
|
||||
status,
|
||||
priority,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
continual_improvement_registries
|
||||
WHERE
|
||||
%s
|
||||
AND id = @continual_improvement_registry_id
|
||||
LIMIT 1;
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"continual_improvement_registry_id": continualImprovementRegistryID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query continual improvement registry: %w", err)
|
||||
}
|
||||
|
||||
registry, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ContinualImprovementRegistry])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect continual improvement registry: %w", err)
|
||||
}
|
||||
|
||||
*cir = registry
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cirs *ContinualImprovementRegistries) CountByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
filter *ContinualImprovementRegistryFilter,
|
||||
) (int, error) {
|
||||
q := `
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM
|
||||
continual_improvement_registries
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
|
||||
row := conn.QueryRow(ctx, q, args)
|
||||
|
||||
var count int
|
||||
err := row.Scan(&count)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("cannot count continual improvement registries: %w", err)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (cirs *ContinualImprovementRegistries) LoadByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
cursor *page.Cursor[ContinualImprovementRegistriesOrderField],
|
||||
filter *ContinualImprovementRegistryFilter,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
source,
|
||||
owner_id,
|
||||
target_date,
|
||||
status,
|
||||
priority,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
continual_improvement_registries
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment(), cursor.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
maps.Copy(args, cursor.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query continual improvement registries: %w", err)
|
||||
}
|
||||
|
||||
registries, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ContinualImprovementRegistry])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect continual improvement registries: %w", err)
|
||||
}
|
||||
|
||||
*cirs = registries
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cir *ContinualImprovementRegistry) Insert(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
INSERT INTO continual_improvement_registries (
|
||||
id,
|
||||
tenant_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
source,
|
||||
owner_id,
|
||||
target_date,
|
||||
status,
|
||||
priority,
|
||||
created_at,
|
||||
updated_at
|
||||
) VALUES (
|
||||
@id,
|
||||
@tenant_id,
|
||||
@organization_id,
|
||||
@reference_id,
|
||||
@description,
|
||||
@source,
|
||||
@owner_id,
|
||||
@target_date,
|
||||
@status,
|
||||
@priority,
|
||||
@created_at,
|
||||
@updated_at
|
||||
)
|
||||
`
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": cir.ID,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"organization_id": cir.OrganizationID,
|
||||
"reference_id": cir.ReferenceID,
|
||||
"description": cir.Description,
|
||||
"source": cir.Source,
|
||||
"owner_id": cir.OwnerID,
|
||||
"target_date": cir.TargetDate,
|
||||
"status": cir.Status,
|
||||
"priority": cir.Priority,
|
||||
"created_at": cir.CreatedAt,
|
||||
"updated_at": cir.UpdatedAt,
|
||||
}
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert continual improvement registry: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cir *ContinualImprovementRegistry) Update(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
UPDATE continual_improvement_registries SET
|
||||
reference_id = @reference_id,
|
||||
description = @description,
|
||||
source = @source,
|
||||
owner_id = @owner_id,
|
||||
target_date = @target_date,
|
||||
status = @status,
|
||||
priority = @priority,
|
||||
updated_at = @updated_at
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": cir.ID,
|
||||
"reference_id": cir.ReferenceID,
|
||||
"description": cir.Description,
|
||||
"source": cir.Source,
|
||||
"owner_id": cir.OwnerID,
|
||||
"target_date": cir.TargetDate,
|
||||
"status": cir.Status,
|
||||
"priority": cir.Priority,
|
||||
"updated_at": cir.UpdatedAt,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot update continual improvement registry: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cir *ContinualImprovementRegistry) Delete(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
DELETE FROM continual_improvement_registries
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"id": cir.ID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot delete continual improvement registry: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cirs ContinualImprovementRegistries) Snapshot(ctx context.Context, conn pg.Conn, scope Scoper, organizationID, snapshotID gid.GID) error {
|
||||
query := `
|
||||
INSERT INTO continual_improvement_registries (
|
||||
id,
|
||||
tenant_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
source,
|
||||
owner_id,
|
||||
target_date,
|
||||
status,
|
||||
priority,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
SELECT
|
||||
generate_gid(decode_base64_unpadded(@tenant_id), @continual_improvement_registry_entity_type),
|
||||
@tenant_id,
|
||||
@snapshot_id,
|
||||
r.id,
|
||||
r.organization_id,
|
||||
r.reference_id,
|
||||
r.description,
|
||||
r.source,
|
||||
r.owner_id,
|
||||
r.target_date,
|
||||
r.status,
|
||||
r.priority,
|
||||
r.created_at,
|
||||
r.updated_at
|
||||
FROM continual_improvement_registries r
|
||||
WHERE %s AND r.organization_id = @organization_id AND r.snapshot_id IS NULL
|
||||
`
|
||||
|
||||
query = fmt.Sprintf(query, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"snapshot_id": snapshotID,
|
||||
"organization_id": organizationID,
|
||||
"continual_improvement_registry_entity_type": ContinualImprovementRegistryEntityType,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, query, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert continual improvement registry snapshots: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ContinualImprovementRegistriesOrderField string
|
||||
|
||||
const (
|
||||
ContinualImprovementRegistriesOrderFieldCreatedAt ContinualImprovementRegistriesOrderField = "CREATED_AT"
|
||||
ContinualImprovementRegistriesOrderFieldTargetDate ContinualImprovementRegistriesOrderField = "TARGET_DATE"
|
||||
ContinualImprovementRegistriesOrderFieldStatus ContinualImprovementRegistriesOrderField = "STATUS"
|
||||
ContinualImprovementRegistriesOrderFieldPriority ContinualImprovementRegistriesOrderField = "PRIORITY"
|
||||
ContinualImprovementRegistriesOrderFieldReferenceId ContinualImprovementRegistriesOrderField = "REFERENCE_ID"
|
||||
)
|
||||
|
||||
func (p ContinualImprovementRegistriesOrderField) Column() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p ContinualImprovementRegistriesOrderField) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p ContinualImprovementRegistriesOrderField) MarshalText() ([]byte, error) {
|
||||
return []byte(p.String()), nil
|
||||
}
|
||||
|
||||
func (p *ContinualImprovementRegistriesOrderField) UnmarshalText(text []byte) error {
|
||||
val := string(text)
|
||||
switch val {
|
||||
case string(ContinualImprovementRegistriesOrderFieldCreatedAt),
|
||||
string(ContinualImprovementRegistriesOrderFieldTargetDate),
|
||||
string(ContinualImprovementRegistriesOrderFieldStatus),
|
||||
string(ContinualImprovementRegistriesOrderFieldPriority),
|
||||
string(ContinualImprovementRegistriesOrderFieldReferenceId):
|
||||
*p = ContinualImprovementRegistriesOrderField(val)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("invalid ContinualImprovementRegistriesOrderField value: %q", val)
|
||||
}
|
||||
@@ -19,19 +19,19 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type NonconformityRegistryStatus string
|
||||
type ContinualImprovementStatus string
|
||||
|
||||
const (
|
||||
NonconformityRegistryStatusOpen NonconformityRegistryStatus = "OPEN"
|
||||
NonconformityRegistryStatusInProgress NonconformityRegistryStatus = "IN_PROGRESS"
|
||||
NonconformityRegistryStatusClosed NonconformityRegistryStatus = "CLOSED"
|
||||
ContinualImprovementStatusOpen ContinualImprovementStatus = "OPEN"
|
||||
ContinualImprovementStatusInProgress ContinualImprovementStatus = "IN_PROGRESS"
|
||||
ContinualImprovementStatusClosed ContinualImprovementStatus = "CLOSED"
|
||||
)
|
||||
|
||||
func (nrs NonconformityRegistryStatus) String() string {
|
||||
return string(nrs)
|
||||
func (cis ContinualImprovementStatus) String() string {
|
||||
return string(cis)
|
||||
}
|
||||
|
||||
func (nrs *NonconformityRegistryStatus) Scan(value any) error {
|
||||
func (cis *ContinualImprovementStatus) Scan(value any) error {
|
||||
var s string
|
||||
switch v := value.(type) {
|
||||
case string:
|
||||
@@ -39,22 +39,22 @@ func (nrs *NonconformityRegistryStatus) Scan(value any) error {
|
||||
case []byte:
|
||||
s = string(v)
|
||||
default:
|
||||
return fmt.Errorf("unsupported type for NonconformityRegistryStatus: %T", value)
|
||||
return fmt.Errorf("unsupported type for ContinualImprovementStatus: %T", value)
|
||||
}
|
||||
|
||||
switch s {
|
||||
case "OPEN":
|
||||
*nrs = NonconformityRegistryStatusOpen
|
||||
*cis = ContinualImprovementStatusOpen
|
||||
case "IN_PROGRESS":
|
||||
*nrs = NonconformityRegistryStatusInProgress
|
||||
*cis = ContinualImprovementStatusInProgress
|
||||
case "CLOSED":
|
||||
*nrs = NonconformityRegistryStatusClosed
|
||||
*cis = ContinualImprovementStatusClosed
|
||||
default:
|
||||
return fmt.Errorf("invalid NonconformityRegistryStatus value: %q", s)
|
||||
return fmt.Errorf("invalid ContinualImprovementStatus value: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nrs NonconformityRegistryStatus) Value() (driver.Value, error) {
|
||||
return nrs.String(), nil
|
||||
func (cis ContinualImprovementStatus) Value() (driver.Value, error) {
|
||||
return cis.String(), nil
|
||||
}
|
||||
383
pkg/coredata/continual_improvements.go
Normal file
383
pkg/coredata/continual_improvements.go
Normal file
@@ -0,0 +1,383 @@
|
||||
// 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"
|
||||
"fmt"
|
||||
"maps"
|
||||
"time"
|
||||
|
||||
"github.com/getprobo/probo/pkg/gid"
|
||||
"github.com/getprobo/probo/pkg/page"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"go.gearno.de/kit/pg"
|
||||
)
|
||||
|
||||
type (
|
||||
ContinualImprovement struct {
|
||||
ID gid.GID `db:"id"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
ReferenceID string `db:"reference_id"`
|
||||
Description *string `db:"description"`
|
||||
Source *string `db:"source"`
|
||||
OwnerID gid.GID `db:"owner_id"`
|
||||
TargetDate *time.Time `db:"target_date"`
|
||||
Status ContinualImprovementStatus `db:"status"`
|
||||
Priority ContinualImprovementPriority `db:"priority"`
|
||||
SnapshotID *gid.GID `db:"snapshot_id"`
|
||||
SourceID *gid.GID `db:"source_id"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
ContinualImprovements []*ContinualImprovement
|
||||
)
|
||||
|
||||
func (ci *ContinualImprovement) CursorKey(field ContinualImprovementOrderField) page.CursorKey {
|
||||
switch field {
|
||||
case ContinualImprovementOrderFieldCreatedAt:
|
||||
return page.NewCursorKey(ci.ID, ci.CreatedAt)
|
||||
case ContinualImprovementOrderFieldTargetDate:
|
||||
return page.NewCursorKey(ci.ID, ci.TargetDate)
|
||||
case ContinualImprovementOrderFieldStatus:
|
||||
return page.NewCursorKey(ci.ID, ci.Status)
|
||||
case ContinualImprovementOrderFieldPriority:
|
||||
return page.NewCursorKey(ci.ID, ci.Priority)
|
||||
case ContinualImprovementOrderFieldReferenceId:
|
||||
return page.NewCursorKey(ci.ID, ci.ReferenceID)
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf("unsupported order by: %s", field))
|
||||
}
|
||||
|
||||
func (ci *ContinualImprovement) LoadByID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
continualImprovementID gid.GID,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
source,
|
||||
owner_id,
|
||||
target_date,
|
||||
status,
|
||||
priority,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
continual_improvements
|
||||
WHERE
|
||||
%s
|
||||
AND id = @continual_improvement_id
|
||||
LIMIT 1;
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"continual_improvement_id": continualImprovementID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query continual improvement: %w", err)
|
||||
}
|
||||
|
||||
improvement, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ContinualImprovement])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect continual improvement: %w", err)
|
||||
}
|
||||
|
||||
*ci = improvement
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cis *ContinualImprovements) CountByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
filter *ContinualImprovementFilter,
|
||||
) (int, error) {
|
||||
q := `
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM
|
||||
continual_improvements
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
|
||||
row := conn.QueryRow(ctx, q, args)
|
||||
|
||||
var count int
|
||||
err := row.Scan(&count)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("cannot count continual improvements: %w", err)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (cis *ContinualImprovements) LoadByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
cursor *page.Cursor[ContinualImprovementOrderField],
|
||||
filter *ContinualImprovementFilter,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
source,
|
||||
owner_id,
|
||||
target_date,
|
||||
status,
|
||||
priority,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
continual_improvements
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment(), cursor.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
maps.Copy(args, cursor.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query continual improvements: %w", err)
|
||||
}
|
||||
|
||||
improvements, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ContinualImprovement])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect continual improvements: %w", err)
|
||||
}
|
||||
|
||||
*cis = improvements
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ci *ContinualImprovement) Insert(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
INSERT INTO continual_improvements (
|
||||
id,
|
||||
tenant_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
source,
|
||||
owner_id,
|
||||
target_date,
|
||||
status,
|
||||
priority,
|
||||
created_at,
|
||||
updated_at
|
||||
) VALUES (
|
||||
@id,
|
||||
@tenant_id,
|
||||
@organization_id,
|
||||
@reference_id,
|
||||
@description,
|
||||
@source,
|
||||
@owner_id,
|
||||
@target_date,
|
||||
@status,
|
||||
@priority,
|
||||
@created_at,
|
||||
@updated_at
|
||||
)
|
||||
`
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": ci.ID,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"organization_id": ci.OrganizationID,
|
||||
"reference_id": ci.ReferenceID,
|
||||
"description": ci.Description,
|
||||
"source": ci.Source,
|
||||
"owner_id": ci.OwnerID,
|
||||
"target_date": ci.TargetDate,
|
||||
"status": ci.Status,
|
||||
"priority": ci.Priority,
|
||||
"created_at": ci.CreatedAt,
|
||||
"updated_at": ci.UpdatedAt,
|
||||
}
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert continual improvement: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ci *ContinualImprovement) Update(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
UPDATE continual_improvements SET
|
||||
reference_id = @reference_id,
|
||||
description = @description,
|
||||
source = @source,
|
||||
owner_id = @owner_id,
|
||||
target_date = @target_date,
|
||||
status = @status,
|
||||
priority = @priority,
|
||||
updated_at = @updated_at
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": ci.ID,
|
||||
"reference_id": ci.ReferenceID,
|
||||
"description": ci.Description,
|
||||
"source": ci.Source,
|
||||
"owner_id": ci.OwnerID,
|
||||
"target_date": ci.TargetDate,
|
||||
"status": ci.Status,
|
||||
"priority": ci.Priority,
|
||||
"updated_at": ci.UpdatedAt,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot update continual improvement: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ci *ContinualImprovement) Delete(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
DELETE FROM continual_improvements
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"id": ci.ID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot delete continual improvement: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cis ContinualImprovements) Snapshot(ctx context.Context, conn pg.Conn, scope Scoper, organizationID, snapshotID gid.GID) error {
|
||||
query := `
|
||||
INSERT INTO continual_improvements (
|
||||
id,
|
||||
tenant_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
source,
|
||||
owner_id,
|
||||
target_date,
|
||||
status,
|
||||
priority,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
SELECT
|
||||
generate_gid(decode_base64_unpadded(@tenant_id), @continual_improvement_entity_type),
|
||||
@tenant_id,
|
||||
@snapshot_id,
|
||||
r.id,
|
||||
r.organization_id,
|
||||
r.reference_id,
|
||||
r.description,
|
||||
r.source,
|
||||
r.owner_id,
|
||||
r.target_date,
|
||||
r.status,
|
||||
r.priority,
|
||||
r.created_at,
|
||||
r.updated_at
|
||||
FROM continual_improvements r
|
||||
WHERE %s AND r.organization_id = @organization_id AND r.snapshot_id IS NULL
|
||||
`
|
||||
|
||||
query = fmt.Sprintf(query, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"snapshot_id": snapshotID,
|
||||
"organization_id": organizationID,
|
||||
"continual_improvement_entity_type": ContinualImprovementEntityType,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, query, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert continual improvement snapshots: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -43,11 +43,11 @@ const (
|
||||
FileEntityType
|
||||
VendorContactEntityType
|
||||
VendorDataPrivacyAgreementEntityType
|
||||
NonconformityRegistryEntityType
|
||||
ComplianceRegistryEntityType
|
||||
NonconformityEntityType
|
||||
ObligationEntityType
|
||||
VendorServiceEntityType
|
||||
SnapshotEntityType
|
||||
ContinualImprovementRegistryEntityType
|
||||
ProcessingActivityRegistryEntityType
|
||||
ContinualImprovementEntityType
|
||||
ProcessingActivityEntityType
|
||||
FrameworkExportEntityType
|
||||
)
|
||||
|
||||
51
pkg/coredata/migrations/20250905T122423Z.sql
Normal file
51
pkg/coredata/migrations/20250905T122423Z.sql
Normal file
@@ -0,0 +1,51 @@
|
||||
ALTER TYPE nonconformity_registries_status RENAME TO nonconformities_status;
|
||||
|
||||
ALTER TYPE snapshots_type
|
||||
RENAME VALUE 'NONCONFORMITY_REGISTRIES' TO 'NONCONFORMITIES';
|
||||
|
||||
ALTER TABLE nonconformity_registries RENAME TO nonconformities;
|
||||
|
||||
ALTER TABLE nonconformities RENAME CONSTRAINT nonconformity_registries_organization_id_fkey TO nonconformities_organization_id_fkey;
|
||||
ALTER TABLE nonconformities RENAME CONSTRAINT nonconformity_registries_owner_id_fkey TO nonconformities_owner_id_fkey;
|
||||
ALTER TABLE nonconformities RENAME CONSTRAINT nonconformity_registries_audit_id_fkey TO nonconformities_audit_id_fkey;
|
||||
ALTER TABLE nonconformities RENAME CONSTRAINT nonconformity_registries_snapshot_id_fkey TO nonconformities_snapshot_id_fkey;
|
||||
ALTER TABLE nonconformities RENAME CONSTRAINT nonconformity_registries_source_id_snapshot_id_key TO nonconformities_source_id_snapshot_id_key;
|
||||
|
||||
ALTER TYPE continual_improvement_registries_status RENAME TO continual_improvements_status;
|
||||
|
||||
ALTER TYPE snapshots_type
|
||||
RENAME VALUE 'CONTINUAL_IMPROVEMENT_REGISTRIES' TO 'CONTINUAL_IMPROVEMENTS';
|
||||
|
||||
ALTER TABLE continual_improvement_registries RENAME TO continual_improvements;
|
||||
|
||||
ALTER TABLE continual_improvements RENAME CONSTRAINT continual_improvement_registries_organization_id_fkey TO continual_improvements_organization_id_fkey;
|
||||
ALTER TABLE continual_improvements RENAME CONSTRAINT continual_improvement_registries_owner_id_fkey TO continual_improvements_owner_id_fkey;
|
||||
ALTER TABLE continual_improvements RENAME CONSTRAINT continual_improvement_registries_snapshot_id_fkey TO continual_improvements_snapshot_id_fkey;
|
||||
ALTER TABLE continual_improvements RENAME CONSTRAINT continual_improvement_registries_source_id_snapshot_id_key TO continual_improvements_source_id_snapshot_id_key;
|
||||
|
||||
ALTER TYPE processing_activity_registries_special_or_criminal_data RENAME TO processing_activities_special_or_criminal_data;
|
||||
ALTER TYPE processing_activity_registries_lawful_basis RENAME TO processing_activities_lawful_basis;
|
||||
ALTER TYPE processing_activity_registries_transfer_safeguards RENAME TO processing_activities_transfer_safeguards;
|
||||
ALTER TYPE processing_activity_registries_data_protection_impact_assessment RENAME TO processing_activities_data_protection_impact_assessment;
|
||||
ALTER TYPE processing_activity_registries_transfer_impact_assessment RENAME TO processing_activities_transfer_impact_assessment;
|
||||
|
||||
ALTER TYPE snapshots_type
|
||||
RENAME VALUE 'PROCESSING_ACTIVITY_REGISTRIES' TO 'PROCESSING_ACTIVITIES';
|
||||
|
||||
ALTER TABLE processing_activity_registries RENAME TO processing_activities;
|
||||
|
||||
ALTER TABLE processing_activities RENAME CONSTRAINT processing_activity_registries_organization_id_fkey TO processing_activities_organization_id_fkey;
|
||||
ALTER TABLE processing_activities RENAME CONSTRAINT processing_activity_registries_snapshot_id_fkey TO processing_activities_snapshot_id_fkey;
|
||||
ALTER TABLE processing_activities RENAME CONSTRAINT processing_activity_registries_source_id_snapshot_id_key TO processing_activities_source_id_snapshot_id_key;
|
||||
|
||||
ALTER TYPE compliance_registries_status RENAME TO obligations_status;
|
||||
|
||||
ALTER TYPE snapshots_type
|
||||
RENAME VALUE 'COMPLIANCE_REGISTRIES' TO 'OBLIGATIONS';
|
||||
|
||||
ALTER TABLE compliance_registries RENAME TO obligations;
|
||||
|
||||
ALTER TABLE obligations RENAME CONSTRAINT compliance_registries_organization_id_fkey TO obligations_organization_id_fkey;
|
||||
ALTER TABLE obligations RENAME CONSTRAINT compliance_registries_owner_id_fkey TO obligations_owner_id_fkey;
|
||||
ALTER TABLE obligations RENAME CONSTRAINT compliance_registries_snapshot_id_fkey TO obligations_snapshot_id_fkey;
|
||||
ALTER TABLE obligations RENAME CONSTRAINT compliance_registries_source_id_snapshot_id_key TO obligations_source_id_snapshot_id_key;
|
||||
415
pkg/coredata/nonconformity.go
Normal file
415
pkg/coredata/nonconformity.go
Normal file
@@ -0,0 +1,415 @@
|
||||
// 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"
|
||||
"fmt"
|
||||
"maps"
|
||||
"time"
|
||||
|
||||
"github.com/getprobo/probo/pkg/gid"
|
||||
"github.com/getprobo/probo/pkg/page"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"go.gearno.de/kit/pg"
|
||||
)
|
||||
|
||||
type (
|
||||
Nonconformity struct {
|
||||
ID gid.GID `db:"id"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
SnapshotID *gid.GID `db:"snapshot_id"`
|
||||
SourceID *gid.GID `db:"source_id"`
|
||||
ReferenceID string `db:"reference_id"`
|
||||
Description *string `db:"description"`
|
||||
AuditID gid.GID `db:"audit_id"`
|
||||
DateIdentified *time.Time `db:"date_identified"`
|
||||
RootCause string `db:"root_cause"`
|
||||
CorrectiveAction *string `db:"corrective_action"`
|
||||
OwnerID gid.GID `db:"owner_id"`
|
||||
DueDate *time.Time `db:"due_date"`
|
||||
Status NonconformityStatus `db:"status"`
|
||||
EffectivenessCheck *string `db:"effectiveness_check"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
Nonconformities []*Nonconformity
|
||||
)
|
||||
|
||||
func (nc *Nonconformity) CursorKey(field NonconformityOrderField) page.CursorKey {
|
||||
switch field {
|
||||
case NonconformityOrderFieldCreatedAt:
|
||||
return page.NewCursorKey(nc.ID, nc.CreatedAt)
|
||||
case NonconformityOrderFieldDateIdentified:
|
||||
return page.NewCursorKey(nc.ID, nc.DateIdentified)
|
||||
case NonconformityOrderFieldDueDate:
|
||||
return page.NewCursorKey(nc.ID, nc.DueDate)
|
||||
case NonconformityOrderFieldStatus:
|
||||
return page.NewCursorKey(nc.ID, nc.Status)
|
||||
case NonconformityOrderFieldReferenceId:
|
||||
return page.NewCursorKey(nc.ID, nc.ReferenceID)
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf("unsupported order by: %s", field))
|
||||
}
|
||||
|
||||
func (nc *Nonconformity) LoadByID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
nonconformityID gid.GID,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
reference_id,
|
||||
description,
|
||||
audit_id,
|
||||
date_identified,
|
||||
root_cause,
|
||||
corrective_action,
|
||||
owner_id,
|
||||
due_date,
|
||||
status,
|
||||
effectiveness_check,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
nonconformities
|
||||
WHERE
|
||||
%s
|
||||
AND id = @nonconformity_id
|
||||
LIMIT 1;
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"nonconformity_id": nonconformityID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query nonconformity: %w", err)
|
||||
}
|
||||
|
||||
nonconformity, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Nonconformity])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect nonconformity: %w", err)
|
||||
}
|
||||
|
||||
*nc = nonconformity
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ncs *Nonconformities) CountByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
filter *NonconformityFilter,
|
||||
) (int, error) {
|
||||
q := `
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM
|
||||
nonconformities
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
|
||||
row := conn.QueryRow(ctx, q, args)
|
||||
|
||||
var count int
|
||||
err := row.Scan(&count)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("cannot count nonconformities: %w", err)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (ncs *Nonconformities) LoadByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
cursor *page.Cursor[NonconformityOrderField],
|
||||
filter *NonconformityFilter,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
reference_id,
|
||||
description,
|
||||
audit_id,
|
||||
date_identified,
|
||||
root_cause,
|
||||
corrective_action,
|
||||
owner_id,
|
||||
due_date,
|
||||
status,
|
||||
effectiveness_check,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
nonconformities
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment(), cursor.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
maps.Copy(args, cursor.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query nonconformities: %w", err)
|
||||
}
|
||||
|
||||
nonconformities, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Nonconformity])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect nonconformities: %w", err)
|
||||
}
|
||||
|
||||
*ncs = nonconformities
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nc *Nonconformity) Insert(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
INSERT INTO nonconformities (
|
||||
id,
|
||||
tenant_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
audit_id,
|
||||
date_identified,
|
||||
root_cause,
|
||||
corrective_action,
|
||||
owner_id,
|
||||
due_date,
|
||||
status,
|
||||
effectiveness_check,
|
||||
created_at,
|
||||
updated_at
|
||||
) VALUES (
|
||||
@id,
|
||||
@tenant_id,
|
||||
@organization_id,
|
||||
@reference_id,
|
||||
@description,
|
||||
@audit_id,
|
||||
@date_identified,
|
||||
@root_cause,
|
||||
@corrective_action,
|
||||
@owner_id,
|
||||
@due_date,
|
||||
@status,
|
||||
@effectiveness_check,
|
||||
@created_at,
|
||||
@updated_at
|
||||
)
|
||||
`
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": nc.ID,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"organization_id": nc.OrganizationID,
|
||||
"reference_id": nc.ReferenceID,
|
||||
"description": nc.Description,
|
||||
"audit_id": nc.AuditID,
|
||||
"date_identified": nc.DateIdentified,
|
||||
"root_cause": nc.RootCause,
|
||||
"corrective_action": nc.CorrectiveAction,
|
||||
"owner_id": nc.OwnerID,
|
||||
"due_date": nc.DueDate,
|
||||
"status": nc.Status,
|
||||
"effectiveness_check": nc.EffectivenessCheck,
|
||||
"created_at": nc.CreatedAt,
|
||||
"updated_at": nc.UpdatedAt,
|
||||
}
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert nonconformity: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nc *Nonconformity) Update(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
UPDATE nonconformities
|
||||
SET
|
||||
reference_id = @reference_id,
|
||||
description = @description,
|
||||
date_identified = @date_identified,
|
||||
root_cause = @root_cause,
|
||||
corrective_action = @corrective_action,
|
||||
due_date = @due_date,
|
||||
status = @status,
|
||||
effectiveness_check = @effectiveness_check,
|
||||
owner_id = @owner_id,
|
||||
audit_id = @audit_id,
|
||||
updated_at = @updated_at
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
AND snapshot_id IS NULL
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": nc.ID,
|
||||
"reference_id": nc.ReferenceID,
|
||||
"description": nc.Description,
|
||||
"date_identified": nc.DateIdentified,
|
||||
"root_cause": nc.RootCause,
|
||||
"corrective_action": nc.CorrectiveAction,
|
||||
"due_date": nc.DueDate,
|
||||
"status": nc.Status,
|
||||
"effectiveness_check": nc.EffectivenessCheck,
|
||||
"owner_id": nc.OwnerID,
|
||||
"audit_id": nc.AuditID,
|
||||
"updated_at": nc.UpdatedAt,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot update nonconformity: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nc *Nonconformity) Delete(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
DELETE FROM nonconformities
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id AND snapshot_id IS NULL
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"id": nc.ID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot delete nonconformity: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ncs Nonconformities) Snapshot(ctx context.Context, conn pg.Conn, scope Scoper, organizationID, snapshotID gid.GID) error {
|
||||
query := `
|
||||
INSERT INTO nonconformities (
|
||||
id,
|
||||
tenant_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
audit_id,
|
||||
date_identified,
|
||||
root_cause,
|
||||
corrective_action,
|
||||
owner_id,
|
||||
due_date,
|
||||
status,
|
||||
effectiveness_check,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
SELECT
|
||||
generate_gid(decode_base64_unpadded(@tenant_id), @nonconformity_entity_type),
|
||||
@tenant_id,
|
||||
@snapshot_id,
|
||||
nc.id,
|
||||
nc.organization_id,
|
||||
nc.reference_id,
|
||||
nc.description,
|
||||
nc.audit_id,
|
||||
nc.date_identified,
|
||||
nc.root_cause,
|
||||
nc.corrective_action,
|
||||
nc.owner_id,
|
||||
nc.due_date,
|
||||
nc.status,
|
||||
nc.effectiveness_check,
|
||||
nc.created_at,
|
||||
nc.updated_at
|
||||
FROM nonconformities nc
|
||||
WHERE %s AND nc.organization_id = @organization_id AND nc.snapshot_id IS NULL
|
||||
`
|
||||
|
||||
query = fmt.Sprintf(query, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"snapshot_id": snapshotID,
|
||||
"organization_id": organizationID,
|
||||
"nonconformity_entity_type": NonconformityEntityType,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, query, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert data snapshots: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -20,18 +20,18 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
ProcessingActivityRegistryFilter struct {
|
||||
NonconformityFilter struct {
|
||||
snapshotID **gid.GID
|
||||
}
|
||||
)
|
||||
|
||||
func NewProcessingActivityRegistryFilter(snapshotID **gid.GID) *ProcessingActivityRegistryFilter {
|
||||
return &ProcessingActivityRegistryFilter{
|
||||
func NewNonconformityFilter(snapshotID **gid.GID) *NonconformityFilter {
|
||||
return &NonconformityFilter{
|
||||
snapshotID: snapshotID,
|
||||
}
|
||||
}
|
||||
|
||||
func (f *ProcessingActivityRegistryFilter) SQLArguments() pgx.NamedArgs {
|
||||
func (f *NonconformityFilter) SQLArguments() pgx.NamedArgs {
|
||||
args := pgx.NamedArgs{}
|
||||
|
||||
if f.snapshotID != nil && *f.snapshotID != nil {
|
||||
@@ -41,7 +41,7 @@ func (f *ProcessingActivityRegistryFilter) SQLArguments() pgx.NamedArgs {
|
||||
return args
|
||||
}
|
||||
|
||||
func (f *ProcessingActivityRegistryFilter) SQLFragment() string {
|
||||
func (f *NonconformityFilter) SQLFragment() string {
|
||||
if f.snapshotID == nil {
|
||||
return "TRUE"
|
||||
}
|
||||
55
pkg/coredata/nonconformity_order_field.go
Normal file
55
pkg/coredata/nonconformity_order_field.go
Normal file
@@ -0,0 +1,55 @@
|
||||
// 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 NonconformityOrderField string
|
||||
|
||||
const (
|
||||
NonconformityOrderFieldCreatedAt NonconformityOrderField = "CREATED_AT"
|
||||
NonconformityOrderFieldDateIdentified NonconformityOrderField = "DATE_IDENTIFIED"
|
||||
NonconformityOrderFieldDueDate NonconformityOrderField = "DUE_DATE"
|
||||
NonconformityOrderFieldStatus NonconformityOrderField = "STATUS"
|
||||
NonconformityOrderFieldReferenceId NonconformityOrderField = "REFERENCE_ID"
|
||||
)
|
||||
|
||||
func (p NonconformityOrderField) Column() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p NonconformityOrderField) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p NonconformityOrderField) MarshalText() ([]byte, error) {
|
||||
return []byte(p.String()), nil
|
||||
}
|
||||
|
||||
func (p *NonconformityOrderField) UnmarshalText(text []byte) error {
|
||||
val := string(text)
|
||||
switch val {
|
||||
case string(NonconformityOrderFieldCreatedAt),
|
||||
string(NonconformityOrderFieldDateIdentified),
|
||||
string(NonconformityOrderFieldDueDate),
|
||||
string(NonconformityOrderFieldStatus),
|
||||
string(NonconformityOrderFieldReferenceId):
|
||||
*p = NonconformityOrderField(val)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("invalid NonconformityOrderField value: %q", val)
|
||||
}
|
||||
@@ -1,415 +0,0 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"maps"
|
||||
"time"
|
||||
|
||||
"github.com/getprobo/probo/pkg/gid"
|
||||
"github.com/getprobo/probo/pkg/page"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"go.gearno.de/kit/pg"
|
||||
)
|
||||
|
||||
type (
|
||||
NonconformityRegistry struct {
|
||||
ID gid.GID `db:"id"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
SnapshotID *gid.GID `db:"snapshot_id"`
|
||||
SourceID *gid.GID `db:"source_id"`
|
||||
ReferenceID string `db:"reference_id"`
|
||||
Description *string `db:"description"`
|
||||
AuditID gid.GID `db:"audit_id"`
|
||||
DateIdentified *time.Time `db:"date_identified"`
|
||||
RootCause string `db:"root_cause"`
|
||||
CorrectiveAction *string `db:"corrective_action"`
|
||||
OwnerID gid.GID `db:"owner_id"`
|
||||
DueDate *time.Time `db:"due_date"`
|
||||
Status NonconformityRegistryStatus `db:"status"`
|
||||
EffectivenessCheck *string `db:"effectiveness_check"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
NonconformityRegistries []*NonconformityRegistry
|
||||
)
|
||||
|
||||
func (nr *NonconformityRegistry) CursorKey(field NonconformityRegistryOrderField) page.CursorKey {
|
||||
switch field {
|
||||
case NonconformityRegistryOrderFieldCreatedAt:
|
||||
return page.NewCursorKey(nr.ID, nr.CreatedAt)
|
||||
case NonconformityRegistryOrderFieldDateIdentified:
|
||||
return page.NewCursorKey(nr.ID, nr.DateIdentified)
|
||||
case NonconformityRegistryOrderFieldDueDate:
|
||||
return page.NewCursorKey(nr.ID, nr.DueDate)
|
||||
case NonconformityRegistryOrderFieldStatus:
|
||||
return page.NewCursorKey(nr.ID, nr.Status)
|
||||
case NonconformityRegistryOrderFieldReferenceId:
|
||||
return page.NewCursorKey(nr.ID, nr.ReferenceID)
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf("unsupported order by: %s", field))
|
||||
}
|
||||
|
||||
func (nr *NonconformityRegistry) LoadByID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
nonconformityRegistryID gid.GID,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
reference_id,
|
||||
description,
|
||||
audit_id,
|
||||
date_identified,
|
||||
root_cause,
|
||||
corrective_action,
|
||||
owner_id,
|
||||
due_date,
|
||||
status,
|
||||
effectiveness_check,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
nonconformity_registries
|
||||
WHERE
|
||||
%s
|
||||
AND id = @nonconformity_registry_id
|
||||
LIMIT 1;
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"nonconformity_registry_id": nonconformityRegistryID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query nonconformity registry: %w", err)
|
||||
}
|
||||
|
||||
registry, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[NonconformityRegistry])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect nonconformity registry: %w", err)
|
||||
}
|
||||
|
||||
*nr = registry
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nrs *NonconformityRegistries) CountByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
filter *NonconformityRegistryFilter,
|
||||
) (int, error) {
|
||||
q := `
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM
|
||||
nonconformity_registries
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
|
||||
row := conn.QueryRow(ctx, q, args)
|
||||
|
||||
var count int
|
||||
err := row.Scan(&count)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("cannot count nonconformity registries: %w", err)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (nrs *NonconformityRegistries) LoadByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
cursor *page.Cursor[NonconformityRegistryOrderField],
|
||||
filter *NonconformityRegistryFilter,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
reference_id,
|
||||
description,
|
||||
audit_id,
|
||||
date_identified,
|
||||
root_cause,
|
||||
corrective_action,
|
||||
owner_id,
|
||||
due_date,
|
||||
status,
|
||||
effectiveness_check,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
nonconformity_registries
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment(), cursor.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
maps.Copy(args, cursor.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query nonconformity registries: %w", err)
|
||||
}
|
||||
|
||||
registries, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[NonconformityRegistry])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect nonconformity registries: %w", err)
|
||||
}
|
||||
|
||||
*nrs = registries
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nr *NonconformityRegistry) Insert(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
INSERT INTO nonconformity_registries (
|
||||
id,
|
||||
tenant_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
audit_id,
|
||||
date_identified,
|
||||
root_cause,
|
||||
corrective_action,
|
||||
owner_id,
|
||||
due_date,
|
||||
status,
|
||||
effectiveness_check,
|
||||
created_at,
|
||||
updated_at
|
||||
) VALUES (
|
||||
@id,
|
||||
@tenant_id,
|
||||
@organization_id,
|
||||
@reference_id,
|
||||
@description,
|
||||
@audit_id,
|
||||
@date_identified,
|
||||
@root_cause,
|
||||
@corrective_action,
|
||||
@owner_id,
|
||||
@due_date,
|
||||
@status,
|
||||
@effectiveness_check,
|
||||
@created_at,
|
||||
@updated_at
|
||||
)
|
||||
`
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": nr.ID,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"organization_id": nr.OrganizationID,
|
||||
"reference_id": nr.ReferenceID,
|
||||
"description": nr.Description,
|
||||
"audit_id": nr.AuditID,
|
||||
"date_identified": nr.DateIdentified,
|
||||
"root_cause": nr.RootCause,
|
||||
"corrective_action": nr.CorrectiveAction,
|
||||
"owner_id": nr.OwnerID,
|
||||
"due_date": nr.DueDate,
|
||||
"status": nr.Status,
|
||||
"effectiveness_check": nr.EffectivenessCheck,
|
||||
"created_at": nr.CreatedAt,
|
||||
"updated_at": nr.UpdatedAt,
|
||||
}
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert nonconformity registry: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nr *NonconformityRegistry) Update(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
UPDATE nonconformity_registries
|
||||
SET
|
||||
reference_id = @reference_id,
|
||||
description = @description,
|
||||
date_identified = @date_identified,
|
||||
root_cause = @root_cause,
|
||||
corrective_action = @corrective_action,
|
||||
due_date = @due_date,
|
||||
status = @status,
|
||||
effectiveness_check = @effectiveness_check,
|
||||
owner_id = @owner_id,
|
||||
audit_id = @audit_id,
|
||||
updated_at = @updated_at
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
AND snapshot_id IS NULL
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": nr.ID,
|
||||
"reference_id": nr.ReferenceID,
|
||||
"description": nr.Description,
|
||||
"date_identified": nr.DateIdentified,
|
||||
"root_cause": nr.RootCause,
|
||||
"corrective_action": nr.CorrectiveAction,
|
||||
"due_date": nr.DueDate,
|
||||
"status": nr.Status,
|
||||
"effectiveness_check": nr.EffectivenessCheck,
|
||||
"owner_id": nr.OwnerID,
|
||||
"audit_id": nr.AuditID,
|
||||
"updated_at": nr.UpdatedAt,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot update nonconformity registry: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nr *NonconformityRegistry) Delete(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
DELETE FROM nonconformity_registries
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id AND snapshot_id IS NULL
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"id": nr.ID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot delete nonconformity registry: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nrs NonconformityRegistries) Snapshot(ctx context.Context, conn pg.Conn, scope Scoper, organizationID, snapshotID gid.GID) error {
|
||||
query := `
|
||||
INSERT INTO nonconformity_registries (
|
||||
id,
|
||||
tenant_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
description,
|
||||
audit_id,
|
||||
date_identified,
|
||||
root_cause,
|
||||
corrective_action,
|
||||
owner_id,
|
||||
due_date,
|
||||
status,
|
||||
effectiveness_check,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
SELECT
|
||||
generate_gid(decode_base64_unpadded(@tenant_id), @nonconformity_registry_entity_type),
|
||||
@tenant_id,
|
||||
@snapshot_id,
|
||||
r.id,
|
||||
r.organization_id,
|
||||
r.reference_id,
|
||||
r.description,
|
||||
r.audit_id,
|
||||
r.date_identified,
|
||||
r.root_cause,
|
||||
r.corrective_action,
|
||||
r.owner_id,
|
||||
r.due_date,
|
||||
r.status,
|
||||
r.effectiveness_check,
|
||||
r.created_at,
|
||||
r.updated_at
|
||||
FROM nonconformity_registries r
|
||||
WHERE %s AND r.organization_id = @organization_id AND r.snapshot_id IS NULL
|
||||
`
|
||||
|
||||
query = fmt.Sprintf(query, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"snapshot_id": snapshotID,
|
||||
"organization_id": organizationID,
|
||||
"nonconformity_registry_entity_type": NonconformityRegistryEntityType,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, query, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert data snapshots: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type NonconformityRegistryOrderField string
|
||||
|
||||
const (
|
||||
NonconformityRegistryOrderFieldCreatedAt NonconformityRegistryOrderField = "CREATED_AT"
|
||||
NonconformityRegistryOrderFieldDateIdentified NonconformityRegistryOrderField = "DATE_IDENTIFIED"
|
||||
NonconformityRegistryOrderFieldDueDate NonconformityRegistryOrderField = "DUE_DATE"
|
||||
NonconformityRegistryOrderFieldStatus NonconformityRegistryOrderField = "STATUS"
|
||||
NonconformityRegistryOrderFieldReferenceId NonconformityRegistryOrderField = "REFERENCE_ID"
|
||||
)
|
||||
|
||||
func (p NonconformityRegistryOrderField) Column() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p NonconformityRegistryOrderField) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p NonconformityRegistryOrderField) MarshalText() ([]byte, error) {
|
||||
return []byte(p.String()), nil
|
||||
}
|
||||
|
||||
func (p *NonconformityRegistryOrderField) UnmarshalText(text []byte) error {
|
||||
val := string(text)
|
||||
switch val {
|
||||
case string(NonconformityRegistryOrderFieldCreatedAt),
|
||||
string(NonconformityRegistryOrderFieldDateIdentified),
|
||||
string(NonconformityRegistryOrderFieldDueDate),
|
||||
string(NonconformityRegistryOrderFieldStatus),
|
||||
string(NonconformityRegistryOrderFieldReferenceId):
|
||||
*p = NonconformityRegistryOrderField(val)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("invalid NonconformityRegistryOrderField value: %q", val)
|
||||
}
|
||||
@@ -19,19 +19,19 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ComplianceRegistryStatus string
|
||||
type NonconformityStatus string
|
||||
|
||||
const (
|
||||
ComplianceRegistryStatusOpen ComplianceRegistryStatus = "OPEN"
|
||||
ComplianceRegistryStatusInProgress ComplianceRegistryStatus = "IN_PROGRESS"
|
||||
ComplianceRegistryStatusClosed ComplianceRegistryStatus = "CLOSED"
|
||||
NonconformityStatusOpen NonconformityStatus = "OPEN"
|
||||
NonconformityStatusInProgress NonconformityStatus = "IN_PROGRESS"
|
||||
NonconformityStatusClosed NonconformityStatus = "CLOSED"
|
||||
)
|
||||
|
||||
func (crs ComplianceRegistryStatus) String() string {
|
||||
return string(crs)
|
||||
func (ncs NonconformityStatus) String() string {
|
||||
return string(ncs)
|
||||
}
|
||||
|
||||
func (crs *ComplianceRegistryStatus) Scan(value any) error {
|
||||
func (ncs *NonconformityStatus) Scan(value any) error {
|
||||
var s string
|
||||
switch v := value.(type) {
|
||||
case string:
|
||||
@@ -39,22 +39,22 @@ func (crs *ComplianceRegistryStatus) Scan(value any) error {
|
||||
case []byte:
|
||||
s = string(v)
|
||||
default:
|
||||
return fmt.Errorf("unsupported type for ComplianceRegistryStatus: %T", value)
|
||||
return fmt.Errorf("unsupported type for NonconformityStatus: %T", value)
|
||||
}
|
||||
|
||||
switch s {
|
||||
case "OPEN":
|
||||
*crs = ComplianceRegistryStatusOpen
|
||||
*ncs = NonconformityStatusOpen
|
||||
case "IN_PROGRESS":
|
||||
*crs = ComplianceRegistryStatusInProgress
|
||||
*ncs = NonconformityStatusInProgress
|
||||
case "CLOSED":
|
||||
*crs = ComplianceRegistryStatusClosed
|
||||
*ncs = NonconformityStatusClosed
|
||||
default:
|
||||
return fmt.Errorf("invalid ComplianceRegistryStatus value: %q", s)
|
||||
return fmt.Errorf("invalid NonconformityStatus value: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (crs ComplianceRegistryStatus) Value() (driver.Value, error) {
|
||||
return crs.String(), nil
|
||||
func (ncs NonconformityStatus) Value() (driver.Value, error) {
|
||||
return ncs.String(), nil
|
||||
}
|
||||
421
pkg/coredata/obligation.go
Normal file
421
pkg/coredata/obligation.go
Normal file
@@ -0,0 +1,421 @@
|
||||
// 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"
|
||||
"fmt"
|
||||
"maps"
|
||||
"time"
|
||||
|
||||
"github.com/getprobo/probo/pkg/gid"
|
||||
"github.com/getprobo/probo/pkg/page"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"go.gearno.de/kit/pg"
|
||||
)
|
||||
|
||||
type (
|
||||
Obligation struct {
|
||||
ID gid.GID `db:"id"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
ReferenceID string `db:"reference_id"`
|
||||
Area *string `db:"area"`
|
||||
Source *string `db:"source"`
|
||||
Requirement *string `db:"requirement"`
|
||||
ActionsToBeImplemented *string `db:"actions_to_be_implemented"`
|
||||
Regulator *string `db:"regulator"`
|
||||
OwnerID gid.GID `db:"owner_id"`
|
||||
LastReviewDate *time.Time `db:"last_review_date"`
|
||||
DueDate *time.Time `db:"due_date"`
|
||||
Status ObligationStatus `db:"status"`
|
||||
SnapshotID *gid.GID `db:"snapshot_id"`
|
||||
SourceID *gid.GID `db:"source_id"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
Obligations []*Obligation
|
||||
)
|
||||
|
||||
func (o *Obligation) CursorKey(field ObligationOrderField) page.CursorKey {
|
||||
switch field {
|
||||
case ObligationOrderFieldCreatedAt:
|
||||
return page.NewCursorKey(o.ID, o.CreatedAt)
|
||||
case ObligationOrderFieldLastReviewDate:
|
||||
return page.NewCursorKey(o.ID, o.LastReviewDate)
|
||||
case ObligationOrderFieldDueDate:
|
||||
return page.NewCursorKey(o.ID, o.DueDate)
|
||||
case ObligationOrderFieldStatus:
|
||||
return page.NewCursorKey(o.ID, o.Status)
|
||||
case ObligationOrderFieldReferenceId:
|
||||
return page.NewCursorKey(o.ID, o.ReferenceID)
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf("unsupported order by: %s", field))
|
||||
}
|
||||
|
||||
func (o *Obligation) LoadByID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
obligationID gid.GID,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
reference_id,
|
||||
area,
|
||||
source,
|
||||
requirement,
|
||||
actions_to_be_implemented,
|
||||
regulator,
|
||||
owner_id,
|
||||
last_review_date,
|
||||
due_date,
|
||||
status,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
obligations
|
||||
WHERE
|
||||
%s
|
||||
AND id = @obligation_id
|
||||
LIMIT 1;
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"obligation_id": obligationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query obligation: %w", err)
|
||||
}
|
||||
|
||||
obligation, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Obligation])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect obligation: %w", err)
|
||||
}
|
||||
|
||||
*o = obligation
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (os *Obligations) CountByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
filter *ObligationFilter,
|
||||
) (int, error) {
|
||||
q := `
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM
|
||||
obligations
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
|
||||
row := conn.QueryRow(ctx, q, args)
|
||||
|
||||
var count int
|
||||
err := row.Scan(&count)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("cannot count obligations: %w", err)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (os *Obligations) LoadByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
cursor *page.Cursor[ObligationOrderField],
|
||||
filter *ObligationFilter,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
area,
|
||||
source,
|
||||
requirement,
|
||||
actions_to_be_implemented,
|
||||
regulator,
|
||||
owner_id,
|
||||
last_review_date,
|
||||
due_date,
|
||||
status,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
obligations
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
AND %s
|
||||
AND %s
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment(), filter.SQLFragment(), cursor.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"organization_id": organizationID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
maps.Copy(args, filter.SQLArguments())
|
||||
maps.Copy(args, cursor.SQLArguments())
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query obligations: %w", err)
|
||||
}
|
||||
|
||||
obligations, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Obligation])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect obligations: %w", err)
|
||||
}
|
||||
|
||||
*os = obligations
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *Obligation) Insert(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
INSERT INTO obligations (
|
||||
id,
|
||||
tenant_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
area,
|
||||
source,
|
||||
requirement,
|
||||
actions_to_be_implemented,
|
||||
regulator,
|
||||
owner_id,
|
||||
last_review_date,
|
||||
due_date,
|
||||
status,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
created_at,
|
||||
updated_at
|
||||
) VALUES (
|
||||
@id,
|
||||
@tenant_id,
|
||||
@organization_id,
|
||||
@reference_id,
|
||||
@area,
|
||||
@source,
|
||||
@requirement,
|
||||
@actions_to_be_implemented,
|
||||
@regulator,
|
||||
@owner_id,
|
||||
@last_review_date,
|
||||
@due_date,
|
||||
@status,
|
||||
@snapshot_id,
|
||||
@source_id,
|
||||
@created_at,
|
||||
@updated_at
|
||||
)
|
||||
`
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": o.ID,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"organization_id": o.OrganizationID,
|
||||
"reference_id": o.ReferenceID,
|
||||
"area": o.Area,
|
||||
"source": o.Source,
|
||||
"requirement": o.Requirement,
|
||||
"actions_to_be_implemented": o.ActionsToBeImplemented,
|
||||
"regulator": o.Regulator,
|
||||
"owner_id": o.OwnerID,
|
||||
"last_review_date": o.LastReviewDate,
|
||||
"due_date": o.DueDate,
|
||||
"status": o.Status,
|
||||
"snapshot_id": o.SnapshotID,
|
||||
"source_id": o.SourceID,
|
||||
"created_at": o.CreatedAt,
|
||||
"updated_at": o.UpdatedAt,
|
||||
}
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert obligation: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *Obligation) Update(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
UPDATE obligations SET
|
||||
reference_id = @reference_id,
|
||||
area = @area,
|
||||
source = @source,
|
||||
requirement = @requirement,
|
||||
actions_to_be_implemented = @actions_to_be_implemented,
|
||||
regulator = @regulator,
|
||||
owner_id = @owner_id,
|
||||
last_review_date = @last_review_date,
|
||||
due_date = @due_date,
|
||||
status = @status,
|
||||
updated_at = @updated_at
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
AND snapshot_id IS NULL
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"id": o.ID,
|
||||
"reference_id": o.ReferenceID,
|
||||
"area": o.Area,
|
||||
"source": o.Source,
|
||||
"requirement": o.Requirement,
|
||||
"actions_to_be_implemented": o.ActionsToBeImplemented,
|
||||
"regulator": o.Regulator,
|
||||
"owner_id": o.OwnerID,
|
||||
"last_review_date": o.LastReviewDate,
|
||||
"due_date": o.DueDate,
|
||||
"status": o.Status,
|
||||
"updated_at": o.UpdatedAt,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot update obligation: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *Obligation) Delete(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
DELETE FROM obligations
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
AND snapshot_id IS NULL
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"id": o.ID}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot delete obligation: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (os Obligations) Snapshot(ctx context.Context, conn pg.Conn, scope Scoper, organizationID, snapshotID gid.GID) error {
|
||||
query := `
|
||||
INSERT INTO obligations (
|
||||
id,
|
||||
tenant_id,
|
||||
snapshot_id,
|
||||
source_id,
|
||||
organization_id,
|
||||
reference_id,
|
||||
area,
|
||||
source,
|
||||
requirement,
|
||||
actions_to_be_implemented,
|
||||
regulator,
|
||||
owner_id,
|
||||
last_review_date,
|
||||
due_date,
|
||||
status,
|
||||
created_at,
|
||||
updated_at
|
||||
)
|
||||
SELECT
|
||||
generate_gid(decode_base64_unpadded(@tenant_id), @obligation_entity_type),
|
||||
@tenant_id,
|
||||
@snapshot_id,
|
||||
o.id,
|
||||
o.organization_id,
|
||||
o.reference_id,
|
||||
o.area,
|
||||
o.source,
|
||||
o.requirement,
|
||||
o.actions_to_be_implemented,
|
||||
o.regulator,
|
||||
o.owner_id,
|
||||
o.last_review_date,
|
||||
o.due_date,
|
||||
o.status,
|
||||
o.created_at,
|
||||
o.updated_at
|
||||
FROM obligations o
|
||||
WHERE %s AND o.organization_id = @organization_id AND o.snapshot_id IS NULL
|
||||
`
|
||||
|
||||
query = fmt.Sprintf(query, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"snapshot_id": snapshotID,
|
||||
"organization_id": organizationID,
|
||||
"obligation_entity_type": ObligationEntityType,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, query, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert obligation snapshots: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -20,18 +20,18 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
ContinualImprovementRegistryFilter struct {
|
||||
ObligationFilter struct {
|
||||
snapshotID **gid.GID
|
||||
}
|
||||
)
|
||||
|
||||
func NewContinualImprovementRegistryFilter(snapshotID **gid.GID) *ContinualImprovementRegistryFilter {
|
||||
return &ContinualImprovementRegistryFilter{
|
||||
func NewObligationFilter(snapshotID **gid.GID) *ObligationFilter {
|
||||
return &ObligationFilter{
|
||||
snapshotID: snapshotID,
|
||||
}
|
||||
}
|
||||
|
||||
func (f *ContinualImprovementRegistryFilter) SQLArguments() pgx.NamedArgs {
|
||||
func (f *ObligationFilter) SQLArguments() pgx.NamedArgs {
|
||||
args := pgx.NamedArgs{}
|
||||
|
||||
if f.snapshotID != nil && *f.snapshotID != nil {
|
||||
@@ -41,7 +41,7 @@ func (f *ContinualImprovementRegistryFilter) SQLArguments() pgx.NamedArgs {
|
||||
return args
|
||||
}
|
||||
|
||||
func (f *ContinualImprovementRegistryFilter) SQLFragment() string {
|
||||
func (f *ObligationFilter) SQLFragment() string {
|
||||
if f.snapshotID == nil {
|
||||
return "TRUE"
|
||||
}
|
||||
55
pkg/coredata/obligation_order_field.go
Normal file
55
pkg/coredata/obligation_order_field.go
Normal file
@@ -0,0 +1,55 @@
|
||||
// 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 ObligationOrderField string
|
||||
|
||||
const (
|
||||
ObligationOrderFieldCreatedAt ObligationOrderField = "CREATED_AT"
|
||||
ObligationOrderFieldLastReviewDate ObligationOrderField = "LAST_REVIEW_DATE"
|
||||
ObligationOrderFieldDueDate ObligationOrderField = "DUE_DATE"
|
||||
ObligationOrderFieldStatus ObligationOrderField = "STATUS"
|
||||
ObligationOrderFieldReferenceId ObligationOrderField = "REFERENCE_ID"
|
||||
)
|
||||
|
||||
func (p ObligationOrderField) Column() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p ObligationOrderField) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p ObligationOrderField) MarshalText() ([]byte, error) {
|
||||
return []byte(p.String()), nil
|
||||
}
|
||||
|
||||
func (p *ObligationOrderField) UnmarshalText(text []byte) error {
|
||||
val := string(text)
|
||||
switch val {
|
||||
case string(ObligationOrderFieldCreatedAt),
|
||||
string(ObligationOrderFieldLastReviewDate),
|
||||
string(ObligationOrderFieldDueDate),
|
||||
string(ObligationOrderFieldStatus),
|
||||
string(ObligationOrderFieldReferenceId):
|
||||
*p = ObligationOrderField(val)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("invalid ObligationOrderField value: %q", val)
|
||||
}
|
||||
@@ -19,19 +19,19 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ContinualImprovementRegistriesStatus string
|
||||
type ObligationStatus string
|
||||
|
||||
const (
|
||||
ContinualImprovementRegistriesStatusOpen ContinualImprovementRegistriesStatus = "OPEN"
|
||||
ContinualImprovementRegistriesStatusInProgress ContinualImprovementRegistriesStatus = "IN_PROGRESS"
|
||||
ContinualImprovementRegistriesStatusClosed ContinualImprovementRegistriesStatus = "CLOSED"
|
||||
ObligationStatusOpen ObligationStatus = "OPEN"
|
||||
ObligationStatusInProgress ObligationStatus = "IN_PROGRESS"
|
||||
ObligationStatusClosed ObligationStatus = "CLOSED"
|
||||
)
|
||||
|
||||
func (cirs ContinualImprovementRegistriesStatus) String() string {
|
||||
return string(cirs)
|
||||
func (os ObligationStatus) String() string {
|
||||
return string(os)
|
||||
}
|
||||
|
||||
func (cirs *ContinualImprovementRegistriesStatus) Scan(value any) error {
|
||||
func (os *ObligationStatus) Scan(value any) error {
|
||||
var s string
|
||||
switch v := value.(type) {
|
||||
case string:
|
||||
@@ -39,22 +39,22 @@ func (cirs *ContinualImprovementRegistriesStatus) Scan(value any) error {
|
||||
case []byte:
|
||||
s = string(v)
|
||||
default:
|
||||
return fmt.Errorf("unsupported type for ContinualImprovementRegistriesStatus: %T", value)
|
||||
return fmt.Errorf("unsupported type for ObligationStatus: %T", value)
|
||||
}
|
||||
|
||||
switch s {
|
||||
case "OPEN":
|
||||
*cirs = ContinualImprovementRegistriesStatusOpen
|
||||
*os = ObligationStatusOpen
|
||||
case "IN_PROGRESS":
|
||||
*cirs = ContinualImprovementRegistriesStatusInProgress
|
||||
*os = ObligationStatusInProgress
|
||||
case "CLOSED":
|
||||
*cirs = ContinualImprovementRegistriesStatusClosed
|
||||
*os = ObligationStatusClosed
|
||||
default:
|
||||
return fmt.Errorf("invalid ContinualImprovementRegistriesStatus value: %q", s)
|
||||
return fmt.Errorf("invalid ObligationStatus value: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cirs ContinualImprovementRegistriesStatus) Value() (driver.Value, error) {
|
||||
return cirs.String(), nil
|
||||
func (os ObligationStatus) Value() (driver.Value, error) {
|
||||
return os.String(), nil
|
||||
}
|
||||
@@ -27,49 +27,49 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
ProcessingActivityRegistry struct {
|
||||
ID gid.GID `db:"id"`
|
||||
SnapshotID *gid.GID `db:"snapshot_id"`
|
||||
SourceID *gid.GID `db:"source_id"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
Name string `db:"name"`
|
||||
Purpose *string `db:"purpose"`
|
||||
DataSubjectCategory *string `db:"data_subject_category"`
|
||||
PersonalDataCategory *string `db:"personal_data_category"`
|
||||
SpecialOrCriminalData ProcessingActivityRegistrySpecialOrCriminalData `db:"special_or_criminal_data"`
|
||||
ConsentEvidenceLink *string `db:"consent_evidence_link"`
|
||||
LawfulBasis ProcessingActivityRegistryLawfulBasis `db:"lawful_basis"`
|
||||
Recipients *string `db:"recipients"`
|
||||
Location *string `db:"location"`
|
||||
InternationalTransfers bool `db:"international_transfers"`
|
||||
TransferSafeguards *ProcessingActivityRegistryTransferSafeguards `db:"transfer_safeguards"`
|
||||
RetentionPeriod *string `db:"retention_period"`
|
||||
SecurityMeasures *string `db:"security_measures"`
|
||||
DataProtectionImpactAssessment ProcessingActivityRegistryDataProtectionImpactAssessment `db:"data_protection_impact_assessment"`
|
||||
TransferImpactAssessment ProcessingActivityRegistryTransferImpactAssessment `db:"transfer_impact_assessment"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
ProcessingActivity struct {
|
||||
ID gid.GID `db:"id"`
|
||||
SnapshotID *gid.GID `db:"snapshot_id"`
|
||||
SourceID *gid.GID `db:"source_id"`
|
||||
OrganizationID gid.GID `db:"organization_id"`
|
||||
Name string `db:"name"`
|
||||
Purpose *string `db:"purpose"`
|
||||
DataSubjectCategory *string `db:"data_subject_category"`
|
||||
PersonalDataCategory *string `db:"personal_data_category"`
|
||||
SpecialOrCriminalData ProcessingActivitySpecialOrCriminalData `db:"special_or_criminal_data"`
|
||||
ConsentEvidenceLink *string `db:"consent_evidence_link"`
|
||||
LawfulBasis ProcessingActivityLawfulBasis `db:"lawful_basis"`
|
||||
Recipients *string `db:"recipients"`
|
||||
Location *string `db:"location"`
|
||||
InternationalTransfers bool `db:"international_transfers"`
|
||||
TransferSafeguards *ProcessingActivityTransferSafeguards `db:"transfer_safeguards"`
|
||||
RetentionPeriod *string `db:"retention_period"`
|
||||
SecurityMeasures *string `db:"security_measures"`
|
||||
DataProtectionImpactAssessment ProcessingActivityDataProtectionImpactAssessment `db:"data_protection_impact_assessment"`
|
||||
TransferImpactAssessment ProcessingActivityTransferImpactAssessment `db:"transfer_impact_assessment"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
ProcessingActivityRegistries []*ProcessingActivityRegistry
|
||||
ProcessingActivities []*ProcessingActivity
|
||||
)
|
||||
|
||||
func (p *ProcessingActivityRegistry) CursorKey(field ProcessingActivityRegistryOrderField) page.CursorKey {
|
||||
func (p *ProcessingActivity) CursorKey(field ProcessingActivityOrderField) page.CursorKey {
|
||||
switch field {
|
||||
case ProcessingActivityRegistryOrderFieldCreatedAt:
|
||||
case ProcessingActivityOrderFieldCreatedAt:
|
||||
return page.NewCursorKey(p.ID, p.CreatedAt)
|
||||
case ProcessingActivityRegistryOrderFieldName:
|
||||
case ProcessingActivityOrderFieldName:
|
||||
return page.NewCursorKey(p.ID, p.Name)
|
||||
}
|
||||
|
||||
panic(fmt.Sprintf("unsupported order by: %s", field))
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistry) LoadByID(
|
||||
func (p *ProcessingActivity) LoadByID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
processingActivityRegistryID gid.GID,
|
||||
processingActivityID gid.GID,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
@@ -95,45 +95,45 @@ SELECT
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
processing_activity_registries
|
||||
processing_activities
|
||||
WHERE
|
||||
%s
|
||||
AND id = @processing_activity_registry_id
|
||||
AND id = @processing_activity_id
|
||||
LIMIT 1;
|
||||
`
|
||||
|
||||
q = fmt.Sprintf(q, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{"processing_activity_registry_id": processingActivityRegistryID}
|
||||
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 registry: %w", err)
|
||||
return fmt.Errorf("cannot query processing activity: %w", err)
|
||||
}
|
||||
|
||||
processingActivityRegistry, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ProcessingActivityRegistry])
|
||||
processingActivity, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[ProcessingActivity])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect processing activity registry: %w", err)
|
||||
return fmt.Errorf("cannot collect processing activity: %w", err)
|
||||
}
|
||||
|
||||
*p = processingActivityRegistry
|
||||
*p = processingActivity
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistries) CountByOrganizationID(
|
||||
func (p *ProcessingActivities) CountByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
filter *ProcessingActivityRegistryFilter,
|
||||
filter *ProcessingActivityFilter,
|
||||
) (int, error) {
|
||||
q := `
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM
|
||||
processing_activity_registries
|
||||
processing_activities
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
@@ -151,19 +151,19 @@ WHERE
|
||||
var count int
|
||||
err := row.Scan(&count)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("cannot count processing activity registries: %w", err)
|
||||
return 0, fmt.Errorf("cannot count processing activities: %w", err)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistries) LoadByOrganizationID(
|
||||
func (p *ProcessingActivities) LoadByOrganizationID(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
organizationID gid.GID,
|
||||
cursor *page.Cursor[ProcessingActivityRegistryOrderField],
|
||||
filter *ProcessingActivityRegistryFilter,
|
||||
cursor *page.Cursor[ProcessingActivityOrderField],
|
||||
filter *ProcessingActivityFilter,
|
||||
) error {
|
||||
q := `
|
||||
SELECT
|
||||
@@ -189,7 +189,7 @@ SELECT
|
||||
created_at,
|
||||
updated_at
|
||||
FROM
|
||||
processing_activity_registries
|
||||
processing_activities
|
||||
WHERE
|
||||
%s
|
||||
AND organization_id = @organization_id
|
||||
@@ -206,26 +206,26 @@ WHERE
|
||||
|
||||
rows, err := conn.Query(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot query processing activity registries: %w", err)
|
||||
return fmt.Errorf("cannot query processing activities: %w", err)
|
||||
}
|
||||
|
||||
processingActivityRegistries, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ProcessingActivityRegistry])
|
||||
processingActivities, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[ProcessingActivity])
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot collect processing activity registries: %w", err)
|
||||
return fmt.Errorf("cannot collect processing activities: %w", err)
|
||||
}
|
||||
|
||||
*p = processingActivityRegistries
|
||||
*p = processingActivities
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistry) Insert(
|
||||
func (p *ProcessingActivity) Insert(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
INSERT INTO processing_activity_registries (
|
||||
INSERT INTO processing_activities (
|
||||
id,
|
||||
tenant_id,
|
||||
snapshot_id,
|
||||
@@ -301,19 +301,19 @@ INSERT INTO processing_activity_registries (
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert processing activity registry: %w", err)
|
||||
return fmt.Errorf("cannot insert processing activity: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistry) Update(
|
||||
func (p *ProcessingActivity) Update(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
UPDATE processing_activity_registries
|
||||
UPDATE processing_activities
|
||||
SET
|
||||
name = @name,
|
||||
purpose = @purpose,
|
||||
@@ -362,19 +362,19 @@ WHERE
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot update processing activity registry: %w", err)
|
||||
return fmt.Errorf("cannot update processing activity: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistry) Delete(
|
||||
func (p *ProcessingActivity) Delete(
|
||||
ctx context.Context,
|
||||
conn pg.Conn,
|
||||
scope Scoper,
|
||||
) error {
|
||||
q := `
|
||||
DELETE FROM processing_activity_registries
|
||||
DELETE FROM processing_activities
|
||||
WHERE
|
||||
%s
|
||||
AND id = @id
|
||||
@@ -388,15 +388,15 @@ WHERE
|
||||
|
||||
_, err := conn.Exec(ctx, q, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot delete processing activity registry: %w", err)
|
||||
return fmt.Errorf("cannot delete processing activity: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (pars ProcessingActivityRegistries) Snapshot(ctx context.Context, conn pg.Conn, scope Scoper, organizationID, snapshotID gid.GID) error {
|
||||
func (pas ProcessingActivities) Snapshot(ctx context.Context, conn pg.Conn, scope Scoper, organizationID, snapshotID gid.GID) error {
|
||||
query := `
|
||||
INSERT INTO processing_activity_registries (
|
||||
INSERT INTO processing_activities (
|
||||
id,
|
||||
tenant_id,
|
||||
snapshot_id,
|
||||
@@ -421,7 +421,7 @@ INSERT INTO processing_activity_registries (
|
||||
updated_at
|
||||
)
|
||||
SELECT
|
||||
generate_gid(decode_base64_unpadded(@tenant_id), @processing_activity_registry_entity_type),
|
||||
generate_gid(decode_base64_unpadded(@tenant_id), @processing_activity_entity_type),
|
||||
@tenant_id,
|
||||
@snapshot_id,
|
||||
par.id,
|
||||
@@ -443,23 +443,23 @@ SELECT
|
||||
par.transfer_impact_assessment,
|
||||
par.created_at,
|
||||
par.updated_at
|
||||
FROM processing_activity_registries par
|
||||
FROM processing_activities par
|
||||
WHERE %s AND par.organization_id = @organization_id AND par.snapshot_id IS NULL
|
||||
`
|
||||
|
||||
query = fmt.Sprintf(query, scope.SQLFragment())
|
||||
|
||||
args := pgx.StrictNamedArgs{
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"snapshot_id": snapshotID,
|
||||
"organization_id": organizationID,
|
||||
"processing_activity_registry_entity_type": ProcessingActivityRegistryEntityType,
|
||||
"tenant_id": scope.GetTenantID(),
|
||||
"snapshot_id": snapshotID,
|
||||
"organization_id": organizationID,
|
||||
"processing_activity_entity_type": ProcessingActivityEntityType,
|
||||
}
|
||||
maps.Copy(args, scope.SQLArguments())
|
||||
|
||||
_, err := conn.Exec(ctx, query, args)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot insert processing activity registry snapshots: %w", err)
|
||||
return fmt.Errorf("cannot insert processing activity snapshots: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -19,18 +19,18 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ProcessingActivityRegistryTransferImpactAssessment string
|
||||
type ProcessingActivityDataProtectionImpactAssessment string
|
||||
|
||||
const (
|
||||
ProcessingActivityRegistryTransferImpactAssessmentNeeded ProcessingActivityRegistryTransferImpactAssessment = "NEEDED"
|
||||
ProcessingActivityRegistryTransferImpactAssessmentNotNeeded ProcessingActivityRegistryTransferImpactAssessment = "NOT_NEEDED"
|
||||
ProcessingActivityDataProtectionImpactAssessmentNeeded ProcessingActivityDataProtectionImpactAssessment = "NEEDED"
|
||||
ProcessingActivityDataProtectionImpactAssessmentNotNeeded ProcessingActivityDataProtectionImpactAssessment = "NOT_NEEDED"
|
||||
)
|
||||
|
||||
func (p ProcessingActivityRegistryTransferImpactAssessment) String() string {
|
||||
func (p ProcessingActivityDataProtectionImpactAssessment) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistryTransferImpactAssessment) Scan(value any) error {
|
||||
func (p *ProcessingActivityDataProtectionImpactAssessment) Scan(value any) error {
|
||||
var s string
|
||||
switch v := value.(type) {
|
||||
case string:
|
||||
@@ -38,20 +38,20 @@ func (p *ProcessingActivityRegistryTransferImpactAssessment) Scan(value any) err
|
||||
case []byte:
|
||||
s = string(v)
|
||||
default:
|
||||
return fmt.Errorf("unsupported type for ProcessingActivityRegistryTransferImpactAssessment: %T", value)
|
||||
return fmt.Errorf("unsupported type for ProcessingActivityDataProtectionImpactAssessment: %T", value)
|
||||
}
|
||||
|
||||
switch s {
|
||||
case "NEEDED":
|
||||
*p = ProcessingActivityRegistryTransferImpactAssessmentNeeded
|
||||
*p = ProcessingActivityDataProtectionImpactAssessmentNeeded
|
||||
case "NOT_NEEDED":
|
||||
*p = ProcessingActivityRegistryTransferImpactAssessmentNotNeeded
|
||||
*p = ProcessingActivityDataProtectionImpactAssessmentNotNeeded
|
||||
default:
|
||||
return fmt.Errorf("invalid ProcessingActivityRegistryTransferImpactAssessment value: %q", s)
|
||||
return fmt.Errorf("invalid ProcessingActivityDataProtectionImpactAssessment value: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p ProcessingActivityRegistryTransferImpactAssessment) Value() (driver.Value, error) {
|
||||
func (p ProcessingActivityDataProtectionImpactAssessment) Value() (driver.Value, error) {
|
||||
return p.String(), nil
|
||||
}
|
||||
@@ -20,18 +20,18 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
ComplianceRegistryFilter struct {
|
||||
ProcessingActivityFilter struct {
|
||||
snapshotID **gid.GID
|
||||
}
|
||||
)
|
||||
|
||||
func NewComplianceRegistryFilter(snapshotID **gid.GID) *ComplianceRegistryFilter {
|
||||
return &ComplianceRegistryFilter{
|
||||
func NewProcessingActivityFilter(snapshotID **gid.GID) *ProcessingActivityFilter {
|
||||
return &ProcessingActivityFilter{
|
||||
snapshotID: snapshotID,
|
||||
}
|
||||
}
|
||||
|
||||
func (f *ComplianceRegistryFilter) SQLArguments() pgx.NamedArgs {
|
||||
func (f *ProcessingActivityFilter) SQLArguments() pgx.NamedArgs {
|
||||
args := pgx.NamedArgs{}
|
||||
|
||||
if f.snapshotID != nil && *f.snapshotID != nil {
|
||||
@@ -41,7 +41,7 @@ func (f *ComplianceRegistryFilter) SQLArguments() pgx.NamedArgs {
|
||||
return args
|
||||
}
|
||||
|
||||
func (f *ComplianceRegistryFilter) SQLFragment() string {
|
||||
func (f *ProcessingActivityFilter) SQLFragment() string {
|
||||
if f.snapshotID == nil {
|
||||
return "TRUE"
|
||||
}
|
||||
69
pkg/coredata/processing_activity_lawful_basis.go
Normal file
69
pkg/coredata/processing_activity_lawful_basis.go
Normal file
@@ -0,0 +1,69 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ProcessingActivityLawfulBasis string
|
||||
|
||||
const (
|
||||
ProcessingActivityLawfulBasisLegitimateInterest ProcessingActivityLawfulBasis = "LEGITIMATE_INTEREST"
|
||||
ProcessingActivityLawfulBasisConsent ProcessingActivityLawfulBasis = "CONSENT"
|
||||
ProcessingActivityLawfulBasisContractualNecessity ProcessingActivityLawfulBasis = "CONTRACTUAL_NECESSITY"
|
||||
ProcessingActivityLawfulBasisLegalObligation ProcessingActivityLawfulBasis = "LEGAL_OBLIGATION"
|
||||
ProcessingActivityLawfulBasisVitalInterests ProcessingActivityLawfulBasis = "VITAL_INTERESTS"
|
||||
ProcessingActivityLawfulBasisPublicTask ProcessingActivityLawfulBasis = "PUBLIC_TASK"
|
||||
)
|
||||
|
||||
func (p ProcessingActivityLawfulBasis) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityLawfulBasis) 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 ProcessingActivityLawfulBasis: %T", value)
|
||||
}
|
||||
|
||||
switch s {
|
||||
case "LEGITIMATE_INTEREST":
|
||||
*p = ProcessingActivityLawfulBasisLegitimateInterest
|
||||
case "CONSENT":
|
||||
*p = ProcessingActivityLawfulBasisConsent
|
||||
case "CONTRACTUAL_NECESSITY":
|
||||
*p = ProcessingActivityLawfulBasisContractualNecessity
|
||||
case "LEGAL_OBLIGATION":
|
||||
*p = ProcessingActivityLawfulBasisLegalObligation
|
||||
case "VITAL_INTERESTS":
|
||||
*p = ProcessingActivityLawfulBasisVitalInterests
|
||||
case "PUBLIC_TASK":
|
||||
*p = ProcessingActivityLawfulBasisPublicTask
|
||||
default:
|
||||
return fmt.Errorf("invalid ProcessingActivityLawfulBasis value: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p ProcessingActivityLawfulBasis) Value() (driver.Value, error) {
|
||||
return p.String(), nil
|
||||
}
|
||||
@@ -18,32 +18,32 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ProcessingActivityRegistryOrderField string
|
||||
type ProcessingActivityOrderField string
|
||||
|
||||
const (
|
||||
ProcessingActivityRegistryOrderFieldCreatedAt ProcessingActivityRegistryOrderField = "CREATED_AT"
|
||||
ProcessingActivityRegistryOrderFieldName ProcessingActivityRegistryOrderField = "NAME"
|
||||
ProcessingActivityOrderFieldCreatedAt ProcessingActivityOrderField = "CREATED_AT"
|
||||
ProcessingActivityOrderFieldName ProcessingActivityOrderField = "NAME"
|
||||
)
|
||||
|
||||
func (p ProcessingActivityRegistryOrderField) Column() string {
|
||||
func (p ProcessingActivityOrderField) Column() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p ProcessingActivityRegistryOrderField) String() string {
|
||||
func (p ProcessingActivityOrderField) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p ProcessingActivityRegistryOrderField) MarshalText() ([]byte, error) {
|
||||
func (p ProcessingActivityOrderField) MarshalText() ([]byte, error) {
|
||||
return []byte(p.String()), nil
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistryOrderField) UnmarshalText(text []byte) error {
|
||||
func (p *ProcessingActivityOrderField) UnmarshalText(text []byte) error {
|
||||
val := string(text)
|
||||
switch val {
|
||||
case string(ProcessingActivityRegistryOrderFieldCreatedAt),
|
||||
string(ProcessingActivityRegistryOrderFieldName):
|
||||
*p = ProcessingActivityRegistryOrderField(val)
|
||||
case string(ProcessingActivityOrderFieldCreatedAt),
|
||||
string(ProcessingActivityOrderFieldName):
|
||||
*p = ProcessingActivityOrderField(val)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("invalid ProcessingActivityRegistryOrderField value: %q", val)
|
||||
return fmt.Errorf("invalid ProcessingActivityOrderField value: %q", val)
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ProcessingActivityRegistryLawfulBasis string
|
||||
|
||||
const (
|
||||
ProcessingActivityRegistryLawfulBasisLegitimateInterest ProcessingActivityRegistryLawfulBasis = "LEGITIMATE_INTEREST"
|
||||
ProcessingActivityRegistryLawfulBasisConsent ProcessingActivityRegistryLawfulBasis = "CONSENT"
|
||||
ProcessingActivityRegistryLawfulBasisContractualNecessity ProcessingActivityRegistryLawfulBasis = "CONTRACTUAL_NECESSITY"
|
||||
ProcessingActivityRegistryLawfulBasisLegalObligation ProcessingActivityRegistryLawfulBasis = "LEGAL_OBLIGATION"
|
||||
ProcessingActivityRegistryLawfulBasisVitalInterests ProcessingActivityRegistryLawfulBasis = "VITAL_INTERESTS"
|
||||
ProcessingActivityRegistryLawfulBasisPublicTask ProcessingActivityRegistryLawfulBasis = "PUBLIC_TASK"
|
||||
)
|
||||
|
||||
func (p ProcessingActivityRegistryLawfulBasis) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistryLawfulBasis) 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 ProcessingActivityRegistryLawfulBasis: %T", value)
|
||||
}
|
||||
|
||||
switch s {
|
||||
case "LEGITIMATE_INTEREST":
|
||||
*p = ProcessingActivityRegistryLawfulBasisLegitimateInterest
|
||||
case "CONSENT":
|
||||
*p = ProcessingActivityRegistryLawfulBasisConsent
|
||||
case "CONTRACTUAL_NECESSITY":
|
||||
*p = ProcessingActivityRegistryLawfulBasisContractualNecessity
|
||||
case "LEGAL_OBLIGATION":
|
||||
*p = ProcessingActivityRegistryLawfulBasisLegalObligation
|
||||
case "VITAL_INTERESTS":
|
||||
*p = ProcessingActivityRegistryLawfulBasisVitalInterests
|
||||
case "PUBLIC_TASK":
|
||||
*p = ProcessingActivityRegistryLawfulBasisPublicTask
|
||||
default:
|
||||
return fmt.Errorf("invalid ProcessingActivityRegistryLawfulBasis value: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p ProcessingActivityRegistryLawfulBasis) Value() (driver.Value, error) {
|
||||
return p.String(), nil
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package coredata
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ProcessingActivityRegistryTransferSafeguards string
|
||||
|
||||
const (
|
||||
ProcessingActivityRegistryTransferSafeguardsStandardContractualClauses ProcessingActivityRegistryTransferSafeguards = "STANDARD_CONTRACTUAL_CLAUSES"
|
||||
ProcessingActivityRegistryTransferSafeguardsBindingCorporateRules ProcessingActivityRegistryTransferSafeguards = "BINDING_CORPORATE_RULES"
|
||||
ProcessingActivityRegistryTransferSafeguardsAdequacyDecision ProcessingActivityRegistryTransferSafeguards = "ADEQUACY_DECISION"
|
||||
ProcessingActivityRegistryTransferSafeguardsDerogations ProcessingActivityRegistryTransferSafeguards = "DEROGATIONS"
|
||||
ProcessingActivityRegistryTransferSafeguardsCodesOfConduct ProcessingActivityRegistryTransferSafeguards = "CODES_OF_CONDUCT"
|
||||
ProcessingActivityRegistryTransferSafeguardsCertificationMechanisms ProcessingActivityRegistryTransferSafeguards = "CERTIFICATION_MECHANISMS"
|
||||
)
|
||||
|
||||
func (p ProcessingActivityRegistryTransferSafeguards) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistryTransferSafeguards) 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 ProcessingActivityRegistryTransferSafeguards: %T", value)
|
||||
}
|
||||
|
||||
switch s {
|
||||
case "STANDARD_CONTRACTUAL_CLAUSES":
|
||||
*p = ProcessingActivityRegistryTransferSafeguardsStandardContractualClauses
|
||||
case "BINDING_CORPORATE_RULES":
|
||||
*p = ProcessingActivityRegistryTransferSafeguardsBindingCorporateRules
|
||||
case "ADEQUACY_DECISION":
|
||||
*p = ProcessingActivityRegistryTransferSafeguardsAdequacyDecision
|
||||
case "DEROGATIONS":
|
||||
*p = ProcessingActivityRegistryTransferSafeguardsDerogations
|
||||
case "CODES_OF_CONDUCT":
|
||||
*p = ProcessingActivityRegistryTransferSafeguardsCodesOfConduct
|
||||
case "CERTIFICATION_MECHANISMS":
|
||||
*p = ProcessingActivityRegistryTransferSafeguardsCertificationMechanisms
|
||||
default:
|
||||
return fmt.Errorf("invalid ProcessingActivityRegistryTransferSafeguards value: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p ProcessingActivityRegistryTransferSafeguards) Value() (driver.Value, error) {
|
||||
return p.String(), nil
|
||||
}
|
||||
@@ -19,19 +19,19 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ProcessingActivityRegistrySpecialOrCriminalData string
|
||||
type ProcessingActivitySpecialOrCriminalData string
|
||||
|
||||
const (
|
||||
ProcessingActivityRegistrySpecialOrCriminalDataYes ProcessingActivityRegistrySpecialOrCriminalData = "YES"
|
||||
ProcessingActivityRegistrySpecialOrCriminalDataNo ProcessingActivityRegistrySpecialOrCriminalData = "NO"
|
||||
ProcessingActivityRegistrySpecialOrCriminalDataPossible ProcessingActivityRegistrySpecialOrCriminalData = "POSSIBLE"
|
||||
ProcessingActivitySpecialOrCriminalDataYes ProcessingActivitySpecialOrCriminalData = "YES"
|
||||
ProcessingActivitySpecialOrCriminalDataNo ProcessingActivitySpecialOrCriminalData = "NO"
|
||||
ProcessingActivitySpecialOrCriminalDataPossible ProcessingActivitySpecialOrCriminalData = "POSSIBLE"
|
||||
)
|
||||
|
||||
func (p ProcessingActivityRegistrySpecialOrCriminalData) String() string {
|
||||
func (p ProcessingActivitySpecialOrCriminalData) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistrySpecialOrCriminalData) Scan(value any) error {
|
||||
func (p *ProcessingActivitySpecialOrCriminalData) Scan(value any) error {
|
||||
var s string
|
||||
switch v := value.(type) {
|
||||
case string:
|
||||
@@ -39,22 +39,22 @@ func (p *ProcessingActivityRegistrySpecialOrCriminalData) Scan(value any) error
|
||||
case []byte:
|
||||
s = string(v)
|
||||
default:
|
||||
return fmt.Errorf("unsupported type for ProcessingActivityRegistrySpecialOrCriminalData: %T", value)
|
||||
return fmt.Errorf("unsupported type for ProcessingActivitySpecialOrCriminalData: %T", value)
|
||||
}
|
||||
|
||||
switch s {
|
||||
case "YES":
|
||||
*p = ProcessingActivityRegistrySpecialOrCriminalDataYes
|
||||
*p = ProcessingActivitySpecialOrCriminalDataYes
|
||||
case "NO":
|
||||
*p = ProcessingActivityRegistrySpecialOrCriminalDataNo
|
||||
*p = ProcessingActivitySpecialOrCriminalDataNo
|
||||
case "POSSIBLE":
|
||||
*p = ProcessingActivityRegistrySpecialOrCriminalDataPossible
|
||||
*p = ProcessingActivitySpecialOrCriminalDataPossible
|
||||
default:
|
||||
return fmt.Errorf("invalid ProcessingActivityRegistrySpecialOrCriminalData value: %q", s)
|
||||
return fmt.Errorf("invalid ProcessingActivitySpecialOrCriminalData value: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p ProcessingActivityRegistrySpecialOrCriminalData) Value() (driver.Value, error) {
|
||||
func (p ProcessingActivitySpecialOrCriminalData) Value() (driver.Value, error) {
|
||||
return p.String(), nil
|
||||
}
|
||||
@@ -19,18 +19,18 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ProcessingActivityRegistryDataProtectionImpactAssessment string
|
||||
type ProcessingActivityTransferImpactAssessment string
|
||||
|
||||
const (
|
||||
ProcessingActivityRegistryDataProtectionImpactAssessmentNeeded ProcessingActivityRegistryDataProtectionImpactAssessment = "NEEDED"
|
||||
ProcessingActivityRegistryDataProtectionImpactAssessmentNotNeeded ProcessingActivityRegistryDataProtectionImpactAssessment = "NOT_NEEDED"
|
||||
ProcessingActivityTransferImpactAssessmentNeeded ProcessingActivityTransferImpactAssessment = "NEEDED"
|
||||
ProcessingActivityTransferImpactAssessmentNotNeeded ProcessingActivityTransferImpactAssessment = "NOT_NEEDED"
|
||||
)
|
||||
|
||||
func (p ProcessingActivityRegistryDataProtectionImpactAssessment) String() string {
|
||||
func (p ProcessingActivityTransferImpactAssessment) String() string {
|
||||
return string(p)
|
||||
}
|
||||
|
||||
func (p *ProcessingActivityRegistryDataProtectionImpactAssessment) Scan(value any) error {
|
||||
func (p *ProcessingActivityTransferImpactAssessment) Scan(value any) error {
|
||||
var s string
|
||||
switch v := value.(type) {
|
||||
case string:
|
||||
@@ -38,20 +38,20 @@ func (p *ProcessingActivityRegistryDataProtectionImpactAssessment) Scan(value an
|
||||
case []byte:
|
||||
s = string(v)
|
||||
default:
|
||||
return fmt.Errorf("unsupported type for ProcessingActivityRegistryDataProtectionImpactAssessment: %T", value)
|
||||
return fmt.Errorf("unsupported type for ProcessingActivityTransferImpactAssessment: %T", value)
|
||||
}
|
||||
|
||||
switch s {
|
||||
case "NEEDED":
|
||||
*p = ProcessingActivityRegistryDataProtectionImpactAssessmentNeeded
|
||||
*p = ProcessingActivityTransferImpactAssessmentNeeded
|
||||
case "NOT_NEEDED":
|
||||
*p = ProcessingActivityRegistryDataProtectionImpactAssessmentNotNeeded
|
||||
*p = ProcessingActivityTransferImpactAssessmentNotNeeded
|
||||
default:
|
||||
return fmt.Errorf("invalid ProcessingActivityRegistryDataProtectionImpactAssessment value: %q", s)
|
||||
return fmt.Errorf("invalid ProcessingActivityTransferImpactAssessment value: %q", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p ProcessingActivityRegistryDataProtectionImpactAssessment) Value() (driver.Value, error) {
|
||||
func (p ProcessingActivityTransferImpactAssessment) Value() (driver.Value, error) {
|
||||
return p.String(), nil
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user