mismo_enum 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +21 -0
  3. data/Rakefile +21 -0
  4. data/app/assets/javascripts/mismo_enum/application.js +13 -0
  5. data/app/assets/stylesheets/mismo_enum/application.css +15 -0
  6. data/app/controllers/mismo_enum/application_controller.rb +4 -0
  7. data/app/helpers/mismo_enum/application_helper.rb +4 -0
  8. data/app/models/mismo_enum/amortization_type.rb +39 -0
  9. data/app/models/mismo_enum/automated_underwriting_system_type.rb +32 -0
  10. data/app/models/mismo_enum/bankruptcy_disposition_type.rb +26 -0
  11. data/app/models/mismo_enum/bankruptcy_status_type.rb +20 -0
  12. data/app/models/mismo_enum/base.rb +6 -0
  13. data/app/models/mismo_enum/borrower_classification_type.rb +19 -0
  14. data/app/models/mismo_enum/citizenship_residency_type.rb +23 -0
  15. data/app/models/mismo_enum/construction_method_type.rb +33 -0
  16. data/app/models/mismo_enum/definition_of_value_type.rb +25 -0
  17. data/app/models/mismo_enum/foreclosure_status_type.rb +35 -0
  18. data/app/models/mismo_enum/gender_type.rb +21 -0
  19. data/app/models/mismo_enum/index_source_type.rb +140 -0
  20. data/app/models/mismo_enum/index_type.rb +27 -0
  21. data/app/models/mismo_enum/loan_delinquency_status_type.rb +108 -0
  22. data/app/models/mismo_enum/loan_purpose_type.rb +26 -0
  23. data/app/models/mismo_enum/loan_state_type.rb +44 -0
  24. data/app/models/mismo_enum/marital_status_type.rb +22 -0
  25. data/app/models/mismo_enum/mortgage_type.rb +43 -0
  26. data/app/models/mismo_enum/payment_delinquency_status_type.rb +22 -0
  27. data/app/models/mismo_enum/postal_state.rb +95 -0
  28. data/app/models/mismo_enum/prepayment_penalty_option_type.rb +21 -0
  29. data/app/models/mismo_enum/project_design_type.rb +24 -0
  30. data/app/models/mismo_enum/project_legal_structure_type.rb +32 -0
  31. data/app/models/mismo_enum/property_usage_type.rb +26 -0
  32. data/app/models/mismo_enum/property_valuation_method_type.rb +29 -0
  33. data/app/models/mismo_enum/property_valuation_state_type.rb +20 -0
  34. data/app/models/mismo_enum/rate_lock_type.rb +19 -0
  35. data/app/models/mismo_enum/refinance_cash_out_determination_type.rb +21 -0
  36. data/app/models/mismo_enum/taxpayer_identifier_type.rb +24 -0
  37. data/app/views/layouts/mismo_enum/application.html.erb +14 -0
  38. data/config/routes.rb +2 -0
  39. data/db/migrations/001_create_mismo_enums.rb +26 -0
  40. data/db/seeds.rb +3 -0
  41. data/lib/generators/mismo_enum/install/install_generator.rb +22 -0
  42. data/lib/generators/mismo_enum/templates/create_mismo_enums.rb +26 -0
  43. data/lib/mismo_enum.rb +3 -0
  44. data/lib/mismo_enum/class_list.rb +50 -0
  45. data/lib/mismo_enum/engine.rb +11 -0
  46. data/lib/mismo_enum/helper.rb +3 -0
  47. data/lib/mismo_enum/version.rb +3 -0
  48. data/lib/tasks/mismo_enum_tasks.rake +23 -0
  49. metadata +92 -0
