-
Notifications
You must be signed in to change notification settings - Fork 26
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
circulation: load legacy transactions #1856
Conversation
4090c69
to
5aeb1d0
Compare
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.
Sound confusing for me to have some legacy load method from Virtua into the RERO project.
In the best of the world, I think this CLI should be extracted from RERO-ILS github project to be integrated into a possible "VirtuaToReroMigration" project
@zannkukai I agree with you, we create a new project MigrateToReroILS
when we have the first Alma
library :-)
5aeb1d0
to
b218456
Compare
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.
Commit message proposition:
circulation: load legacy transactions
* Creates a CLI to load prepared Virtua circulation transactions into
RERO ILS. Three transaction types are allowed: checkouts, requests and
fines.
b218456
to
2c3274c
Compare
acc6f15
to
591f209
Compare
* Creates a CLI to load prepared Virtua circulation transactions into RERO ILS. Three transaction types are allowed: checkouts, requests and fines. Co-Authored-by: Aly Badr <aly.badr@rero.ch>
591f209
to
876768b
Compare
def check_missing_fields(transaction, transaction_type): | ||
"""Return list of missing fields for a given transaction type. | ||
|
||
transaction: the json transaction record. |
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 be: :param
, see https://thomas-cokelaer.info/tutorials/sphinx/docstring_python.html for more details. Please check similar cases.
item: the item record. | ||
""" | ||
if transaction_type == 'checkout': | ||
transaction['state'] = 'ITEM_ON_LOAN' |
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.
The alternative can be to have a dict with new fields and use the update
dict method.
records = read_json_record(infile) | ||
else: | ||
file_data = json.load(infile) | ||
text = 'Loading Virtua transactions of type {transaction_type}'.format( |
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.
you can use f''
here, please check other cases.
RERO ILS. Three transaction types are allowed: checkouts, requests and
fines.
Co-Authored-by: Aly Badr aly.badr@rero.ch
Why are you opening this PR?
https://tree.taiga.io/project/rero21-reroils/us/2011?milestone=289558
Code review check list