Skip to content

Commit

Permalink
Add publishers field to record type
Browse files Browse the repository at this point in the history
Why these changes are being introduced:

We recently [made the decision in transmogrifier](MITLibraries/transmogrifier#132)
To map publication information to a new nested field, named
`publishers` to avoid a naming conflict with the existing
`publicationInformation` field.

Relevant ticket(s):

* [GDT-270](https://mitlibraries.atlassian.net/browse/GDT-270)
* [GDT-218](https://mitlibraries.atlassian.net/browse/GDT-218)
* [GDT-229](https://mitlibraries.atlassian.net/browse/GDT-229)
* [GDT-271](https://mitlibraries.atlassian.net/browse/GDT-271)

How this addresses that need:

This adds the new `publishers` field and deprecates
`publicationInformation`.

Side effects of this change:

A follow-on ticket is needed to add this field to the UI. (This
is ticketed as GDT-271.)
  • Loading branch information
jazairi committed Apr 4, 2024
1 parent 0b13697 commit 47a4ebc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/graphql/types/record_type.rb
Expand Up @@ -131,6 +131,12 @@ def matched_phrases
end
end

class PublishersType < Types::BaseObject
field :name, String, description: 'The name of the publisher'
field :date, String, description: 'The date of the publication'
field :location, String, description: 'Where the publisher is located'
end

class RecordType < Types::BaseObject
field :identifier, ID, null: false, deprecation_reason: 'Use `timdex_record_id`'
field :timdex_record_id, ID, null: false, description: 'TIMDEX unique identifier for the item'
Expand Down Expand Up @@ -158,8 +164,8 @@ class RecordType < Types::BaseObject
field :call_numbers, [String], null: true, description: 'Identification number used to classify and locate item'
field :citation, String, null: true, description: 'Citation for item'
field :edition, String, null: true, description: 'Edition information for item'
field :imprint, [String], null: true, deprecation_reason: 'Use `publicationInformation`'
field :publication_information, [String], description: 'Imprint information for item'
field :imprint, [String], null: true, deprecation_reason: 'Use `publishers`'
field :publication_information, [String], deprecation_reason: 'Use `publishers`'
field :physical_description, String, null: true, description: 'Physical description of item'
field :publication_frequency, [String], null: true,
description: 'Publication frequency of item (used for serials)'
Expand Down Expand Up @@ -188,6 +194,7 @@ class RecordType < Types::BaseObject
field :provider, String,
null: true,
description: 'The host institution for a resource. Currently only used for geospatial records'
field :publishers, [Types::PublishersType], null: true, description: 'Publishers that are associated with the item'

def in_bibliography
@object['related_items']&.map { |i| i['uri'] if i['relationship'] == 'IsCitedBy' }&.compact
Expand Down

0 comments on commit 47a4ebc

Please sign in to comment.