-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log (history) for entity changes #118
Comments
What to log?Some of the things that should be logged to the history for an Order:
Common fields
Since each type of log entry would have other different fields, it might make sense to just dump related data (refundId for refunds, fulfillmentId for fulfillments etc) into a stringified JSON field and use a discriminator + unions for the purposes of type safety. Also the GraphQL type could also just use the JSON type to expose whatever data is needed. |
Is your feature request related to a problem? Please describe.
An Order changes state during processing. We need a log of these changes so for auditing purposes, including date, administrator, and other contextual information. E.g.
This would allow us to implement an Order History like Shopify do:
Same also goes for Payment entities. Generalizing this, it might also be useful to log changes to other entities such as Customer or ProductVariant. We'd need to strike a balance here because for certain frequently-changing entities this could generate a log of only marginally-useful noise.
Describe the solution you'd like
A new entity,
LogEntry
which contains things like date, user, event type, contextual info. An interfaceLoggable
could be implemented by entities which should be logged:Need to figure out whether a single entity would work with the various types of log message that might be needed, or whether inheritance would be better.
The text was updated successfully, but these errors were encountered: