vaccination-characteristics 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32b80395e901ca6b565df1c7210a3f0c2b6be079b7ee455bf2b815aecfe4cc07
4
- data.tar.gz: c991b91ddfd57d9d2a5d3c93714b11c566d845f912f6b91d56b1bf26a5c805ff
3
+ metadata.gz: 8a4db6b756e272a410157d709f20d850762541932af3298cf1c57f185ea110de
4
+ data.tar.gz: 50195f0bbbd3eb13f2e5e861a65d2768c022f6b99d47c82e527019345f0570de
5
5
  SHA512:
6
- metadata.gz: 3b8f702fc38bc6128a8e21abf8e9d8020dbbd4567ff29c20d8e1102bf4bc148214c3a2d444897b5dbeae59daa717035ca13bbc359daa12ce1a3192da0af76bcb
7
- data.tar.gz: 2dca68c7f7ff186d854acafe3e78d20eab93ec78f890efdacae7f5b7ce2f3412d1f797895de6810080c1668b22043c959e9d73d829611e7b53006540e1f0a927
6
+ metadata.gz: 7449bd17a51079ad0f54f7b56cdf5cf45276fd21f78892bb4c0ac407e772e8f7ccad152f55e15cf559d94688b9d0950257ec2c598f513760b0666aaf3fff6e1f
7
+ data.tar.gz: 172c683377ff8764f9c03f8760cc004fdffb9f175ab71286585270b40d8b38f1d33e48b53bf5f9df7d12175cf1af2ea0dbe460d475c2ccaa36018bdcf269b0f7
data/Changelog.md CHANGED
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
- - Add the boolean `Condition#deprecated` field, defaulting to `false` for older dumps. Deprecated conditions remain accessible through the repository.
12
+ - Add the timestamp `Condition#deprecated_on` field, exposed as a `Date` using the UTC calendar day (or `nil` for active conditions). Deprecated conditions remain accessible through the repository.
13
13
 
14
14
  - Add `proxy_addr` and `proxy_port` options to `Database.load`, `Database.fetch_latest_version_hash`, and `Database.watch_latest_version` for CDN requests. Both default to `nil`, so no proxy is used unless explicitly configured.
15
15
 
@@ -4,7 +4,8 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  require_relative 'ConditionType_pb'
7
- descriptor_data = "\n\x0FCondition.proto\x12\evaccination_characteristics\x1A\x13ConditionType.proto\">\n\x04Code\x12\"\n\fnomenclature\x18\x01 \x01(\tR\fnomenclature\x12\x12\n\x04code\x18\x02 \x01(\tR\x04code\"\x80\x02\n\tCondition\x12\x0E\n\x02id\x18\x01 \x01(\x05R\x02id\x12\x14\n\x05label\x18\x02 \x01(\tR\x05label\x12 \n\vdescription\x18\x03 \x01(\tR\vdescription\x12>\n\x04type\x18\x04 \x01(\x0E2*.vaccination_characteristics.ConditionTypeR\x04type\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x127\n\x05codes\x18\x06 \x03(\v2!.vaccination_characteristics.CodeR\x05codes\x12\x1E\n\ndeprecated\x18\a \x01(\bR\ndeprecatedB\x13\n\x0Fcom.syadem.sadvP\x01b\x06proto3"
7
+ require 'google/protobuf/timestamp_pb'
8
+ descriptor_data = "\n\x0FCondition.proto\x12\evaccination_characteristics\x1A\x13ConditionType.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\">\n\x04Code\x12\"\n\fnomenclature\x18\x01 \x01(\tR\fnomenclature\x12\x12\n\x04code\x18\x02 \x01(\tR\x04code\"\xA1\x02\n\tCondition\x12\x0E\n\x02id\x18\x01 \x01(\x05R\x02id\x12\x14\n\x05label\x18\x02 \x01(\tR\x05label\x12 \n\vdescription\x18\x03 \x01(\tR\vdescription\x12>\n\x04type\x18\x04 \x01(\x0E2*.vaccination_characteristics.ConditionTypeR\x04type\x12\x12\n\x04tags\x18\x05 \x03(\tR\x04tags\x127\n\x05codes\x18\x06 \x03(\v2!.vaccination_characteristics.CodeR\x05codes\x12?\n\rdeprecated_on\x18\a \x01(\v2\x1A.google.protobuf.TimestampR\fdeprecatedOnB\x13\n\x0Fcom.syadem.sadvP\x01b\x06proto3"
8
9
 
9
10
  ::Google::Protobuf::DescriptorPool.generated_pool.add_serialized_file(descriptor_data)
10
11
 
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "Condition_pb"
4
+ require "date"
5
+
6
+ module VaccinationCharacteristics
7
+ class Condition
8
+ def deprecated_on
9
+ timestamp = self["deprecated_on"]
10
+ Time.at(timestamp.seconds, timestamp.nanos, :nanosecond).utc.to_date if timestamp
11
+ end
12
+
13
+ def deprecated_on=(value)
14
+ if value.nil?
15
+ clear_deprecated_on
16
+ else
17
+ self["deprecated_on"] =
18
+ if value.is_a?(Date)
19
+ Google::Protobuf::Timestamp.new(seconds: Time.utc(value.year, value.month, value.day).to_i)
20
+ else
21
+ value
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VaccinationCharacteristics
4
- VERSION = "1.3.0"
4
+ VERSION = "1.4.0"
5
5
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "vaccination_characteristics/version"
4
4
  require_relative "vaccination_characteristics/VaccinationCharacteristicsDatabase_pb"
5
+ require_relative "vaccination_characteristics/condition"
5
6
  require_relative "vaccination_characteristics/repository"
6
7
  require_relative "vaccination_characteristics/version_watcher"
7
8
  require "net/http"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vaccination-characteristics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Syadem
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-02 00:00:00.000000000 Z
11
+ date: 2026-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -57,6 +57,7 @@ files:
57
57
  - lib/vaccination_characteristics/Condition_pb.rb
58
58
  - lib/vaccination_characteristics/VaccinationCharacteristicsDatabase_pb.rb
59
59
  - lib/vaccination_characteristics/Version_pb.rb
60
+ - lib/vaccination_characteristics/condition.rb
60
61
  - lib/vaccination_characteristics/repositories/condition_repository.rb
61
62
  - lib/vaccination_characteristics/repository.rb
62
63
  - lib/vaccination_characteristics/version.rb