Add implemented state and justification to controls
Introduce `implemented` enum (IMPLEMENTED/NOT_IMPLEMENTED) and `not_implemented_justification` (nullable text) fields on the Control entity across all API surfaces (GraphQL, MCP, CLI), database, frontend, and SOA export. The database stores implementation state as a PostgreSQL enum `control_implementation_state`. Controls default to IMPLEMENTED during migration. The SOA list and PDF export show implementation status alongside applicability, with "-" for non-applicable controls. Justification columns are renamed for clarity: "Justification for non-applicability" and "Justification for non-implementation". Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -252,6 +252,11 @@ func CreateControl(c *testutil.Client, frameworkID string, attrs ...Attrs) strin
|
||||
"description": a.getString("description", "Test control description"),
|
||||
"sectionTitle": a.getString("sectionTitle", fmt.Sprintf("Section %s", gofakeit.LetterN(3))),
|
||||
"bestPractice": a.getBool("bestPractice", true),
|
||||
"implemented": a.getString("implemented", "IMPLEMENTED"),
|
||||
}
|
||||
|
||||
if justification := a.getStringPtr("notImplementedJustification"); justification != nil {
|
||||
input["notImplementedJustification"] = *justification
|
||||
}
|
||||
|
||||
var result struct {
|
||||
@@ -495,6 +500,16 @@ func (b *ControlBuilder) WithBestPractice(bestPractice bool) *ControlBuilder {
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ControlBuilder) WithImplemented(implemented string) *ControlBuilder {
|
||||
b.attrs["implemented"] = implemented
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ControlBuilder) WithNotImplementedJustification(justification string) *ControlBuilder {
|
||||
b.attrs["notImplementedJustification"] = justification
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ControlBuilder) Create() string {
|
||||
return CreateControl(b.client, b.frameworkID, b.attrs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user