diff --git a/apps/console/src/__generated__/core/AssetsListQuery.graphql.ts b/apps/console/src/__generated__/core/AssetsListQuery.graphql.ts index 74bc9884d..06c3d196c 100644 --- a/apps/console/src/__generated__/core/AssetsListQuery.graphql.ts +++ b/apps/console/src/__generated__/core/AssetsListQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<13d2dd64b5963f27b35077c80106abfb>> * @lightSyntaxTransform * @nogrep */ @@ -269,7 +269,7 @@ return { { "alias": null, "args": null, - "concreteType": "People", + "concreteType": "Profile", "kind": "LinkedField", "name": "owner", "plural": false, diff --git a/apps/console/src/__generated__/core/AssetsPageFragment.graphql.ts b/apps/console/src/__generated__/core/AssetsPageFragment.graphql.ts index 29d316617..4d7885f13 100644 --- a/apps/console/src/__generated__/core/AssetsPageFragment.graphql.ts +++ b/apps/console/src/__generated__/core/AssetsPageFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<764aed3f20dfa64736dc42751e17de65>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -205,7 +205,7 @@ return { { "alias": null, "args": null, - "concreteType": "People", + "concreteType": "Profile", "kind": "LinkedField", "name": "owner", "plural": false, diff --git a/apps/console/src/__generated__/core/DatumGraphListQuery.graphql.ts b/apps/console/src/__generated__/core/DatumGraphListQuery.graphql.ts index 001cc6d57..8e4b019c5 100644 --- a/apps/console/src/__generated__/core/DatumGraphListQuery.graphql.ts +++ b/apps/console/src/__generated__/core/DatumGraphListQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<034a68d54259fb22cf2d563699ad4257>> + * @generated SignedSource<<5e92ff2e3743b8ef52f11fd34b76e2d5>> * @lightSyntaxTransform * @nogrep */ @@ -189,7 +189,7 @@ return { { "alias": null, "args": null, - "concreteType": "People", + "concreteType": "Profile", "kind": "LinkedField", "name": "owner", "plural": false, diff --git a/apps/console/src/__generated__/core/DocumentSignaturePlaceholder_requestSignatureMutation.graphql.ts b/apps/console/src/__generated__/core/DocumentSignaturePlaceholder_requestSignatureMutation.graphql.ts index 99646a57c..7108039aa 100644 --- a/apps/console/src/__generated__/core/DocumentSignaturePlaceholder_requestSignatureMutation.graphql.ts +++ b/apps/console/src/__generated__/core/DocumentSignaturePlaceholder_requestSignatureMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<617f61c937eec7639e3c1c25884f1911>> * @lightSyntaxTransform * @nogrep */ @@ -88,7 +88,7 @@ v4 = { { "alias": null, "args": null, - "concreteType": "People", + "concreteType": "Profile", "kind": "LinkedField", "name": "signedBy", "plural": false, diff --git a/apps/console/src/__generated__/core/DocumentsPageQuery.graphql.ts b/apps/console/src/__generated__/core/DocumentsPageQuery.graphql.ts index 9c0ae5caa..a8afb3234 100644 --- a/apps/console/src/__generated__/core/DocumentsPageQuery.graphql.ts +++ b/apps/console/src/__generated__/core/DocumentsPageQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -314,7 +314,7 @@ return { { "alias": null, "args": null, - "concreteType": "People", + "concreteType": "Profile", "kind": "LinkedField", "name": "owner", "plural": false, diff --git a/apps/console/src/__generated__/core/MeasureTasksTabQuery.graphql.ts b/apps/console/src/__generated__/core/MeasureTasksTabQuery.graphql.ts index 3f643fd11..d262903b2 100644 --- a/apps/console/src/__generated__/core/MeasureTasksTabQuery.graphql.ts +++ b/apps/console/src/__generated__/core/MeasureTasksTabQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<07e722a4da8a25668cd0e49cc07598f9>> + * @generated SignedSource<<762a47bad27e4d68dbc150a47c41c362>> * @lightSyntaxTransform * @nogrep */ @@ -311,7 +311,7 @@ return { { "alias": null, "args": null, - "concreteType": "People", + "concreteType": "Profile", "kind": "LinkedField", "name": "assignedTo", "plural": false, diff --git a/apps/console/src/__generated__/core/MeetingGraphListQuery.graphql.ts b/apps/console/src/__generated__/core/MeetingGraphListQuery.graphql.ts index aec7822b7..03cf62ade 100644 --- a/apps/console/src/__generated__/core/MeetingGraphListQuery.graphql.ts +++ b/apps/console/src/__generated__/core/MeetingGraphListQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<7ac900885cf356d87efb7496bd37bbad>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -198,7 +198,7 @@ return { { "alias": null, "args": null, - "concreteType": "People", + "concreteType": "Profile", "kind": "LinkedField", "name": "attendees", "plural": true, diff --git a/apps/console/src/__generated__/core/MeetingGraphNodeQuery.graphql.ts b/apps/console/src/__generated__/core/MeetingGraphNodeQuery.graphql.ts index f04a59156..67c373a6e 100644 --- a/apps/console/src/__generated__/core/MeetingGraphNodeQuery.graphql.ts +++ b/apps/console/src/__generated__/core/MeetingGraphNodeQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<75a92b14ee7a1d73c9dde3d9d8d76de6>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -147,7 +147,7 @@ return { { "alias": null, "args": null, - "concreteType": "People", + "concreteType": "Profile", "kind": "LinkedField", "name": "attendees", "plural": true, diff --git a/apps/console/src/__generated__/core/ProcessingActivityGraphNodeQuery.graphql.ts b/apps/console/src/__generated__/core/ProcessingActivityGraphNodeQuery.graphql.ts index b02261163..911c399fe 100644 --- a/apps/console/src/__generated__/core/ProcessingActivityGraphNodeQuery.graphql.ts +++ b/apps/console/src/__generated__/core/ProcessingActivityGraphNodeQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<95c0d606637cea849328f351b4d8b72b>> * @lightSyntaxTransform * @nogrep */ @@ -255,7 +255,7 @@ v21 = { v22 = { "alias": null, "args": null, - "concreteType": "People", + "concreteType": "Profile", "kind": "LinkedField", "name": "dataProtectionOfficer", "plural": false, diff --git a/apps/console/src/__generated__/core/TaskGraphQuery.graphql.ts b/apps/console/src/__generated__/core/TaskGraphQuery.graphql.ts index 3a9a0e872..dbc194830 100644 --- a/apps/console/src/__generated__/core/TaskGraphQuery.graphql.ts +++ b/apps/console/src/__generated__/core/TaskGraphQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -191,7 +191,7 @@ return { { "alias": null, "args": null, - "concreteType": "People", + "concreteType": "Profile", "kind": "LinkedField", "name": "assignedTo", "plural": false, diff --git a/apps/console/src/__generated__/iam/SidebarFragment.graphql.ts b/apps/console/src/__generated__/iam/SidebarFragment.graphql.ts index 5ab91a5fd..b23ada91d 100644 --- a/apps/console/src/__generated__/iam/SidebarFragment.graphql.ts +++ b/apps/console/src/__generated__/iam/SidebarFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<63f008ba2b41fba49ba0c3145874aa72>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -22,7 +22,6 @@ export type SidebarFragment$data = { readonly canListMeetings: boolean; readonly canListNonconformities: boolean; readonly canListObligations: boolean; - readonly canListPeople: boolean; readonly canListProcessingActivities: boolean; readonly canListRightsRequests: boolean; readonly canListRisks: boolean; @@ -109,19 +108,6 @@ const node: ReaderFragment = { "name": "permission", "storageKey": "permission(action:\"core:framework:list\")" }, - { - "alias": "canListPeople", - "args": [ - { - "kind": "Literal", - "name": "action", - "value": "core:people:list" - } - ], - "kind": "ScalarField", - "name": "permission", - "storageKey": "permission(action:\"core:people:list\")" - }, { "alias": "canListVendors", "args": [ @@ -309,6 +295,6 @@ const node: ReaderFragment = { "abstractKey": null }; -(node as any).hash = "6d640139997b2c7561699c1efb668650"; +(node as any).hash = "b5d26b301116eb710832a55c425ed168"; export default node; diff --git a/pkg/coredata/asset.go b/pkg/coredata/asset.go index bd698485e..415866fcb 100644 --- a/pkg/coredata/asset.go +++ b/pkg/coredata/asset.go @@ -84,7 +84,7 @@ SELECT source_id, name, organization_id, - owner_id, + owner_profile_id, amount, asset_type, data_types_stored, @@ -134,7 +134,7 @@ SELECT source_id, name, organization_id, - owner_id, + owner_profile_id, amount, asset_type, data_types_stored, @@ -144,13 +144,13 @@ FROM assets WHERE %s - AND owner_id = @owner_id + AND owner_profile_id = @owner_profile_id LIMIT 1; ` q = fmt.Sprintf(q, scope.SQLFragment()) - args := pgx.StrictNamedArgs{"owner_id": a.OwnerID} + args := pgx.StrictNamedArgs{"owner_profile_id": a.OwnerID} maps.Copy(args, scope.SQLArguments()) rows, err := conn.Query(ctx, q, args) @@ -221,7 +221,7 @@ SELECT source_id, name, organization_id, - owner_id, + owner_profile_id, amount, asset_type, data_types_stored, @@ -269,7 +269,7 @@ INSERT INTO assets ( tenant_id, name, organization_id, - owner_id, + owner_profile_id, amount, asset_type, data_types_stored, @@ -280,7 +280,7 @@ INSERT INTO assets ( @tenant_id, @name, @organization_id, - @owner_id, + @owner_profile_id, @amount, @asset_type, @data_types_stored, @@ -294,7 +294,7 @@ INSERT INTO assets ( "tenant_id": scope.GetTenantID(), "organization_id": a.OrganizationID, "name": a.Name, - "owner_id": a.OwnerID, + "owner_profile_id": a.OwnerID, "amount": a.Amount, "asset_type": a.AssetType, "data_types_stored": a.DataTypesStored, @@ -319,7 +319,7 @@ func (a *Asset) Update( UPDATE assets SET name = @name, - owner_id = @owner_id, + owner_profile_id = @owner_profile_id, amount = @amount, asset_type = @asset_type, data_types_stored = @data_types_stored, @@ -334,7 +334,7 @@ RETURNING source_id, name, organization_id, - owner_id, + owner_profile_id, amount, asset_type, data_types_stored, @@ -347,7 +347,7 @@ RETURNING args := pgx.StrictNamedArgs{ "id": a.ID, "name": a.Name, - "owner_id": a.OwnerID, + "owner_profile_id": a.OwnerID, "amount": a.Amount, "asset_type": a.AssetType, "data_types_stored": a.DataTypesStored, @@ -429,7 +429,7 @@ INSERT INTO assets ( source_id, name, organization_id, - owner_id, + owner_profile_id, amount, asset_type, data_types_stored, @@ -443,7 +443,7 @@ SELECT a.id, a.name, a.organization_id, - a.owner_id, + a.owner_profile_id, a.amount, a.asset_type, a.data_types_stored, diff --git a/pkg/coredata/continual_improvements.go b/pkg/coredata/continual_improvements.go index 020d34625..cc2644823 100644 --- a/pkg/coredata/continual_improvements.go +++ b/pkg/coredata/continual_improvements.go @@ -92,7 +92,7 @@ SELECT reference_id, description, source, - owner_id, + owner_profile_id, target_date, status, priority, @@ -178,7 +178,7 @@ SELECT reference_id, description, source, - owner_id, + owner_profile_id, target_date, status, priority, @@ -230,7 +230,7 @@ INSERT INTO continual_improvements ( reference_id, description, source, - owner_id, + owner_profile_id, target_date, status, priority, @@ -243,7 +243,7 @@ INSERT INTO continual_improvements ( @reference_id, @description, @source, - @owner_id, + @owner_profile_id, @target_date, @status, @priority, @@ -253,18 +253,18 @@ INSERT INTO continual_improvements ( ` 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, + "id": ci.ID, + "tenant_id": scope.GetTenantID(), + "organization_id": ci.OrganizationID, + "reference_id": ci.ReferenceID, + "description": ci.Description, + "source": ci.Source, + "owner_profile_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) @@ -285,7 +285,7 @@ UPDATE continual_improvements SET reference_id = @reference_id, description = @description, source = @source, - owner_id = @owner_id, + owner_profile_id = @owner_profile_id, target_date = @target_date, status = @status, priority = @priority, @@ -298,15 +298,15 @@ WHERE 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, + "id": ci.ID, + "reference_id": ci.ReferenceID, + "description": ci.Description, + "source": ci.Source, + "owner_profile_id": ci.OwnerID, + "target_date": ci.TargetDate, + "status": ci.Status, + "priority": ci.Priority, + "updated_at": ci.UpdatedAt, } maps.Copy(args, scope.SQLArguments()) @@ -354,7 +354,7 @@ INSERT INTO continual_improvements ( reference_id, description, source, - owner_id, + owner_profile_id, target_date, status, priority, @@ -370,7 +370,7 @@ SELECT r.reference_id, r.description, r.source, - r.owner_id, + r.owner_profile_id, r.target_date, r.status, r.priority, diff --git a/pkg/coredata/datum.go b/pkg/coredata/datum.go index 6ff2b2298..1eb1b043d 100644 --- a/pkg/coredata/datum.go +++ b/pkg/coredata/datum.go @@ -85,7 +85,7 @@ func (d *Datum) LoadByID( SELECT id, name, - owner_id, + owner_profile_id, organization_id, data_classification, snapshot_id, @@ -129,7 +129,7 @@ func (d *Datum) LoadByOwnerID( SELECT id, name, - owner_id, + owner_profile_id, organization_id, data_classification, snapshot_id, @@ -140,13 +140,13 @@ FROM data WHERE %s - AND owner_id = @owner_id + AND owner_profile_id = @owner_profile_id LIMIT 1; ` q = fmt.Sprintf(q, scope.SQLFragment()) - args := pgx.StrictNamedArgs{"owner_id": d.OwnerID} + args := pgx.StrictNamedArgs{"owner_profile_id": d.OwnerID} maps.Copy(args, scope.SQLArguments()) rows, err := conn.Query(ctx, q, args) @@ -212,7 +212,7 @@ SELECT id, name, organization_id, - owner_id, + owner_profile_id, data_classification, snapshot_id, source_id, @@ -259,7 +259,7 @@ INSERT INTO data ( id, tenant_id, name, - owner_id, + owner_profile_id, organization_id, data_classification, snapshot_id, @@ -270,7 +270,7 @@ INSERT INTO data ( @id, @tenant_id, @name, - @owner_id, + @owner_profile_id, @organization_id, @data_classification, @snapshot_id, @@ -284,7 +284,7 @@ INSERT INTO data ( "id": d.ID, "tenant_id": scope.GetTenantID(), "name": d.Name, - "owner_id": d.OwnerID, + "owner_profile_id": d.OwnerID, "organization_id": d.OrganizationID, "data_classification": d.DataClassification, "snapshot_id": d.SnapshotID, @@ -310,7 +310,7 @@ func (d *Datum) Update( UPDATE data SET name = @name, - owner_id = @owner_id, + owner_profile_id = @owner_profile_id, data_classification = @data_classification, updated_at = @updated_at WHERE @@ -320,7 +320,7 @@ WHERE RETURNING id, name, - owner_id, + owner_profile_id, organization_id, data_classification, snapshot_id, @@ -334,7 +334,7 @@ RETURNING args := pgx.StrictNamedArgs{ "id": d.ID, "name": d.Name, - "owner_id": d.OwnerID, + "owner_profile_id": d.OwnerID, "data_classification": d.DataClassification, "updated_at": d.UpdatedAt, } @@ -414,7 +414,7 @@ INSERT INTO data ( source_id, name, organization_id, - owner_id, + owner_profile_id, data_classification, created_at, updated_at @@ -426,7 +426,7 @@ SELECT d.id, d.name, d.organization_id, - d.owner_id, + d.owner_profile_id, d.data_classification, d.created_at, d.updated_at diff --git a/pkg/coredata/document.go b/pkg/coredata/document.go index 6c91d2339..1b01ee189 100644 --- a/pkg/coredata/document.go +++ b/pkg/coredata/document.go @@ -83,7 +83,7 @@ func (p *Document) LoadByID( SELECT id, organization_id, - owner_id, + owner_profile_id, title, document_type, classification, @@ -135,7 +135,7 @@ func (p *Document) LoadByIDWithFilter( SELECT id, organization_id, - owner_id, + owner_profile_id, title, document_type, classification, @@ -188,7 +188,7 @@ func (p *Documents) LoadByIDs( SELECT id, organization_id, - owner_id, + owner_profile_id, title, document_type, classification, @@ -270,7 +270,7 @@ func (p *Documents) LoadByOrganizationID( SELECT id, organization_id, - owner_id, + owner_profile_id, title, document_type, classification, @@ -321,7 +321,7 @@ func (p *Documents) LoadAllByOrganizationID( SELECT id, organization_id, - owner_id, + owner_profile_id, title, document_type, classification, @@ -371,7 +371,7 @@ INSERT INTO tenant_id, id, organization_id, - owner_id, + owner_profile_id, title, document_type, classification, @@ -384,7 +384,7 @@ VALUES ( @tenant_id, @document_id, @organization_id, - @owner_id, + @owner_profile_id, @title, @document_type, @classification, @@ -399,7 +399,7 @@ VALUES ( "tenant_id": scope.GetTenantID(), "document_id": p.ID, "organization_id": p.OrganizationID, - "owner_id": p.OwnerID, + "owner_profile_id": p.OwnerID, "title": p.Title, "document_type": p.DocumentType, "classification": p.Classification, @@ -460,7 +460,7 @@ UPDATE SET title = @title, current_published_version = @current_published_version, - owner_id = @owner_id, + owner_profile_id = @owner_profile_id, document_type = @document_type, classification = @classification, trust_center_visibility = @trust_center_visibility, @@ -477,7 +477,7 @@ WHERE "updated_at": time.Now(), "title": p.Title, "current_published_version": p.CurrentPublishedVersion, - "owner_id": p.OwnerID, + "owner_profile_id": p.OwnerID, "document_type": p.DocumentType, "classification": p.Classification, "trust_center_visibility": p.TrustCenterVisibility, @@ -548,7 +548,7 @@ WITH scoped_documents AS ( SELECT scoped_documents.id, scoped_documents.organization_id, - scoped_documents.owner_id, + scoped_documents.owner_profile_id, scoped_documents.title, scoped_documents.document_type, scoped_documents.classification, @@ -638,7 +638,7 @@ WITH scoped_documents AS ( SELECT scoped_documents.id, scoped_documents.organization_id, - scoped_documents.owner_id, + scoped_documents.owner_profile_id, scoped_documents.title, scoped_documents.document_type, scoped_documents.classification, diff --git a/pkg/coredata/document_version.go b/pkg/coredata/document_version.go index bb499f311..60acb37b7 100644 --- a/pkg/coredata/document_version.go +++ b/pkg/coredata/document_version.go @@ -77,7 +77,7 @@ SELECT organization_id, document_id, title, - owner_id, + owner_profile_id, version_number, classification, content, @@ -139,7 +139,7 @@ SELECT organization_id, document_id, title, - owner_id, + owner_profile_id, version_number, classification, content, @@ -190,7 +190,7 @@ INSERT INTO document_versions ( organization_id, document_id, title, - owner_id, + owner_profile_id, version_number, classification, content, @@ -205,7 +205,7 @@ VALUES ( @organization_id, @document_id, @title, - @owner_id, + @owner_profile_id, @version_number, @classification, @content, @@ -216,19 +216,19 @@ VALUES ( ) ` args := pgx.StrictNamedArgs{ - "tenant_id": scope.GetTenantID(), - "id": dv.ID, - "organization_id": dv.OrganizationID, - "document_id": dv.DocumentID, - "title": dv.Title, - "owner_id": dv.OwnerID, - "version_number": dv.VersionNumber, - "classification": dv.Classification, - "content": dv.Content, - "changelog": dv.Changelog, - "status": dv.Status, - "created_at": dv.CreatedAt, - "updated_at": dv.UpdatedAt, + "tenant_id": scope.GetTenantID(), + "id": dv.ID, + "organization_id": dv.OrganizationID, + "document_id": dv.DocumentID, + "title": dv.Title, + "owner_profile_id": dv.OwnerID, + "version_number": dv.VersionNumber, + "classification": dv.Classification, + "content": dv.Content, + "changelog": dv.Changelog, + "status": dv.Status, + "created_at": dv.CreatedAt, + "updated_at": dv.UpdatedAt, } _, err := conn.Exec(ctx, q, args) @@ -260,7 +260,7 @@ SELECT organization_id, document_id, title, - owner_id, + owner_profile_id, version_number, classification, content, @@ -313,7 +313,7 @@ SELECT organization_id, document_id, title, - owner_id, + owner_profile_id, version_number, classification, content, @@ -364,7 +364,7 @@ SELECT organization_id, document_id, title, - owner_id, + owner_profile_id, version_number, classification, content, @@ -413,7 +413,7 @@ func (dv DocumentVersion) Update( q := ` UPDATE document_versions SET title = @title, - owner_id = @owner_id, + owner_profile_id = @owner_profile_id, changelog = @changelog, status = @status, content = @content, @@ -429,7 +429,7 @@ WHERE %s args := pgx.StrictNamedArgs{ "document_version_id": dv.ID, "title": dv.Title, - "owner_id": dv.OwnerID, + "owner_profile_id": dv.OwnerID, "changelog": dv.Changelog, "status": dv.Status, "content": dv.Content, diff --git a/pkg/coredata/document_version_signature.go b/pkg/coredata/document_version_signature.go index 194eca0ad..0315a280b 100644 --- a/pkg/coredata/document_version_signature.go +++ b/pkg/coredata/document_version_signature.go @@ -91,7 +91,7 @@ SELECT organization_id, document_version_id, state, - signed_by, + signed_by_profile_id, signed_at, requested_at, created_at, @@ -101,7 +101,7 @@ FROM WHERE %s AND document_version_id = @document_version_id - AND signed_by = @signatory + AND signed_by_profile_id = @signatory LIMIT 1 ` @@ -137,7 +137,7 @@ SELECT organization_id, document_version_id, state, - signed_by, + signed_by_profile_id, signed_at, requested_at, created_at, @@ -181,7 +181,7 @@ INSERT INTO document_version_signatures ( organization_id, document_version_id, state, - signed_by, + signed_by_profile_id, signed_at, requested_at, created_at, @@ -192,7 +192,7 @@ INSERT INTO document_version_signatures ( @organization_id, @document_version_id, @state, - @signed_by, + @signed_by_profile_id, @signed_at, @requested_at, @created_at, @@ -201,16 +201,16 @@ INSERT INTO document_version_signatures ( ` args := pgx.StrictNamedArgs{ - "id": pvs.ID, - "tenant_id": scope.GetTenantID(), - "organization_id": pvs.OrganizationID, - "document_version_id": pvs.DocumentVersionID, - "state": pvs.State, - "signed_by": pvs.SignedBy, - "signed_at": pvs.SignedAt, - "requested_at": pvs.RequestedAt, - "created_at": pvs.CreatedAt, - "updated_at": pvs.UpdatedAt, + "id": pvs.ID, + "tenant_id": scope.GetTenantID(), + "organization_id": pvs.OrganizationID, + "document_version_id": pvs.DocumentVersionID, + "state": pvs.State, + "signed_by_profile_id": pvs.SignedBy, + "signed_at": pvs.SignedAt, + "requested_at": pvs.RequestedAt, + "created_at": pvs.CreatedAt, + "updated_at": pvs.UpdatedAt, } _, err := conn.Exec(ctx, q, args) @@ -241,7 +241,7 @@ SELECT organization_id, document_version_id, state, - signed_by, + signed_by_profile_id, signed_at, requested_at, created_at, @@ -286,7 +286,7 @@ func (pvs *DocumentVersionSignature) Update( UPDATE document_version_signatures SET state = @state, - signed_by = @signed_by, + signed_by_profile_id = @signed_by_profile_id, signed_at = @signed_at, updated_at = @updated_at WHERE @@ -297,11 +297,11 @@ WHERE q = fmt.Sprintf(q, scope.SQLFragment()) args := pgx.StrictNamedArgs{ - "id": pvs.ID, - "state": pvs.State, - "signed_by": pvs.SignedBy, - "signed_at": pvs.SignedAt, - "updated_at": pvs.UpdatedAt, + "id": pvs.ID, + "state": pvs.State, + "signed_by_profile_id": pvs.SignedBy, + "signed_at": pvs.SignedAt, + "updated_at": pvs.UpdatedAt, } maps.Copy(args, scope.SQLArguments()) @@ -355,7 +355,7 @@ WITH sigs AS ( dvs.tenant_id, dvs.document_version_id, dvs.state, - dvs.signed_by, + dvs.signed_by_profile_id, dvs.signed_at, dvs.requested_at, dvs.created_at, @@ -364,7 +364,7 @@ WITH sigs AS ( FROM document_version_signatures dvs INNER JOIN - peoples p ON dvs.signed_by = p.id + peoples p ON dvs.signed_by_profile_id = p.id WHERE dvs.document_version_id = @document_version_id ORDER BY @@ -376,7 +376,7 @@ SELECT organization_id, document_version_id, state, - signed_by, + signed_by_profile_id, signed_at, requested_at, created_at, @@ -422,7 +422,7 @@ func (pvs *DocumentVersionSignature) IsSignedByUserEmail( SELECT EXISTS ( SELECT 1 FROM document_version_signatures dvs - INNER JOIN peoples p ON dvs.signed_by = p.id + INNER JOIN peoples p ON dvs.signed_by_profile_id = p.id WHERE dvs.document_version_id = @document_version_id AND p.primary_email_address = @user_email AND dvs.state = 'SIGNED' diff --git a/pkg/coredata/meeting_attendee.go b/pkg/coredata/meeting_attendee.go index bfa93ff93..f0d6693f0 100644 --- a/pkg/coredata/meeting_attendee.go +++ b/pkg/coredata/meeting_attendee.go @@ -45,7 +45,7 @@ func (ma *MeetingAttendees) LoadByMeetingID( q := ` SELECT meeting_id, - attendee_id, + attendee_profile_id, organization_id, created_at FROM @@ -87,7 +87,7 @@ func (ma *MeetingAttendees) Merge( q := ` WITH attendee_ids AS ( SELECT - unnest(@attendee_ids::text[]) AS attendee_id, + unnest(@attendee_ids::text[]) AS attendee_profile_id, @tenant_id AS tenant_id, @meeting_id AS meeting_id, @organization_id AS organization_id, @@ -97,10 +97,10 @@ MERGE INTO meeting_attendees AS tgt USING attendee_ids AS src ON tgt.tenant_id = src.tenant_id AND tgt.meeting_id = src.meeting_id - AND tgt.attendee_id = src.attendee_id + AND tgt.attendee_profile_id = src.attendee_profile_id WHEN NOT MATCHED THEN - INSERT (tenant_id, meeting_id, attendee_id, organization_id, created_at) - VALUES (src.tenant_id, src.meeting_id, src.attendee_id, src.organization_id, src.created_at) + INSERT (tenant_id, meeting_id, attendee_profile_id, organization_id, created_at) + VALUES (src.tenant_id, src.meeting_id, src.attendee_profile_id, src.organization_id, src.created_at) WHEN NOT MATCHED BY SOURCE AND tgt.tenant_id = @tenant_id AND tgt.meeting_id = @meeting_id THEN DELETE diff --git a/pkg/coredata/membership_profile.go b/pkg/coredata/membership_profile.go index 3cc0f78bd..f8cac5e2e 100644 --- a/pkg/coredata/membership_profile.go +++ b/pkg/coredata/membership_profile.go @@ -88,7 +88,7 @@ SELECT i.email_address, p.full_name, p.kind, - p.additionalEmailAddresses, + p.additional_email_addresses, p.position, p.contract_start_date, p.contract_end_date, @@ -142,7 +142,7 @@ SELECT i.email_address, p.full_name, p.kind, - p.additionalEmailAddresses, + p.additional_email_addresses, p.position, p.contract_start_date, p.contract_end_date, @@ -196,7 +196,7 @@ SELECT i.email_address, p.full_name, p.kind, - p.additionalEmailAddresses, + p.additional_email_addresses, p.position, p.contract_start_date, p.contract_end_date, @@ -246,7 +246,7 @@ WITH attendees AS ( i.email_address, p.full_name, p.kind, - p.additionalEmailAddresses, + p.additional_email_addresses, p.position, p.contract_start_date, p.contract_end_date, @@ -370,7 +370,7 @@ INSERT INTO membership_id, full_name, kind, - additionalEmailAddresses, + additional_email_addresses, position, contract_start_date, contract_end_date, @@ -384,7 +384,7 @@ VALUES ( @membership_id, @full_name, @kind, - @additionalEmailAddresses, + @additional_email_addresses, @position, @contract_start_date, @contract_end_date, @@ -394,18 +394,18 @@ VALUES ( ` args := pgx.StrictNamedArgs{ - "tenant_id": p.ID.TenantID().String(), - "id": p.ID, - "identity_id": p.IdentityID, - "membership_id": p.MembershipID, - "full_name": p.FullName, - "kind": p.Kind, - "additionalEmailAddresses": p.AdditionalEmailAddresses, - "position": p.Position, - "contract_start_date": p.ContractStartDate, - "contract_end_date": p.ContractEndDate, - "created_at": p.CreatedAt, - "updated_at": p.UpdatedAt, + "tenant_id": p.ID.TenantID().String(), + "id": p.ID, + "identity_id": p.IdentityID, + "membership_id": p.MembershipID, + "full_name": p.FullName, + "kind": p.Kind, + "additional_email_addresses": p.AdditionalEmailAddresses, + "position": p.Position, + "contract_start_date": p.ContractStartDate, + "contract_end_date": p.ContractEndDate, + "created_at": p.CreatedAt, + "updated_at": p.UpdatedAt, } _, err := conn.Exec(ctx, q, args) @@ -427,7 +427,7 @@ UPDATE SET full_name = @full_name, kind = @kind, - additionalEmailAddresses = @additionalEmailAddresses, + additional_email_addresses = @additional_email_addresses, position = @position, contract_start_date = @contract_start_date, contract_end_date = @contract_end_date, @@ -440,14 +440,14 @@ WHERE q = fmt.Sprintf(q, scope.SQLFragment()) args := pgx.StrictNamedArgs{ - "id": p.ID, - "full_name": p.FullName, - "kind": p.Kind, - "additionalEmailAddresses": p.AdditionalEmailAddresses, - "position": p.Position, - "contract_start_date": p.ContractStartDate, - "contract_end_date": p.ContractEndDate, - "updated_at": p.UpdatedAt, + "id": p.ID, + "full_name": p.FullName, + "kind": p.Kind, + "additional_email_addresses": p.AdditionalEmailAddresses, + "position": p.Position, + "contract_start_date": p.ContractStartDate, + "contract_end_date": p.ContractEndDate, + "updated_at": p.UpdatedAt, } maps.Copy(args, scope.SQLArguments()) diff --git a/pkg/coredata/nonconformity.go b/pkg/coredata/nonconformity.go index 7b3c18943..f6d8db175 100644 --- a/pkg/coredata/nonconformity.go +++ b/pkg/coredata/nonconformity.go @@ -99,7 +99,7 @@ SELECT date_identified, root_cause, corrective_action, - owner_id, + owner_profile_id, due_date, status, effectiveness_check, @@ -188,7 +188,7 @@ SELECT date_identified, root_cause, corrective_action, - owner_id, + owner_profile_id, due_date, status, effectiveness_check, @@ -241,7 +241,7 @@ INSERT INTO nonconformities ( date_identified, root_cause, corrective_action, - owner_id, + owner_profile_id, due_date, status, effectiveness_check, @@ -257,7 +257,7 @@ INSERT INTO nonconformities ( @date_identified, @root_cause, @corrective_action, - @owner_id, + @owner_profile_id, @due_date, @status, @effectiveness_check, @@ -276,7 +276,7 @@ INSERT INTO nonconformities ( "date_identified": nc.DateIdentified, "root_cause": nc.RootCause, "corrective_action": nc.CorrectiveAction, - "owner_id": nc.OwnerID, + "owner_profile_id": nc.OwnerID, "due_date": nc.DueDate, "status": nc.Status, "effectiveness_check": nc.EffectivenessCheck, @@ -308,7 +308,7 @@ SET due_date = @due_date, status = @status, effectiveness_check = @effectiveness_check, - owner_id = @owner_id, + owner_profile_id = @owner_profile_id, audit_id = @audit_id, updated_at = @updated_at WHERE @@ -329,7 +329,7 @@ WHERE "due_date": nc.DueDate, "status": nc.Status, "effectiveness_check": nc.EffectivenessCheck, - "owner_id": nc.OwnerID, + "owner_profile_id": nc.OwnerID, "audit_id": nc.AuditID, "updated_at": nc.UpdatedAt, } @@ -382,7 +382,7 @@ INSERT INTO nonconformities ( date_identified, root_cause, corrective_action, - owner_id, + owner_profile_id, due_date, status, effectiveness_check, @@ -401,7 +401,7 @@ SELECT nc.date_identified, nc.root_cause, nc.corrective_action, - nc.owner_id, + nc.owner_profile_id, nc.due_date, nc.status, nc.effectiveness_check, diff --git a/pkg/coredata/obligation.go b/pkg/coredata/obligation.go index 3e15ff741..639c3961e 100644 --- a/pkg/coredata/obligation.go +++ b/pkg/coredata/obligation.go @@ -96,7 +96,7 @@ SELECT requirement, actions_to_be_implemented, regulator, - owner_id, + owner_profile_id, last_review_date, due_date, status, @@ -229,7 +229,7 @@ SELECT requirement, actions_to_be_implemented, regulator, - owner_id, + owner_profile_id, last_review_date, due_date, status, @@ -287,7 +287,7 @@ WITH obls AS ( o.requirement, o.actions_to_be_implemented, o.regulator, - o.owner_id, + o.owner_profile_id, o.last_review_date, o.due_date, o.status, @@ -313,7 +313,7 @@ SELECT requirement, actions_to_be_implemented, regulator, - owner_id, + owner_profile_id, last_review_date, due_date, status, @@ -414,7 +414,7 @@ WITH obls AS ( o.requirement, o.actions_to_be_implemented, o.regulator, - o.owner_id, + o.owner_profile_id, o.last_review_date, o.due_date, o.status, @@ -439,7 +439,7 @@ SELECT requirement, actions_to_be_implemented, regulator, - owner_id, + owner_profile_id, last_review_date, due_date, status, @@ -491,7 +491,7 @@ INSERT INTO obligations ( requirement, actions_to_be_implemented, regulator, - owner_id, + owner_profile_id, last_review_date, due_date, status, @@ -509,7 +509,7 @@ INSERT INTO obligations ( @requirement, @actions_to_be_implemented, @regulator, - @owner_id, + @owner_profile_id, @last_review_date, @due_date, @status, @@ -530,7 +530,7 @@ INSERT INTO obligations ( "requirement": o.Requirement, "actions_to_be_implemented": o.ActionsToBeImplemented, "regulator": o.Regulator, - "owner_id": o.OwnerID, + "owner_profile_id": o.OwnerID, "last_review_date": o.LastReviewDate, "due_date": o.DueDate, "status": o.Status, @@ -561,7 +561,7 @@ UPDATE obligations SET requirement = @requirement, actions_to_be_implemented = @actions_to_be_implemented, regulator = @regulator, - owner_id = @owner_id, + owner_profile_id = @owner_profile_id, last_review_date = @last_review_date, due_date = @due_date, status = @status, @@ -582,7 +582,7 @@ WHERE "requirement": o.Requirement, "actions_to_be_implemented": o.ActionsToBeImplemented, "regulator": o.Regulator, - "owner_id": o.OwnerID, + "owner_profile_id": o.OwnerID, "last_review_date": o.LastReviewDate, "due_date": o.DueDate, "status": o.Status, @@ -638,7 +638,7 @@ INSERT INTO obligations ( requirement, actions_to_be_implemented, regulator, - owner_id, + owner_profile_id, last_review_date, due_date, status, @@ -657,7 +657,7 @@ SELECT o.requirement, o.actions_to_be_implemented, o.regulator, - o.owner_id, + o.owner_profile_id, o.last_review_date, o.due_date, o.status, diff --git a/pkg/coredata/processing_activities.go b/pkg/coredata/processing_activities.go index 4cf6f9603..b4cce4b6e 100644 --- a/pkg/coredata/processing_activities.go +++ b/pkg/coredata/processing_activities.go @@ -114,7 +114,7 @@ SELECT last_review_date, next_review_date, role, - data_protection_officer_id, + dpo_profile_id, created_at, updated_at FROM @@ -212,7 +212,7 @@ SELECT last_review_date, next_review_date, role, - data_protection_officer_id, + dpo_profile_id, created_at, updated_at FROM @@ -277,7 +277,7 @@ SELECT last_review_date, next_review_date, role, - data_protection_officer_id, + dpo_profile_id, created_at, updated_at FROM @@ -340,7 +340,7 @@ INSERT INTO processing_activities ( last_review_date, next_review_date, role, - data_protection_officer_id, + dpo_profile_id, created_at, updated_at ) VALUES ( @@ -367,7 +367,7 @@ INSERT INTO processing_activities ( @last_review_date, @next_review_date, @role, - @data_protection_officer_id, + @dpo_profile_id, @created_at, @updated_at ) @@ -397,7 +397,7 @@ INSERT INTO processing_activities ( "last_review_date": p.LastReviewDate, "next_review_date": p.NextReviewDate, "role": p.Role, - "data_protection_officer_id": p.DataProtectionOfficerID, + "dpo_profile_id": p.DataProtectionOfficerID, "created_at": p.CreatedAt, "updated_at": p.UpdatedAt, } @@ -436,7 +436,7 @@ SET last_review_date = @last_review_date, next_review_date = @next_review_date, role = @role, - data_protection_officer_id = @data_protection_officer_id, + dpo_profile_id = @dpo_profile_id, updated_at = @updated_at WHERE %s @@ -466,7 +466,7 @@ WHERE "last_review_date": p.LastReviewDate, "next_review_date": p.NextReviewDate, "role": p.Role, - "data_protection_officer_id": p.DataProtectionOfficerID, + "dpo_profile_id": p.DataProtectionOfficerID, "updated_at": p.UpdatedAt, } maps.Copy(args, scope.SQLArguments()) @@ -549,7 +549,7 @@ INSERT INTO processing_activities ( last_review_date, next_review_date, role, - data_protection_officer_id, + dpo_profile_id, created_at, updated_at ) @@ -577,7 +577,7 @@ SELECT par.last_review_date, par.next_review_date, par.role, - par.data_protection_officer_id, + par.dpo_profile_id, par.created_at, par.updated_at FROM processing_activities par diff --git a/pkg/coredata/risk.go b/pkg/coredata/risk.go index 430eb3453..931298d58 100644 --- a/pkg/coredata/risk.go +++ b/pkg/coredata/risk.go @@ -155,7 +155,7 @@ WITH rsks AS ( r.name, r.description, r.category, - r.owner_id, + r.owner_profile_id, p.full_name as owner_full_name, r.treatment, r.note, @@ -175,7 +175,7 @@ WITH rsks AS ( INNER JOIN risks_measures rm ON r.id = rm.risk_id LEFT JOIN - peoples p ON r.owner_id = p.id + peoples p ON r.owner_profile_id = p.id WHERE rm.measure_id = @measure_id ) @@ -185,7 +185,7 @@ SELECT name, description, category, - owner_id, + owner_profile_id, owner_full_name, treatment, note, @@ -274,7 +274,7 @@ WITH rsks AS ( r.organization_id, r.name, r.description, - r.owner_id, + r.owner_profile_id, p.full_name as owner_full_name, r.treatment, r.note, @@ -293,7 +293,7 @@ WITH rsks AS ( FROM risks r LEFT JOIN - peoples p ON r.owner_id = p.id + peoples p ON r.owner_profile_id = p.id WHERE r.organization_id = @organization_id ) @@ -302,7 +302,7 @@ SELECT organization_id, name, description, - owner_id, + owner_profile_id, owner_full_name, treatment, note, @@ -358,7 +358,7 @@ SELECT name, description, category, - owner_id, + owner_profile_id, NULL as owner_full_name, treatment, note, @@ -407,8 +407,8 @@ func (r *Risk) Insert( scope Scoper, ) error { q := ` -INSERT INTO risks (id, tenant_id, organization_id, name, description, category, owner_id, treatment, note, inherent_likelihood, inherent_impact, residual_likelihood, residual_impact, created_at, updated_at) -VALUES (@id, @tenant_id, @organization_id, @name, @description, @category, @owner_id, @treatment, @note, @inherent_likelihood, @inherent_impact, @residual_likelihood, @residual_impact, @created_at, @updated_at) +INSERT INTO risks (id, tenant_id, organization_id, name, description, category, owner_profile_id, treatment, note, inherent_likelihood, inherent_impact, residual_likelihood, residual_impact, created_at, updated_at) +VALUES (@id, @tenant_id, @organization_id, @name, @description, @category, @owner_profile_id, @treatment, @note, @inherent_likelihood, @inherent_impact, @residual_likelihood, @residual_impact, @created_at, @updated_at) ` args := pgx.StrictNamedArgs{ @@ -418,7 +418,7 @@ VALUES (@id, @tenant_id, @organization_id, @name, @description, @category, @owne "name": r.Name, "description": r.Description, "category": r.Category, - "owner_id": r.OwnerID, + "owner_profile_id": r.OwnerID, "treatment": r.Treatment, "note": r.Note, "inherent_likelihood": r.InherentLikelihood, @@ -443,7 +443,7 @@ UPDATE risks SET name = @name, description = @description, - owner_id = @owner_id, + owner_profile_id = @owner_profile_id, treatment = @treatment, inherent_likelihood = @inherent_likelihood, inherent_impact = @inherent_impact, @@ -463,7 +463,7 @@ WHERE %s "name": r.Name, "description": r.Description, "category": r.Category, - "owner_id": r.OwnerID, + "owner_profile_id": r.OwnerID, "treatment": r.Treatment, "note": r.Note, "inherent_likelihood": r.InherentLikelihood, @@ -567,7 +567,7 @@ INSERT INTO risks ( category, treatment, note, - owner_id, + owner_profile_id, inherent_likelihood, inherent_impact, residual_likelihood, @@ -586,7 +586,7 @@ SELECT r.category, r.treatment, r.note, - r.owner_id, + r.owner_profile_id, r.inherent_likelihood, r.inherent_impact, r.residual_likelihood, diff --git a/pkg/coredata/state_of_applicability.go b/pkg/coredata/state_of_applicability.go index b2c944061..1522f0e2e 100644 --- a/pkg/coredata/state_of_applicability.go +++ b/pkg/coredata/state_of_applicability.go @@ -81,7 +81,7 @@ SELECT name, source_id, snapshot_id, - owner_id, + owner_profile_id, created_at, updated_at FROM @@ -130,7 +130,7 @@ SELECT name, source_id, snapshot_id, - owner_id, + owner_profile_id, created_at, updated_at FROM @@ -210,7 +210,7 @@ INSERT INTO name, source_id, snapshot_id, - owner_id, + owner_profile_id, created_at, updated_at ) @@ -221,7 +221,7 @@ VALUES ( @name, @source_id, @snapshot_id, - @owner_id, + @owner_profile_id, @created_at, @updated_at ); @@ -234,7 +234,7 @@ VALUES ( "name": s.Name, "source_id": s.SourceID, "snapshot_id": s.SnapshotID, - "owner_id": s.OwnerID, + "owner_profile_id": s.OwnerID, "created_at": s.CreatedAt, "updated_at": s.UpdatedAt, } @@ -262,7 +262,7 @@ func (s *StateOfApplicability) Update( UPDATE states_of_applicability SET name = @name, - owner_id = @owner_id, + owner_profile_id = @owner_profile_id, updated_at = @updated_at WHERE %s @@ -274,7 +274,7 @@ WHERE args := pgx.StrictNamedArgs{ "state_of_applicability_id": s.ID, "name": s.Name, - "owner_id": s.OwnerID, + "owner_profile_id": s.OwnerID, "updated_at": s.UpdatedAt, } maps.Copy(args, scope.SQLArguments()) @@ -354,7 +354,7 @@ INSERT INTO states_of_applicability ( name, source_id, snapshot_id, - owner_id, + owner_profile_id, created_at, updated_at ) @@ -365,7 +365,7 @@ SELECT soa.name, soa.id, @snapshot_id, - soa.owner_id, + soa.owner_profile_id, soa.created_at, soa.updated_at FROM states_of_applicability soa diff --git a/pkg/coredata/task.go b/pkg/coredata/task.go index e896e6500..04b893859 100644 --- a/pkg/coredata/task.go +++ b/pkg/coredata/task.go @@ -87,7 +87,7 @@ SELECT state, reference_id, time_estimate, - assigned_to, + assigned_to_profile_id, deadline, created_at, updated_at @@ -140,7 +140,7 @@ INSERT INTO reference_id, state, time_estimate, - assigned_to, + assigned_to_profile_id, deadline, created_at, updated_at @@ -155,7 +155,7 @@ VALUES ( @reference_id, @state, @time_estimate, - @assigned_to, + @assigned_to_profile_id, @deadline, @created_at, @updated_at @@ -163,19 +163,19 @@ VALUES ( ` args := pgx.StrictNamedArgs{ - "tenant_id": scope.GetTenantID(), - "task_id": c.ID, - "organization_id": c.OrganizationID, - "measure_id": c.MeasureID, - "name": c.Name, - "description": c.Description, - "reference_id": c.ReferenceID, - "state": c.State, - "time_estimate": c.TimeEstimate, - "assigned_to": c.AssignedToID, - "deadline": c.Deadline, - "created_at": c.CreatedAt, - "updated_at": c.UpdatedAt, + "tenant_id": scope.GetTenantID(), + "task_id": c.ID, + "organization_id": c.OrganizationID, + "measure_id": c.MeasureID, + "name": c.Name, + "description": c.Description, + "reference_id": c.ReferenceID, + "state": c.State, + "time_estimate": c.TimeEstimate, + "assigned_to_profile_id": c.AssignedToID, + "deadline": c.Deadline, + "created_at": c.CreatedAt, + "updated_at": c.UpdatedAt, } _, err := conn.Exec(ctx, q, args) @@ -209,7 +209,7 @@ INSERT INTO reference_id, state, time_estimate, - assigned_to, + assigned_to_profile_id, deadline, created_at, updated_at @@ -224,7 +224,7 @@ VALUES ( @reference_id, @state, @time_estimate, - @assigned_to, + @assigned_to_profile_id, @deadline, @created_at, @updated_at @@ -243,26 +243,26 @@ RETURNING reference_id, state, time_estimate, - assigned_to, + assigned_to_profile_id, deadline, created_at, updated_at ` args := pgx.StrictNamedArgs{ - "tenant_id": scope.GetTenantID(), - "task_id": c.ID, - "organization_id": c.OrganizationID, - "measure_id": c.MeasureID, - "name": c.Name, - "description": c.Description, - "reference_id": c.ReferenceID, - "state": c.State, - "time_estimate": c.TimeEstimate, - "assigned_to": c.AssignedToID, - "deadline": c.Deadline, - "created_at": c.CreatedAt, - "updated_at": c.UpdatedAt, + "tenant_id": scope.GetTenantID(), + "task_id": c.ID, + "organization_id": c.OrganizationID, + "measure_id": c.MeasureID, + "name": c.Name, + "description": c.Description, + "reference_id": c.ReferenceID, + "state": c.State, + "time_estimate": c.TimeEstimate, + "assigned_to_profile_id": c.AssignedToID, + "deadline": c.Deadline, + "created_at": c.CreatedAt, + "updated_at": c.UpdatedAt, } rows, err := conn.Query(ctx, q, args) if err != nil { @@ -328,7 +328,7 @@ func (c *Tasks) LoadByOrganizationID( state, reference_id, time_estimate, - assigned_to, + assigned_to_profile_id, deadline, created_at, updated_at @@ -409,7 +409,7 @@ SELECT state, reference_id, time_estimate, - assigned_to, + assigned_to_profile_id, deadline, created_at, updated_at @@ -454,7 +454,7 @@ SET state = @state, time_estimate = @time_estimate, updated_at = @updated_at, - assigned_to = @assigned_to, + assigned_to_profile_id = @assigned_to_profile_id, deadline = @deadline WHERE %s AND id = @task_id @@ -462,14 +462,14 @@ WHERE %s q = fmt.Sprintf(q, scope.SQLFragment()) args := pgx.NamedArgs{ - "task_id": c.ID, - "name": c.Name, - "description": c.Description, - "state": c.State, - "time_estimate": c.TimeEstimate, - "updated_at": c.UpdatedAt, - "assigned_to": c.AssignedToID, - "deadline": c.Deadline, + "task_id": c.ID, + "name": c.Name, + "description": c.Description, + "state": c.State, + "time_estimate": c.TimeEstimate, + "updated_at": c.UpdatedAt, + "assigned_to_profile_id": c.AssignedToID, + "deadline": c.Deadline, } maps.Copy(args, scope.SQLArguments()) diff --git a/pkg/coredata/vendor.go b/pkg/coredata/vendor.go index f513d1e0f..436e514bc 100644 --- a/pkg/coredata/vendor.go +++ b/pkg/coredata/vendor.go @@ -116,8 +116,8 @@ SELECT subprocessors_list_url, certifications, countries, - business_owner_id, - security_owner_id, + business_owner_profile_id, + security_owner_profile_id, status_page_url, terms_of_service_url, security_page_url, @@ -184,8 +184,8 @@ INSERT INTO subprocessors_list_url, certifications, countries, - business_owner_id, - security_owner_id, + business_owner_profile_id, + security_owner_profile_id, status_page_url, terms_of_service_url, security_page_url, @@ -213,8 +213,8 @@ VALUES ( @subprocessors_list_url, @certifications, @countries, - @business_owner_id, - @security_owner_id, + @business_owner_profile_id, + @security_owner_profile_id, @status_page_url, @terms_of_service_url, @security_page_url, @@ -244,8 +244,8 @@ VALUES ( "subprocessors_list_url": v.SubprocessorsListURL, "certifications": v.Certifications, "countries": v.Countries, - "business_owner_id": v.BusinessOwnerID, - "security_owner_id": v.SecurityOwnerID, + "business_owner_profile_id": v.BusinessOwnerID, + "security_owner_profile_id": v.SecurityOwnerID, "status_page_url": v.StatusPageURL, "terms_of_service_url": v.TermsOfServiceURL, "security_page_url": v.SecurityPageURL, @@ -339,8 +339,8 @@ SELECT subprocessors_list_url, certifications, countries, - business_owner_id, - security_owner_id, + business_owner_profile_id, + security_owner_profile_id, status_page_url, terms_of_service_url, security_page_url, @@ -405,8 +405,8 @@ SET terms_of_service_url = @terms_of_service_url, security_page_url = @security_page_url, trust_page_url = @trust_page_url, - business_owner_id = @business_owner_id, - security_owner_id = @security_owner_id, + business_owner_profile_id = @business_owner_profile_id, + security_owner_profile_id = @security_owner_profile_id, show_on_trust_center = @show_on_trust_center, updated_at = @updated_at WHERE %s @@ -434,8 +434,8 @@ WHERE %s "terms_of_service_url": v.TermsOfServiceURL, "security_page_url": v.SecurityPageURL, "trust_page_url": v.TrustPageURL, - "business_owner_id": v.BusinessOwnerID, - "security_owner_id": v.SecurityOwnerID, + "business_owner_profile_id": v.BusinessOwnerID, + "security_owner_profile_id": v.SecurityOwnerID, "show_on_trust_center": v.ShowOnTrustCenter, } @@ -544,8 +544,8 @@ WITH vend AS ( v.subprocessors_list_url, v.certifications, v.countries, - v.business_owner_id, - v.security_owner_id, + v.business_owner_profile_id, + v.security_owner_profile_id, v.status_page_url, v.terms_of_service_url, v.security_page_url, @@ -579,8 +579,8 @@ SELECT subprocessors_list_url, certifications, countries, - business_owner_id, - security_owner_id, + business_owner_profile_id, + security_owner_profile_id, status_page_url, terms_of_service_url, security_page_url, @@ -681,8 +681,8 @@ WITH vend AS ( v.subprocessors_list_url, v.certifications, v.countries, - v.business_owner_id, - v.security_owner_id, + v.business_owner_profile_id, + v.security_owner_profile_id, v.status_page_url, v.terms_of_service_url, v.security_page_url, @@ -716,8 +716,8 @@ SELECT subprocessors_list_url, certifications, countries, - business_owner_id, - security_owner_id, + business_owner_profile_id, + security_owner_profile_id, status_page_url, terms_of_service_url, security_page_url, @@ -779,8 +779,8 @@ WITH vend AS ( v.subprocessors_list_url, v.certifications, v.countries, - v.business_owner_id, - v.security_owner_id, + v.business_owner_profile_id, + v.security_owner_profile_id, v.status_page_url, v.terms_of_service_url, v.security_page_url, @@ -814,8 +814,8 @@ SELECT subprocessors_list_url, certifications, countries, - business_owner_id, - security_owner_id, + business_owner_profile_id, + security_owner_profile_id, status_page_url, terms_of_service_url, security_page_url, @@ -962,8 +962,8 @@ INSERT INTO vendors ( subprocessors_list_url, certifications, countries, - business_owner_id, - security_owner_id, + business_owner_profile_id, + security_owner_profile_id, status_page_url, terms_of_service_url, security_page_url, @@ -991,8 +991,8 @@ SELECT v.subprocessors_list_url, v.certifications, v.countries, - v.business_owner_id, - v.security_owner_id, + v.business_owner_profile_id, + v.security_owner_profile_id, v.status_page_url, v.terms_of_service_url, v.security_page_url, @@ -1064,8 +1064,8 @@ INSERT INTO vendors ( subprocessors_list_url, certifications, countries, - business_owner_id, - security_owner_id, + business_owner_profile_id, + security_owner_profile_id, status_page_url, terms_of_service_url, security_page_url, @@ -1093,8 +1093,8 @@ SELECT v.subprocessors_list_url, v.certifications, v.countries, - v.business_owner_id, - v.security_owner_id, + v.business_owner_profile_id, + v.security_owner_profile_id, v.status_page_url, v.terms_of_service_url, v.security_page_url, @@ -1166,8 +1166,8 @@ INSERT INTO vendors ( subprocessors_list_url, certifications, countries, - business_owner_id, - security_owner_id, + business_owner_profile_id, + security_owner_profile_id, status_page_url, terms_of_service_url, security_page_url, @@ -1195,8 +1195,8 @@ SELECT v.subprocessors_list_url, v.certifications, v.countries, - v.business_owner_id, - v.security_owner_id, + v.business_owner_profile_id, + v.security_owner_profile_id, v.status_page_url, v.terms_of_service_url, v.security_page_url, @@ -1270,8 +1270,8 @@ INSERT INTO vendors ( subprocessors_list_url, certifications, countries, - business_owner_id, - security_owner_id, + business_owner_profile_id, + security_owner_profile_id, status_page_url, terms_of_service_url, security_page_url, @@ -1299,8 +1299,8 @@ SELECT v.subprocessors_list_url, v.certifications, v.countries, - v.business_owner_id, - v.security_owner_id, + v.business_owner_profile_id, + v.security_owner_profile_id, v.status_page_url, v.terms_of_service_url, v.security_page_url,