Adds logging to several backend routes via Homebrew Logger class to allow traceback of user activities: adding user to an organization, inviting a user, removing a user or updating a user.
Create temporary table for the log record
sql CREATE TABLE public.log ( "id" SERIAL PRIMARY KEY, "payload" json NOT NULL, "createdAt" timestamptz NOT NULL DEFAULT now(), "eventType" varchar NOT NULL, "result" varchar NOT NULL );
Invite a user and assign them to an organization
Deny a user's request
Approve a user's request
View User Logs by going to Admin Tools => Select the User Logs tab
Filters implemented:
Result => Either 'success' or 'fail'
Payload => JSON object you can search with this format: createdUserPayload.id: a23das12312n-asda912-asd
Timestamp
EventType
✅ Pre-approval checklist
[x] This PR has an informative and human-readable title.
[x] Changes are limited to a single goal - eschew scope creep!
[x] All future TODOs are captured in issues, which are referenced
in code comments.
[x] All relevant type-of-change labels have been added.
🗣 Description
Logger
class to allow traceback of user activities: adding user to an organization, inviting a user, removing a user or updating a user.💠Motivation and context
Resolves CRASM-569
🧪 Testing
sql CREATE TABLE public.log ( "id" SERIAL PRIMARY KEY, "payload" json NOT NULL, "createdAt" timestamptz NOT NULL DEFAULT now(), "eventType" varchar NOT NULL, "result" varchar NOT NULL );
Filters implemented:
✅ Pre-approval checklist
✅ Pre-merge checklist
✅ Post-merge checklist