Add first risk assememnt implementation
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -107,32 +107,6 @@ enum MesureImportance
|
||||
)
|
||||
}
|
||||
|
||||
enum ServiceCriticality
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.ServiceCriticality") {
|
||||
LOW
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.ServiceCriticalityLow"
|
||||
)
|
||||
MEDIUM
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.ServiceCriticalityMedium"
|
||||
)
|
||||
HIGH
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.ServiceCriticalityHigh"
|
||||
)
|
||||
}
|
||||
|
||||
enum RiskTier
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.RiskTier") {
|
||||
CRITICAL
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.RiskTierCritical")
|
||||
SIGNIFICANT
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.RiskTierSignificant")
|
||||
GENERAL
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.RiskTierGeneral")
|
||||
}
|
||||
|
||||
enum PolicyStatus
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.PolicyStatus") {
|
||||
DRAFT
|
||||
@@ -276,6 +250,32 @@ enum ConnectorOrderField
|
||||
)
|
||||
}
|
||||
|
||||
enum DataSensitivity
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.DataSensitivity") {
|
||||
NONE
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataSensitivityNone")
|
||||
LOW
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataSensitivityLow")
|
||||
MEDIUM
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataSensitivityMedium")
|
||||
HIGH
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataSensitivityHigh")
|
||||
CRITICAL
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.DataSensitivityCritical")
|
||||
}
|
||||
|
||||
enum BusinessImpact
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.BusinessImpact") {
|
||||
LOW
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.BusinessImpactLow")
|
||||
MEDIUM
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.BusinessImpactMedium")
|
||||
HIGH
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.BusinessImpactHigh")
|
||||
CRITICAL
|
||||
@goEnum(value: "github.com/getprobo/probo/pkg/coredata.BusinessImpactCritical")
|
||||
}
|
||||
|
||||
# Order Input Types
|
||||
input UserOrder
|
||||
@goModel(
|
||||
@@ -488,13 +488,19 @@ type Vendor implements Node {
|
||||
orderBy: VendorComplianceReportOrder
|
||||
): VendorComplianceReportConnection! @goField(forceResolver: true)
|
||||
|
||||
riskAssessments(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: VendorRiskAssessmentOrder
|
||||
): VendorRiskAssessmentConnection! @goField(forceResolver: true)
|
||||
|
||||
businessOwner: People @goField(forceResolver: true)
|
||||
securityOwner: People @goField(forceResolver: true)
|
||||
|
||||
serviceStartAt: Datetime!
|
||||
serviceTerminationAt: Datetime
|
||||
serviceCriticality: ServiceCriticality!
|
||||
riskTier: RiskTier!
|
||||
statusPageUrl: String
|
||||
termsOfServiceUrl: String
|
||||
privacyPolicyUrl: String
|
||||
@@ -850,6 +856,16 @@ type ConnectorEdge {
|
||||
node: Connector!
|
||||
}
|
||||
|
||||
type VendorRiskAssessmentConnection {
|
||||
edges: [VendorRiskAssessmentEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type VendorRiskAssessmentEdge {
|
||||
cursor: CursorKey!
|
||||
node: VendorRiskAssessment!
|
||||
}
|
||||
|
||||
# Root Types
|
||||
type Query {
|
||||
node(id: ID!): Node!
|
||||
@@ -951,6 +967,8 @@ type Mutation {
|
||||
createPolicy(input: CreatePolicyInput!): CreatePolicyPayload!
|
||||
updatePolicy(input: UpdatePolicyInput!): UpdatePolicyPayload!
|
||||
deletePolicy(input: DeletePolicyInput!): DeletePolicyPayload!
|
||||
|
||||
createVendorRiskAssessment(input: CreateVendorRiskAssessmentInput!): CreateVendorRiskAssessmentPayload!
|
||||
}
|
||||
|
||||
# Input Types
|
||||
@@ -986,8 +1004,6 @@ input CreateVendorInput {
|
||||
termsOfServiceUrl: String
|
||||
serviceStartAt: Datetime!
|
||||
serviceTerminationAt: Datetime
|
||||
serviceCriticality: ServiceCriticality!
|
||||
riskTier: RiskTier!
|
||||
businessOwnerId: ID
|
||||
securityOwnerId: ID
|
||||
}
|
||||
@@ -998,8 +1014,6 @@ input UpdateVendorInput {
|
||||
description: String
|
||||
serviceStartAt: Datetime
|
||||
serviceTerminationAt: Datetime
|
||||
serviceCriticality: ServiceCriticality
|
||||
riskTier: RiskTier
|
||||
statusPageUrl: String
|
||||
termsOfServiceUrl: String
|
||||
privacyPolicyUrl: String
|
||||
@@ -1434,3 +1448,48 @@ type InviteUserPayload {
|
||||
type RemoveUserPayload {
|
||||
success: Boolean!
|
||||
}
|
||||
|
||||
input VendorRiskAssessmentOrder {
|
||||
field: VendorRiskAssessmentOrderField!
|
||||
direction: OrderDirection!
|
||||
}
|
||||
|
||||
type VendorRiskAssessment implements Node {
|
||||
id: ID!
|
||||
vendor: Vendor! @goField(forceResolver: true)
|
||||
assessedAt: Datetime!
|
||||
assessedBy: People! @goField(forceResolver: true)
|
||||
expiresAt: Datetime!
|
||||
dataSensitivity: DataSensitivity!
|
||||
businessImpact: BusinessImpact!
|
||||
notes: String
|
||||
attachments: [String!]!
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
}
|
||||
|
||||
enum VendorRiskAssessmentOrderField
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.VendorRiskAssessmentOrderField") {
|
||||
CREATED_AT
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.VendorRiskAssessmentOrderFieldCreatedAt"
|
||||
)
|
||||
EXPIRES_AT
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.VendorRiskAssessmentOrderFieldExpiresAt"
|
||||
)
|
||||
}
|
||||
|
||||
input CreateVendorRiskAssessmentInput {
|
||||
vendorId: ID!
|
||||
assessedBy: ID!
|
||||
expiresAt: Datetime!
|
||||
dataSensitivity: DataSensitivity!
|
||||
businessImpact: BusinessImpact!
|
||||
notes: String
|
||||
attachments: [String!]
|
||||
}
|
||||
|
||||
type CreateVendorRiskAssessmentPayload {
|
||||
vendorRiskAssessmentEdge: VendorRiskAssessmentEdge!
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -220,33 +220,45 @@ type CreateTaskPayload struct {
|
||||
}
|
||||
|
||||
type CreateVendorInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name string `json:"name"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
|
||||
LegalName *string `json:"legalName,omitempty"`
|
||||
WebsiteURL *string `json:"websiteUrl,omitempty"`
|
||||
PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"`
|
||||
Category *string `json:"category,omitempty"`
|
||||
ServiceLevelAgreementURL *string `json:"serviceLevelAgreementUrl,omitempty"`
|
||||
DataProcessingAgreementURL *string `json:"dataProcessingAgreementUrl,omitempty"`
|
||||
Certifications []string `json:"certifications,omitempty"`
|
||||
SecurityPageURL *string `json:"securityPageUrl,omitempty"`
|
||||
TrustPageURL *string `json:"trustPageUrl,omitempty"`
|
||||
StatusPageURL *string `json:"statusPageUrl,omitempty"`
|
||||
TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"`
|
||||
ServiceStartAt time.Time `json:"serviceStartAt"`
|
||||
ServiceTerminationAt *time.Time `json:"serviceTerminationAt,omitempty"`
|
||||
ServiceCriticality coredata.ServiceCriticality `json:"serviceCriticality"`
|
||||
RiskTier coredata.RiskTier `json:"riskTier"`
|
||||
BusinessOwnerID *gid.GID `json:"businessOwnerId,omitempty"`
|
||||
SecurityOwnerID *gid.GID `json:"securityOwnerId,omitempty"`
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name string `json:"name"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
|
||||
LegalName *string `json:"legalName,omitempty"`
|
||||
WebsiteURL *string `json:"websiteUrl,omitempty"`
|
||||
PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"`
|
||||
Category *string `json:"category,omitempty"`
|
||||
ServiceLevelAgreementURL *string `json:"serviceLevelAgreementUrl,omitempty"`
|
||||
DataProcessingAgreementURL *string `json:"dataProcessingAgreementUrl,omitempty"`
|
||||
Certifications []string `json:"certifications,omitempty"`
|
||||
SecurityPageURL *string `json:"securityPageUrl,omitempty"`
|
||||
TrustPageURL *string `json:"trustPageUrl,omitempty"`
|
||||
StatusPageURL *string `json:"statusPageUrl,omitempty"`
|
||||
TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"`
|
||||
ServiceStartAt time.Time `json:"serviceStartAt"`
|
||||
ServiceTerminationAt *time.Time `json:"serviceTerminationAt,omitempty"`
|
||||
BusinessOwnerID *gid.GID `json:"businessOwnerId,omitempty"`
|
||||
SecurityOwnerID *gid.GID `json:"securityOwnerId,omitempty"`
|
||||
}
|
||||
|
||||
type CreateVendorPayload struct {
|
||||
VendorEdge *VendorEdge `json:"vendorEdge"`
|
||||
}
|
||||
|
||||
type CreateVendorRiskAssessmentInput struct {
|
||||
VendorID gid.GID `json:"vendorId"`
|
||||
AssessedBy gid.GID `json:"assessedBy"`
|
||||
ExpiresAt time.Time `json:"expiresAt"`
|
||||
DataSensitivity coredata.DataSensitivity `json:"dataSensitivity"`
|
||||
BusinessImpact coredata.BusinessImpact `json:"businessImpact"`
|
||||
Notes *string `json:"notes,omitempty"`
|
||||
Attachments []string `json:"attachments,omitempty"`
|
||||
}
|
||||
|
||||
type CreateVendorRiskAssessmentPayload struct {
|
||||
VendorRiskAssessmentEdge *VendorRiskAssessmentEdge `json:"vendorRiskAssessmentEdge"`
|
||||
}
|
||||
|
||||
type DeleteControlMesureMappingInput struct {
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
MesureID gid.GID `json:"mesureId"`
|
||||
@@ -744,27 +756,25 @@ type UpdateTaskPayload struct {
|
||||
}
|
||||
|
||||
type UpdateVendorInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
ServiceStartAt *time.Time `json:"serviceStartAt,omitempty"`
|
||||
ServiceTerminationAt *time.Time `json:"serviceTerminationAt,omitempty"`
|
||||
ServiceCriticality *coredata.ServiceCriticality `json:"serviceCriticality,omitempty"`
|
||||
RiskTier *coredata.RiskTier `json:"riskTier,omitempty"`
|
||||
StatusPageURL *string `json:"statusPageUrl,omitempty"`
|
||||
TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"`
|
||||
PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"`
|
||||
ServiceLevelAgreementURL *string `json:"serviceLevelAgreementUrl,omitempty"`
|
||||
DataProcessingAgreementURL *string `json:"dataProcessingAgreementUrl,omitempty"`
|
||||
WebsiteURL *string `json:"websiteUrl,omitempty"`
|
||||
LegalName *string `json:"legalName,omitempty"`
|
||||
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
|
||||
Category *string `json:"category,omitempty"`
|
||||
Certifications []string `json:"certifications,omitempty"`
|
||||
SecurityPageURL *string `json:"securityPageUrl,omitempty"`
|
||||
TrustPageURL *string `json:"trustPageUrl,omitempty"`
|
||||
BusinessOwnerID *gid.GID `json:"businessOwnerId,omitempty"`
|
||||
SecurityOwnerID *gid.GID `json:"securityOwnerId,omitempty"`
|
||||
ID gid.GID `json:"id"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
ServiceStartAt *time.Time `json:"serviceStartAt,omitempty"`
|
||||
ServiceTerminationAt *time.Time `json:"serviceTerminationAt,omitempty"`
|
||||
StatusPageURL *string `json:"statusPageUrl,omitempty"`
|
||||
TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"`
|
||||
PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"`
|
||||
ServiceLevelAgreementURL *string `json:"serviceLevelAgreementUrl,omitempty"`
|
||||
DataProcessingAgreementURL *string `json:"dataProcessingAgreementUrl,omitempty"`
|
||||
WebsiteURL *string `json:"websiteUrl,omitempty"`
|
||||
LegalName *string `json:"legalName,omitempty"`
|
||||
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
|
||||
Category *string `json:"category,omitempty"`
|
||||
Certifications []string `json:"certifications,omitempty"`
|
||||
SecurityPageURL *string `json:"securityPageUrl,omitempty"`
|
||||
TrustPageURL *string `json:"trustPageUrl,omitempty"`
|
||||
BusinessOwnerID *gid.GID `json:"businessOwnerId,omitempty"`
|
||||
SecurityOwnerID *gid.GID `json:"securityOwnerId,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateVendorPayload struct {
|
||||
@@ -809,12 +819,11 @@ type Vendor struct {
|
||||
Name string `json:"name"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
ComplianceReports *VendorComplianceReportConnection `json:"complianceReports"`
|
||||
RiskAssessments *VendorRiskAssessmentConnection `json:"riskAssessments"`
|
||||
BusinessOwner *People `json:"businessOwner,omitempty"`
|
||||
SecurityOwner *People `json:"securityOwner,omitempty"`
|
||||
ServiceStartAt time.Time `json:"serviceStartAt"`
|
||||
ServiceTerminationAt *time.Time `json:"serviceTerminationAt,omitempty"`
|
||||
ServiceCriticality coredata.ServiceCriticality `json:"serviceCriticality"`
|
||||
RiskTier coredata.RiskTier `json:"riskTier"`
|
||||
StatusPageURL *string `json:"statusPageUrl,omitempty"`
|
||||
TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"`
|
||||
PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"`
|
||||
@@ -868,6 +877,38 @@ type VendorEdge struct {
|
||||
Node *Vendor `json:"node"`
|
||||
}
|
||||
|
||||
type VendorRiskAssessment struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Vendor *Vendor `json:"vendor"`
|
||||
AssessedAt time.Time `json:"assessedAt"`
|
||||
AssessedBy *People `json:"assessedBy"`
|
||||
ExpiresAt time.Time `json:"expiresAt"`
|
||||
DataSensitivity coredata.DataSensitivity `json:"dataSensitivity"`
|
||||
BusinessImpact coredata.BusinessImpact `json:"businessImpact"`
|
||||
Notes *string `json:"notes,omitempty"`
|
||||
Attachments []string `json:"attachments"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (VendorRiskAssessment) IsNode() {}
|
||||
func (this VendorRiskAssessment) GetID() gid.GID { return this.ID }
|
||||
|
||||
type VendorRiskAssessmentConnection struct {
|
||||
Edges []*VendorRiskAssessmentEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
}
|
||||
|
||||
type VendorRiskAssessmentEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *VendorRiskAssessment `json:"node"`
|
||||
}
|
||||
|
||||
type VendorRiskAssessmentOrder struct {
|
||||
Field coredata.VendorRiskAssessmentOrderField `json:"field"`
|
||||
Direction page.OrderDirection `json:"direction"`
|
||||
}
|
||||
|
||||
type Viewer struct {
|
||||
ID gid.GID `json:"id"`
|
||||
User *User `json:"user"`
|
||||
|
||||
@@ -52,8 +52,6 @@ func NewVendor(v *coredata.Vendor) *Vendor {
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
ServiceStartAt: v.ServiceStartAt,
|
||||
ServiceTerminationAt: v.ServiceTerminationAt,
|
||||
ServiceCriticality: v.ServiceCriticality,
|
||||
RiskTier: v.RiskTier,
|
||||
StatusPageURL: v.StatusPageURL,
|
||||
TermsOfServiceURL: v.TermsOfServiceURL,
|
||||
PrivacyPolicyURL: v.PrivacyPolicyURL,
|
||||
|
||||
57
pkg/server/api/console/v1/types/vendor_risk_assessment.go
Normal file
57
pkg/server/api/console/v1/types/vendor_risk_assessment.go
Normal file
@@ -0,0 +1,57 @@
|
||||
// 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 (
|
||||
"github.com/getprobo/probo/pkg/coredata"
|
||||
"github.com/getprobo/probo/pkg/page"
|
||||
)
|
||||
|
||||
type (
|
||||
VendorRiskAssessmentOrderBy OrderBy[coredata.VendorRiskAssessmentOrderField]
|
||||
)
|
||||
|
||||
func NewVendorRiskAssessmentConnection(p *page.Page[*coredata.VendorRiskAssessment, coredata.VendorRiskAssessmentOrderField]) *VendorRiskAssessmentConnection {
|
||||
var edges = make([]*VendorRiskAssessmentEdge, len(p.Data))
|
||||
|
||||
for i := range edges {
|
||||
edges[i] = NewVendorRiskAssessmentEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
||||
}
|
||||
|
||||
return &VendorRiskAssessmentConnection{
|
||||
Edges: edges,
|
||||
PageInfo: NewPageInfo(p),
|
||||
}
|
||||
}
|
||||
|
||||
func NewVendorRiskAssessmentEdge(c *coredata.VendorRiskAssessment, orderBy coredata.VendorRiskAssessmentOrderField) *VendorRiskAssessmentEdge {
|
||||
return &VendorRiskAssessmentEdge{
|
||||
Cursor: c.CursorKey(orderBy),
|
||||
Node: NewVendorRiskAssessment(c),
|
||||
}
|
||||
}
|
||||
|
||||
func NewVendorRiskAssessment(c *coredata.VendorRiskAssessment) *VendorRiskAssessment {
|
||||
return &VendorRiskAssessment{
|
||||
ID: c.ID,
|
||||
AssessedAt: c.AssessedAt,
|
||||
ExpiresAt: c.ExpiresAt,
|
||||
DataSensitivity: c.DataSensitivity,
|
||||
BusinessImpact: c.BusinessImpact,
|
||||
Notes: c.Notes,
|
||||
CreatedAt: c.CreatedAt,
|
||||
UpdatedAt: c.UpdatedAt,
|
||||
}
|
||||
}
|
||||
@@ -206,6 +206,22 @@ func (r *mutationResolver) CreateOrganization(ctx context.Context, input types.C
|
||||
tenantIDs, _ := ctx.Value(userTenantContextKey).(*[]gid.TenantID)
|
||||
*tenantIDs = append(*tenantIDs, organization.ID.TenantID())
|
||||
|
||||
_, err = svc.Peoples.Create(
|
||||
ctx,
|
||||
probo.CreatePeopleRequest{
|
||||
OrganizationID: organization.ID,
|
||||
UserID: &UserFromContext(ctx).ID,
|
||||
FullName: UserFromContext(ctx).FullName,
|
||||
PrimaryEmailAddress: UserFromContext(ctx).EmailAddress,
|
||||
AdditionalEmailAddresses: []string{},
|
||||
Kind: coredata.PeopleKindEmployee,
|
||||
},
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot create people: %w", err)
|
||||
}
|
||||
|
||||
return &types.CreateOrganizationPayload{
|
||||
OrganizationEdge: types.NewOrganizationEdge(organization, coredata.OrganizationOrderFieldCreatedAt),
|
||||
}, nil
|
||||
@@ -363,8 +379,6 @@ func (r *mutationResolver) CreateVendor(ctx context.Context, input types.CreateV
|
||||
Description: input.Description,
|
||||
ServiceStartAt: input.ServiceStartAt,
|
||||
ServiceTerminationAt: input.ServiceTerminationAt,
|
||||
ServiceCriticality: input.ServiceCriticality,
|
||||
RiskTier: input.RiskTier,
|
||||
StatusPageURL: input.StatusPageURL,
|
||||
TermsOfServiceURL: input.TermsOfServiceURL,
|
||||
PrivacyPolicyURL: input.PrivacyPolicyURL,
|
||||
@@ -399,8 +413,6 @@ func (r *mutationResolver) UpdateVendor(ctx context.Context, input types.UpdateV
|
||||
Description: input.Description,
|
||||
ServiceStartAt: input.ServiceStartAt,
|
||||
ServiceTerminationAt: input.ServiceTerminationAt,
|
||||
ServiceCriticality: input.ServiceCriticality,
|
||||
RiskTier: input.RiskTier,
|
||||
StatusPageURL: input.StatusPageURL,
|
||||
TermsOfServiceURL: input.TermsOfServiceURL,
|
||||
PrivacyPolicyURL: input.PrivacyPolicyURL,
|
||||
@@ -1034,6 +1046,33 @@ func (r *mutationResolver) DeletePolicy(ctx context.Context, input types.DeleteP
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CreateVendorRiskAssessment is the resolver for the createVendorRiskAssessment field.
|
||||
func (r *mutationResolver) CreateVendorRiskAssessment(ctx context.Context, input types.CreateVendorRiskAssessmentInput) (*types.CreateVendorRiskAssessmentPayload, error) {
|
||||
svc := GetTenantService(ctx, r.proboSvc, input.VendorID.TenantID())
|
||||
user := UserFromContext(ctx)
|
||||
|
||||
expiresAt := time.Now().Add(time.Hour * 24 * 365)
|
||||
|
||||
vendorRiskAssessment, err := svc.Vendors.CreateRiskAssessment(
|
||||
ctx,
|
||||
probo.CreateVendorRiskAssessmentRequest{
|
||||
VendorID: input.VendorID,
|
||||
AssessedByID: user.ID,
|
||||
ExpiresAt: expiresAt,
|
||||
DataSensitivity: input.DataSensitivity,
|
||||
BusinessImpact: input.BusinessImpact,
|
||||
Notes: input.Notes,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot create vendor risk assessment: %w", err))
|
||||
}
|
||||
|
||||
return &types.CreateVendorRiskAssessmentPayload{
|
||||
VendorRiskAssessmentEdge: types.NewVendorRiskAssessmentEdge(vendorRiskAssessment, coredata.VendorRiskAssessmentOrderFieldCreatedAt),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// LogoURL is the resolver for the logoUrl field.
|
||||
func (r *organizationResolver) LogoURL(ctx context.Context, obj *types.Organization) (*string, error) {
|
||||
svc := GetTenantService(ctx, r.proboSvc, obj.ID.TenantID())
|
||||
@@ -1544,6 +1583,11 @@ func (r *vendorResolver) ComplianceReports(ctx context.Context, obj *types.Vendo
|
||||
return types.NewVendorComplianceReportConnection(page), nil
|
||||
}
|
||||
|
||||
// RiskAssessments is the resolver for the riskAssessments field.
|
||||
func (r *vendorResolver) RiskAssessments(ctx context.Context, obj *types.Vendor, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.VendorRiskAssessmentOrder) (*types.VendorRiskAssessmentConnection, error) {
|
||||
panic(fmt.Errorf("not implemented: RiskAssessments - riskAssessments"))
|
||||
}
|
||||
|
||||
// BusinessOwner is the resolver for the businessOwner field.
|
||||
func (r *vendorResolver) BusinessOwner(ctx context.Context, obj *types.Vendor) (*types.People, error) {
|
||||
svc := GetTenantService(ctx, r.proboSvc, obj.ID.TenantID())
|
||||
@@ -1610,6 +1654,16 @@ func (r *vendorComplianceReportResolver) FileURL(ctx context.Context, obj *types
|
||||
return fileURL, nil
|
||||
}
|
||||
|
||||
// Vendor is the resolver for the vendor field.
|
||||
func (r *vendorRiskAssessmentResolver) Vendor(ctx context.Context, obj *types.VendorRiskAssessment) (*types.Vendor, error) {
|
||||
panic(fmt.Errorf("not implemented: Vendor - vendor"))
|
||||
}
|
||||
|
||||
// AssessedBy is the resolver for the assessedBy field.
|
||||
func (r *vendorRiskAssessmentResolver) AssessedBy(ctx context.Context, obj *types.VendorRiskAssessment) (*types.People, error) {
|
||||
panic(fmt.Errorf("not implemented: AssessedBy - assessedBy"))
|
||||
}
|
||||
|
||||
// Organizations is the resolver for the organizations field.
|
||||
func (r *viewerResolver) Organizations(ctx context.Context, obj *types.Viewer, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrganizationOrder) (*types.OrganizationConnection, error) {
|
||||
user := UserFromContext(ctx)
|
||||
@@ -1673,6 +1727,11 @@ func (r *Resolver) VendorComplianceReport() schema.VendorComplianceReportResolve
|
||||
return &vendorComplianceReportResolver{r}
|
||||
}
|
||||
|
||||
// VendorRiskAssessment returns schema.VendorRiskAssessmentResolver implementation.
|
||||
func (r *Resolver) VendorRiskAssessment() schema.VendorRiskAssessmentResolver {
|
||||
return &vendorRiskAssessmentResolver{r}
|
||||
}
|
||||
|
||||
// Viewer returns schema.ViewerResolver implementation.
|
||||
func (r *Resolver) Viewer() schema.ViewerResolver { return &viewerResolver{r} }
|
||||
|
||||
@@ -1688,4 +1747,5 @@ type riskResolver struct{ *Resolver }
|
||||
type taskResolver struct{ *Resolver }
|
||||
type vendorResolver struct{ *Resolver }
|
||||
type vendorComplianceReportResolver struct{ *Resolver }
|
||||
type vendorRiskAssessmentResolver struct{ *Resolver }
|
||||
type viewerResolver struct{ *Resolver }
|
||||
|
||||
Reference in New Issue
Block a user