theurbanforrest / olomana

1 stars 0 forks source link

[Func] Authentication & /user sync #13

Open theurbanforrest opened 4 years ago

theurbanforrest commented 4 years ago

User Story

If I disable/delete/edit accounts in Firebase Authentication (the source of record [SOR]), it now becomes out of sync with the active RTD /users table.

I need to get these in sync

Acceptance Criteria

  1. Every hour, the /users table should check that it's in sync with the SOR. If not, run script to sync them.
  2. Admin can click button to manually run the sync.
theurbanforrest commented 4 years ago

Thoughts on logic:

SOR: Firebase Authentication Users table /users: Firebase RTD /users path

Mark what should be deleted/edited

Get /users then loop thru vs. SOR For each:

If not in SOR, mark to DELETE Else for each field, check value:

If not exact match, mark to UPDATE

Perform the action

For each in marked table

If DELETE, perform delete If UPDATE, for each field perform the UPDATE

Notes