appydave-tools 0.4.1 → 0.5.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/appydave/tools/configuration/models/bank_reconciliation_config.rb +86 -0
- data/lib/appydave/tools/version.rb +1 -1
- data/lib/appydave/tools.rb +2 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38e915f4af00415a837d3951bf3b678b881617d820c57cf0842caf1751c272c0
|
4
|
+
data.tar.gz: 3ec4f4c1093872fd73fe77fa7758ab8ae0926f80c180fc29a6ca0715a26529a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08f2ed9f573f47a57b19ff3b26c1f141ec42bd4965062fa5b53953a493fb6aaea57b4480c3dc3a53fe920ed24ecf6addbd217ad731adedb0f1d5b32cdec034fd'
|
7
|
+
data.tar.gz: 26c0225c9185ccca543d3afa56b338bedeb88149989ed4b3e1440e9a9afbf234511401330d5b5d30b955f223382c2b34d724dbb103de0e092cda5023cc48ed17
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.4.1](https://github.com/klueless-io/appydave-tools/compare/v0.4.0...v0.4.1) (2024-05-26)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* move configuration models in to own namespace ([0a8dc48](https://github.com/klueless-io/appydave-tools/commit/0a8dc486c3f610a91dac1941bc986a1d5b05e24e))
|
7
|
+
|
1
8
|
# [0.4.0](https://github.com/klueless-io/appydave-tools/compare/v0.3.8...v0.4.0) (2024-05-26)
|
2
9
|
|
3
10
|
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appydave
|
4
|
+
module Tools
|
5
|
+
module Configuration
|
6
|
+
module Models
|
7
|
+
# Bank reconciliation configuration
|
8
|
+
class BankReconciliationConfig < ConfigBase
|
9
|
+
# Retrieve all bank accounts
|
10
|
+
def bank_accounts
|
11
|
+
data['bank_accounts'].map do |account|
|
12
|
+
BankAccount.new(account)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def chart_of_accounts
|
17
|
+
data['chart_of_accounts'].map do |entry|
|
18
|
+
ChartOfAccount.new(entry)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_bank_account(account_number, bsb = nil)
|
23
|
+
account_data = data['bank_accounts'].find do |account|
|
24
|
+
account['account_number'] == account_number && (account['bsb'].nil? || account['bsb'] == bsb)
|
25
|
+
end
|
26
|
+
|
27
|
+
BankAccount.new(account_data) if account_data
|
28
|
+
end
|
29
|
+
|
30
|
+
# Retrieve a chart of account entry by code
|
31
|
+
def get_chart_of_account(code)
|
32
|
+
entry_data = data['chart_of_accounts'].find { |entry| entry['code'] == code }
|
33
|
+
ChartOfAccount.new(entry_data) if entry_data
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def default_data
|
39
|
+
{
|
40
|
+
'bank_accounts' => [],
|
41
|
+
'chart_of_accounts' => []
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Inner class to represent a bank account
|
46
|
+
class BankAccount
|
47
|
+
attr_accessor :account_number, :bsb, :name, :bank
|
48
|
+
|
49
|
+
def initialize(data)
|
50
|
+
@account_number = data['account_number']
|
51
|
+
@bsb = data['bsb']
|
52
|
+
@name = data['name']
|
53
|
+
@bank = data['bank']
|
54
|
+
end
|
55
|
+
|
56
|
+
def to_h
|
57
|
+
{
|
58
|
+
'account_number' => @account_number,
|
59
|
+
'bsb' => @bsb,
|
60
|
+
'name' => @name,
|
61
|
+
'bank' => @bank
|
62
|
+
}
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Inner class to represent a chart of account entry
|
67
|
+
class ChartOfAccount
|
68
|
+
attr_accessor :code, :narration
|
69
|
+
|
70
|
+
def initialize(data)
|
71
|
+
@code = data['code']
|
72
|
+
@narration = data['narration']
|
73
|
+
end
|
74
|
+
|
75
|
+
def to_h
|
76
|
+
{
|
77
|
+
'code' => @code,
|
78
|
+
'narration' => @narration
|
79
|
+
}
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
data/lib/appydave/tools.rb
CHANGED
@@ -16,6 +16,7 @@ require 'appydave/tools/configuration/configurable'
|
|
16
16
|
require 'appydave/tools/configuration/config'
|
17
17
|
require 'appydave/tools/configuration/models/config_base'
|
18
18
|
require 'appydave/tools/configuration/models/settings_config'
|
19
|
+
require 'appydave/tools/configuration/models/bank_reconciliation_config'
|
19
20
|
require 'appydave/tools/configuration/models/channel_projects_config'
|
20
21
|
require 'appydave/tools/configuration/models/channels_config'
|
21
22
|
require 'appydave/tools/name_manager/project_name'
|
@@ -23,6 +24,7 @@ require 'appydave/tools/name_manager/project_name'
|
|
23
24
|
Appydave::Tools::Configuration::Config.set_default do |config|
|
24
25
|
config.config_path = File.expand_path('~/.config/appydave')
|
25
26
|
config.register(:settings, Appydave::Tools::Configuration::Models::SettingsConfig)
|
27
|
+
config.register(:bank_reconciliation, Appydave::Tools::Configuration::Models::BankReconciliationConfig)
|
26
28
|
config.register(:channels, Appydave::Tools::Configuration::ChannelsConfig)
|
27
29
|
config.register(:channel_projects, Appydave::Tools::Configuration::ChannelProjectsConfig)
|
28
30
|
end
|
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "appydave-tools",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.5.0",
|
4
4
|
"lockfileVersion": 3,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "appydave-tools",
|
9
|
-
"version": "0.
|
9
|
+
"version": "0.5.0",
|
10
10
|
"devDependencies": {
|
11
11
|
"@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
|
12
12
|
"@semantic-release/changelog": "^6.0.3",
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appydave-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- lib/appydave/tools/configuration/_doc.md
|
95
95
|
- lib/appydave/tools/configuration/config.rb
|
96
96
|
- lib/appydave/tools/configuration/configurable.rb
|
97
|
+
- lib/appydave/tools/configuration/models/bank_reconciliation_config.rb
|
97
98
|
- lib/appydave/tools/configuration/models/channel_projects_config.rb
|
98
99
|
- lib/appydave/tools/configuration/models/channels_config.rb
|
99
100
|
- lib/appydave/tools/configuration/models/config_base.rb
|