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

circulation: load legacy transactions #1856

Merged
merged 1 commit into from
May 3, 2021

Conversation

BadrAly
Copy link

@BadrAly BadrAly commented Apr 29, 2021

  • 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

Why are you opening this PR?

https://tree.taiga.io/project/rero21-reroils/us/2011?milestone=289558

Code review check list

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?
  • Cypress tests successful?

@BadrAly BadrAly added the f: data migration Data migration from a legacy system or a previous version label Apr 29, 2021
@BadrAly BadrAly self-assigned this Apr 29, 2021
@BadrAly BadrAly force-pushed the baa-load-virtua-loans-cli branch from 4090c69 to 5aeb1d0 Compare April 29, 2021 04:57
@BadrAly BadrAly marked this pull request as ready for review April 29, 2021 07:00
Copy link
Contributor

@zannkukai zannkukai left a 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 :-)

@BadrAly BadrAly force-pushed the baa-load-virtua-loans-cli branch from 5aeb1d0 to b218456 Compare April 29, 2021 08:06
@BadrAly BadrAly requested a review from zannkukai April 29, 2021 08:07
Copy link

@iGormilhit iGormilhit left a 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.

@BadrAly BadrAly force-pushed the baa-load-virtua-loans-cli branch from b218456 to 2c3274c Compare April 29, 2021 08:23
@BadrAly BadrAly requested a review from iGormilhit April 29, 2021 08:23
@BadrAly BadrAly force-pushed the baa-load-virtua-loans-cli branch 2 times, most recently from acc6f15 to 591f209 Compare April 30, 2021 07:59
@BadrAly BadrAly added this to the v1.2.0 milestone Apr 30, 2021
@BadrAly BadrAly requested a review from rerowep April 30, 2021 08:00
* 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>
@BadrAly BadrAly force-pushed the baa-load-virtua-loans-cli branch from 591f209 to 876768b Compare May 2, 2021 10:45
@BadrAly BadrAly requested a review from rerowep May 2, 2021 10:45
def check_missing_fields(transaction, transaction_type):
"""Return list of missing fields for a given transaction type.

transaction: the json transaction record.
Copy link
Contributor

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'
Copy link
Contributor

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(
Copy link
Contributor

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.

@jma jma merged commit 529045d into rero:dev May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: data migration Data migration from a legacy system or a previous version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants