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

schemas: fix patron transaction events schema #987

Merged
merged 1 commit into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion rero_ils/modules/loans/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ def create_payment_record(patron_transaction, user_pid, user_library):
}
data['type'] = 'payment'
data['subtype'] = 'cash'
data['status'] = 'open'
data['amount'] = patron_transaction.get('total_amount')
data['creation_date'] = datetime.now(timezone.utc).isoformat()
return data
2 changes: 1 addition & 1 deletion rero_ils/modules/patron_transaction_events/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def create_event_from_patron_transaction(
data['subtype'] = 'overdue'
elif patron_transaction.get('type') == 'subscription':
data['subtype'] = 'other'
data['data'] = _('Initial charge')
data['note'] = _('Initial charge')
record = cls.create(
data,
dbcommit=dbcommit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"type": "object",
"title": "Patron transaction event",
"description": "JSON schema for patron transaction event.",
"additionalProperties": false,
"required": [
"$schema",
"pid",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
}
}
},
"organisation": {
"properties": {
"pid": {
"type": "keyword"
}
}
},
"_created": {
"type": "date"
},
Expand Down
5 changes: 2 additions & 3 deletions tests/data/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2390,7 +2390,6 @@
},
"operator": {
"$ref": "https://ils.rero.ch/api/patrons/ptrn1"
},
"status": "open"
}
}
}
}