appydave-tools 0.4.1 → 0.5.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: adaf87989c7386fc11d7e2b29a9578b7920a913232e606169b67406f0ddb819a
4
- data.tar.gz: af6c9502a2b8a66bbe26a0f483109f417c168eeb8c26d8805549e439dff0d437
3
+ metadata.gz: 38e915f4af00415a837d3951bf3b678b881617d820c57cf0842caf1751c272c0
4
+ data.tar.gz: 3ec4f4c1093872fd73fe77fa7758ab8ae0926f80c180fc29a6ca0715a26529a2
5
5
  SHA512:
6
- metadata.gz: 6334c9279ca5e2f6fd5cf1de4973470dd4dfb2e74e5346e0b0f86a9b1a7fb5594940236e22785123887e6df03a2f009feb677ebb975be3f59606522f23ea1ac0
7
- data.tar.gz: 5856609b0464a50f23e1ab700a8995ff86cde4f00dc4c75b9fd81f13d0dfd5dc89cac09c04d72f4026e888bd884009156bb110e1e5bf0e41510ee81dd0b5d54f
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Appydave
4
4
  module Tools
5
- VERSION = '0.4.1'
5
+ VERSION = '0.5.0'
6
6
  end
7
7
  end
@@ -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.4.1",
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.4.1",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "AppyDave YouTube Automation Tools",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
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.1
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