Skip to content

Conversation

nhart24
Copy link

@nhart24 nhart24 commented May 13, 2024

Summary / Highlights

Organization functionality has been implemented analogous to Vendor class; also added an Affiliate class in models.py that Vendor and Organization both inherit from (could eventually replace shared functionality in other Vendor and Organization files - would need to test the database). Closes #976.

Details (Give details about what this PR accomplishes, include any screenshots etc)

Taken from https://docs.google.com/document/d/1eHafgpwCL_A7oL0DgtIANvQLgwk2vG10zllVe9gphBk/edit?usp=sharing

  • Implemented an “Associate” class in Models.py; Vendors and Organizations both inherit from this parent class
  • Implemented an “Organization” class in Models.py; structurally similar to Vendor
  • Implemented an “OrganizationsPageSettings” class in Models.py; structurally similar to VendorPageSettings
  • Copied most files with “Vendor” in their name and manually replaced all instances of Vendor in such files with Organization:
  • src/api/handlers - page_settings_organizations.py
  • src/api/handlers - organization.py
  • src/api/services - organization.py
  • src/api/store - organization.py
  • Added “OrganizationHandler” and “OrganizationsPageSettingsHandler” to urls.py
  • Added “Organization” item type to FootageConstants.py (key: ORGANIZATION; json_field: is_organization)
  • Added function “get_organization_filter_params” to filter_functions.py
  • Set up a unit test for Organizations in test_organizations.py
Screenshot 2024-05-12 at 8 43 07 PM

Testing Steps (Provide details on how your changes can be tested)

Need to test whether the Organization entry is implemented in the database (and whether inheriting from Affiliate class causes problems); need to add front-end functionality for adding Organizations in admin site

Requirements (place an x in each [ ])

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've tested my changes manually.
  • I've added unit tests to my PR.
Transparency (Project board)
  • I've given my PR a meaningful title.
  • I linked this PR to the relevant issue.
  • I moved the linked issue from the "Sprint backlog" to "In progress" when I started this.
  • I moved the linked issue to "QA Verification" now that it is ready to merge.

@nhart24 nhart24 requested a review from BradHN1 May 13, 2024 00:43


class Vendor(models.Model):
class Affiliate(models.Model):
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest instead of Affiliate (which implies some affiliation, even its just a name) to call the base class Org

Fixed a redundant mention of service_area in filter_functions and added an allowed_users field in the Organization model class
Copy link
Contributor

@BradHN1 BradHN1 left a comment

Choose a reason for hiding this comment

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

LGTM

@archx3
Copy link
Contributor

archx3 commented May 20, 2024

need to test whether the Organization entry is implemented in the database (and whether inheriting from Affiliate class)

Has the inherittance uncertainty been resolved yet?

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.

Back-end implementation of Organizations for Event upgrades

3 participants