uc3-dmp-id 0.1.61 → 0.1.62

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb07288c4e1b21217a2ca9ed4df6a8c7243968c2cea3dbd0474796b6399d2a09
4
- data.tar.gz: 665c7eb28c3fd99e73c50f06b9bd95be7f96bb95b0a0c551634c6b5c941fd9db
3
+ metadata.gz: 289f8d64c3d235bd1dcfa4944f61f9b02df27a10269fe4e488f22e07858ca7a7
4
+ data.tar.gz: 8cf27583d3ac6dc860b451358d5ddc2c398138106f95829234ade8f075e1bbcf
5
5
  SHA512:
6
- metadata.gz: 8f196c1f061e5fcbd9085f5d483936797b3fe97bdb3e74b9bb8e2fc83effdefc4ecffbb28a0f0b478418fff6e8b6edd21b35cb2e103e6d7db1696e33e94d9d2f
7
- data.tar.gz: b4adad6f533baff187391f415123134b93ffc0c01a93771f6519d8e935f91966c32c0d2ff2c051a98b09a596a615c86226b1f7ba6eeda72092b34b127edac403
6
+ metadata.gz: 0e37a65b597ce40874d7380ca16af810eb0a87a21251cbf9edd1b770cfa64d7fee113746669899879aaa9bd55abdbc91e5cfdde8ceabab73c4939193dbfcd9e1
7
+ data.tar.gz: 12f88664290e9d479c099d3fa28a1657182b40146dbb1cb4c55f28b0f44102d962ad0f11e1d30767b160dbfd502af0e24ee03ec54d1af484191f5853e500927f
@@ -19,6 +19,12 @@ module Uc3DmpId
19
19
 
20
20
  ORCID_DOMAIN = 'https://orcid.org/'
21
21
  ROR_DOMAIN = 'https://ror.org/'
22
+ SORT_OPTIONS = %w[title modified]
23
+ SORT_DIRECTIONS = %w[asc desc]
24
+ MAX_PAGE_SIZE = 100
25
+ DEFAULT_PAGE_SIZE = 25
26
+ DEFAULT_SORT_OPTION = 'modified'
27
+ DEFAULT_SORT_DIR = 'desc'
22
28
 
23
29
  class << self
24
30
  # TODO: Replace this with ElasticSearch
@@ -32,19 +38,15 @@ module Uc3DmpId
32
38
  owner_pks = owner.nil? ? [] : _by_owner(owner: owner, client:, logger:)
33
39
  org_pks = org.nil? ? [] : _by_org(org: org, client:, logger:)
34
40
  funder_pks = funder.nil? ? [] : _by_funder(funder: funder, client:, logger:)
41
+ pks = [owner_pks, org_pks, funder_pks].reject(&:empty?)
35
42
  return [] if owner_pks.empty? && org_pks.empty? && funder_pks.empty?
36
43
 
37
44
  # Only use the DMPs that fit all of the filter criteria
38
- dmps = owner_pks & org_pks & funder_pks
45
+ dmps = pks.reduce(:&).flatten.uniq
39
46
  return [] if dmps.nil? || dmps.empty?
40
47
 
41
- # Perfom search operations
42
48
 
43
- # Handle sort
44
-
45
- # Handle pagination
46
-
47
- # Fetch full DMP records
49
+ # Fetch full DMP records for the results
48
50
  client = Uc3DmpDynamo::Client.new(table: ENV['DYNAMO_TABLE'])
49
51
  _fetch_dmps(client:, pks: dmps.map { |dmp| dmp['pk'] }, logger:)
50
52
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.1.61'
4
+ VERSION = '0.1.62'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.61
4
+ version: 0.1.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley