Add audit start and end dates to audits

ISO audits often span a window distinct from certificate validity.
Store optional audit_start_date and audit_end_date on the audit
record and expose them through GraphQL, MCP, CLI, n8n, and console.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
Cursor Agent
2026-07-28 14:35:36 +00:00
committed by Bryan Frimin
parent dcb7ffa945
commit fe215efbd1
25 changed files with 385 additions and 28 deletions

View File

@@ -43,6 +43,8 @@ query($id: ID!, $first: Int, $after: CursorKey, $orderBy: AuditOrder) {
state
validFrom
validUntil
auditStartDate
auditEndDate
}
}
pageInfo {
@@ -56,11 +58,13 @@ query($id: ID!, $first: Int, $after: CursorKey, $orderBy: AuditOrder) {
`
type audit struct {
ID string `json:"id"`
Name string `json:"name"`
State string `json:"state"`
ValidFrom *string `json:"validFrom"`
ValidUntil *string `json:"validUntil"`
ID string `json:"id"`
Name string `json:"name"`
State string `json:"state"`
ValidFrom *string `json:"validFrom"`
ValidUntil *string `json:"validUntil"`
AuditStartDate *string `json:"auditStartDate"`
AuditEndDate *string `json:"auditEndDate"`
}
func NewCmdList(f *cmdutil.Factory) *cobra.Command {
@@ -180,16 +184,28 @@ func NewCmdList(f *cmdutil.Factory) *cobra.Command {
validUntil = *a.ValidUntil
}
auditStartDate := ""
if a.AuditStartDate != nil {
auditStartDate = *a.AuditStartDate
}
auditEndDate := ""
if a.AuditEndDate != nil {
auditEndDate = *a.AuditEndDate
}
rows = append(rows, []string{
a.ID,
a.Name,
a.State,
validFrom,
validUntil,
auditStartDate,
auditEndDate,
})
}
t := cmdutil.NewTable("ID", "NAME", "STATE", "VALID FROM", "VALID UNTIL").Rows(rows...)
t := cmdutil.NewTable("ID", "NAME", "STATE", "VALID FROM", "VALID UNTIL", "AUDIT START", "AUDIT END").Rows(rows...)
_, _ = fmt.Fprintln(f.IOStreams.Out, t)