sul-dlss / libsys-airflow

Airflow DAGS for migrating and managing ILS data into FOLIO along with other LibSys workflows
Apache License 2.0
5 stars 0 forks source link

Add or update digital bookplate data in bookplate table #1180

Closed shelleydoljack closed 1 month ago

shelleydoljack commented 2 months ago

This task gets the parsed JSON bookplate data and store it in the bookplates table. It should lookup in the bookplates table for the Symphony Fund Name (e.g. ABBOTT) and druid (or just druid for the "gift funds") to see if a record already exists. If none found, create a new record in the table, with created date and updated date the same. If a record is found, compare the druid, titles and image filenames in the record to see if there are changes. If no changes, do nothing. If there are changes, update the data in the bookplates table (also updating the updated date column) and pass the updated data along with a reason field (e.g. title change, filename change) in the XCOM so that it can be reported out. For new bookplates, add that to the XCOM too to be reported out.

shelleydoljack commented 2 months ago

A database conflict should tell you which field it errored on so we should be able to catch that exception to pass in the XCOM. We want to report out if the filename or title changed if it's not too difficult but it doesn't happen often so we might add this later.