diff --git a/backend/database/models/officer.py b/backend/database/models/officer.py index 1d11334e..fa797e32 100644 --- a/backend/database/models/officer.py +++ b/backend/database/models/officer.py @@ -16,6 +16,23 @@ class Rank(str, enum.Enum): CHIEF = "CHIEF" +class StateID(db.Model): + """ + Represents a Statewide ID that follows an offcier even as they move between + law enforcement agencies. for an officer. For example, in New York, this + would be the Tax ID Number. + """ + id = db.Column(db.Integer, primary_key=True) + officer_id = db.Column( + db.Integer, db.ForeignKey("officer.id")) + id_name = db.Column(db.Text) # e.g. "Tax ID Number" + state = db.Column(db.Text) # e.g. "NY" + value = db.Column(db.Text) # e.g. "958938" + + def __repr__(self): + return f"" + + class Officer(db.Model): id = db.Column(db.Integer, primary_key=True) # officer id first_name = db.Column(db.Text) @@ -23,9 +40,6 @@ class Officer(db.Model): race = db.Column(db.Text) ethnicity = db.Column(db.Text) gender = db.Column(db.Text) - # Note: rank at time of incident - rank = db.Column(db.Enum(Rank)) - star = db.Column(db.Text) # type? date_of_birth = db.Column(db.Date) def __repr__(self): diff --git a/backend/database/models/perpetrator.py b/backend/database/models/perpetrator.py index be44f075..ed2f554a 100644 --- a/backend/database/models/perpetrator.py +++ b/backend/database/models/perpetrator.py @@ -15,7 +15,9 @@ class Perpetrator(db.Model): unit = db.Column(db.Text) # type? # Note: rank at time of incident rank = db.Column(db.Enum(Rank)) - star = db.Column(db.Text) # type? + state_id_val = db.Column(db.Text) + state_id_state = db.Column(db.Text) + state_id_name = db.Column(db.Text) role = db.Column(db.Text) suspects = db.relationship( "Officer", secondary=perpetrator_officer, backref="accusations")