Add meeting and meeting summary objects
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
committed by
Bryan Frimin
parent
0a9033aaaf
commit
139f5984e2
@@ -395,6 +395,14 @@ enum DocumentOrderField
|
||||
)
|
||||
}
|
||||
|
||||
enum MeetingOrderField
|
||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.MeetingOrderField") {
|
||||
DATE @goEnum(value: "go.probo.inc/probo/pkg/coredata.MeetingOrderFieldDate")
|
||||
NAME @goEnum(value: "go.probo.inc/probo/pkg/coredata.MeetingOrderFieldName")
|
||||
CREATED_AT
|
||||
@goEnum(value: "go.probo.inc/probo/pkg/coredata.MeetingOrderFieldCreatedAt")
|
||||
}
|
||||
|
||||
enum RiskOrderField
|
||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.RiskOrderField") {
|
||||
CREATED_AT
|
||||
@@ -1200,6 +1208,14 @@ input DocumentOrder
|
||||
field: DocumentOrderField!
|
||||
}
|
||||
|
||||
input MeetingOrder
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.MeetingOrderBy"
|
||||
) {
|
||||
direction: OrderDirection!
|
||||
field: MeetingOrderField!
|
||||
}
|
||||
|
||||
input RiskOrder
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.RiskOrderBy"
|
||||
@@ -1442,6 +1458,7 @@ type Organization implements Node {
|
||||
websiteUrl: String
|
||||
email: String
|
||||
headquarterAddress: String
|
||||
context: OrganizationContext @goField(forceResolver: true)
|
||||
|
||||
memberships(
|
||||
first: Int
|
||||
@@ -1511,6 +1528,14 @@ type Organization implements Node {
|
||||
filter: DocumentFilter
|
||||
): DocumentConnection! @goField(forceResolver: true)
|
||||
|
||||
meetings(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: MeetingOrder
|
||||
): MeetingConnection! @goField(forceResolver: true)
|
||||
|
||||
measures(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
@@ -1996,6 +2021,17 @@ type Document implements Node {
|
||||
updatedAt: Datetime!
|
||||
}
|
||||
|
||||
type Meeting implements Node {
|
||||
id: ID!
|
||||
name: String!
|
||||
date: Datetime!
|
||||
minutes: String
|
||||
attendees: [People!]! @goField(forceResolver: true)
|
||||
organization: Organization! @goField(forceResolver: true)
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
}
|
||||
|
||||
type Risk implements Node {
|
||||
id: ID!
|
||||
snapshotId: ID
|
||||
@@ -2478,6 +2514,20 @@ type DocumentEdge {
|
||||
node: Document!
|
||||
}
|
||||
|
||||
type MeetingConnection
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.MeetingConnection"
|
||||
) {
|
||||
totalCount: Int! @goField(forceResolver: true)
|
||||
edges: [MeetingEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type MeetingEdge {
|
||||
cursor: CursorKey!
|
||||
node: Meeting!
|
||||
}
|
||||
|
||||
type RiskConnection
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.RiskConnection"
|
||||
@@ -2677,6 +2727,9 @@ type Mutation {
|
||||
updateOrganization(
|
||||
input: UpdateOrganizationInput!
|
||||
): UpdateOrganizationPayload!
|
||||
updateOrganizationContext(
|
||||
input: UpdateOrganizationContextInput!
|
||||
): UpdateOrganizationContextPayload!
|
||||
deleteOrganizationHorizontalLogo(
|
||||
input: DeleteOrganizationHorizontalLogoInput!
|
||||
): DeleteOrganizationHorizontalLogoPayload!
|
||||
@@ -2895,6 +2948,10 @@ type Mutation {
|
||||
createDocument(input: CreateDocumentInput!): CreateDocumentPayload!
|
||||
updateDocument(input: UpdateDocumentInput!): UpdateDocumentPayload!
|
||||
deleteDocument(input: DeleteDocumentInput!): DeleteDocumentPayload!
|
||||
# Meeting mutations
|
||||
createMeeting(input: CreateMeetingInput!): CreateMeetingPayload!
|
||||
updateMeeting(input: UpdateMeetingInput!): UpdateMeetingPayload!
|
||||
deleteMeeting(input: DeleteMeetingInput!): DeleteMeetingPayload!
|
||||
publishDocumentVersion(
|
||||
input: PublishDocumentVersionInput!
|
||||
): PublishDocumentVersionPayload!
|
||||
@@ -3050,6 +3107,11 @@ input UpdateOrganizationInput {
|
||||
horizontalLogoFile: Upload
|
||||
}
|
||||
|
||||
input UpdateOrganizationContextInput {
|
||||
organizationId: ID!
|
||||
summary: String @goField(omittable: true)
|
||||
}
|
||||
|
||||
input DeleteOrganizationHorizontalLogoInput {
|
||||
organizationId: ID!
|
||||
}
|
||||
@@ -3539,6 +3601,26 @@ input DeleteDocumentInput {
|
||||
documentId: ID!
|
||||
}
|
||||
|
||||
input CreateMeetingInput {
|
||||
organizationId: ID!
|
||||
name: String!
|
||||
date: Datetime!
|
||||
attendeeIds: [ID!]
|
||||
minutes: String
|
||||
}
|
||||
|
||||
input UpdateMeetingInput {
|
||||
meetingId: ID!
|
||||
name: String
|
||||
date: Datetime
|
||||
attendeeIds: [ID!]
|
||||
minutes: String @goField(omittable: true)
|
||||
}
|
||||
|
||||
input DeleteMeetingInput {
|
||||
meetingId: ID!
|
||||
}
|
||||
|
||||
input ConfirmEmailInput {
|
||||
token: String!
|
||||
}
|
||||
@@ -3772,6 +3854,15 @@ type UpdateOrganizationPayload {
|
||||
organization: Organization!
|
||||
}
|
||||
|
||||
type UpdateOrganizationContextPayload {
|
||||
context: OrganizationContext!
|
||||
}
|
||||
|
||||
type OrganizationContext {
|
||||
organizationId: ID!
|
||||
summary: String
|
||||
}
|
||||
|
||||
type DeleteOrganizationHorizontalLogoPayload {
|
||||
organization: Organization!
|
||||
}
|
||||
@@ -4091,6 +4182,18 @@ type DeleteDocumentPayload {
|
||||
deletedDocumentId: ID!
|
||||
}
|
||||
|
||||
type CreateMeetingPayload {
|
||||
meetingEdge: MeetingEdge!
|
||||
}
|
||||
|
||||
type UpdateMeetingPayload {
|
||||
meeting: Meeting!
|
||||
}
|
||||
|
||||
type DeleteMeetingPayload {
|
||||
deletedMeetingId: ID!
|
||||
}
|
||||
|
||||
type ConfirmEmailPayload {
|
||||
success: Boolean!
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
82
pkg/server/api/console/v1/types/meeting.go
Normal file
82
pkg/server/api/console/v1/types/meeting.go
Normal file
@@ -0,0 +1,82 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"go.probo.inc/probo/pkg/coredata"
|
||||
"go.probo.inc/probo/pkg/gid"
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
type (
|
||||
MeetingOrderBy OrderBy[coredata.MeetingOrderField]
|
||||
|
||||
MeetingConnection struct {
|
||||
TotalCount int
|
||||
Edges []*MeetingEdge
|
||||
PageInfo PageInfo
|
||||
|
||||
Resolver any
|
||||
ParentID gid.GID
|
||||
}
|
||||
)
|
||||
|
||||
func NewMeetingConnection(
|
||||
p *page.Page[*coredata.Meeting, coredata.MeetingOrderField],
|
||||
parentType any,
|
||||
parentID gid.GID,
|
||||
) *MeetingConnection {
|
||||
var edges = make([]*MeetingEdge, len(p.Data))
|
||||
|
||||
for i := range edges {
|
||||
edges[i] = NewMeetingEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
||||
}
|
||||
|
||||
return &MeetingConnection{
|
||||
Edges: edges,
|
||||
PageInfo: *NewPageInfo(p),
|
||||
|
||||
Resolver: parentType,
|
||||
ParentID: parentID,
|
||||
}
|
||||
}
|
||||
|
||||
func NewMeetingEdges(meetings []*coredata.Meeting, orderBy coredata.MeetingOrderField) []*MeetingEdge {
|
||||
edges := make([]*MeetingEdge, len(meetings))
|
||||
|
||||
for i := range edges {
|
||||
edges[i] = NewMeetingEdge(meetings[i], orderBy)
|
||||
}
|
||||
|
||||
return edges
|
||||
}
|
||||
|
||||
func NewMeetingEdge(meeting *coredata.Meeting, orderBy coredata.MeetingOrderField) *MeetingEdge {
|
||||
return &MeetingEdge{
|
||||
Cursor: meeting.CursorKey(orderBy),
|
||||
Node: NewMeeting(meeting),
|
||||
}
|
||||
}
|
||||
|
||||
func NewMeeting(meeting *coredata.Meeting) *Meeting {
|
||||
return &Meeting{
|
||||
ID: meeting.ID,
|
||||
Name: meeting.Name,
|
||||
Date: meeting.Date,
|
||||
Minutes: meeting.Minutes,
|
||||
CreatedAt: meeting.CreatedAt,
|
||||
UpdatedAt: meeting.UpdatedAt,
|
||||
}
|
||||
}
|
||||
26
pkg/server/api/console/v1/types/organization_context.go
Normal file
26
pkg/server/api/console/v1/types/organization_context.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
|
||||
//
|
||||
// Permission to use, copy, modify, and/or distribute this software for any
|
||||
// purpose with or without fee is hereby granted, provided that the above
|
||||
// copyright notice and this permission notice appear in all copies.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
// PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"go.probo.inc/probo/pkg/coredata"
|
||||
)
|
||||
|
||||
func NewOrganizationContext(oc *coredata.OrganizationContext) *OrganizationContext {
|
||||
return &OrganizationContext{
|
||||
OrganizationID: oc.OrganizationID,
|
||||
Summary: oc.Summary,
|
||||
}
|
||||
}
|
||||
@@ -376,6 +376,18 @@ type CreateMeasurePayload struct {
|
||||
MeasureEdge *MeasureEdge `json:"measureEdge"`
|
||||
}
|
||||
|
||||
type CreateMeetingInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name string `json:"name"`
|
||||
Date time.Time `json:"date"`
|
||||
AttendeeIds []gid.GID `json:"attendeeIds,omitempty"`
|
||||
Minutes *string `json:"minutes,omitempty"`
|
||||
}
|
||||
|
||||
type CreateMeetingPayload struct {
|
||||
MeetingEdge *MeetingEdge `json:"meetingEdge"`
|
||||
}
|
||||
|
||||
type CreateNonconformityInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
ReferenceID string `json:"referenceId"`
|
||||
@@ -446,7 +458,7 @@ type CreateProcessingActivityInput struct {
|
||||
Recipients *string `json:"recipients,omitempty"`
|
||||
Location *string `json:"location,omitempty"`
|
||||
InternationalTransfers bool `json:"internationalTransfers"`
|
||||
TransferSafeguard *coredata.ProcessingActivityTransferSafeguard `json:"transferSafeguards,omitempty"`
|
||||
TransferSafeguards *coredata.ProcessingActivityTransferSafeguard `json:"transferSafeguards,omitempty"`
|
||||
RetentionPeriod *string `json:"retentionPeriod,omitempty"`
|
||||
SecurityMeasures *string `json:"securityMeasures,omitempty"`
|
||||
DataProtectionImpactAssessment coredata.ProcessingActivityDataProtectionImpactAssessment `json:"dataProtectionImpactAssessment"`
|
||||
@@ -841,6 +853,14 @@ type DeleteMeasurePayload struct {
|
||||
DeletedMeasureID gid.GID `json:"deletedMeasureId"`
|
||||
}
|
||||
|
||||
type DeleteMeetingInput struct {
|
||||
MeetingID gid.GID `json:"meetingId"`
|
||||
}
|
||||
|
||||
type DeleteMeetingPayload struct {
|
||||
DeletedMeetingID gid.GID `json:"deletedMeetingId"`
|
||||
}
|
||||
|
||||
type DeleteNonconformityInput struct {
|
||||
NonconformityID gid.GID `json:"nonconformityId"`
|
||||
}
|
||||
@@ -1340,6 +1360,25 @@ type MeasureFilter struct {
|
||||
State *coredata.MeasureState `json:"state,omitempty"`
|
||||
}
|
||||
|
||||
type Meeting struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Date time.Time `json:"date"`
|
||||
Minutes *string `json:"minutes,omitempty"`
|
||||
Attendees []*People `json:"attendees"`
|
||||
Organization *Organization `json:"organization"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (Meeting) IsNode() {}
|
||||
func (this Meeting) GetID() gid.GID { return this.ID }
|
||||
|
||||
type MeetingEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *Meeting `json:"node"`
|
||||
}
|
||||
|
||||
type Membership struct {
|
||||
ID gid.GID `json:"id"`
|
||||
UserID gid.GID `json:"userID"`
|
||||
@@ -1432,6 +1471,7 @@ type Organization struct {
|
||||
WebsiteURL *string `json:"websiteUrl,omitempty"`
|
||||
Email *string `json:"email,omitempty"`
|
||||
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
|
||||
Context *OrganizationContext `json:"context,omitempty"`
|
||||
Memberships *MembershipConnection `json:"memberships"`
|
||||
Invitations *InvitationConnection `json:"invitations"`
|
||||
SlackConnections *SlackConnectionConnection `json:"slackConnections"`
|
||||
@@ -1440,6 +1480,7 @@ type Organization struct {
|
||||
Vendors *VendorConnection `json:"vendors"`
|
||||
Peoples *PeopleConnection `json:"peoples"`
|
||||
Documents *DocumentConnection `json:"documents"`
|
||||
Meetings *MeetingConnection `json:"meetings"`
|
||||
Measures *MeasureConnection `json:"measures"`
|
||||
Risks *RiskConnection `json:"risks"`
|
||||
Tasks *TaskConnection `json:"tasks"`
|
||||
@@ -1467,6 +1508,11 @@ type OrganizationConnection struct {
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
}
|
||||
|
||||
type OrganizationContext struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Summary *string `json:"summary,omitempty"`
|
||||
}
|
||||
|
||||
type OrganizationEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *Organization `json:"node"`
|
||||
@@ -1956,6 +2002,18 @@ type UpdateMeasurePayload struct {
|
||||
Measure *Measure `json:"measure"`
|
||||
}
|
||||
|
||||
type UpdateMeetingInput struct {
|
||||
MeetingID gid.GID `json:"meetingId"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Date *time.Time `json:"date,omitempty"`
|
||||
AttendeeIds []gid.GID `json:"attendeeIds,omitempty"`
|
||||
Minutes graphql.Omittable[*string] `json:"minutes,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateMeetingPayload struct {
|
||||
Meeting *Meeting `json:"meeting"`
|
||||
}
|
||||
|
||||
type UpdateNonconformityInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
ReferenceID *string `json:"referenceId,omitempty"`
|
||||
@@ -1991,6 +2049,15 @@ type UpdateObligationPayload struct {
|
||||
Obligation *Obligation `json:"obligation"`
|
||||
}
|
||||
|
||||
type UpdateOrganizationContextInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Summary graphql.Omittable[*string] `json:"summary,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateOrganizationContextPayload struct {
|
||||
Context *OrganizationContext `json:"context"`
|
||||
}
|
||||
|
||||
type UpdateOrganizationInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
|
||||
@@ -1177,6 +1177,68 @@ func (r *measureConnectionResolver) TotalCount(ctx context.Context, obj *types.M
|
||||
panic(fmt.Errorf("unsupported resolver: %T", obj.Resolver))
|
||||
}
|
||||
|
||||
// Attendees is the resolver for the attendees field.
|
||||
func (r *meetingResolver) Attendees(ctx context.Context, obj *types.Meeting) ([]*types.People, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
attendees, err := prb.Meetings.GetAttendees(ctx, obj.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot load meeting attendees: %w", err))
|
||||
}
|
||||
|
||||
if len(attendees) == 0 {
|
||||
return []*types.People{}, nil
|
||||
}
|
||||
|
||||
people := make([]*types.People, len(attendees))
|
||||
for i, attendee := range attendees {
|
||||
people[i] = types.NewPeople(attendee)
|
||||
}
|
||||
|
||||
return people, nil
|
||||
}
|
||||
|
||||
// Organization is the resolver for the organization field.
|
||||
func (r *meetingResolver) Organization(ctx context.Context, obj *types.Meeting) (*types.Organization, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
meeting, err := prb.Meetings.Get(ctx, obj.ID)
|
||||
if err != nil {
|
||||
var errNotFound *coredata.ErrMeetingNotFound
|
||||
if errors.As(err, &errNotFound) {
|
||||
return nil, gqlutils.NotFound(errNotFound)
|
||||
}
|
||||
panic(fmt.Errorf("cannot load meeting: %w", err))
|
||||
}
|
||||
|
||||
organization, err := prb.Organizations.Get(ctx, meeting.OrganizationID)
|
||||
if err != nil {
|
||||
var errNotFound *coredata.ErrOrganizationNotFound
|
||||
if errors.As(err, &errNotFound) {
|
||||
return nil, gqlutils.NotFound(errNotFound)
|
||||
}
|
||||
panic(fmt.Errorf("cannot load organization: %w", err))
|
||||
}
|
||||
|
||||
return types.NewOrganization(organization), nil
|
||||
}
|
||||
|
||||
// TotalCount is the resolver for the totalCount field.
|
||||
func (r *meetingConnectionResolver) TotalCount(ctx context.Context, obj *types.MeetingConnection) (int, error) {
|
||||
prb := r.ProboService(ctx, obj.ParentID.TenantID())
|
||||
|
||||
switch obj.Resolver.(type) {
|
||||
case *organizationResolver:
|
||||
count, err := prb.Meetings.CountForOrganizationID(ctx, obj.ParentID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot count meetings: %w", err))
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
|
||||
panic(fmt.Errorf("unsupported resolver: %T", obj.Resolver))
|
||||
}
|
||||
|
||||
// AuthMethod is the resolver for the authMethod field.
|
||||
func (r *membershipResolver) AuthMethod(ctx context.Context, obj *types.Membership) (coredata.UserAuthMethod, error) {
|
||||
session := SessionFromContext(ctx)
|
||||
@@ -1317,6 +1379,25 @@ func (r *mutationResolver) UpdateOrganization(ctx context.Context, input types.U
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UpdateOrganizationContext is the resolver for the updateOrganizationContext field.
|
||||
func (r *mutationResolver) UpdateOrganizationContext(ctx context.Context, input types.UpdateOrganizationContextInput) (*types.UpdateOrganizationContextPayload, error) {
|
||||
prb := r.ProboService(ctx, input.OrganizationID.TenantID())
|
||||
|
||||
req := probo.UpdateOrganizationContextRequest{
|
||||
OrganizationID: input.OrganizationID,
|
||||
Summary: UnwrapOmittable(input.Summary),
|
||||
}
|
||||
|
||||
organizationContext, err := prb.Organizations.UpdateContext(ctx, req)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot update organization context: %w", err))
|
||||
}
|
||||
|
||||
return &types.UpdateOrganizationContextPayload{
|
||||
Context: types.NewOrganizationContext(organizationContext),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteOrganizationHorizontalLogo is the resolver for the deleteOrganizationHorizontalLogo field.
|
||||
func (r *mutationResolver) DeleteOrganizationHorizontalLogo(ctx context.Context, input types.DeleteOrganizationHorizontalLogoInput) (*types.DeleteOrganizationHorizontalLogoPayload, error) {
|
||||
prb := r.ProboService(ctx, input.OrganizationID.TenantID())
|
||||
@@ -2841,6 +2922,71 @@ func (r *mutationResolver) DeleteDocument(ctx context.Context, input types.Delet
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CreateMeeting is the resolver for the createMeeting field.
|
||||
func (r *mutationResolver) CreateMeeting(ctx context.Context, input types.CreateMeetingInput) (*types.CreateMeetingPayload, error) {
|
||||
prb := r.ProboService(ctx, input.OrganizationID.TenantID())
|
||||
|
||||
meeting, err := prb.Meetings.Create(
|
||||
ctx,
|
||||
probo.CreateMeetingRequest{
|
||||
OrganizationID: input.OrganizationID,
|
||||
Name: input.Name,
|
||||
Date: input.Date,
|
||||
AttendeeIDs: input.AttendeeIds,
|
||||
Minutes: input.Minutes,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot create meeting: %w", err))
|
||||
}
|
||||
|
||||
return &types.CreateMeetingPayload{
|
||||
MeetingEdge: types.NewMeetingEdge(meeting, coredata.MeetingOrderFieldCreatedAt),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UpdateMeeting is the resolver for the updateMeeting field.
|
||||
func (r *mutationResolver) UpdateMeeting(ctx context.Context, input types.UpdateMeetingInput) (*types.UpdateMeetingPayload, error) {
|
||||
prb := r.ProboService(ctx, input.MeetingID.TenantID())
|
||||
|
||||
var attendeeIDs []gid.GID
|
||||
if input.AttendeeIds != nil {
|
||||
attendeeIDs = input.AttendeeIds
|
||||
}
|
||||
|
||||
meeting, err := prb.Meetings.Update(
|
||||
ctx,
|
||||
probo.UpdateMeetingRequest{
|
||||
MeetingID: input.MeetingID,
|
||||
Name: input.Name,
|
||||
Date: input.Date,
|
||||
AttendeeIDs: attendeeIDs,
|
||||
Minutes: UnwrapOmittable(input.Minutes),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot update meeting: %w", err))
|
||||
}
|
||||
|
||||
return &types.UpdateMeetingPayload{
|
||||
Meeting: types.NewMeeting(meeting),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteMeeting is the resolver for the deleteMeeting field.
|
||||
func (r *mutationResolver) DeleteMeeting(ctx context.Context, input types.DeleteMeetingInput) (*types.DeleteMeetingPayload, error) {
|
||||
prb := r.ProboService(ctx, input.MeetingID.TenantID())
|
||||
|
||||
err := prb.Meetings.Delete(ctx, input.MeetingID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot delete meeting: %w", err))
|
||||
}
|
||||
|
||||
return &types.DeleteMeetingPayload{
|
||||
DeletedMeetingID: input.MeetingID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// PublishDocumentVersion is the resolver for the publishDocumentVersion field.
|
||||
func (r *mutationResolver) PublishDocumentVersion(ctx context.Context, input types.PublishDocumentVersionInput) (*types.PublishDocumentVersionPayload, error) {
|
||||
prb := r.ProboService(ctx, input.DocumentID.TenantID())
|
||||
@@ -3560,7 +3706,7 @@ func (r *mutationResolver) CreateProcessingActivity(ctx context.Context, input t
|
||||
Recipients: input.Recipients,
|
||||
Location: input.Location,
|
||||
InternationalTransfers: input.InternationalTransfers,
|
||||
TransferSafeguard: input.TransferSafeguard,
|
||||
TransferSafeguard: input.TransferSafeguards,
|
||||
RetentionPeriod: input.RetentionPeriod,
|
||||
SecurityMeasures: input.SecurityMeasures,
|
||||
DataProtectionImpactAssessment: input.DataProtectionImpactAssessment,
|
||||
@@ -4090,6 +4236,18 @@ func (r *organizationResolver) HorizontalLogoURL(ctx context.Context, obj *types
|
||||
return prb.Organizations.GenerateHorizontalLogoURL(ctx, obj.ID, 1*time.Hour)
|
||||
}
|
||||
|
||||
// Context is the resolver for the context field.
|
||||
func (r *organizationResolver) Context(ctx context.Context, obj *types.Organization) (*types.OrganizationContext, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
orgContext, err := prb.Organizations.GetContextSummary(ctx, obj.ID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot load organization context: %w", err))
|
||||
}
|
||||
|
||||
return types.NewOrganizationContext(orgContext), nil
|
||||
}
|
||||
|
||||
// Memberships is the resolver for the memberships field.
|
||||
func (r *organizationResolver) Memberships(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MembershipOrderBy) (*types.MembershipConnection, error) {
|
||||
pageOrderBy := page.OrderBy[coredata.MembershipOrderField]{
|
||||
@@ -4311,6 +4469,31 @@ func (r *organizationResolver) Documents(ctx context.Context, obj *types.Organiz
|
||||
return types.NewDocumentConnection(page, r, obj.ID, documentFilter), nil
|
||||
}
|
||||
|
||||
// Meetings is the resolver for the meetings field.
|
||||
func (r *organizationResolver) Meetings(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MeetingOrderBy) (*types.MeetingConnection, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.MeetingOrderField]{
|
||||
Field: coredata.MeetingOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.MeetingOrderField]{
|
||||
Field: orderBy.Field,
|
||||
Direction: orderBy.Direction,
|
||||
}
|
||||
}
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := prb.Meetings.ListForOrganizationID(ctx, obj.ID, cursor)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot list organization meetings: %w", err))
|
||||
}
|
||||
|
||||
return types.NewMeetingConnection(page, r, obj.ID), nil
|
||||
}
|
||||
|
||||
// Measures is the resolver for the measures field.
|
||||
func (r *organizationResolver) Measures(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MeasureOrderBy, filter *types.MeasureFilter) (*types.MeasureConnection, error) {
|
||||
prb := r.ProboService(ctx, obj.ID.TenantID())
|
||||
@@ -5003,6 +5186,17 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
||||
}
|
||||
|
||||
return types.NewTrustCenterAccess(trustCenterAccess), nil
|
||||
case coredata.MeetingEntityType:
|
||||
meeting, err := prb.Meetings.Get(ctx, id)
|
||||
if err != nil {
|
||||
var errNotFound *coredata.ErrMeetingNotFound
|
||||
if errors.As(err, &errNotFound) {
|
||||
return nil, gqlutils.NotFound(errNotFound)
|
||||
}
|
||||
panic(fmt.Errorf("cannot get meeting: %w", err))
|
||||
}
|
||||
|
||||
return types.NewMeeting(meeting), nil
|
||||
default:
|
||||
}
|
||||
|
||||
@@ -6272,6 +6466,14 @@ func (r *Resolver) MeasureConnection() schema.MeasureConnectionResolver {
|
||||
return &measureConnectionResolver{r}
|
||||
}
|
||||
|
||||
// Meeting returns schema.MeetingResolver implementation.
|
||||
func (r *Resolver) Meeting() schema.MeetingResolver { return &meetingResolver{r} }
|
||||
|
||||
// MeetingConnection returns schema.MeetingConnectionResolver implementation.
|
||||
func (r *Resolver) MeetingConnection() schema.MeetingConnectionResolver {
|
||||
return &meetingConnectionResolver{r}
|
||||
}
|
||||
|
||||
// Membership returns schema.MembershipResolver implementation.
|
||||
func (r *Resolver) Membership() schema.MembershipResolver { return &membershipResolver{r} }
|
||||
|
||||
@@ -6449,6 +6651,8 @@ type invitationResolver struct{ *Resolver }
|
||||
type invitationConnectionResolver struct{ *Resolver }
|
||||
type measureResolver struct{ *Resolver }
|
||||
type measureConnectionResolver struct{ *Resolver }
|
||||
type meetingResolver struct{ *Resolver }
|
||||
type meetingConnectionResolver struct{ *Resolver }
|
||||
type membershipResolver struct{ *Resolver }
|
||||
type membershipConnectionResolver struct{ *Resolver }
|
||||
type mutationResolver struct{ *Resolver }
|
||||
|
||||
Reference in New Issue
Block a user