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!
|
updatedAt: Datetime!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Control implements Node
|
type Control implements Node {
|
||||||
@goModel(
|
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.Control"
|
|
||||||
) {
|
|
||||||
id: ID!
|
id: ID!
|
||||||
sectionTitle: String!
|
sectionTitle: String!
|
||||||
name: String!
|
name: String!
|
||||||
|
|||||||
@@ -11760,10 +11760,7 @@ type Framework implements Node {
|
|||||||
updatedAt: Datetime!
|
updatedAt: Datetime!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Control implements Node
|
type Control implements Node {
|
||||||
@goModel(
|
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.Control"
|
|
||||||
) {
|
|
||||||
id: ID!
|
id: ID!
|
||||||
sectionTitle: String!
|
sectionTitle: String!
|
||||||
name: 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 {
|
func NewAssetEdge(asset *coredata.Asset, orderField coredata.AssetOrderField) *AssetEdge {
|
||||||
return &AssetEdge{
|
return &AssetEdge{
|
||||||
Node: NewAsset(asset),
|
Node: NewAsset(asset),
|
||||||
Cursor: asset.CursorKey(orderField),
|
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 {
|
func NewAudit(a *coredata.Audit) *Audit {
|
||||||
return &Audit{
|
return &Audit{
|
||||||
ID: a.ID,
|
ID: a.ID,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: a.OrganizationID,
|
||||||
|
},
|
||||||
|
Framework: &Framework{
|
||||||
|
ID: a.FrameworkID,
|
||||||
|
},
|
||||||
ValidFrom: a.ValidFrom,
|
ValidFrom: a.ValidFrom,
|
||||||
ValidUntil: a.ValidUntil,
|
ValidUntil: a.ValidUntil,
|
||||||
State: a.State,
|
State: a.State,
|
||||||
@@ -64,10 +77,3 @@ func NewAudit(a *coredata.Audit) *Audit {
|
|||||||
UpdatedAt: a.UpdatedAt,
|
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 {
|
func NewContinualImprovement(ci *coredata.ContinualImprovement) *ContinualImprovement {
|
||||||
return &ContinualImprovement{
|
return &ContinualImprovement{
|
||||||
ID: ci.ID,
|
ID: ci.ID,
|
||||||
SnapshotID: ci.SnapshotID,
|
SnapshotID: ci.SnapshotID,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: ci.OrganizationID,
|
||||||
|
},
|
||||||
|
Owner: &People{
|
||||||
|
ID: ci.OwnerID,
|
||||||
|
},
|
||||||
SourceID: ci.SourceID,
|
SourceID: ci.SourceID,
|
||||||
ReferenceID: ci.ReferenceID,
|
ReferenceID: ci.ReferenceID,
|
||||||
Description: ci.Description,
|
Description: ci.Description,
|
||||||
@@ -70,10 +83,3 @@ func NewContinualImprovement(ci *coredata.ContinualImprovement) *ContinualImprov
|
|||||||
UpdatedAt: ci.UpdatedAt,
|
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
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
|
|
||||||
"go.probo.inc/probo/pkg/coredata"
|
"go.probo.inc/probo/pkg/coredata"
|
||||||
"go.probo.inc/probo/pkg/gid"
|
"go.probo.inc/probo/pkg/gid"
|
||||||
"go.probo.inc/probo/pkg/page"
|
"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 (
|
type (
|
||||||
ControlOrderBy OrderBy[coredata.ControlOrderField]
|
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 {
|
func NewControl(control *coredata.Control) *Control {
|
||||||
return &Control{
|
return &Control{
|
||||||
ID: control.ID,
|
ID: control.ID,
|
||||||
OrganizationID: control.OrganizationID,
|
Framework: &Framework{
|
||||||
|
ID: control.FrameworkID,
|
||||||
|
},
|
||||||
SectionTitle: control.SectionTitle,
|
SectionTitle: control.SectionTitle,
|
||||||
Name: control.Name,
|
Name: control.Name,
|
||||||
Description: control.Description,
|
Description: control.Description,
|
||||||
@@ -78,10 +64,3 @@ func NewControl(control *coredata.Control) *Control {
|
|||||||
UpdatedAt: control.UpdatedAt,
|
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 {
|
func NewCustomDomain(d *coredata.CustomDomain, cnameTarget string) *CustomDomain {
|
||||||
result := &CustomDomain{
|
result := &CustomDomain{
|
||||||
ID: d.ID,
|
ID: d.ID,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: d.OrganizationID,
|
||||||
|
},
|
||||||
Domain: d.Domain,
|
Domain: d.Domain,
|
||||||
SslStatus: d.SSLStatus,
|
SslStatus: d.SSLStatus,
|
||||||
CreatedAt: d.CreatedAt,
|
CreatedAt: d.CreatedAt,
|
||||||
|
|||||||
@@ -75,7 +75,10 @@ func NewDataConnection(
|
|||||||
|
|
||||||
func NewDatum(d *coredata.Datum) *Datum {
|
func NewDatum(d *coredata.Datum) *Datum {
|
||||||
return &Datum{
|
return &Datum{
|
||||||
ID: d.ID,
|
ID: d.ID,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: d.OrganizationID,
|
||||||
|
},
|
||||||
OrganizationID: d.OrganizationID,
|
OrganizationID: d.OrganizationID,
|
||||||
Name: d.Name,
|
Name: d.Name,
|
||||||
SnapshotID: d.SnapshotID,
|
SnapshotID: d.SnapshotID,
|
||||||
|
|||||||
@@ -75,8 +75,14 @@ func NewDocumentEdge(document *coredata.Document, orderBy coredata.DocumentOrder
|
|||||||
|
|
||||||
func NewDocument(document *coredata.Document) *Document {
|
func NewDocument(document *coredata.Document) *Document {
|
||||||
return &Document{
|
return &Document{
|
||||||
ID: document.ID,
|
ID: document.ID,
|
||||||
Title: document.Title,
|
Title: document.Title,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: document.OrganizationID,
|
||||||
|
},
|
||||||
|
Owner: &People{
|
||||||
|
ID: document.OwnerID,
|
||||||
|
},
|
||||||
DocumentType: document.DocumentType,
|
DocumentType: document.DocumentType,
|
||||||
Classification: document.Classification,
|
Classification: document.Classification,
|
||||||
CurrentPublishedVersion: document.CurrentPublishedVersion,
|
CurrentPublishedVersion: document.CurrentPublishedVersion,
|
||||||
|
|||||||
@@ -82,6 +82,12 @@ func NewDocumentVersion(documentVersion *coredata.DocumentVersion) *DocumentVers
|
|||||||
return &DocumentVersion{
|
return &DocumentVersion{
|
||||||
ID: documentVersion.ID,
|
ID: documentVersion.ID,
|
||||||
OrganizationID: documentVersion.OrganizationID,
|
OrganizationID: documentVersion.OrganizationID,
|
||||||
|
Document: &Document{
|
||||||
|
ID: documentVersion.DocumentID,
|
||||||
|
},
|
||||||
|
Owner: &People{
|
||||||
|
ID: documentVersion.OwnerID,
|
||||||
|
},
|
||||||
Version: documentVersion.VersionNumber,
|
Version: documentVersion.VersionNumber,
|
||||||
Title: documentVersion.Title,
|
Title: documentVersion.Title,
|
||||||
Content: documentVersion.Content,
|
Content: documentVersion.Content,
|
||||||
|
|||||||
@@ -53,6 +53,12 @@ func NewDocumentVersionSignatureEdge(documentVersionSignature *coredata.Document
|
|||||||
|
|
||||||
func NewDocumentVersionSignature(documentVersionSignature *coredata.DocumentVersionSignature) *DocumentVersionSignature {
|
func NewDocumentVersionSignature(documentVersionSignature *coredata.DocumentVersionSignature) *DocumentVersionSignature {
|
||||||
return &DocumentVersionSignature{
|
return &DocumentVersionSignature{
|
||||||
|
DocumentVersion: &DocumentVersion{
|
||||||
|
ID: documentVersionSignature.DocumentVersionID,
|
||||||
|
},
|
||||||
|
SignedBy: &People{
|
||||||
|
ID: documentVersionSignature.SignedBy,
|
||||||
|
},
|
||||||
ID: documentVersionSignature.ID,
|
ID: documentVersionSignature.ID,
|
||||||
State: documentVersionSignature.State,
|
State: documentVersionSignature.State,
|
||||||
SignedAt: documentVersionSignature.SignedAt,
|
SignedAt: documentVersionSignature.SignedAt,
|
||||||
|
|||||||
@@ -67,13 +67,30 @@ func NewEvidence(e *coredata.Evidence) *Evidence {
|
|||||||
urlPtr = &urlCopy
|
urlPtr = &urlCopy
|
||||||
}
|
}
|
||||||
|
|
||||||
return &Evidence{
|
evidence := &Evidence{
|
||||||
ID: e.ID,
|
ID: e.ID,
|
||||||
State: e.State,
|
State: e.State,
|
||||||
Type: e.Type,
|
Type: e.Type,
|
||||||
URL: urlPtr,
|
URL: urlPtr,
|
||||||
|
Measure: &Measure{
|
||||||
|
ID: e.MeasureID,
|
||||||
|
},
|
||||||
Description: e.Description,
|
Description: e.Description,
|
||||||
CreatedAt: e.CreatedAt,
|
CreatedAt: e.CreatedAt,
|
||||||
UpdatedAt: e.UpdatedAt,
|
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 {
|
func NewFramework(f *coredata.Framework) *Framework {
|
||||||
return &Framework{
|
return &Framework{
|
||||||
ID: f.ID,
|
ID: f.ID,
|
||||||
Name: f.Name,
|
Name: f.Name,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: f.OrganizationID,
|
||||||
|
},
|
||||||
Description: f.Description,
|
Description: f.Description,
|
||||||
CreatedAt: f.CreatedAt,
|
CreatedAt: f.CreatedAt,
|
||||||
UpdatedAt: f.UpdatedAt,
|
UpdatedAt: f.UpdatedAt,
|
||||||
|
|||||||
@@ -72,8 +72,11 @@ func NewMeetingEdge(meeting *coredata.Meeting, orderBy coredata.MeetingOrderFiel
|
|||||||
|
|
||||||
func NewMeeting(meeting *coredata.Meeting) *Meeting {
|
func NewMeeting(meeting *coredata.Meeting) *Meeting {
|
||||||
return &Meeting{
|
return &Meeting{
|
||||||
ID: meeting.ID,
|
ID: meeting.ID,
|
||||||
Name: meeting.Name,
|
Name: meeting.Name,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: meeting.OrganizationID,
|
||||||
|
},
|
||||||
Date: meeting.Date,
|
Date: meeting.Date,
|
||||||
Minutes: meeting.Minutes,
|
Minutes: meeting.Minutes,
|
||||||
CreatedAt: meeting.CreatedAt,
|
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 {
|
func NewNonconformity(nr *coredata.Nonconformity) *Nonconformity {
|
||||||
return &Nonconformity{
|
nc := &Nonconformity{
|
||||||
ID: nr.ID,
|
ID: nr.ID,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: nr.OrganizationID,
|
||||||
|
},
|
||||||
|
Owner: &People{
|
||||||
|
ID: nr.OwnerID,
|
||||||
|
},
|
||||||
ReferenceID: nr.ReferenceID,
|
ReferenceID: nr.ReferenceID,
|
||||||
SnapshotID: nr.SnapshotID,
|
SnapshotID: nr.SnapshotID,
|
||||||
Description: nr.Description,
|
Description: nr.Description,
|
||||||
@@ -70,11 +83,12 @@ func NewNonconformity(nr *coredata.Nonconformity) *Nonconformity {
|
|||||||
CreatedAt: nr.CreatedAt,
|
CreatedAt: nr.CreatedAt,
|
||||||
UpdatedAt: nr.UpdatedAt,
|
UpdatedAt: nr.UpdatedAt,
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
func NewNonconformityEdge(nr *coredata.Nonconformity, orderField coredata.NonconformityOrderField) *NonconformityEdge {
|
if nr.AuditID != nil {
|
||||||
return &NonconformityEdge{
|
nc.Audit = &Audit{
|
||||||
Node: NewNonconformity(nr),
|
ID: *nr.AuditID,
|
||||||
Cursor: nr.CursorKey(orderField),
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return nc
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,9 +57,15 @@ func NewObligationConnection(
|
|||||||
|
|
||||||
func NewObligation(cr *coredata.Obligation) *Obligation {
|
func NewObligation(cr *coredata.Obligation) *Obligation {
|
||||||
return &Obligation{
|
return &Obligation{
|
||||||
ID: cr.ID,
|
ID: cr.ID,
|
||||||
SnapshotID: cr.SnapshotID,
|
SnapshotID: cr.SnapshotID,
|
||||||
SourceID: cr.SourceID,
|
SourceID: cr.SourceID,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: cr.OrganizationID,
|
||||||
|
},
|
||||||
|
Owner: &People{
|
||||||
|
ID: cr.OwnerID,
|
||||||
|
},
|
||||||
Area: cr.Area,
|
Area: cr.Area,
|
||||||
Source: cr.Source,
|
Source: cr.Source,
|
||||||
Requirement: cr.Requirement,
|
Requirement: cr.Requirement,
|
||||||
|
|||||||
@@ -19,14 +19,26 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewOrganization(o *coredata.Organization) *Organization {
|
func NewOrganization(o *coredata.Organization) *Organization {
|
||||||
return &Organization{
|
org := &Organization{
|
||||||
ID: o.ID,
|
ID: o.ID,
|
||||||
Name: o.Name,
|
Name: o.Name,
|
||||||
Description: o.Description,
|
Description: o.Description,
|
||||||
WebsiteURL: o.WebsiteURL,
|
WebsiteURL: o.WebsiteURL,
|
||||||
Email: o.Email,
|
Email: o.Email,
|
||||||
|
Context: &OrganizationContext{
|
||||||
|
OrganizationID: o.ID,
|
||||||
|
},
|
||||||
|
|
||||||
HeadquarterAddress: o.HeadquarterAddress,
|
HeadquarterAddress: o.HeadquarterAddress,
|
||||||
CreatedAt: o.CreatedAt,
|
CreatedAt: o.CreatedAt,
|
||||||
UpdatedAt: o.UpdatedAt,
|
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 {
|
func NewProcessingActivity(par *coredata.ProcessingActivity) *ProcessingActivity {
|
||||||
return &ProcessingActivity{
|
return &ProcessingActivity{
|
||||||
ID: par.ID,
|
ID: par.ID,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: par.OrganizationID,
|
||||||
|
},
|
||||||
SnapshotID: par.SnapshotID,
|
SnapshotID: par.SnapshotID,
|
||||||
SourceID: par.SourceID,
|
SourceID: par.SourceID,
|
||||||
Name: par.Name,
|
Name: par.Name,
|
||||||
@@ -82,10 +92,3 @@ func NewProcessingActivity(par *coredata.ProcessingActivity) *ProcessingActivity
|
|||||||
UpdatedAt: par.UpdatedAt,
|
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 {
|
func NewRisk(r *coredata.Risk) *Risk {
|
||||||
return &Risk{
|
risk := &Risk{
|
||||||
ID: r.ID,
|
ID: r.ID,
|
||||||
Name: r.Name,
|
Name: r.Name,
|
||||||
SnapshotID: r.SnapshotID,
|
SnapshotID: r.SnapshotID,
|
||||||
@@ -76,9 +76,20 @@ func NewRisk(r *coredata.Risk) *Risk {
|
|||||||
ResidualLikelihood: r.ResidualLikelihood,
|
ResidualLikelihood: r.ResidualLikelihood,
|
||||||
ResidualImpact: r.ResidualImpact,
|
ResidualImpact: r.ResidualImpact,
|
||||||
ResidualRiskScore: r.ResidualRiskScore,
|
ResidualRiskScore: r.ResidualRiskScore,
|
||||||
Category: r.Category,
|
Organization: &Organization{
|
||||||
CreatedAt: r.CreatedAt,
|
ID: r.OrganizationID,
|
||||||
UpdatedAt: r.UpdatedAt,
|
},
|
||||||
Note: r.Note,
|
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 {
|
func NewSnapshotEdge(s *coredata.Snapshot, orderField coredata.SnapshotOrderField) *SnapshotEdge {
|
||||||
return &SnapshotEdge{
|
return &SnapshotEdge{
|
||||||
Node: NewSnapshot(s),
|
Node: NewSnapshot(s),
|
||||||
Cursor: s.CursorKey(orderField),
|
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 {
|
func NewTask(t *coredata.Task) *Task {
|
||||||
node := &Task{
|
node := &Task{
|
||||||
ID: t.ID,
|
ID: t.ID,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: t.OrganizationID,
|
||||||
|
},
|
||||||
|
|
||||||
Name: t.Name,
|
Name: t.Name,
|
||||||
Description: t.Description,
|
Description: t.Description,
|
||||||
State: t.State,
|
State: t.State,
|
||||||
TimeEstimate: t.TimeEstimate,
|
TimeEstimate: t.TimeEstimate,
|
||||||
|
Deadline: t.Deadline,
|
||||||
CreatedAt: t.CreatedAt,
|
CreatedAt: t.CreatedAt,
|
||||||
UpdatedAt: t.UpdatedAt,
|
UpdatedAt: t.UpdatedAt,
|
||||||
Deadline: t.Deadline,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if t.MeasureID != nil {
|
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
|
return node
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,10 @@ func NewTrustCenter(tc *coredata.TrustCenter, file *coredata.File) *TrustCenter
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &TrustCenter{
|
return &TrustCenter{
|
||||||
ID: tc.ID,
|
ID: tc.ID,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: tc.OrganizationID,
|
||||||
|
},
|
||||||
Active: tc.Active,
|
Active: tc.Active,
|
||||||
NdaFileName: ndaFileName,
|
NdaFileName: ndaFileName,
|
||||||
CreatedAt: tc.CreatedAt,
|
CreatedAt: tc.CreatedAt,
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewTrustCenterDocumentAccess(tcda *coredata.TrustCenterDocumentAccess) *TrustCenterDocumentAccess {
|
func NewTrustCenterDocumentAccess(tcda *coredata.TrustCenterDocumentAccess) *TrustCenterDocumentAccess {
|
||||||
return &TrustCenterDocumentAccess{
|
object := &TrustCenterDocumentAccess{
|
||||||
ID: tcda.ID,
|
ID: tcda.ID,
|
||||||
OrganizationID: tcda.OrganizationID,
|
OrganizationID: tcda.OrganizationID,
|
||||||
Status: tcda.Status,
|
Status: tcda.Status,
|
||||||
@@ -65,6 +65,26 @@ func NewTrustCenterDocumentAccess(tcda *coredata.TrustCenterDocumentAccess) *Tru
|
|||||||
ReportID: tcda.ReportID,
|
ReportID: tcda.ReportID,
|
||||||
TrustCenterFileID: tcda.TrustCenterFileID,
|
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(
|
func NewTrustCenterDocumentAccessConnection(
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ func NewTrustCenterFile(tcf *coredata.TrustCenterFile) *TrustCenterFile {
|
|||||||
TrustCenterVisibility: tcf.TrustCenterVisibility,
|
TrustCenterVisibility: tcf.TrustCenterVisibility,
|
||||||
CreatedAt: tcf.CreatedAt,
|
CreatedAt: tcf.CreatedAt,
|
||||||
UpdatedAt: tcf.UpdatedAt,
|
UpdatedAt: tcf.UpdatedAt,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: tcf.OrganizationID,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,6 +166,28 @@ type ContinualImprovementFilter struct {
|
|||||||
SnapshotID *gid.GID `json:"snapshotId,omitempty"`
|
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 {
|
type ControlEdge struct {
|
||||||
Cursor page.CursorKey `json:"cursor"`
|
Cursor page.CursorKey `json:"cursor"`
|
||||||
Node *Control `json:"node"`
|
Node *Control `json:"node"`
|
||||||
|
|||||||
@@ -61,8 +61,11 @@ func NewVendorEdge(v *coredata.Vendor, orderBy coredata.VendorOrderField) *Vendo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewVendor(v *coredata.Vendor) *Vendor {
|
func NewVendor(v *coredata.Vendor) *Vendor {
|
||||||
return &Vendor{
|
object := &Vendor{
|
||||||
ID: v.ID,
|
ID: v.ID,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: v.OrganizationID,
|
||||||
|
},
|
||||||
Name: v.Name,
|
Name: v.Name,
|
||||||
Description: v.Description,
|
Description: v.Description,
|
||||||
StatusPageURL: v.StatusPageURL,
|
StatusPageURL: v.StatusPageURL,
|
||||||
@@ -85,4 +88,18 @@ func NewVendor(v *coredata.Vendor) *Vendor {
|
|||||||
UpdatedAt: v.UpdatedAt,
|
UpdatedAt: v.UpdatedAt,
|
||||||
CreatedAt: v.CreatedAt,
|
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 {
|
func NewVendorBusinessAssociateAgreement(v *coredata.VendorBusinessAssociateAgreement, file *coredata.File) *VendorBusinessAssociateAgreement {
|
||||||
return &VendorBusinessAssociateAgreement{
|
return &VendorBusinessAssociateAgreement{
|
||||||
ID: v.ID,
|
ID: v.ID,
|
||||||
|
Vendor: &Vendor{
|
||||||
|
ID: v.VendorID,
|
||||||
|
},
|
||||||
ValidFrom: v.ValidFrom,
|
ValidFrom: v.ValidFrom,
|
||||||
ValidUntil: v.ValidUntil,
|
ValidUntil: v.ValidUntil,
|
||||||
FileName: file.FileName,
|
FileName: file.FileName,
|
||||||
|
|||||||
@@ -44,12 +44,23 @@ func NewVendorComplianceReportEdge(c *coredata.VendorComplianceReport, orderBy c
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewVendorComplianceReport(c *coredata.VendorComplianceReport) *VendorComplianceReport {
|
func NewVendorComplianceReport(c *coredata.VendorComplianceReport) *VendorComplianceReport {
|
||||||
return &VendorComplianceReport{
|
object := &VendorComplianceReport{
|
||||||
ID: c.ID,
|
ID: c.ID,
|
||||||
|
Vendor: &Vendor{
|
||||||
|
ID: c.VendorID,
|
||||||
|
},
|
||||||
ReportDate: c.ReportDate,
|
ReportDate: c.ReportDate,
|
||||||
ValidUntil: c.ValidUntil,
|
ValidUntil: c.ValidUntil,
|
||||||
ReportName: c.ReportName,
|
ReportName: c.ReportName,
|
||||||
CreatedAt: c.CreatedAt,
|
CreatedAt: c.CreatedAt,
|
||||||
UpdatedAt: c.UpdatedAt,
|
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 {
|
func NewVendorContact(c *coredata.VendorContact) *VendorContact {
|
||||||
return &VendorContact{
|
return &VendorContact{
|
||||||
ID: c.ID,
|
ID: c.ID,
|
||||||
|
Vendor: &Vendor{
|
||||||
|
ID: c.VendorID,
|
||||||
|
},
|
||||||
FullName: c.FullName,
|
FullName: c.FullName,
|
||||||
Email: c.Email,
|
Email: c.Email,
|
||||||
Phone: c.Phone,
|
Phone: c.Phone,
|
||||||
|
|||||||
@@ -20,7 +20,10 @@ import (
|
|||||||
|
|
||||||
func NewVendorDataPrivacyAgreement(v *coredata.VendorDataPrivacyAgreement, file *coredata.File) *VendorDataPrivacyAgreement {
|
func NewVendorDataPrivacyAgreement(v *coredata.VendorDataPrivacyAgreement, file *coredata.File) *VendorDataPrivacyAgreement {
|
||||||
return &VendorDataPrivacyAgreement{
|
return &VendorDataPrivacyAgreement{
|
||||||
ID: v.ID,
|
ID: v.ID,
|
||||||
|
Vendor: &Vendor{
|
||||||
|
ID: v.VendorID,
|
||||||
|
},
|
||||||
ValidFrom: v.ValidFrom,
|
ValidFrom: v.ValidFrom,
|
||||||
ValidUntil: v.ValidUntil,
|
ValidUntil: v.ValidUntil,
|
||||||
FileName: file.FileName,
|
FileName: file.FileName,
|
||||||
|
|||||||
@@ -45,7 +45,10 @@ func NewVendorRiskAssessmentEdge(c *coredata.VendorRiskAssessment, orderBy cored
|
|||||||
|
|
||||||
func NewVendorRiskAssessment(c *coredata.VendorRiskAssessment) *VendorRiskAssessment {
|
func NewVendorRiskAssessment(c *coredata.VendorRiskAssessment) *VendorRiskAssessment {
|
||||||
return &VendorRiskAssessment{
|
return &VendorRiskAssessment{
|
||||||
ID: c.ID,
|
ID: c.ID,
|
||||||
|
Vendor: &Vendor{
|
||||||
|
ID: c.VendorID,
|
||||||
|
},
|
||||||
ExpiresAt: c.ExpiresAt,
|
ExpiresAt: c.ExpiresAt,
|
||||||
DataSensitivity: c.DataSensitivity,
|
DataSensitivity: c.DataSensitivity,
|
||||||
BusinessImpact: c.BusinessImpact,
|
BusinessImpact: c.BusinessImpact,
|
||||||
|
|||||||
@@ -45,7 +45,10 @@ func NewVendorServiceEdge(s *coredata.VendorService, orderBy coredata.VendorServ
|
|||||||
|
|
||||||
func NewVendorService(s *coredata.VendorService) *VendorService {
|
func NewVendorService(s *coredata.VendorService) *VendorService {
|
||||||
return &VendorService{
|
return &VendorService{
|
||||||
ID: s.ID,
|
ID: s.ID,
|
||||||
|
Vendor: &Vendor{
|
||||||
|
ID: s.VendorID,
|
||||||
|
},
|
||||||
Name: s.Name,
|
Name: s.Name,
|
||||||
Description: s.Description,
|
Description: s.Description,
|
||||||
CreatedAt: s.CreatedAt,
|
CreatedAt: s.CreatedAt,
|
||||||
|
|||||||
Reference in New Issue
Block a user