Skip to content

Commit

Permalink
subscription: update patrons jsonschema
Browse files Browse the repository at this point in the history
* Corrects patron JSON schema according to guidelines.

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
  • Loading branch information
zannkukai committed Apr 24, 2020
1 parent 4392d18 commit a04c3ea
Show file tree
Hide file tree
Showing 10 changed files with 1,360 additions and 1,354 deletions.
12 changes: 6 additions & 6 deletions rero_ils/modules/patrons/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,6 @@ def organisation_pid(self):
return patron_type.organisation_pid
return None


class PatronsIndexer(IlsRecordsIndexer):
"""Holdings indexing class."""

record_cls = Patron

@property
def has_valid_subscription(self):
"""Check if the patron has a valid subscription at current time.
Expand Down Expand Up @@ -419,3 +413,9 @@ def get_pending_subscriptions(self):
if transaction.status == 'open':
pending_subs.append(sub)
return pending_subs


class PatronsIndexer(IlsRecordsIndexer):
"""Holdings indexing class."""

record_cls = Patron
10 changes: 4 additions & 6 deletions rero_ils/modules/patrons/jsonschemas/patrons/patron-v0.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
}
},
"subscriptions": {
"title": "Patron subscriptions",
"title": "Subscriptions",
"type": "array",
"minItems": 1,
"items": {
Expand All @@ -292,21 +292,20 @@
"properties": {
"start_date": {
"title": "Subscription start date",
"description": "The subscription start date (date included)",
"description": "The subscription start date (selected date included).",
"type": "string",
"format": "date",
"pattern": "\\d{4}-((0[1-9])|(1[0-2]))-(((0[1-9])|[1-2][0-9])|(3[0-1]))$"
},
"end_date": {
"title": "Subscription end date",
"description": "The subscription end date (date excluded)",
"description": "The subscription end date (selected date excluded).",
"type": "string",
"format": "date",
"pattern": "\\d{4}-((0[1-9])|(1[0-2]))-(((0[1-9])|[1-2][0-9])|(3[0-1]))$"
},
"patron_type": {
"title": "Patron Type",
"description": "Patron type linked to this subscription",
"title": "Patron type",
"type": "object",
"required": [
"$ref"
Expand All @@ -321,7 +320,6 @@
},
"patron_transaction": {
"title": "Patron transaction",
"description": "Patron transaction linked to this subscription",
"type": "object",
"required": [
"$ref"
Expand Down

0 comments on commit a04c3ea

Please sign in to comment.