Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

[Task]: Create tables for opportunity attachments #126

Closed
chouinar opened this issue Jun 28, 2024 · 1 comment
Closed

[Task]: Create tables for opportunity attachments #126

chouinar opened this issue Jun 28, 2024 · 1 comment
Assignees
Labels

Comments

@chouinar
Copy link
Collaborator

chouinar commented Jun 28, 2024

Summary

We want to create the following tables for storing opportunity attachment information:
Scratchpad - Michael - Grants gov - Page 9 (1)

Several of these tables have foreign keys to the opportunity table which already exists.

Please create these table models (except the two prefixed by lk_) in the https://github.com/navapbc/simpler-grants-gov/blob/main/api/src/db/models/opportunity_models.py file.

Not included on all of these tables is the updated_at and created_at timestamps, which can be added automatically to the model by adding TimestampMixin as a parent class (ie. your class definition should look like class MyTable(ApiSchemaTable, TimestampMixin):)


The two lookup tables (prefixed with lk) should be created like our other lookup tables: https://github.com/navapbc/simpler-grants-gov/blob/main/api/src/db/models/lookup_models.py - to do this you'll need to create a Python enum for each and configure it to map to integer values in the DB.

See: https://github.com/navapbc/simpler-grants-gov/blob/main/documentation/api/lookup-values.md for further details on how this works.


For these two enums, we'll want the following values.

For the opportunity attachment type enum, there are exactly two values:

  • related_link -> 1
  • attachment -> 2

For the opportunity attachment folder type enum, there are exactly three values:

  • full_announcement -> 1
  • revised_full_announcement -> 2
  • other_supporting_documents -> 3

Acceptance criteria

  • Tables created in our SQLAlchemy models
  • Migrations created via Alembic
  • Lookup table values configured
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants