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

Implement LoanCheckout model for gathering history #9

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

attemoi
Copy link
Contributor

@attemoi attemoi commented Feb 2, 2024

Description

Context found at https://jira.lingsoft.fi/browse/SIMPLYE-195

How Has This Been Tested?

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@attemoi attemoi force-pushed the feature/simplye-195/loan-history-model branch from 72f0dc1 to e9139f3 Compare February 2, 2024 07:53
license_pool_id = Column(Integer, ForeignKey("licensepools.id"), index=True)
license_pool: Mapped[LicensePool] = relationship("LicensePool")

license_id = Column(Integer, ForeignKey("licenses.id"), index=True, nullable=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is license_id needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

@ttuovinen or @jompu might be able to answer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's no licence_id available when saving the history item, so I've omitted the field for now.

@attemoi attemoi force-pushed the feature/simplye-195/loan-history-model branch from e9139f3 to 61c7929 Compare February 5, 2024 08:36
# Renewals are counted as checkouts
assert 2 == len(circulation_api.patron.loan_checkouts)

# Loans of open-access books go through a different code
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we include open-access books in checkout history?

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't know if there will be such titles in the library collection, at least not at the beginning.

@attemoi attemoi force-pushed the feature/simplye-195/loan-history-model branch 2 times, most recently from 2461ae4 to 8e52465 Compare February 5, 2024 09:03
@attemoi attemoi force-pushed the feature/simplye-195/loan-history-model branch from 8e52465 to f83a5e8 Compare February 5, 2024 09:07
@attemoi
Copy link
Contributor Author

attemoi commented Feb 5, 2024

Something to note is that the next time there are database changes in the upstream project, the changes from this downstream migration need to be merged back into the upstream branch. This process is explained here: https://alembic.sqlalchemy.org/en/latest/branches.html

@attemoi attemoi merged commit fcca932 into main Feb 6, 2024
15 checks passed
@attemoi attemoi deleted the feature/simplye-195/loan-history-model branch February 7, 2024 06:30
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.

2 participants