hackforla / hackforla/peopledepot

Create Table: permission_history

Open
#37 8 comments 0 reactions 1 assignee Claimed by @dmartin4820 View on GitHub
complexity: medium feature: table creation p-feature: permissions PII: TRUE role: back end s: org s: VRMS size: 1pt
Dominant language
Python
Stars
14
Forks
37
Avg merge
9d 15h
Merged PRs (30d)
5

Description

### Dependency

- [x] #22
- [ ] #181

### Overview

We need to create the permission_history table so that we can update a shared data store across hackforla.org, vrms, civictechjobs, and tables (onboarding) project.

#### Details

A table and a model are the same thing

### Action Items

- [x] identify and document table description (see spreadsheet under Resources)
- [ ] if not, reach out to PD leads
- [x] compare and check off the data fields (below) against the ERD. Note any fields in the ERD that's missing from the list. (see Resources)
- [x] compare the check off associated tables (below) against the ERD. Note any associated tables in the ERD that's missing from the list (see Resources)
- [x] create a single model in Django (defining schema)
- [ ] write a test for the relationships this model will have with other models (e.g., creating a user and assigning them a set of permissions on a project).
- [ ] write an API end point
- [ ] write API unit tests
- [ ] document the endpoint
- Check to see if open issues in `FK status` below
- [x] If all Issues listed are closed (or there are no FKs), then skip the next 3 steps
- [ ] ~comment out the code after you create it (see FK Status below for open/closed state)~
- [ ] ~add an action item on the open issue to uncomment the code line you commented out when that issue's table is created.~
- [ ] ~Provide your file and line number as a permalink under resources in that issue~

### Resources/Instructions

- See [People Depot Resources wiki page](https://github.com/hackforla/peopledepot/wiki/Resources-and-Links) for links
- ERD
- Spreadsheet: [PD: Table and field explanations, Current Field Permission tab](https://docs.google.com/spreadsheets/d/1x_zZ8JLS2hO-zG0jUocOJmX16jh-DF5dccrd_OEGNZ0/edit?gid=749942651)
- API Endpoint
- See the [wiki page](https://github.com/hackforla/peopledepot/wiki/Create-Table-issues-data-gathering-workflow) for instructions.

### Description

When a permission is overwritten in #22 a record of it will be stored in this table instead of being deleted.

All records that have dateEnded from the Permission table will be moved here 1:12 AM Pacific Time

### Data Fields

Name | Type | FK Table | FK table Issue(s)
-- | -- | -- | --
user | int | user | #15
project | int | project | #16
permission_type | int | permission_type | #24
practice_area | int| practice_area | #63
granted | DateTimeField | |
ended | DateTimeField | |
created_by | int - User ID of who first granted the permission | user | #15
updated_by | int - User ID of who last changed the permission | user | #15

1. In ERD only (having items here indicates a mismatch, which requires a review)
- None

### FK status
- #24
- #63
- #16
- #15

### Associated Tables

1. Copied from spreadsheet and checked off according to ERD. (unchecked items indicate a mismatch between ERD and spreadsheet, which requires a review)
- [x] permission_type (many-to-one) #24
- [x] practice_area (many-to-one) #63
- [x] project (many-to-one) #16
- [x] user (many-to-one) #15

1. In ERD only (having items here indicates a mismatch, which requires a review)
- None

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.