dina 0.8.8.0 → 0.9.0.0

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: 622d5a98c36798a96522565afc4ebb8b92f03b98871c3978755a1ff0c943af08
4
- data.tar.gz: 388e6517c19f10d1929cb9e1f01f6fb8c60119b33b8e2a74d4ea450562ffaf27
3
+ metadata.gz: 27acdf30e09b690b73f8259fb85b62336c19af883559d1c37f29956fd1a65def
4
+ data.tar.gz: 3407082f98d36a8ff78301e48a5aa28c45482b27ccfd25d579c887d7bb12d155
5
5
  SHA512:
6
- metadata.gz: 55342e9497c5c1bd9c5375fca33774d711c411213cd879a0c014c8ad9a01c3f63194bb3085b243a4a4ab89b413ff15e74f6b11916e3a88453f12988c4968ef82
7
- data.tar.gz: 95cbb829a44ebdc779cb2a89ae572e2f2ccdbd7a3603b5552535834e7370f4c34f3c01067589488f04e696c5c1809659afcf3f8568dbc1eee6576d39236abd61
6
+ metadata.gz: 548ddc0feac986f42f2f36ac2a1887639f67cf647215e8f0d0f27977886a92213bc6ca8912576c8abcb110e0b2fe37a3ab36f544f0b4c63b484e3cf864a6a187
7
+ data.tar.gz: 6b51728d08aa817222e7d8ddd32085bede6abac6553a815aa4f80d7d4d846e16a0bc1d24912faf70b60b98dd218232b7ab038043971a8fd72c54926100592d0c
@@ -0,0 +1,15 @@
1
+ module Dina
2
+ class DateCaster
3
+ def self.cast(value, default)
4
+ if value.is_a?(String)
5
+ y, m, d = value.split '-'
6
+ raise PropertyValueInvalid, "Invalid date" unless Date.valid_date?(y.to_i, m.to_i, d.to_i)
7
+ Date.parse(value).to_s
8
+ elsif value.is_a?(Date)
9
+ value.to_s
10
+ else
11
+ default
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,19 @@
1
+ module Dina
2
+ class ScheduledAction
3
+ attr_accessor :actionType
4
+ attr_accessor :date
5
+ attr_accessor :actionStatus
6
+ attr_accessor :remarks
7
+ attr_accessor :assignedTo
8
+
9
+ def initialize
10
+ end
11
+
12
+ def to_hash
13
+ hash = {}
14
+ instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
15
+ hash.deep_symbolize_keys
16
+ end
17
+
18
+ end
19
+ end
@@ -4,9 +4,9 @@ module Dina
4
4
  class AcquisitionEvent < BaseModel
5
5
  property :id, type: :string, default: SecureRandom.uuid
6
6
  property :group, type: :string
7
- property :receivedDate, type: :string
7
+ property :receivedDate, type: :date
8
8
  property :receptionRemarks, type: :string
9
- property :isolatedOn, type: :string
9
+ property :isolatedOn, type: :date
10
10
  property :isolationRemarks, type: :string
11
11
  property :createdBy, type: :string
12
12
  property :createdOn, type: :time
@@ -17,11 +17,11 @@ module Dina
17
17
  property :preparationFixative, type: :string
18
18
  property :preparationMaterials, type: :string
19
19
  property :preparationSubstrate, type: :string
20
- property :preparationDate, type: :time
20
+ property :preparationDate, type: :date
21
21
  property :preparationRemarks, type: :string
22
22
  property :dwcDegreeOfEstablishment, type: :string
23
23
  property :materialSampleState, type: :string
24
- property :stateChangedOn, type: :time
24
+ property :stateChangedOn, type: :date
25
25
  property :stateChangeRemarks, type: :string
26
26
  property :materialSampleRemarks, type: :string
27
27
  property :extensionValues, type: :object
@@ -69,6 +69,7 @@ module Dina
69
69
  def self.accepted_types
