Remove meeting feature

Drop meetings and meeting_attendees tables, remove all meeting-related
code across GraphQL, MCP, CLI, N8N, webhooks, frontend, and e2e tests.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-04-16 17:57:34 +02:00
parent c32aff5e9e
commit 6c5c1fa818
45 changed files with 24 additions and 4906 deletions

View File

@@ -89,8 +89,6 @@ func ResourceTypeName(entityType uint16) string {
return "Membership"
case TrustCenterFileEntityType:
return "TrustCenterFile"
case MeetingEntityType:
return "Meeting"
case DataProtectionImpactAssessmentEntityType:
return "DataProtectionImpactAssessment"
case TransferImpactAssessmentEntityType:

View File

@@ -68,7 +68,7 @@ const (
SAMLConfigurationEntityType uint16 = 42
PersonalAPIKeyEntityType uint16 = 43
_ uint16 = 44 // PersonalAPIKeyMembershipEntityType - removed
MeetingEntityType uint16 = 45
_ uint16 = 45 // MeetingEntityType - removed
DataProtectionImpactAssessmentEntityType uint16 = 46
TransferImpactAssessmentEntityType uint16 = 47
RightsRequestEntityType uint16 = 48
@@ -196,8 +196,6 @@ func NewEntityFromID(id gid.GID) (any, bool) {
return &SAMLConfiguration{ID: id}, true
case PersonalAPIKeyEntityType:
return &PersonalAPIKey{ID: id}, true
case MeetingEntityType:
return &Meeting{ID: id}, true
case DataProtectionImpactAssessmentEntityType:
return &DataProtectionImpactAssessment{ID: id}, true
case TransferImpactAssessmentEntityType:

View File

@@ -1,306 +0,0 @@
// Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
package coredata
import (
"context"
"errors"
"fmt"
"maps"
"time"
"github.com/jackc/pgx/v5"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page"
)
type (
Meeting struct {
ID gid.GID `db:"id"`
OrganizationID gid.GID `db:"organization_id"`
Name string `db:"name"`
Date time.Time `db:"date"`
Minutes *string `db:"minutes"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
Meetings []*Meeting
)
func (m Meeting) CursorKey(orderBy MeetingOrderField) page.CursorKey {
switch orderBy {
case MeetingOrderFieldCreatedAt:
return page.NewCursorKey(m.ID, m.CreatedAt)
case MeetingOrderFieldDate:
return page.NewCursorKey(m.ID, m.Date)
case MeetingOrderFieldName:
return page.NewCursorKey(m.ID, m.Name)
}
panic(fmt.Sprintf("unsupported order by: %s", orderBy))
}
// AuthorizationAttributes returns the authorization attributes for policy evaluation.
func (m *Meeting) AuthorizationAttributes(ctx context.Context, conn pg.Querier) (map[string]string, error) {
q := `SELECT organization_id FROM meetings WHERE id = $1 LIMIT 1;`
var organizationID gid.GID
if err := conn.QueryRow(ctx, q, m.ID).Scan(&organizationID); err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return nil, ErrResourceNotFound
}
return nil, fmt.Errorf("cannot query meeting authorization attributes: %w", err)
}
return map[string]string{"organization_id": organizationID.String()}, nil
}
func (m *Meeting) LoadByID(
ctx context.Context,
conn pg.Querier,
scope Scoper,
meetingID gid.GID,
) error {
q := `
SELECT
id,
organization_id,
name,
date,
minutes,
created_at,
updated_at
FROM
meetings
WHERE
%s
AND id = @meeting_id
LIMIT 1;
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{"meeting_id": meetingID}
maps.Copy(args, scope.SQLArguments())
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query meetings: %w", err)
}
meeting, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[Meeting])
if err != nil {
if errors.Is(err, pgx.ErrNoRows) {
return ErrResourceNotFound
}
return fmt.Errorf("cannot collect meeting: %w", err)
}
*m = meeting
return nil
}
func (m *Meetings) LoadByOrganizationID(
ctx context.Context,
conn pg.Querier,
scope Scoper,
organizationID gid.GID,
cursor *page.Cursor[MeetingOrderField],
) error {
q := `
SELECT
id,
organization_id,
name,
date,
minutes,
created_at,
updated_at
FROM
meetings
WHERE
%s
AND organization_id = @organization_id
AND %s
`
q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment())
args := pgx.NamedArgs{"organization_id": organizationID}
maps.Copy(args, scope.SQLArguments())
maps.Copy(args, cursor.SQLArguments())
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query meetings: %w", err)
}
meetings, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Meeting])
if err != nil {
return fmt.Errorf("cannot collect meetings: %w", err)
}
*m = meetings
return nil
}
func (m *Meetings) CountByOrganizationID(
ctx context.Context,
conn pg.Querier,
scope Scoper,
organizationID gid.GID,
) (int, error) {
q := `
SELECT
COUNT(*)
FROM
meetings
WHERE
%s
AND organization_id = @organization_id
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{
"organization_id": organizationID,
}
maps.Copy(args, scope.SQLArguments())
row := conn.QueryRow(ctx, q, args)
var count int
if err := row.Scan(&count); err != nil {
return 0, fmt.Errorf("cannot count meetings: %w", err)
}
return count, nil
}
func (m *Meeting) Insert(
ctx context.Context,
conn pg.Tx,
scope Scoper,
) error {
q := `
INSERT INTO
meetings (
tenant_id,
id,
organization_id,
name,
date,
minutes,
created_at,
updated_at
)
VALUES (
@tenant_id,
@meeting_id,
@organization_id,
@name,
@date,
@minutes,
@created_at,
@updated_at
);
`
args := pgx.StrictNamedArgs{
"tenant_id": scope.GetTenantID(),
"meeting_id": m.ID,
"organization_id": m.OrganizationID,
"name": m.Name,
"date": m.Date,
"minutes": m.Minutes,
"created_at": m.CreatedAt,
"updated_at": m.UpdatedAt,
}
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot insert meeting: %w", err)
}
return nil
}
func (m *Meeting) Update(
ctx context.Context,
conn pg.Tx,
scope Scoper,
) error {
q := `
UPDATE meetings
SET
name = @name,
date = @date,
minutes = @minutes,
updated_at = @updated_at
WHERE %s
AND id = @meeting_id
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{
"meeting_id": m.ID,
"name": m.Name,
"date": m.Date,
"minutes": m.Minutes,
"updated_at": m.UpdatedAt,
}
maps.Copy(args, scope.SQLArguments())
result, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot update meeting: %w", err)
}
if result.RowsAffected() == 0 {
return ErrResourceNotFound
}
return nil
}
func (m *Meeting) Delete(
ctx context.Context,
conn pg.Tx,
scope Scoper,
) error {
q := `
DELETE FROM meetings
WHERE %s
AND id = @meeting_id
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.StrictNamedArgs{
"meeting_id": m.ID,
}
maps.Copy(args, scope.SQLArguments())
result, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot delete meeting: %w", err)
}
if result.RowsAffected() == 0 {
return ErrResourceNotFound
}
return nil
}

View File

@@ -1,82 +0,0 @@
// Copyright (c) 2025-2026 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"
"time"
"github.com/jackc/pgx/v5"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/gid"
)
type (
MeetingAttendee struct {
MeetingID gid.GID `db:"meeting_id"`
OrganizationID gid.GID `db:"organization_id"`
AttendeeID gid.GID `db:"attendee_profile_id"`
CreatedAt time.Time `db:"created_at"`
}
MeetingAttendees []*MeetingAttendee
)
func (ma *MeetingAttendees) Merge(
ctx context.Context,
conn pg.Querier,
scope Scoper,
meetingID gid.GID,
organizationID gid.GID,
attendeeIDs []gid.GID,
) error {
q := `
WITH attendee_ids AS (
SELECT
unnest(@attendee_ids::text[]) AS attendee_profile_id,
@tenant_id AS tenant_id,
@meeting_id AS meeting_id,
@organization_id AS organization_id,
@created_at::timestamptz AS created_at
)
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_profile_id = src.attendee_profile_id
WHEN NOT MATCHED THEN
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
`
args := pgx.StrictNamedArgs{
"tenant_id": scope.GetTenantID(),
"meeting_id": meetingID,
"organization_id": organizationID,
"created_at": time.Now(),
"attendee_ids": attendeeIDs,
}
_, err := conn.Exec(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot merge meeting attendees: %w", err)
}
return nil
}

View File

@@ -1,57 +0,0 @@
// Copyright (c) 2025-2026 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 (
MeetingOrderField string
)
const (
MeetingOrderFieldDate MeetingOrderField = "DATE"
MeetingOrderFieldName MeetingOrderField = "NAME"
MeetingOrderFieldCreatedAt MeetingOrderField = "CREATED_AT"
)
func (p MeetingOrderField) Column() string {
return string(p)
}
func (p MeetingOrderField) String() string {
return string(p)
}
func (p MeetingOrderField) IsValid() bool {
switch p {
case MeetingOrderFieldDate, MeetingOrderFieldName, MeetingOrderFieldCreatedAt:
return true
}
return false
}
func (p MeetingOrderField) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}
func (p *MeetingOrderField) UnmarshalText(text []byte) error {
*p = MeetingOrderField(text)
if !p.IsValid() {
return fmt.Errorf("%s is not a valid MeetingOrderField", string(text))
}
return nil
}

View File

@@ -718,122 +718,6 @@ WHERE
return count, nil
}
func (p *MembershipProfiles) LoadByMeetingID(
ctx context.Context,
conn pg.Querier,
scope Scoper,
meetingID gid.GID,
) error {
q := `
WITH attendees AS (
SELECT
p.id,
p.tenant_id,
p.identity_id,
p.organization_id,
i.email_address,
p.source,
p.state,
p.full_name,
p.kind,
p.additional_email_addresses,
p.position,
p.contract_start_date,
p.contract_end_date,
p.user_name,
p.external_id,
p.nickname,
p.locale,
p.timezone,
p.profile_url,
p.preferred_language,
p.given_name,
p.family_name,
p.formatted_name,
p.middle_name,
p.honorific_prefix,
p.honorific_suffix,
p.employee_number,
p.department,
p.cost_center,
p.enterprise_organization,
p.division,
p.manager_value,
p.created_at,
p.updated_at,
ma.created_at AS attendee_created_at
FROM
iam_membership_profiles p
INNER JOIN identities i
ON i.id = p.identity_id
INNER JOIN
meeting_attendees ma ON p.id = ma.attendee_profile_id
WHERE
ma.meeting_id = @meeting_id
)
SELECT
id,
identity_id,
organization_id,
kind,
email_address,
source,
state,
full_name,
additional_email_addresses,
position,
contract_start_date,
contract_end_date,
'' AS organization_name,
user_name,
external_id,
nickname,
locale,
timezone,
profile_url,
preferred_language,
given_name,
family_name,
formatted_name,
middle_name,
honorific_prefix,
honorific_suffix,
employee_number,
department,
cost_center,
enterprise_organization,
division,
manager_value,
created_at,
updated_at
FROM
attendees
WHERE
%s
ORDER BY
attendee_created_at ASC
`
q = fmt.Sprintf(q, scope.SQLFragment())
args := pgx.NamedArgs{"meeting_id": meetingID}
maps.Copy(args, scope.SQLArguments())
rows, err := conn.Query(ctx, q, args)
if err != nil {
return fmt.Errorf("cannot query profiles: %w", err)
}
profiles, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[MembershipProfile])
if err != nil {
return fmt.Errorf("cannot collect profiles: %w", err)
}
*p = profiles
return nil
}
func (p *MembershipProfiles) LoadAwaitingSigning(
ctx context.Context,
conn pg.Querier,

View File

@@ -0,0 +1,16 @@
-- Copyright (c) 2026 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.
DROP TABLE meeting_attendees;
DROP TABLE meetings;

View File

@@ -23,9 +23,6 @@ import (
type WebhookEventType string
const (
WebhookEventTypeMeetingCreated WebhookEventType = "meeting:created"
WebhookEventTypeMeetingUpdated WebhookEventType = "meeting:updated"
WebhookEventTypeMeetingDeleted WebhookEventType = "meeting:deleted"
WebhookEventTypeVendorCreated WebhookEventType = "vendor:created"
WebhookEventTypeVendorUpdated WebhookEventType = "vendor:updated"
WebhookEventTypeVendorDeleted WebhookEventType = "vendor:deleted"
@@ -43,8 +40,7 @@ func (w WebhookEventType) String() string {
func (w WebhookEventType) IsValid() bool {
switch w {
case WebhookEventTypeMeetingCreated, WebhookEventTypeMeetingUpdated, WebhookEventTypeMeetingDeleted,
WebhookEventTypeVendorCreated, WebhookEventTypeVendorUpdated, WebhookEventTypeVendorDeleted,
case WebhookEventTypeVendorCreated, WebhookEventTypeVendorUpdated, WebhookEventTypeVendorDeleted,
WebhookEventTypeUserCreated, WebhookEventTypeUserUpdated, WebhookEventTypeUserDeleted,
WebhookEventTypeObligationCreated, WebhookEventTypeObligationUpdated, WebhookEventTypeObligationDeleted:
return true