Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue #3874] Create Rough Tables for Opportunity Applicate package #3906

Open
wants to merge 52 commits into
base: main
Choose a base branch
from

Conversation

babebe
Copy link
Collaborator

@babebe babebe commented Feb 14, 2025

Summary

Fixes #{3874}

Time to review: 15 mins

Rough Tables Created
opportunity_application_form
opportunity_competition_form
opportunity_competition
opportunity_competition_assistance_listing
opportunity_competition_instruction

Factories created

api/src/db/models/opportunity_models.py Outdated Show resolved Hide resolved
api/src/db/models/opportunity_models.py Outdated Show resolved Hide resolved
api/src/db/models/opportunity_models.py Outdated Show resolved Hide resolved
api/tests/src/db/models/factories.py Outdated Show resolved Hide resolved
api/tests/src/db/models/factories.py Outdated Show resolved Hide resolved
api/tests/src/db/models/factories.py Outdated Show resolved Hide resolved
api/tests/src/db/models/factories.py Outdated Show resolved Hide resolved
api/src/db/models/opportunity_models.py Outdated Show resolved Hide resolved
api/src/db/models/opportunity_models.py Outdated Show resolved Hide resolved
sa.Column("form_id", sa.UUID(), nullable=False),
sa.Column("form_name", sa.Text(), nullable=False),
sa.Column("form_version", sa.Text(), nullable=False),
sa.Column("is_active", sa.Boolean(), nullable=False),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should think through the lifecycle a bit more than just currently active or inactive. Do we need to have a "available after"/"available until" kind of dates when a form is "depreciated" or "retired?" For example what if SF-424 v4 is live now and v5 gets approved and added to the system. Do all applications switch immediately? Do new application packages only show v5 when selecting what forms to add? Is there a period where both remain pick-able when setting up an application package? Even if we just have active, I think it'd be good to have this be a date/time and have it be called like inactive_at and that date then controls if it's shown and also provides more of a history of when it became inactivated, can be set for a future date, etc.

If we want to move this forward in the short term, maybe just make this a timestamp instead of boolean and re-name it accordingly and then we can always add an "active_at" column in the future if we need more specifics of a lifecycle.

Copy link
Collaborator Author

@babebe babebe Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdragon These were initially considered basic columns, with the plan to add more as needed. I believe it's a good idea to include both inactive_at and active_at columns, as it's generally better for each column to serve a single purpose rather than combining logic. Thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense for now and then yes, we absolutely shouldn't try to make perfect tables out of the gate and anticipate revisions and improvements as we work with the tables and learn more about the functionality. 👍🏻

Copy link
Collaborator Author

@babebe babebe Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added inactive_at -nullable and active_at-non-nullable datetime columns and updated factory

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would maybe let active_at be null too for now. I could see someone setting up a form but not knowing when it will be ready to be made active and so we'd force them to put in some random future date to be able to even start working on the form. I think it being null is a better signal that it's not scheduled to be active yet.

Copy link
Collaborator Author

@babebe babebe Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we then update is_active to default to False or be nullable ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I thought we were replacing is_active with the active_at. I think we can just remove is_active for now and we can use a active_at <= now() kind of logic to determine if something is active rather than having the boolean too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed is_active and made active_at nullable

@babebe babebe requested a review from mdragon February 18, 2025 18:26
@babebe babebe linked an issue Feb 19, 2025 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create rough tables representing an opportunity application package
4 participants