CDLUC3 / dmsp_rails_prototype

Prototype DMSP Rails7 API app
0 stars 0 forks source link

Build out Org model #4

Open briri opened 9 months ago

briri commented 9 months ago

Build the orgs table in Dynamo and the corresponding scaffolding (Model, Controller, Policy).

The record structure should use the ROR ID as the partition key. We don't need a Sort Key here, searching will be done via OpenSearch.

The field structure should look something like this, where we've extracted the most important elements from the raw ROR record. The Metadata entry should contain the raw ROR record.:

PK: ROR id
SK: 'ORG'
Provenance: String (e.g. 'ror', 'dmsp')
Name: String
Url: String
Type: String (e.g. Funder, Education, etc.)
Metadata: JSON Object (essentially the rest of the ROR record)

Add API integrations as separate records. This record is where we will store custom/related info specific to the application. Then, for all of the NIH (Url ends with nih.gov), NASA (Url ends with nasa.gov) and then refer to the DMPTool's v5 Rake task to find the other Orgs with an API integration with Crossref. Add entries for those orgs.

PK: ROR id
SK: 'DMSP'
ApiTarget: String (URL of the API endpoint to search for projects)
ApiGuidance: Text (info to display in UI when user is searching the API)
ApiQueryFields: JSON Object (describes the fields the UI should provide for search)
ApiAuthTarget: String (URL of the authentication endpoint if applicable)

The Model should fetch both records and combine them as necessary for the . Even though most of the data will come from ROR, we will need to be able to create our own Org records, so the controller should support full CRUD operations.

Refer to the Define Data Model ticket on the dmsp_aws_prototype repo.

Build RSpec tests!

briri commented 7 months ago

Built definition for the Org model. Need to build in logic to connect records to the Typeaheads Dynamo table and OpenSearch next.