bcgov / critterbase-api

0 stars 0 forks source link

Simsbiohub 471 Taxon -> ITIS Migration #43

Closed MacQSL closed 6 months ago

MacQSL commented 7 months ago

Taxon -> ITIS Migration

Description of changes:

  1. Created migration for dropping taxon table and associated taxon_id fields.
  2. Added new columns for itis_tsn + itis_scientific_name (scientific name only exists in the critter table)
  3. Created new ItisService / CritterService / MarkingServices / XrefService
  4. Migration handles the translation of previous taxon_ids -> itis_tsn values.
  5. Updated seed data.
  6. Updated endpoints / routers / services / repositories that handle taxon_id
  7. Removed old dead code / unused endpoints
  8. General refactoring of code to be more similar to SIMS
  9. Updated swagger documentation

Important Features

Migration (prisma/migrations/taxon_to_itis)

ItisService

XrefService / XrefRepository

CritterService / CritterRepository

MacQSL commented 6 months ago

Critter

/api/critter/create

  • swagger docs says it needs an ID as a parameter it just needs the payload

Im unable to reproduce this. Are you making a post request to this endpoint?

Xref

Probably just a data issue but this is the TSN I used: /api/xref/taxon-qualitative-measurements?tsn=180701

  • no measurements responds with an error

/api/xref/taxon-quantitative-measurements?tsn=180701

  • no measurements responds with an error

/api/xref/taxon-measurements?tsn=180701

  • no measurements responds with an error

I've updated these endpoints to respond empty but succeed if no xref values for provided tsn (and tsn value is real tsn). You can test with tsn=180596

Lookup Endpoints

/api/lookups/enum/frequency-unit

endpoint changed to api/lookups/enum/frequency-units updated swagger

  • route not found

/api/lookups/enum/measurement-unit

endpoint changed to api/lookups/enum/measurement-units updated swagger

Access

/api

  • swggaer docs return object with message, endpoint just returns strings

updated swagger

/api/types/{model}

  • returns an array not a string

updated the swagger for types/{model} endpoint.