Add connnected object id
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -1889,10 +1889,7 @@ type Framework implements Node {
|
||||
updatedAt: Datetime!
|
||||
}
|
||||
|
||||
type Control implements Node
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.Control"
|
||||
) {
|
||||
type Control implements Node {
|
||||
id: ID!
|
||||
sectionTitle: String!
|
||||
name: String!
|
||||
|
||||
@@ -11760,10 +11760,7 @@ type Framework implements Node {
|
||||
updatedAt: Datetime!
|
||||
}
|
||||
|
||||
type Control implements Node
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.Control"
|
||||
) {
|
||||
type Control implements Node {
|
||||
id: ID!
|
||||
sectionTitle: String!
|
||||
name: String!
|
||||
|
||||
@@ -41,22 +41,25 @@ func NewAssetConnection(
|
||||
}
|
||||
}
|
||||
|
||||
func NewAsset(asset *coredata.Asset) *Asset {
|
||||
return &Asset{
|
||||
ID: asset.ID,
|
||||
SnapshotID: asset.SnapshotID,
|
||||
Name: asset.Name,
|
||||
Amount: asset.Amount,
|
||||
AssetType: asset.AssetType,
|
||||
DataTypesStored: asset.DataTypesStored,
|
||||
CreatedAt: asset.CreatedAt,
|
||||
UpdatedAt: asset.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func NewAssetEdge(asset *coredata.Asset, orderField coredata.AssetOrderField) *AssetEdge {
|
||||
return &AssetEdge{
|
||||
Node: NewAsset(asset),
|
||||
Cursor: asset.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
|
||||
func NewAsset(asset *coredata.Asset) *Asset {
|
||||
return &Asset{
|
||||
ID: asset.ID,
|
||||
SnapshotID: asset.SnapshotID,
|
||||
Name: asset.Name,
|
||||
Amount: asset.Amount,
|
||||
Owner: &People{
|
||||
ID: asset.OwnerID,
|
||||
},
|
||||
AssetType: asset.AssetType,
|
||||
DataTypesStored: asset.DataTypesStored,
|
||||
CreatedAt: asset.CreatedAt,
|
||||
UpdatedAt: asset.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,9 +52,22 @@ func NewAuditConnection(
|
||||
}
|
||||
}
|
||||
|
||||
func NewAuditEdge(a *coredata.Audit, orderField coredata.AuditOrderField) *AuditEdge {
|
||||
return &AuditEdge{
|
||||
Node: NewAudit(a),
|
||||
Cursor: a.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
|
||||
func NewAudit(a *coredata.Audit) *Audit {
|
||||
return &Audit{
|
||||
ID: a.ID,
|
||||
ID: a.ID,
|
||||
Organization: &Organization{
|
||||
ID: a.OrganizationID,
|
||||
},
|
||||
Framework: &Framework{
|
||||
ID: a.FrameworkID,
|
||||
},
|
||||
ValidFrom: a.ValidFrom,
|
||||
ValidUntil: a.ValidUntil,
|
||||
State: a.State,
|
||||
@@ -64,10 +77,3 @@ func NewAudit(a *coredata.Audit) *Audit {
|
||||
UpdatedAt: a.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func NewAuditEdge(a *coredata.Audit, orderField coredata.AuditOrderField) *AuditEdge {
|
||||
return &AuditEdge{
|
||||
Node: NewAudit(a),
|
||||
Cursor: a.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,10 +55,23 @@ func NewContinualImprovementConnection(
|
||||
}
|
||||
}
|
||||
|
||||
func NewContinualImprovementEdge(ci *coredata.ContinualImprovement, orderField coredata.ContinualImprovementOrderField) *ContinualImprovementEdge {
|
||||
return &ContinualImprovementEdge{
|
||||
Node: NewContinualImprovement(ci),
|
||||
Cursor: ci.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
|
||||
func NewContinualImprovement(ci *coredata.ContinualImprovement) *ContinualImprovement {
|
||||
return &ContinualImprovement{
|
||||
ID: ci.ID,
|
||||
SnapshotID: ci.SnapshotID,
|
||||
ID: ci.ID,
|
||||
SnapshotID: ci.SnapshotID,
|
||||
Organization: &Organization{
|
||||
ID: ci.OrganizationID,
|
||||
},
|
||||
Owner: &People{
|
||||
ID: ci.OwnerID,
|
||||
},
|
||||
SourceID: ci.SourceID,
|
||||
ReferenceID: ci.ReferenceID,
|
||||
Description: ci.Description,
|
||||
@@ -70,10 +83,3 @@ func NewContinualImprovement(ci *coredata.ContinualImprovement) *ContinualImprov
|
||||
UpdatedAt: ci.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func NewContinualImprovementEdge(ci *coredata.ContinualImprovement, orderField coredata.ContinualImprovementOrderField) *ContinualImprovementEdge {
|
||||
return &ContinualImprovementEdge{
|
||||
Node: NewContinualImprovement(ci),
|
||||
Cursor: ci.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +1,11 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go.probo.inc/probo/pkg/coredata"
|
||||
"go.probo.inc/probo/pkg/gid"
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
type Control struct {
|
||||
ID gid.GID `json:"id"`
|
||||
OrganizationID gid.GID `json:"-"`
|
||||
SectionTitle string `json:"sectionTitle"`
|
||||
Name string `json:"name"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Status coredata.ControlStatus `json:"status"`
|
||||
ExclusionJustification *string `json:"exclusionJustification,omitempty"`
|
||||
BestPractice bool `json:"bestPractice"`
|
||||
Framework *Framework `json:"framework"`
|
||||
Measures *MeasureConnection `json:"measures"`
|
||||
Documents *DocumentConnection `json:"documents"`
|
||||
Audits *AuditConnection `json:"audits"`
|
||||
Snapshots *SnapshotConnection `json:"snapshots"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (Control) IsNode() {}
|
||||
func (c Control) GetID() gid.GID { return c.ID }
|
||||
|
||||
type (
|
||||
ControlOrderBy OrderBy[coredata.ControlOrderField]
|
||||
|
||||
@@ -64,10 +41,19 @@ func NewControlConnection(
|
||||
}
|
||||
}
|
||||
|
||||
func NewControlEdge(control *coredata.Control, orderField coredata.ControlOrderField) *ControlEdge {
|
||||
return &ControlEdge{
|
||||
Node: NewControl(control),
|
||||
Cursor: control.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
|
||||
func NewControl(control *coredata.Control) *Control {
|
||||
return &Control{
|
||||
ID: control.ID,
|
||||
OrganizationID: control.OrganizationID,
|
||||
ID: control.ID,
|
||||
Framework: &Framework{
|
||||
ID: control.FrameworkID,
|
||||
},
|
||||
SectionTitle: control.SectionTitle,
|
||||
Name: control.Name,
|
||||
Description: control.Description,
|
||||
@@ -78,10 +64,3 @@ func NewControl(control *coredata.Control) *Control {
|
||||
UpdatedAt: control.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func NewControlEdge(control *coredata.Control, orderField coredata.ControlOrderField) *ControlEdge {
|
||||
return &ControlEdge{
|
||||
Node: NewControl(control),
|
||||
Cursor: control.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,10 @@ import (
|
||||
|
||||
func NewCustomDomain(d *coredata.CustomDomain, cnameTarget string) *CustomDomain {
|
||||
result := &CustomDomain{
|
||||
ID: d.ID,
|
||||
ID: d.ID,
|
||||
Organization: &Organization{
|
||||
ID: d.OrganizationID,
|
||||
},
|
||||
Domain: d.Domain,
|
||||
SslStatus: d.SSLStatus,
|
||||
CreatedAt: d.CreatedAt,
|
||||
|
||||
@@ -75,7 +75,10 @@ func NewDataConnection(
|
||||
|
||||
func NewDatum(d *coredata.Datum) *Datum {
|
||||
return &Datum{
|
||||
ID: d.ID,
|
||||
ID: d.ID,
|
||||
Organization: &Organization{
|
||||
ID: d.OrganizationID,
|
||||
},
|
||||
OrganizationID: d.OrganizationID,
|
||||
Name: d.Name,
|
||||
SnapshotID: d.SnapshotID,
|
||||
|
||||
@@ -75,8 +75,14 @@ func NewDocumentEdge(document *coredata.Document, orderBy coredata.DocumentOrder
|
||||
|
||||
func NewDocument(document *coredata.Document) *Document {
|
||||
return &Document{
|
||||
ID: document.ID,
|
||||
Title: document.Title,
|
||||
ID: document.ID,
|
||||
Title: document.Title,
|
||||
Organization: &Organization{
|
||||
ID: document.OrganizationID,
|
||||
},
|
||||
Owner: &People{
|
||||
ID: document.OwnerID,
|
||||
},
|
||||
DocumentType: document.DocumentType,
|
||||
Classification: document.Classification,
|
||||
CurrentPublishedVersion: document.CurrentPublishedVersion,
|
||||
|
||||
@@ -82,6 +82,12 @@ func NewDocumentVersion(documentVersion *coredata.DocumentVersion) *DocumentVers
|
||||
return &DocumentVersion{
|
||||
ID: documentVersion.ID,
|
||||
OrganizationID: documentVersion.OrganizationID,
|
||||
Document: &Document{
|
||||
ID: documentVersion.DocumentID,
|
||||
},
|
||||
Owner: &People{
|
||||
ID: documentVersion.OwnerID,
|
||||
},
|
||||
Version: documentVersion.VersionNumber,
|
||||
Title: documentVersion.Title,
|
||||
Content: documentVersion.Content,
|
||||
|
||||
@@ -53,6 +53,12 @@ func NewDocumentVersionSignatureEdge(documentVersionSignature *coredata.Document
|
||||
|
||||
func NewDocumentVersionSignature(documentVersionSignature *coredata.DocumentVersionSignature) *DocumentVersionSignature {
|
||||
return &DocumentVersionSignature{
|
||||
DocumentVersion: &DocumentVersion{
|
||||
ID: documentVersionSignature.DocumentVersionID,
|
||||
},
|
||||
SignedBy: &People{
|
||||
ID: documentVersionSignature.SignedBy,
|
||||
},
|
||||
ID: documentVersionSignature.ID,
|
||||
State: documentVersionSignature.State,
|
||||
SignedAt: documentVersionSignature.SignedAt,
|
||||
|
||||
@@ -67,13 +67,30 @@ func NewEvidence(e *coredata.Evidence) *Evidence {
|
||||
urlPtr = &urlCopy
|
||||
}
|
||||
|
||||
return &Evidence{
|
||||
ID: e.ID,
|
||||
State: e.State,
|
||||
Type: e.Type,
|
||||
URL: urlPtr,
|
||||
evidence := &Evidence{
|
||||
ID: e.ID,
|
||||
State: e.State,
|
||||
Type: e.Type,
|
||||
URL: urlPtr,
|
||||
Measure: &Measure{
|
||||
ID: e.MeasureID,
|
||||
},
|
||||
Description: e.Description,
|
||||
CreatedAt: e.CreatedAt,
|
||||
UpdatedAt: e.UpdatedAt,
|
||||
}
|
||||
|
||||
if e.EvidenceFileId != nil {
|
||||
evidence.File = &File{
|
||||
ID: *e.EvidenceFileId,
|
||||
}
|
||||
}
|
||||
|
||||
if e.TaskID != nil {
|
||||
evidence.Task = &Task{
|
||||
ID: *e.TaskID,
|
||||
}
|
||||
}
|
||||
|
||||
return evidence
|
||||
}
|
||||
|
||||
@@ -62,8 +62,11 @@ func NewFrameworkEdge(f *coredata.Framework, orderBy coredata.FrameworkOrderFiel
|
||||
|
||||
func NewFramework(f *coredata.Framework) *Framework {
|
||||
return &Framework{
|
||||
ID: f.ID,
|
||||
Name: f.Name,
|
||||
ID: f.ID,
|
||||
Name: f.Name,
|
||||
Organization: &Organization{
|
||||
ID: f.OrganizationID,
|
||||
},
|
||||
Description: f.Description,
|
||||
CreatedAt: f.CreatedAt,
|
||||
UpdatedAt: f.UpdatedAt,
|
||||
|
||||
@@ -72,8 +72,11 @@ func NewMeetingEdge(meeting *coredata.Meeting, orderBy coredata.MeetingOrderFiel
|
||||
|
||||
func NewMeeting(meeting *coredata.Meeting) *Meeting {
|
||||
return &Meeting{
|
||||
ID: meeting.ID,
|
||||
Name: meeting.Name,
|
||||
ID: meeting.ID,
|
||||
Name: meeting.Name,
|
||||
Organization: &Organization{
|
||||
ID: meeting.OrganizationID,
|
||||
},
|
||||
Date: meeting.Date,
|
||||
Minutes: meeting.Minutes,
|
||||
CreatedAt: meeting.CreatedAt,
|
||||
|
||||
@@ -55,9 +55,22 @@ func NewNonconformityConnection(
|
||||
}
|
||||
}
|
||||
|
||||
func NewNonconformityEdge(nr *coredata.Nonconformity, orderField coredata.NonconformityOrderField) *NonconformityEdge {
|
||||
return &NonconformityEdge{
|
||||
Node: NewNonconformity(nr),
|
||||
Cursor: nr.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
|
||||
func NewNonconformity(nr *coredata.Nonconformity) *Nonconformity {
|
||||
return &Nonconformity{
|
||||
ID: nr.ID,
|
||||
nc := &Nonconformity{
|
||||
ID: nr.ID,
|
||||
Organization: &Organization{
|
||||
ID: nr.OrganizationID,
|
||||
},
|
||||
Owner: &People{
|
||||
ID: nr.OwnerID,
|
||||
},
|
||||
ReferenceID: nr.ReferenceID,
|
||||
SnapshotID: nr.SnapshotID,
|
||||
Description: nr.Description,
|
||||
@@ -70,11 +83,12 @@ func NewNonconformity(nr *coredata.Nonconformity) *Nonconformity {
|
||||
CreatedAt: nr.CreatedAt,
|
||||
UpdatedAt: nr.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func NewNonconformityEdge(nr *coredata.Nonconformity, orderField coredata.NonconformityOrderField) *NonconformityEdge {
|
||||
return &NonconformityEdge{
|
||||
Node: NewNonconformity(nr),
|
||||
Cursor: nr.CursorKey(orderField),
|
||||
if nr.AuditID != nil {
|
||||
nc.Audit = &Audit{
|
||||
ID: *nr.AuditID,
|
||||
}
|
||||
}
|
||||
|
||||
return nc
|
||||
}
|
||||
|
||||
@@ -57,9 +57,15 @@ func NewObligationConnection(
|
||||
|
||||
func NewObligation(cr *coredata.Obligation) *Obligation {
|
||||
return &Obligation{
|
||||
ID: cr.ID,
|
||||
SnapshotID: cr.SnapshotID,
|
||||
SourceID: cr.SourceID,
|
||||
ID: cr.ID,
|
||||
SnapshotID: cr.SnapshotID,
|
||||
SourceID: cr.SourceID,
|
||||
Organization: &Organization{
|
||||
ID: cr.OrganizationID,
|
||||
},
|
||||
Owner: &People{
|
||||
ID: cr.OwnerID,
|
||||
},
|
||||
Area: cr.Area,
|
||||
Source: cr.Source,
|
||||
Requirement: cr.Requirement,
|
||||
|
||||
@@ -19,14 +19,26 @@ import (
|
||||
)
|
||||
|
||||
func NewOrganization(o *coredata.Organization) *Organization {
|
||||
return &Organization{
|
||||
ID: o.ID,
|
||||
Name: o.Name,
|
||||
Description: o.Description,
|
||||
WebsiteURL: o.WebsiteURL,
|
||||
Email: o.Email,
|
||||
org := &Organization{
|
||||
ID: o.ID,
|
||||
Name: o.Name,
|
||||
Description: o.Description,
|
||||
WebsiteURL: o.WebsiteURL,
|
||||
Email: o.Email,
|
||||
Context: &OrganizationContext{
|
||||
OrganizationID: o.ID,
|
||||
},
|
||||
|
||||
HeadquarterAddress: o.HeadquarterAddress,
|
||||
CreatedAt: o.CreatedAt,
|
||||
UpdatedAt: o.UpdatedAt,
|
||||
}
|
||||
|
||||
if o.CustomDomainID != nil {
|
||||
org.CustomDomain = &CustomDomain{
|
||||
ID: *o.CustomDomainID,
|
||||
}
|
||||
}
|
||||
|
||||
return org
|
||||
}
|
||||
|
||||
@@ -55,9 +55,19 @@ func NewProcessingActivityConnection(
|
||||
}
|
||||
}
|
||||
|
||||
func NewProcessingActivityEdge(par *coredata.ProcessingActivity, orderField coredata.ProcessingActivityOrderField) *ProcessingActivityEdge {
|
||||
return &ProcessingActivityEdge{
|
||||
Node: NewProcessingActivity(par),
|
||||
Cursor: par.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
|
||||
func NewProcessingActivity(par *coredata.ProcessingActivity) *ProcessingActivity {
|
||||
return &ProcessingActivity{
|
||||
ID: par.ID,
|
||||
ID: par.ID,
|
||||
Organization: &Organization{
|
||||
ID: par.OrganizationID,
|
||||
},
|
||||
SnapshotID: par.SnapshotID,
|
||||
SourceID: par.SourceID,
|
||||
Name: par.Name,
|
||||
@@ -82,10 +92,3 @@ func NewProcessingActivity(par *coredata.ProcessingActivity) *ProcessingActivity
|
||||
UpdatedAt: par.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func NewProcessingActivityEdge(par *coredata.ProcessingActivity, orderField coredata.ProcessingActivityOrderField) *ProcessingActivityEdge {
|
||||
return &ProcessingActivityEdge{
|
||||
Node: NewProcessingActivity(par),
|
||||
Cursor: par.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ func NewRiskEdge(r *coredata.Risk, orderBy coredata.RiskOrderField) *RiskEdge {
|
||||
}
|
||||
|
||||
func NewRisk(r *coredata.Risk) *Risk {
|
||||
return &Risk{
|
||||
risk := &Risk{
|
||||
ID: r.ID,
|
||||
Name: r.Name,
|
||||
SnapshotID: r.SnapshotID,
|
||||
@@ -76,9 +76,20 @@ func NewRisk(r *coredata.Risk) *Risk {
|
||||
ResidualLikelihood: r.ResidualLikelihood,
|
||||
ResidualImpact: r.ResidualImpact,
|
||||
ResidualRiskScore: r.ResidualRiskScore,
|
||||
Category: r.Category,
|
||||
CreatedAt: r.CreatedAt,
|
||||
UpdatedAt: r.UpdatedAt,
|
||||
Note: r.Note,
|
||||
Organization: &Organization{
|
||||
ID: r.OrganizationID,
|
||||
},
|
||||
Category: r.Category,
|
||||
CreatedAt: r.CreatedAt,
|
||||
UpdatedAt: r.UpdatedAt,
|
||||
Note: r.Note,
|
||||
}
|
||||
|
||||
if r.OwnerID != nil {
|
||||
risk.Owner = &People{
|
||||
ID: *r.OwnerID,
|
||||
}
|
||||
}
|
||||
|
||||
return risk
|
||||
}
|
||||
|
||||
@@ -52,19 +52,22 @@ func NewSnapshotConnection(
|
||||
}
|
||||
}
|
||||
|
||||
func NewSnapshot(s *coredata.Snapshot) *Snapshot {
|
||||
return &Snapshot{
|
||||
ID: s.ID,
|
||||
Name: s.Name,
|
||||
Type: s.Type,
|
||||
Description: s.Description,
|
||||
CreatedAt: s.CreatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func NewSnapshotEdge(s *coredata.Snapshot, orderField coredata.SnapshotOrderField) *SnapshotEdge {
|
||||
return &SnapshotEdge{
|
||||
Node: NewSnapshot(s),
|
||||
Cursor: s.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
|
||||
func NewSnapshot(s *coredata.Snapshot) *Snapshot {
|
||||
return &Snapshot{
|
||||
ID: s.ID,
|
||||
Organization: &Organization{
|
||||
ID: s.OrganizationID,
|
||||
},
|
||||
Name: s.Name,
|
||||
Type: s.Type,
|
||||
Description: s.Description,
|
||||
CreatedAt: s.CreatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,14 +62,18 @@ func NewTaskEdge(t *coredata.Task, orderBy coredata.TaskOrderField) *TaskEdge {
|
||||
|
||||
func NewTask(t *coredata.Task) *Task {
|
||||
node := &Task{
|
||||
ID: t.ID,
|
||||
ID: t.ID,
|
||||
Organization: &Organization{
|
||||
ID: t.OrganizationID,
|
||||
},
|
||||
|
||||
Name: t.Name,
|
||||
Description: t.Description,
|
||||
State: t.State,
|
||||
TimeEstimate: t.TimeEstimate,
|
||||
Deadline: t.Deadline,
|
||||
CreatedAt: t.CreatedAt,
|
||||
UpdatedAt: t.UpdatedAt,
|
||||
Deadline: t.Deadline,
|
||||
}
|
||||
|
||||
if t.MeasureID != nil {
|
||||
@@ -78,5 +82,11 @@ func NewTask(t *coredata.Task) *Task {
|
||||
}
|
||||
}
|
||||
|
||||
if t.AssignedToID != nil {
|
||||
node.AssignedTo = &People{
|
||||
ID: *t.AssignedToID,
|
||||
}
|
||||
}
|
||||
|
||||
return node
|
||||
}
|
||||
|
||||
@@ -25,7 +25,10 @@ func NewTrustCenter(tc *coredata.TrustCenter, file *coredata.File) *TrustCenter
|
||||
}
|
||||
|
||||
return &TrustCenter{
|
||||
ID: tc.ID,
|
||||
ID: tc.ID,
|
||||
Organization: &Organization{
|
||||
ID: tc.OrganizationID,
|
||||
},
|
||||
Active: tc.Active,
|
||||
NdaFileName: ndaFileName,
|
||||
CreatedAt: tc.CreatedAt,
|
||||
|
||||
@@ -54,7 +54,7 @@ type (
|
||||
)
|
||||
|
||||
func NewTrustCenterDocumentAccess(tcda *coredata.TrustCenterDocumentAccess) *TrustCenterDocumentAccess {
|
||||
return &TrustCenterDocumentAccess{
|
||||
object := &TrustCenterDocumentAccess{
|
||||
ID: tcda.ID,
|
||||
OrganizationID: tcda.OrganizationID,
|
||||
Status: tcda.Status,
|
||||
@@ -65,6 +65,26 @@ func NewTrustCenterDocumentAccess(tcda *coredata.TrustCenterDocumentAccess) *Tru
|
||||
ReportID: tcda.ReportID,
|
||||
TrustCenterFileID: tcda.TrustCenterFileID,
|
||||
}
|
||||
|
||||
if tcda.DocumentID != nil {
|
||||
object.Document = &Document{
|
||||
ID: *tcda.DocumentID,
|
||||
}
|
||||
}
|
||||
|
||||
if tcda.ReportID != nil {
|
||||
object.Report = &Report{
|
||||
ID: *tcda.ReportID,
|
||||
}
|
||||
}
|
||||
|
||||
if tcda.TrustCenterFileID != nil {
|
||||
object.TrustCenterFile = &TrustCenterFile{
|
||||
ID: *tcda.TrustCenterFileID,
|
||||
}
|
||||
}
|
||||
|
||||
return object
|
||||
}
|
||||
|
||||
func NewTrustCenterDocumentAccessConnection(
|
||||
|
||||
@@ -37,6 +37,9 @@ func NewTrustCenterFile(tcf *coredata.TrustCenterFile) *TrustCenterFile {
|
||||
TrustCenterVisibility: tcf.TrustCenterVisibility,
|
||||
CreatedAt: tcf.CreatedAt,
|
||||
UpdatedAt: tcf.UpdatedAt,
|
||||
Organization: &Organization{
|
||||
ID: tcf.OrganizationID,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -166,6 +166,28 @@ type ContinualImprovementFilter struct {
|
||||
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
|
||||
}
|
||||
|
||||
type Control struct {
|
||||
ID gid.GID `json:"id"`
|
||||
SectionTitle string `json:"sectionTitle"`
|
||||
Name string `json:"name"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Status coredata.ControlStatus `json:"status"`
|
||||
ExclusionJustification *string `json:"exclusionJustification,omitempty"`
|
||||
BestPractice bool `json:"bestPractice"`
|
||||
Framework *Framework `json:"framework"`
|
||||
Measures *MeasureConnection `json:"measures"`
|
||||
Documents *DocumentConnection `json:"documents"`
|
||||
Audits *AuditConnection `json:"audits"`
|
||||
Obligations *ObligationConnection `json:"obligations"`
|
||||
Snapshots *SnapshotConnection `json:"snapshots"`
|
||||
StateOfApplicabilityControls *StateOfApplicabilityControlConnection `json:"stateOfApplicabilityControls"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (Control) IsNode() {}
|
||||
func (this Control) GetID() gid.GID { return this.ID }
|
||||
|
||||
type ControlEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *Control `json:"node"`
|
||||
|
||||
@@ -61,8 +61,11 @@ func NewVendorEdge(v *coredata.Vendor, orderBy coredata.VendorOrderField) *Vendo
|
||||
}
|
||||
|
||||
func NewVendor(v *coredata.Vendor) *Vendor {
|
||||
return &Vendor{
|
||||
ID: v.ID,
|
||||
object := &Vendor{
|
||||
ID: v.ID,
|
||||
Organization: &Organization{
|
||||
ID: v.OrganizationID,
|
||||
},
|
||||
Name: v.Name,
|
||||
Description: v.Description,
|
||||
StatusPageURL: v.StatusPageURL,
|
||||
@@ -85,4 +88,18 @@ func NewVendor(v *coredata.Vendor) *Vendor {
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
CreatedAt: v.CreatedAt,
|
||||
}
|
||||
|
||||
if v.BusinessOwnerID != nil {
|
||||
object.BusinessOwner = &People{
|
||||
ID: *v.BusinessOwnerID,
|
||||
}
|
||||
}
|
||||
|
||||
if v.SecurityOwnerID != nil {
|
||||
object.SecurityOwner = &People{
|
||||
ID: *v.SecurityOwnerID,
|
||||
}
|
||||
}
|
||||
|
||||
return object
|
||||
}
|
||||
|
||||
@@ -20,7 +20,10 @@ import (
|
||||
|
||||
func NewVendorBusinessAssociateAgreement(v *coredata.VendorBusinessAssociateAgreement, file *coredata.File) *VendorBusinessAssociateAgreement {
|
||||
return &VendorBusinessAssociateAgreement{
|
||||
ID: v.ID,
|
||||
ID: v.ID,
|
||||
Vendor: &Vendor{
|
||||
ID: v.VendorID,
|
||||
},
|
||||
ValidFrom: v.ValidFrom,
|
||||
ValidUntil: v.ValidUntil,
|
||||
FileName: file.FileName,
|
||||
|
||||
@@ -44,12 +44,23 @@ func NewVendorComplianceReportEdge(c *coredata.VendorComplianceReport, orderBy c
|
||||
}
|
||||
|
||||
func NewVendorComplianceReport(c *coredata.VendorComplianceReport) *VendorComplianceReport {
|
||||
return &VendorComplianceReport{
|
||||
ID: c.ID,
|
||||
object := &VendorComplianceReport{
|
||||
ID: c.ID,
|
||||
Vendor: &Vendor{
|
||||
ID: c.VendorID,
|
||||
},
|
||||
ReportDate: c.ReportDate,
|
||||
ValidUntil: c.ValidUntil,
|
||||
ReportName: c.ReportName,
|
||||
CreatedAt: c.CreatedAt,
|
||||
UpdatedAt: c.UpdatedAt,
|
||||
}
|
||||
|
||||
if c.ReportFileId != nil {
|
||||
object.File = &File{
|
||||
ID: *c.ReportFileId,
|
||||
}
|
||||
}
|
||||
|
||||
return object
|
||||
}
|
||||
|
||||
@@ -45,7 +45,10 @@ func NewVendorContactEdge(c *coredata.VendorContact, orderBy coredata.VendorCont
|
||||
|
||||
func NewVendorContact(c *coredata.VendorContact) *VendorContact {
|
||||
return &VendorContact{
|
||||
ID: c.ID,
|
||||
ID: c.ID,
|
||||
Vendor: &Vendor{
|
||||
ID: c.VendorID,
|
||||
},
|
||||
FullName: c.FullName,
|
||||
Email: c.Email,
|
||||
Phone: c.Phone,
|
||||
|
||||
@@ -20,7 +20,10 @@ import (
|
||||
|
||||
func NewVendorDataPrivacyAgreement(v *coredata.VendorDataPrivacyAgreement, file *coredata.File) *VendorDataPrivacyAgreement {
|
||||
return &VendorDataPrivacyAgreement{
|
||||
ID: v.ID,
|
||||
ID: v.ID,
|
||||
Vendor: &Vendor{
|
||||
ID: v.VendorID,
|
||||
},
|
||||
ValidFrom: v.ValidFrom,
|
||||
ValidUntil: v.ValidUntil,
|
||||
FileName: file.FileName,
|
||||
|
||||
@@ -45,7 +45,10 @@ func NewVendorRiskAssessmentEdge(c *coredata.VendorRiskAssessment, orderBy cored
|
||||
|
||||
func NewVendorRiskAssessment(c *coredata.VendorRiskAssessment) *VendorRiskAssessment {
|
||||
return &VendorRiskAssessment{
|
||||
ID: c.ID,
|
||||
ID: c.ID,
|
||||
Vendor: &Vendor{
|
||||
ID: c.VendorID,
|
||||
},
|
||||
ExpiresAt: c.ExpiresAt,
|
||||
DataSensitivity: c.DataSensitivity,
|
||||
BusinessImpact: c.BusinessImpact,
|
||||
|
||||
@@ -45,7 +45,10 @@ func NewVendorServiceEdge(s *coredata.VendorService, orderBy coredata.VendorServ
|
||||
|
||||
func NewVendorService(s *coredata.VendorService) *VendorService {
|
||||
return &VendorService{
|
||||
ID: s.ID,
|
||||
ID: s.ID,
|
||||
Vendor: &Vendor{
|
||||
ID: s.VendorID,
|
||||
},
|
||||
Name: s.Name,
|
||||
Description: s.Description,
|
||||
CreatedAt: s.CreatedAt,
|
||||
|
||||
Reference in New Issue
Block a user