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

@@ -40,6 +40,8 @@ query($id: ID!) {
state
validFrom
validUntil
auditStartDate
auditEndDate
createdAt
updatedAt
}
@@ -49,14 +51,16 @@ query($id: ID!) {
type viewResponse struct {
Node *struct {
Typename string `json:"__typename"`
ID string `json:"id"`
Name string `json:"name"`
State string `json:"state"`
ValidFrom *string `json:"validFrom"`
ValidUntil *string `json:"validUntil"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
Typename string `json:"__typename"`
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"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
} `json:"node"`
}
@@ -134,6 +138,14 @@ func NewCmdView(f *cmdutil.Factory) *cobra.Command {
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Valid Until:"), *a.ValidUntil)
}
if a.AuditStartDate != nil && *a.AuditStartDate != "" {
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Audit Start:"), *a.AuditStartDate)
}
if a.AuditEndDate != nil && *a.AuditEndDate != "" {
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Audit End:"), *a.AuditEndDate)
}
_, _ = fmt.Fprintln(out)
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Created:"), cmdutil.FormatTime(a.CreatedAt))
_, _ = fmt.Fprintf(out, "%s%s\n", label.Render("Updated:"), cmdutil.FormatTime(a.UpdatedAt))