avniproject / avni-server

Backend APIs for Avni
https://avniproject.org
GNU Affero General Public License v3.0
5 stars 25 forks source link

User update does not update audit information #706

Open vinayvenu opened 3 months ago

vinayvenu commented 3 months ago

The regular audit mechanism for all transactions in Avni does not work with the User domain object. As a result, all changes require us to manually set the user who updates a user. This currently does not happen for the following.

  1. PUT /user/{id}
  2. DELETE /user/{id}
  3. PUT /user/{id}/disable
  4. PUT /user/accountOrgAdmin/{id}/disable

There is a User.setAuditInfo that will need to be called in all these scenarios

Dashlet26 commented 3 months ago

Whats the issue in this ........ like how to update User.setAuditInfo to make changes for the above following or something else

vinayvenu commented 3 months ago

@Dashlet26 didn't understand your concern.

Dashlet26 commented 3 months ago

Whats the issue in this

vinayvenu commented 3 months ago

Try any of the urls mentioned in the issue, and you will notice that last_modified_by_id and last_modified_by columns on the users table are not modified. They need to be updated in all these scenarios.

If this is not clear, please join https://join.skype.com/xiTU162DSJTd so we can understand your concern.

MiirzaBaig commented 2 months ago

@vinayvenu Would like to work on this bug, if needed we can join a call for understanding the bug in depth...

ombhardwajj commented 2 months ago

@vinayvenu , I've tried to fix this issue . Could you please review the changes? Please let me know If any further adjustments are needed!!

https://github.com/ombhardwajj/avni-server/commit/64df2659901b03bae7de4ca0c2ebc63e109b31a6

vinayvenu commented 2 months ago

@ombhardwajj can you please raise a PR?