Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement auditing #135

Closed
cbellone opened this issue Jul 4, 2016 · 12 comments
Closed

Implement auditing #135

cbellone opened this issue Jul 4, 2016 · 12 comments
Assignees
Milestone

Comments

@cbellone
Copy link
Member

cbellone commented Jul 4, 2016

We should log all operations like:

  • event creation/modification
  • reservation complete
  • reservation expired
  • check-in
    ...
@cbellone cbellone added this to the 1.9 milestone Jul 4, 2016
@thiyagu06
Copy link

Is this issue has been implemented?

@cbellone
Copy link
Member Author

Hi @thiyagu06,

no, it has been scheduled for next release. Currently we're analyzing the impact and figuring out how to implement it.
Do you have any suggestions / do you want to help with this?

Thank you!
Celestino

@thiyagu06
Copy link

Hi @cbellone

yes.. I would like to help to fix this issue. Please include in discussions.

@cbellone
Copy link
Member Author

OK, great! We'll involve you after we close the release 1.8 (it would happen in the next few days, hopefully). In the meantime please subscribe to our mailing list https://groups.google.com/d/forum/alfio

See you soon!

@cbellone
Copy link
Member Author

Hi @thiyagu06
still interested in helping with this task?
Do you have already an idea on how could we implement it?

Thanks
Celestino

@thiyagu06
Copy link

Hi @cbellone ,

Yes.. I am ready take up this task..

@cbellone
Copy link
Member Author

cbellone commented Oct 10, 2016

That's great!

The goal of the task is to offer the "auditing" functionality in the admin tool, so that users can see what's happened to a particular ticket or reservation.

Our idea would be to create an auditing table, and then store the modification in it. The table should contain:

SESSION_ID: The java session ID of the user
USER_ID: if available
TIMESTAMP: The timestamp of the modification
ACTION: varchar/enum, possible values: INSERT, UPDATE, ...
ENTITY_TYPE: varchar/enum, possible values: EVENT, TICKET, CATEGORY, ...
ENTITY_ID: The id of the modified entity
MODIFICATIONS: JSON with the modified properties (for each property: old_value and new_value)

how does it sound?

EDIT: added USER_ID and EVENT as ENTITY_TYPE

@thiyagu06
Copy link

thiyagu06 commented Oct 11, 2016

@cbellone
yeah sure.. thats fine. If an with entity with same id is audited multiple times, based modifications column it will be difficult to find the history of the changed values for a particular columns. give your thoughts on this..

@cbellone
Copy link
Member Author

I am not sure I understand your point. Anyway I see two possible scenarios:

  1. Multiple modifications at the same time

That could happen if a user modifies two or more properties of the entity in the same transaction (e.g. category price and max seats). In this case the MODIFICATIONS json will contain two pairs (old and new value), one for category price and the other one for max seats

  1. Entity modified multiple (n) times
    In this case we'll have (n) rows in the table, each one corresponding to a particular modification.

Either way we can display the updated history on the admin GUI, sorting the result set by timestamp. Then it would be an easy task to implement a full-text search on the client, so that the admin can see how a particular column has been modified.

Does that answer your question?

@thiyagu06
Copy link

yeah..perfect. I just want know json format for modification. then ,I will look into the code and discuss on the design.

@cbellone
Copy link
Member Author

Hi @thiyagu06

I would say something like that:

[{
   "propertyName": "property1",
   "oldValue": "old",
   "newValue":"new"
}, {
   "propertyName": "property2",
   "oldValue": "old2",
   "newValue":"new2"
}]

@cbellone cbellone removed this from the 1.9 milestone Oct 22, 2016
@cbellone cbellone added this to the 1.11 milestone Mar 20, 2017
syjer added a commit that referenced this issue May 29, 2017
syjer added a commit that referenced this issue May 29, 2017
syjer added a commit that referenced this issue May 29, 2017
syjer added a commit that referenced this issue May 29, 2017
syjer added a commit that referenced this issue May 29, 2017
@syjer
Copy link
Member

syjer commented May 29, 2017

can be considered done, finally

@syjer syjer closed this as completed May 29, 2017
syjer added a commit that referenced this issue May 30, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants