summaryrefslogtreecommitdiffstats
path: root/rust/src/entity_crud.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-05-13 19:17:19 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-05-13 19:17:19 -0700
commite63e21495c5e63f9fce3a0204f178d104c46124e (patch)
treee80e76c4a0b64dd97959e63a375d012d58e4d4df /rust/src/entity_crud.rs
parent5c3156b10f05bd68530dd1fb2c502764b8397cb1 (diff)
downloadfatcat-e63e21495c5e63f9fce3a0204f178d104c46124e.tar.gz
fatcat-e63e21495c5e63f9fce3a0204f178d104c46124e.zip
rust: fill in missing extid checkers
Diffstat (limited to 'rust/src/entity_crud.rs')
-rw-r--r--rust/src/entity_crud.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/rust/src/entity_crud.rs b/rust/src/entity_crud.rs
index af496ad9..3bd19cce 100644
--- a/rust/src/entity_crud.rs
+++ b/rust/src/entity_crud.rs
@@ -1988,6 +1988,7 @@ impl EntityCrud for ReleaseEntity {
fn db_insert_revs(conn: &DbConn, models: &[&Self]) -> Result<Vec<Uuid>> {
// first verify external identifier syntax
for entity in models {
+ // TODO: yeah... helper function to call all these?
if let Some(ref extid) = entity.ext_ids.doi {
check_doi(extid)?;
}
@@ -2000,7 +2001,21 @@ impl EntityCrud for ReleaseEntity {
if let Some(ref extid) = entity.ext_ids.wikidata_qid {
check_wikidata_qid(extid)?;
}
- // TODO: JSTOR and arxiv IDs
+ if let Some(ref extid) = entity.ext_ids.isbn13 {
+ check_isbn13(extid)?;
+ }
+ if let Some(ref extid) = entity.ext_ids.core {
+ check_core_id(extid)?;
+ }
+ if let Some(ref extid) = entity.ext_ids.jstor {
+ check_jstor_id(extid)?;
+ }
+ if let Some(ref extid) = entity.ext_ids.mag {
+ check_mag_id(extid)?;
+ }
+ if let Some(ref extid) = entity.ext_ids.ark {
+ check_ark_id(extid)?;
+ }
if let Some(ref release_type) = entity.release_type {
check_release_type(release_type)?;
}