hws-transactions 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/hws-transactions/models/base.rb +5 -7
- data/lib/hws-transactions/models/transaction_group.rb +2 -2
- data/lib/hws-transactions.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 355de16d7149038ec235c7b8af247d1c233591a6a146787de4ca73e0a6ec208b
|
4
|
+
data.tar.gz: 5ce99f18022e2c562027f72252f073adc9097eaa885f161594bfd23e4da5f63e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca139e9ea189a3e733f815a2f42ec64dea5f3a421b120d0b96d366f131bb308593e445a691ec01e4075bda08e41c7dc2e622365d140b33041a304d1025eb3693
|
7
|
+
data.tar.gz: 0d2c75354daca587b19df1cc0ea9c9f4d7225dad433ada917bdac467aa5b3ed095c1eeaad7885d263c3677b58235cd1084a9675aa80da177260e505035687488
|
data/CHANGELOG.md
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
self.abstract_class = true
|
3
|
+
class Hws::Transactions::Models::Base < ActiveRecord::Base # :nodoc:
|
4
|
+
self.abstract_class = true
|
6
5
|
|
7
|
-
|
6
|
+
before_create :set_uuid
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
end
|
8
|
+
def set_uuid
|
9
|
+
self.id = LSUUID.generate if self.id.blank?
|
12
10
|
end
|
13
11
|
end
|
@@ -81,11 +81,11 @@ module Hws::Transactions::Models
|
|
81
81
|
tags['immutable_tags'] = {} unless tags.key? 'immutable_tags'
|
82
82
|
|
83
83
|
unless tags['mutable_tags'].keys.all? { |key| self.mutable_tags.include?(key) }
|
84
|
-
raise
|
84
|
+
raise "Invalid mutable tags present in add_entry request. Given keys: #{tags['mutable_tags'].keys} | Allowed keys: #{self.mutable_tags}"
|
85
85
|
end
|
86
86
|
|
87
87
|
unless tags['immutable_tags'].keys.all? { |key| self.immutable_tags.include?(key) }
|
88
|
-
raise
|
88
|
+
raise "Invalid immutable_tags tags present in add_entry request. Given keys: #{tags['immutable_tags'].keys} | Allowed keys: #{self.immutable_tags}"
|
89
89
|
end
|
90
90
|
|
91
91
|
tags
|
data/lib/hws-transactions.rb
CHANGED
@@ -47,10 +47,16 @@ module Hws # :nodoc:
|
|
47
47
|
# 'last_entry': '',
|
48
48
|
# 'page_size': 10
|
49
49
|
# }
|
50
|
-
def self.list_entries(transaction_group_id, filters, page_context)
|
50
|
+
def self.list_entries(transaction_group_id, filters = {}, page_context = {})
|
51
51
|
self.get_group(transaction_group_id).try(:list_entries, filters.with_indifferent_access, page_context.with_indifferent_access)
|
52
52
|
end
|
53
53
|
|
54
|
+
def self.get_entry(entry_id)
|
55
|
+
entry = ::Hws::Transactions::Models::TransactionEntry.find_by(id: entry_id)
|
56
|
+
{ id: entry.id, transaction_group_id: entry.transaction_group_id, value: entry.value, txn_time: entry.txn_time,
|
57
|
+
tags: { immutable_tags: entry.immutable_tags, mutable_tags: entry.mutable_tags } }
|
58
|
+
end
|
59
|
+
|
54
60
|
module Models # :nodoc:
|
55
61
|
end
|
56
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hws-transactions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hypto Engineering Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lsuuid
|