70
70
  [
71
71
  "WHOLE_ORGANISM",
72
+ "CULTURE_STRAIN",
72
73
  "ORGANISM_PART",
73
74
  "MIXED_ORGANISMS",
74
75
  "MOLECULAR_SAMPLE"
@@ -6,8 +6,8 @@ module Dina
6
6
  property :group, type: :string
7
7
  property :name, type: :string
8
8
  property :multilingualDescription, type: :multilingual_description
9
- property :startDate, type: :string
10
- property :endDate, type: :string
9
+ property :startDate, type: :date
10
+ property :endDate, type: :date
11
11
  property :status, type: :string
12
12
  property :createdBy, type: :string
13
13
  property :createdOn, type: :time
@@ -5,6 +5,7 @@ module Dina
5
5
  property :id, type: :string, default: SecureRandom.uuid
6
6
  property :group, type: :string
7
7
  property :name, type: :string
8
+ property :barcode, type: :string
8
9
  property :storageUnitChildren, type: :array
9
10
  property :hierarchy, type: :string
10
11
  property :createdBy, type: :string
@@ -11,9 +11,9 @@ module Dina
11
11
  property :otherIdentifiers, type: :array, default: []
12
12
  property :status, type: :string
13
13
  property :purpose, type: :string
14
- property :openedDate, type: :time
15
- property :closedDate, type: :time
16
- property :dueDate, type: :time
14
+ property :openedDate, type: :date
15
+ property :closedDate, type: :date
16
+ property :dueDate, type: :date
17
17
  property :remarks, type: :string
18
18
  property :managedAttributes, type: :object
19
19
  property :agentRoles, type: :array # Each of type Dina::AgentRole
data/lib/dina/version.rb CHANGED
@@ -2,8 +2,8 @@ module Dina
2
2
  class Version
3
3
 
4
4
  MAJOR = 0
5
- MINOR = 8
6
- PATCH = 8
5
+ MINOR = 9
6
+ PATCH = 0
7
7
  BUILD = 0
8
8
 
9
9
  def self.version
data/lib/dina.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "keycloak"
2
2
  require "json_api_client"
3
3
  require "time"
4
+ require "date"
4
5
  require "securerandom"
5
6
  require "require_all"
6
7
  require_all File.join(File.dirname(__FILE__), 'dina')
@@ -11,6 +12,7 @@ module Dina
11
12
  JsonApiClient::Paginating::NestedParamPaginator.per_page_param = "limit"
12
13
  JsonApiClient::Schema.register array: ArrayCaster
13
14
  JsonApiClient::Schema.register object: ObjectCaster
15
+ JsonApiClient::Schema.register date: DateCaster
14
16
  JsonApiClient::Schema.register multilingual_title: MultilingualTitleCaster
15
17
  JsonApiClient::Schema.register multilingual_description: MultilingualDescriptionCaster
16
18
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.8.0
4
+ version: 0.9.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David P. Shorthouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-07 00:00:00.000000000 Z
11
+ date: 2023-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_api_client
@@ -145,6 +145,7 @@ files:
145
145
  - lib/dina.rb
146
146
  - lib/dina/authentication/authentication.rb
147
147
  - lib/dina/casters/array_caster.rb
148
+ - lib/dina/casters/date_caster.rb
148
149
  - lib/dina/casters/multilingual_description.rb
149
150
  - lib/dina/casters/multilingual_description_caster.rb
150
151
  - lib/dina/casters/multilingual_title.rb
@@ -155,6 +156,7 @@ files:
155
156
  - lib/dina/components/determination.rb
156
157
  - lib/dina/components/geographic_source.rb
157
158
  - lib/dina/components/georeference_assertion.rb
159
+ - lib/dina/components/scheduled_action.rb
158
160
  - lib/dina/components/shipment.rb
159
161
  - lib/dina/exceptions.rb
160
162
  - lib/dina/json_api_client_patch.rb