feat(shared): add audit package - #172
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Suggest replacing the domain-specific fields with a type Details interface {
Metadata() map[string]any
}
type Event struct {
TraceID string
Timestamp time.Time
EventType string
Action Action
Status Status
ActorType string
ActorID string
TargetType string
TargetID string
Details Details // nil when a domain has nothing extra to attach
}
Worth doing now, while there are no consumers of this package yet. It also happens to line up field-for-field with |
fd31bb1 to
bf36fa8
Compare
bf36fa8 to
8a73a82
Compare
Land Auditor, Event, and domain/action constants in shared/audit so downstream modules can depend on a tagged shared release. Co-authored-by: Cursor <cursoragent@cursor.com>
8a73a82 to
e952230
Compare
|
Done —
|
Summary
Land the
shared/auditpackage on its own so it can be tagged as a realsharedrelease (e.g.shared/v0.4.0) before payment and storage start importing it.Auditoris about to become part of the exportedpaymentandstorageservice interfaces. Those modules cannotrequire github.com/OpenNSW/core/shared v0.3.0for a package that does not exist at that tag, and areplace => ../shareddirective is not transitive — it only works when the declaring module is built from this monorepo checkout.Type of Change
Changes Made
shared/auditwithAuditor,Event,Domain, andActionconstants used by payment and storage.shared/README.md.No consumer (
payment/storage) changes in this PR.Testing
GOWORK=off go test -C shared ./...passes. The new package is types-only (no test files).Checklist
Related Issues
Split out of #149 at reviewer request. After this merges, please tag
shared/v0.4.0so #149 can bumprequire github.com/OpenNSW/core/sharedinpaymentandstorageand drop the localreplacedirectives.