@@ -0,0 +1,32 @@
1
+ # app/models/mismo_enum/project_legal_structure_type.rb
2
+ # enum
3
+
4
+ class MismoEnum::ProjectLegalStructureType < MismoEnum::Base
5
+ validates_presence_of :name
6
+ validates_uniqueness_of :name
7
+
8
+ def self.description
9
+ 'Specifies the form of ownership that defines the quality and quantity of'+
10
+ ' ownership and rights to the individual unit owner.'
11
+ end
12
+
13
+ def self.seed
14
+ [[1, 'Condominium', 'A project that is legally formed as a condominium '+
15
+ 'under the Condominium-Enabling Legislation of the state in which the'+
16
+ ' project is located.'],
17
+ [2, 'Cooperative', 'A project in which a corporation or business trust '+
18
+ 'holds title to the property and issues shares of stock as evidence '+
19
+ 'of ownership in the corporation or business trust. The corporation or'+
20
+ ' business trust grants occupancy rights to the shareholder tenants '+
21
+ 'through proprietary leases. '],
22
+ [3, 'CommonInterestApartment', 'Any project or building that is owned by '+
23
+ 'several owners as tenants in common or by a home owners association '+
24
+ 'in which individuals have an undivided interest in a residential '+
25
+ 'apartment building and land, and are the rights of exclusive '+
26
+ 'occupancy of a specific apartment in the building.'],
27
+ [4, 'Unknown', '']
28
+ ].each { |id, entry, desc| create(id: id,
29
+ name: entry,
30
+ description: desc) }
31
+ end
32
+ end
@@ -0,0 +1,26 @@
1
+ # app/models/mismo_enum/property_usage_type.rb
2
+ # enum
3
+
4
+ class MismoEnum::PropertyUsageType < MismoEnum::Base
5
+ validates_presence_of :name
6
+ validates_uniqueness_of :name
7
+
8
+ def self.description
9
+ 'Borrowers answer to the question: What type of property did you own'+
10
+ ' principal residence, second home, or investment property? Collected on'+
11
+ ' the URLA in Section VIII line m1.'
12
+ end
13
+
14
+ def self.seed
15
+ [[1, 'Investment', 'A home owned for the purpose of generating income by '+
16
+ 'renting the property.'],
17
+ [2, 'PrimaryResidence', 'Residence that the owner physically occupies and'+
18
+ ' uses as his or her principal residence.'],
19
+ [3, 'SecondHome', 'A property occupied by the owner for a portion of the'+
20
+ ' year and is not the primary residence.'],
21
+ [4, 'Other', '']
22
+ ].each { |id, entry, desc| create(id: id,
23
+ name: entry,
24
+ description: desc) }
25
+ end
26
+ end
@@ -0,0 +1,29 @@
1
+ # app/models/mismo_enum/property_valuation_method_type.rb
2
+ # enum
3
+
4
+ class MismoEnum::PropertyValuationMethodType < MismoEnum::Base
5
+ validates_presence_of :name
6
+ validates_uniqueness_of :name
7
+
8
+ def self.description
9
+ 'Specifies the method by which the property value was assessed.'
10
+ end
11
+
12
+ def self.seed
13
+ [[1, 'AutomatedValuationModel', ''],
14
+ [2, 'DesktopAppraisal', 'This appraisal valuation is commonly used for '+
15
+ 'refinancing, home equity loans, and home equity lines of credit.  The'+
16
+ ' appraiser determines the value of the property through public '+
17
+ 'records, tax assessments and comparable sales history.'],
18
+ [3, 'DriveBy', ''],
19
+ [4, 'FullAppraisal', ''],
20
+ [5, 'None', ''],
21
+ [6, 'Other', ''],
22
+ [7, 'PriorAppraisalUsed', ''],
23
+ [8, 'BrokerPriceOption', ''],
24
+ [9, 'TaxValuation', '']
25
+ ].each { |id, entry, desc| create(id: id,
26
+ name: entry,
27
+ description: desc) }
28
+ end
29
+ end
@@ -0,0 +1,20 @@
1
+ # app/models/mismo_enum/property_valuation_state_type.rb
2
+ # enum
3
+
4
+ class MismoEnum::PropertyValuationStateType < MismoEnum::Base
5
+ validates_presence_of :name
6
+ validates_uniqueness_of :name
7
+
8
+ def self.description
9
+ 'Specifies that the subject property valuation amount is the amount at the'+
10
+ ' point of origination or a subsequent evaluation.'
11
+ end
12
+
13
+ def self.seed
14
+ [[1, 'Original', ''],
15
+ [2, 'Subsequent', '']
16
+ ].each { |id, entry, desc| create(id: id,
17
+ name: entry,
18
+ description: desc) }
19
+ end
20
+ end
@@ -0,0 +1,19 @@
1
+ # app/models/mismo_enum/rate_lock_type.rb
2
+ # enum
3
+
4
+ class MismoEnum::RateLockType < MismoEnum::Base
5
+ validates_presence_of :name
6
+ validates_uniqueness_of :name
7
+
8
+ def self.description
9
+ 'Specifies the method by which the rate lock period will be determined.'
10
+ end
11
+
12
+ def self.seed
13
+ [[1, 'BestEfforts', ''],
14
+ [2, 'Mandatory', '']
15
+ ].each { |id, entry, desc| create(id: id,
16
+ name: entry,
17
+ description: desc) }
18
+ end
19
+ end
@@ -0,0 +1,21 @@
1
+ # app/models/mismo_enum/refinance_cash_out_determination_type.rb
2
+ # enum
3
+
4
+ class MismoEnum::RefinanceCashOutDeterminationType < MismoEnum::Base
5
+ validates_presence_of :name
6
+ validates_uniqueness_of :name
7
+
8
+ def self.description
9
+ 'Specifies how the lender has classified a refinanced loan.'
10
+ end
11
+
12
+ def self.seed
13
+ [[1, 'CashOut', ''],
14
+ [2, 'LimitedCashOut', ''],
15
+ [3, 'NoCashOut', ''],
16
+ [4, 'Unknown', '']
17
+ ].each { |id, entry, desc| create(id: id,
18
+ name: entry,
19
+ description: desc) }
20
+ end
21
+ end
@@ -0,0 +1,24 @@
1
+ # app/models/mismo_enum/taxpayer_identifier_type.rb
2
+ # enum
3
+
4
+ class MismoEnum::TaxpayerIdentifierType < MismoEnum::Base
5
+ validates_presence_of :name
6
+ validates_uniqueness_of :name
7
+
8
+ def self.description
9
+ 'Specifies the type of identification number used by the Internal Revenue'+
10
+ ' Service (IRS) in the administration of tax laws. It is issued either by'+
11
+ ' the Social Security Administration (SSA) or the IRS. A Social Security'+
12
+ ' number (SSN) is issued by the SSA; all other taxpayer identification'+
13
+ ' numbers are issued by the IRS.'
14
+ end
15
+
16
+ def self.seed
17
+ [[1, 'EmployerIdentificationNumber', ''],
18
+ [2, 'IndividualTaxpayerIdentificationNumber', ''],
19
+ [3, 'SocialSecurityNumber', '']
20
+ ].each { |id, entry, desc| create(id: id,
21
+ name: entry,
22
+ description: desc) }
23
+ end
24
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>MismoEnum</title>
5
+ <%= stylesheet_link_tag "mismo_enum/application", media: "all" %>
6
+ <%= javascript_include_tag "mismo_enum/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ MismoEnum::Engine.routes.draw do
2
+ end
@@ -0,0 +1,26 @@
1
+ class CreateMismoEnums < ActiveRecord::Migration
2
+ def up
3
+ MismoEnum::ClassList::ENUMS.each { |n|
4
+ tname = "mismo_enum_#{n.pluralize}".to_sym
5
+
6
+ create_table tname do |t|
7
+ t.string :name, null: false
8
+ t.text :description
9
+ end
10
+
11
+ add_index tname, :name, { :unique => true }
12
+
13
+ if serial_sequence(tname, "id")
14
+ ActiveRecord::Base.connection.
15
+ execute("DROP SEQUENCE mismo_enum_#{n.pluralize}_id_seq CASCADE;")
16
+ end
17
+ }
18
+ end
19
+
20
+ def down
21
+ MismoEnum::ClassList::ENUMS.each { |n|
22
+ tname = "mismo_enum_#{n.pluralise}".to_sym
23
+ drop_table tname
24
+ }
25
+ end
26
+ end
data/db/seeds.rb ADDED
@@ -0,0 +1,3 @@
1
+ MismoEnum::ClassList::ENUMS.each do |enum|
2
+ "MismoEnum::#{enum.camelize}".constantize.seed
3
+ end
@@ -0,0 +1,22 @@
1
+ module MismoEnum
2
+ module Generators
3
+ class InstallGenerator < ::Rails::Generators::Base
4
+ include Rails::Generators::Migration
5
+ source_root File.expand_path('../../templates', __FILE__)
6
+ desc "add the migrations"
7
+
8
+ def self.next_migration_number(path)
9
+ unless @prev_migration_nr
10
+ @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
11
+ else
12
+ @prev_migration_nr += 1
13
+ end
14
+ @prev_migration_nr.to_s
15
+ end
16
+
17
+ def copy_migrations
18
+ migration_template "create_mismo_enums.rb", "db/migrate/create_mismo_enums.rb"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ class CreateMismoEnums < ActiveRecord::Migration
2
+ def up
3
+ MismoEnum::ClassList::ENUMS.each { |n|
4
+ tname = "mismo_enum_#{n.pluralize}".to_sym
5
+
6
+ create_table tname do |t|
7
+ t.string :name, null: false
8
+ t.text :description
9
+ end
10
+
11
+ add_index tname, :name, { :unique => true }
12
+
13
+ if serial_sequence(tname, "id")
14
+ ActiveRecord::Base.connection.
15
+ execute("DROP SEQUENCE mismo_enum_#{n.pluralize}_id_seq CASCADE;")
16
+ end
17
+ }
18
+ end
19
+
20
+ def down
21
+ MismoEnum::ClassList::ENUMS.each { |n|
22
+ tname = "mismo_enum_#{n.pluralise}".to_sym
23
+ drop_table tname
24
+ }
25
+ end
26
+ end
data/lib/mismo_enum.rb ADDED
@@ -0,0 +1,3 @@
1
+ require "mismo_enum/engine"
2
+ require "mismo_enum/class_list"
3
+ require "mismo_enum/version"
@@ -0,0 +1,50 @@
1
+ module MismoEnum::ClassList
2
+
3
+ # alphabetic order
4
+ BORROWER_ENUMS = %w{
5
+ bankruptcy_disposition_type
6
+ bankruptcy_status_type
7
+ borrower_classification_type
8
+ citizenship_residency_type
9
+ gender_type
10
+ marital_status_type
11
+ taxpayer_identifier_type
12
+ }
13
+
14
+ LOAN_ENUMS = %w{
15
+ amortization_type
16
+ automated_underwriting_system_type
17
+ foreclosure_status_type
18
+ index_source_type
19
+ index_type
20
+ loan_delinquency_status_type
21
+ loan_purpose_type
22
+ loan_state_type
23
+ mortgage_type
24
+ payment_delinquency_status_type
25
+ prepayment_penalty_option_type
26
+ rate_lock_type
27
+ refinance_cash_out_determination_type
28
+ }
29
+
30
+ PROPERTY_ENUMS = %w{
31
+ construction_method_type
32
+ definition_of_value_type
33
+ project_design_type
34
+ project_legal_structure_type
35
+ property_usage_type
36
+ property_valuation_method_type
37
+ property_valuation_state_type
38
+ }
39
+
40
+ UTIL_ENUMS = %w{
41
+ postal_state
42
+ }
43
+
44
+ ENUMS = BORROWER_ENUMS +
45
+ LOAN_ENUMS +
46
+ PROPERTY_ENUMS +
47
+ UTIL_ENUMS
48
+
49
+ ENUM_CLASSES = ENUMS.map(&:camelize)
50
+ end
@@ -0,0 +1,11 @@
1
+ #require 'rspec/rails'
2
+ module MismoEnum
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace MismoEnum
5
+
6
+ config.generators do |g|
7
+ g.test_framework :rspec, :view_specs => false
8
+ g.fixture_replacement :factory_girl, :dir => 'spec/factories'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ class MismoEnum::Helper
2
+
3
+ end
@@ -0,0 +1,3 @@
1
+ module MismoEnum
2
+ VERSION = "0.1.2"
3
+ end
@@ -0,0 +1,23 @@
1
+ namespace :mismo_enum do
2
+ desc 'Load Mismo Enum Seed data.'
3
+ task seed: :environment do
4
+ begin
5
+ MismoEnum::Engine.load_seed
6
+ puts "Database has been seeded with Mismo Enum data."
7
+ rescue => error
8
+ puts "Error: ", error
9
+ end
10
+ end
11
+
12
+ desc 'Print out all models and their fields'
13
+ task print_schema: :environment do
14
+ Rails.application.eager_load!
15
+ ActiveRecord::Base.descendants.sort_by(&:name).each do |model|
16
+ puts model.name
17
+ model.attribute_names.each do |attribute|
18
+ puts " #{attribute}"
19
+ end
20
+ puts
21
+ end
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mismo_enum
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Chad Edie
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: MISMO enumerations for use in mortgage banking.
14
+ email:
15
+ - chad.edie@pnmac.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - MIT-LICENSE
21
+ - Rakefile
22
+ - app/assets/javascripts/mismo_enum/application.js
23
+ - app/assets/stylesheets/mismo_enum/application.css
24
+ - app/controllers/mismo_enum/application_controller.rb
25
+ - app/helpers/mismo_enum/application_helper.rb
26
+ - app/models/mismo_enum/amortization_type.rb
27
+ - app/models/mismo_enum/automated_underwriting_system_type.rb
28
+ - app/models/mismo_enum/bankruptcy_disposition_type.rb
29
+ - app/models/mismo_enum/bankruptcy_status_type.rb
30
+ - app/models/mismo_enum/base.rb
31
+ - app/models/mismo_enum/borrower_classification_type.rb
32
+ - app/models/mismo_enum/citizenship_residency_type.rb
33
+ - app/models/mismo_enum/construction_method_type.rb
34
+ - app/models/mismo_enum/definition_of_value_type.rb
35
+ - app/models/mismo_enum/foreclosure_status_type.rb
36
+ - app/models/mismo_enum/gender_type.rb
37
+ - app/models/mismo_enum/index_source_type.rb
38
+ - app/models/mismo_enum/index_type.rb
39
+ - app/models/mismo_enum/loan_delinquency_status_type.rb
40
+ - app/models/mismo_enum/loan_purpose_type.rb
41
+ - app/models/mismo_enum/loan_state_type.rb
42
+ - app/models/mismo_enum/marital_status_type.rb
43
+ - app/models/mismo_enum/mortgage_type.rb
44
+ - app/models/mismo_enum/payment_delinquency_status_type.rb
45
+ - app/models/mismo_enum/postal_state.rb
46
+ - app/models/mismo_enum/prepayment_penalty_option_type.rb
47
+ - app/models/mismo_enum/project_design_type.rb
48
+ - app/models/mismo_enum/project_legal_structure_type.rb
49
+ - app/models/mismo_enum/property_usage_type.rb
50
+ - app/models/mismo_enum/property_valuation_method_type.rb
51
+ - app/models/mismo_enum/property_valuation_state_type.rb
52
+ - app/models/mismo_enum/rate_lock_type.rb
53
+ - app/models/mismo_enum/refinance_cash_out_determination_type.rb
54
+ - app/models/mismo_enum/taxpayer_identifier_type.rb
55
+ - app/views/layouts/mismo_enum/application.html.erb
56
+ - config/routes.rb
57
+ - db/migrations/001_create_mismo_enums.rb
58
+ - db/seeds.rb
59
+ - lib/generators/mismo_enum/install/install_generator.rb
60
+ - lib/generators/mismo_enum/templates/create_mismo_enums.rb
61
+ - lib/mismo_enum.rb
62
+ - lib/mismo_enum/class_list.rb
63
+ - lib/mismo_enum/engine.rb
64
+ - lib/mismo_enum/helper.rb
65
+ - lib/mismo_enum/version.rb
66
+ - lib/tasks/mismo_enum_tasks.rake
67
+ homepage: https://github.com/Solnse/mismo_enum
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubyforge_project:
87
+ rubygems_version: 2.4.8
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: MISMO enumerations for use in mortgage banking.
91
+ test_files: []
92
+ has_rdoc: