package middleware import ( "context" "git.lohmar.co.uk/cclohmar/NextMyDay/internal/core/audit" ) // AttachAudit attaches the request's audit metadata to ctx (SPEC-003 §4, ruling // R-1). The door calls it before dispatching to a module; every service then // writes its audit rows with the right actor · client IP · correlation. func AttachAudit(ctx context.Context, actorUserID int64, clientIP, correlationID string) context.Context { return audit.WithMeta(ctx, audit.Meta{ ActorUserID: actorUserID, ClientIP: clientIP, CorrelationID: correlationID, }) }