-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add configuration settings for collections subscriptions. (PP-1850) #2153
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2153 +/- ##
=======================================
Coverage 90.78% 90.78%
=======================================
Files 350 350
Lines 40608 40611 +3
Branches 8796 8796
=======================================
+ Hits 36864 36867 +3
Misses 2439 2439
Partials 1305 1305 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments with a couple questions on this one
), | ||
required=False, | ||
), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be adding these settings for every circulation API? It seems like we only really want them for OPDS importer based APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they could be handy more generally; but, I'm fine moving them to the OPDS collections setting hierarchy for now.
I'm planning to implement the subscription (vs. association) concept across all collection types, but the absence of these settings on a collection would be interpreted as always subscribed (i.e., no restriction).
@@ -570,6 +570,33 @@ class BaseCirculationApiSettings(BaseSettings): | |||
) | |||
} | |||
|
|||
subscription_activation_date: str | None = FormField( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these are coming in as dates, should we be setting the type here to reflect that, rather then just a generic str
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did try using subscription_activation_date: datetime.date | None = FormField( ...
for these, but ran into type errors in Pydantic.
I can dig into that some more as I do the implementation.
I was thinking about this one, and I'm wondering if we want to store the subscription end dates as full datetime. We are going to need a particular time to say a subscription ends, and we will need to think about what timezone that should be in. A couple options I was thinking about:
|
My original thought on this was to use UTC to make this easier to manage with the distributors, who might also be enforcing their subscriptions. It would make things simpler. If libraries are able to negotiate a single "grace" day on each end of the subscription. We could always add an offset later. |
Description
Adds start and end date configuration settings for collection subscriptions.
NB: Submitting this PR as draft, since additional work is needed fully implement the subscription functionality.
Motivation and Context
Support automatic activation/deactivation of library associations with a collection.
[Jira PP-1850]
How Has This Been Tested?
Checklist