sul-dlss / cocina-models

Cocina repository data model (implemented in Ruby)
https://sul-dlss.github.io/cocina-models/
3 stars 0 forks source link

If an event note has a parallelValue, extract the data #626

Closed aaron-collier closed 1 year ago

aaron-collier commented 1 year ago

Why was this change made? 🤔

While working on https://github.com/sul-dlss/dor_indexing_app/issues/992 for resource_type - I discovered that while we follow the same logic internally to determine this should provide a resource_type of Journal/Periodical, when translating the cocina to mods in order to use stanford-mods to determine the resource_type we do not look for the parallelValue and thus miss value="monthly" and type="frequency".

This checks if the note has a parallelValue and if so, uses value(s) found there to write the note.

The Cocina for a note that has a parallelValue:

#<Cocina::Models::DescriptiveValue 
    structuredValue=[]
    parallelValue=[
        #<Cocina::Models::DescriptiveValue 
            structuredValue=[] parallelValue=[] groupedValue=[] 
            value="monthly" 
            type="frequency" 
            status=nil code=nil uri=nil standard=nil encoding=nil 
            identifier=[] source=nil displayLabel=nil qualifier=nil note=[] valueLanguage=nil valueAt=nil appliesTo=[]>

How was this change tested? 🤨

unit