next_sges 0.1.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.
Files changed (154) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +36 -0
  5. data/app/assets/config/next_sges_manifest.js +2 -0
  6. data/app/assets/javascripts/next_sges/administrators.js +2 -0
  7. data/app/assets/javascripts/next_sges/application.js +13 -0
  8. data/app/assets/javascripts/next_sges/collection_note_items.js +2 -0
  9. data/app/assets/javascripts/next_sges/collection_notes.js +2 -0
  10. data/app/assets/javascripts/next_sges/collection_types.js +2 -0
  11. data/app/assets/javascripts/next_sges/deposits.js +2 -0
  12. data/app/assets/javascripts/next_sges/inscriptions.js +2 -0
  13. data/app/assets/javascripts/next_sges/parents.js +2 -0
  14. data/app/assets/javascripts/next_sges/responsible_others.js +2 -0
  15. data/app/assets/javascripts/next_sges/school_admins.js +2 -0
  16. data/app/assets/javascripts/next_sges/schools.js +2 -0
  17. data/app/assets/javascripts/next_sges/students.js +2 -0
  18. data/app/assets/stylesheets/next_sges/administrators.css +4 -0
  19. data/app/assets/stylesheets/next_sges/application.css +15 -0
  20. data/app/assets/stylesheets/next_sges/collection_note_items.css +4 -0
  21. data/app/assets/stylesheets/next_sges/collection_notes.css +4 -0
  22. data/app/assets/stylesheets/next_sges/collection_types.css +4 -0
  23. data/app/assets/stylesheets/next_sges/deposits.css +4 -0
  24. data/app/assets/stylesheets/next_sges/inscriptions.css +4 -0
  25. data/app/assets/stylesheets/next_sges/parents.css +4 -0
  26. data/app/assets/stylesheets/next_sges/responsible_others.css +4 -0
  27. data/app/assets/stylesheets/next_sges/school_admins.css +4 -0
  28. data/app/assets/stylesheets/next_sges/schools.css +4 -0
  29. data/app/assets/stylesheets/next_sges/students.css +4 -0
  30. data/app/assets/stylesheets/scaffold.css +80 -0
  31. data/app/controllers/next_sges/administrators_controller.rb +62 -0
  32. data/app/controllers/next_sges/application_controller.rb +5 -0
  33. data/app/controllers/next_sges/collection_note_items_controller.rb +62 -0
  34. data/app/controllers/next_sges/collection_notes_controller.rb +62 -0
  35. data/app/controllers/next_sges/collection_types_controller.rb +62 -0
  36. data/app/controllers/next_sges/deposits_controller.rb +62 -0
  37. data/app/controllers/next_sges/inscriptions_controller.rb +62 -0
  38. data/app/controllers/next_sges/parents_controller.rb +62 -0
  39. data/app/controllers/next_sges/responsible_others_controller.rb +62 -0
  40. data/app/controllers/next_sges/school_admins_controller.rb +62 -0
  41. data/app/controllers/next_sges/schools_controller.rb +62 -0
  42. data/app/controllers/next_sges/students_controller.rb +62 -0
  43. data/app/helpers/next_sges/administrators_helper.rb +4 -0
  44. data/app/helpers/next_sges/application_helper.rb +4 -0
  45. data/app/helpers/next_sges/collection_note_items_helper.rb +4 -0
  46. data/app/helpers/next_sges/collection_notes_helper.rb +4 -0
  47. data/app/helpers/next_sges/collection_types_helper.rb +4 -0
  48. data/app/helpers/next_sges/deposits_helper.rb +4 -0
  49. data/app/helpers/next_sges/inscriptions_helper.rb +4 -0
  50. data/app/helpers/next_sges/parents_helper.rb +4 -0
  51. data/app/helpers/next_sges/responsible_others_helper.rb +4 -0
  52. data/app/helpers/next_sges/school_admins_helper.rb +4 -0
  53. data/app/helpers/next_sges/schools_helper.rb +4 -0
  54. data/app/helpers/next_sges/students_helper.rb +4 -0
  55. data/app/jobs/next_sges/application_job.rb +4 -0
  56. data/app/mailers/next_sges/application_mailer.rb +6 -0
  57. data/app/models/next_sges/administrator.rb +19 -0
  58. data/app/models/next_sges/application_record.rb +33 -0
  59. data/app/models/next_sges/collection_note.rb +68 -0
  60. data/app/models/next_sges/collection_note_item.rb +173 -0
  61. data/app/models/next_sges/collection_type.rb +36 -0
  62. data/app/models/next_sges/deposit.rb +31 -0
  63. data/app/models/next_sges/inscription.rb +5 -0
  64. data/app/models/next_sges/parent.rb +37 -0
  65. data/app/models/next_sges/responsible_other.rb +20 -0
  66. data/app/models/next_sges/school.rb +21 -0
  67. data/app/models/next_sges/school_admin.rb +10 -0
  68. data/app/models/next_sges/student.rb +39 -0
  69. data/app/views/layouts/next_sges/application.html.erb +14 -0
  70. data/app/views/next_sges/administrators/_form.html.erb +27 -0
  71. data/app/views/next_sges/administrators/edit.html.erb +6 -0
  72. data/app/views/next_sges/administrators/index.html.erb +29 -0
  73. data/app/views/next_sges/administrators/new.html.erb +5 -0
  74. data/app/views/next_sges/administrators/show.html.erb +14 -0
  75. data/app/views/next_sges/collection_note_items/_form.html.erb +107 -0
  76. data/app/views/next_sges/collection_note_items/edit.html.erb +6 -0
  77. data/app/views/next_sges/collection_note_items/index.html.erb +61 -0
  78. data/app/views/next_sges/collection_note_items/new.html.erb +5 -0
  79. data/app/views/next_sges/collection_note_items/show.html.erb +94 -0
  80. data/app/views/next_sges/collection_notes/_form.html.erb +37 -0
  81. data/app/views/next_sges/collection_notes/edit.html.erb +6 -0
  82. data/app/views/next_sges/collection_notes/index.html.erb +33 -0
  83. data/app/views/next_sges/collection_notes/new.html.erb +5 -0
  84. data/app/views/next_sges/collection_notes/show.html.erb +24 -0
  85. data/app/views/next_sges/collection_types/_form.html.erb +37 -0
  86. data/app/views/next_sges/collection_types/edit.html.erb +6 -0
  87. data/app/views/next_sges/collection_types/index.html.erb +33 -0
  88. data/app/views/next_sges/collection_types/new.html.erb +5 -0
  89. data/app/views/next_sges/collection_types/show.html.erb +24 -0
  90. data/app/views/next_sges/deposits/_form.html.erb +37 -0
  91. data/app/views/next_sges/deposits/edit.html.erb +6 -0
  92. data/app/views/next_sges/deposits/index.html.erb +33 -0
  93. data/app/views/next_sges/deposits/new.html.erb +5 -0
  94. data/app/views/next_sges/deposits/show.html.erb +24 -0
  95. data/app/views/next_sges/inscriptions/_form.html.erb +102 -0
  96. data/app/views/next_sges/inscriptions/edit.html.erb +6 -0
  97. data/app/views/next_sges/inscriptions/index.html.erb +59 -0
  98. data/app/views/next_sges/inscriptions/new.html.erb +5 -0
  99. data/app/views/next_sges/inscriptions/show.html.erb +89 -0
  100. data/app/views/next_sges/parents/_form.html.erb +42 -0
  101. data/app/views/next_sges/parents/edit.html.erb +6 -0
  102. data/app/views/next_sges/parents/index.html.erb +35 -0
  103. data/app/views/next_sges/parents/new.html.erb +5 -0
  104. data/app/views/next_sges/parents/show.html.erb +29 -0
  105. data/app/views/next_sges/responsible_others/_form.html.erb +97 -0
  106. data/app/views/next_sges/responsible_others/edit.html.erb +6 -0
  107. data/app/views/next_sges/responsible_others/index.html.erb +57 -0
  108. data/app/views/next_sges/responsible_others/new.html.erb +5 -0
  109. data/app/views/next_sges/responsible_others/show.html.erb +84 -0
  110. data/app/views/next_sges/school_admins/_form.html.erb +32 -0
  111. data/app/views/next_sges/school_admins/edit.html.erb +6 -0
  112. data/app/views/next_sges/school_admins/index.html.erb +31 -0
  113. data/app/views/next_sges/school_admins/new.html.erb +5 -0
  114. data/app/views/next_sges/school_admins/show.html.erb +19 -0
  115. data/app/views/next_sges/schools/_form.html.erb +62 -0
  116. data/app/views/next_sges/schools/edit.html.erb +6 -0
  117. data/app/views/next_sges/schools/index.html.erb +43 -0
  118. data/app/views/next_sges/schools/new.html.erb +5 -0
  119. data/app/views/next_sges/schools/show.html.erb +49 -0
  120. data/app/views/next_sges/students/_form.html.erb +42 -0
  121. data/app/views/next_sges/students/edit.html.erb +6 -0
  122. data/app/views/next_sges/students/index.html.erb +35 -0
  123. data/app/views/next_sges/students/new.html.erb +5 -0
  124. data/app/views/next_sges/students/show.html.erb +29 -0
  125. data/config/routes.rb +13 -0
  126. data/db/migrate/20171209090042_create_next_sges_schools.rb +17 -0
  127. data/db/migrate/20171209093554_create_next_sges_parents.rb +17 -0
  128. data/db/migrate/20171209093716_create_next_sges_collection_types.rb +13 -0
  129. data/db/migrate/20171209095546_create_next_sges_students.rb +17 -0
  130. data/db/migrate/20171209100114_create_next_sges_collection_notes.rb +14 -0
  131. data/db/migrate/20171209104046_create_next_sges_deposits.rb +13 -0
  132. data/db/migrate/20171209110844_create_next_sges_administrators.rb +10 -0
  133. data/db/migrate/20171209111036_create_next_sges_school_admins.rb +12 -0
  134. data/db/migrate/20171209213002_create_next_sges_inscriptions.rb +25 -0
  135. data/db/migrate/20171209213302_create_join_table_inscription_collection_type.rb +8 -0
  136. data/db/migrate/20171211132659_create_join_table_student_collection_type.rb +8 -0
  137. data/db/migrate/20171211140033_add_value_to_collection_types.rb +5 -0
  138. data/db/migrate/20171213141321_create_next_sges_collection_note_items.rb +26 -0
  139. data/db/migrate/20171213160012_add_discount_ad_fine_to_collection_type.rb +13 -0
  140. data/db/migrate/20171214154917_rename_anual_payment_discount_from_next_sges_collection_types.rb +5 -0
  141. data/db/migrate/20171214204406_add_account_balance_to_next_sges_parents.rb +17 -0
  142. data/db/migrate/20171215120306_remove_student_from_deposit.rb +6 -0
  143. data/db/migrate/20171215133634_add_type_to_next_sges_deposits.rb +5 -0
  144. data/db/migrate/20171215144509_add_documents_to_next_sgad_parents.rb +6 -0
  145. data/db/migrate/20171215175025_add_avatar_to_next_sges_schools.rb +5 -0
  146. data/db/migrate/20171218082424_add_nif_to_next_sges_schools.rb +11 -0
  147. data/db/migrate/20171221224739_create_next_sges_responsible_others.rb +24 -0
  148. data/db/migrate/20171227221731_add_birthday_to_next_sgad_students.rb +7 -0
  149. data/db/migrate/20180216140129_add_collection_note_to_deposits.rb +5 -0
  150. data/lib/next_sges.rb +5 -0
  151. data/lib/next_sges/engine.rb +5 -0
  152. data/lib/next_sges/version.rb +3 -0
  153. data/lib/tasks/next_sges_tasks.rake +4 -0
  154. metadata +224 -0
@@ -0,0 +1,6 @@
1
+ <h1>Editing Student</h1>
2
+
3
+ <%= render 'form', student: @student %>
4
+
5
+ <%= link_to 'Show', @student %> |
6
+ <%= link_to 'Back', students_path %>
@@ -0,0 +1,35 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Students</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th>Name</th>
9
+ <th>Number</th>
10
+ <th>Status</th>
11
+ <th>Parent</th>
12
+ <th>Account balance</th>
13
+ <th colspan="3"></th>
14
+ </tr>
15
+ </thead>
16
+
17
+ <tbody>
18
+ <% @students.each do |student| %>
19
+ <tr>
20
+ <td><%= student.name %></td>
21
+ <td><%= student.number %></td>
22
+ <td><%= student.status %></td>
23
+ <td><%= student.parent %></td>
24
+ <td><%= student.account_balance %></td>
25
+ <td><%= link_to 'Show', student %></td>
26
+ <td><%= link_to 'Edit', edit_student_path(student) %></td>
27
+ <td><%= link_to 'Destroy', student, method: :delete, data: { confirm: 'Are you sure?' } %></td>
28
+ </tr>
29
+ <% end %>
30
+ </tbody>
31
+ </table>
32
+
33
+ <br>
34
+
35
+ <%= link_to 'New Student', new_student_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New Student</h1>
2
+
3
+ <%= render 'form', student: @student %>
4
+
5
+ <%= link_to 'Back', students_path %>
@@ -0,0 +1,29 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Name:</strong>
5
+ <%= @student.name %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Number:</strong>
10
+ <%= @student.number %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Status:</strong>
15
+ <%= @student.status %>
16
+ </p>
17
+
18
+ <p>
19
+ <strong>Parent:</strong>
20
+ <%= @student.parent %>
21
+ </p>
22
+
23
+ <p>
24
+ <strong>Account balance:</strong>
25
+ <%= @student.account_balance %>
26
+ </p>
27
+
28
+ <%= link_to 'Edit', edit_student_path(@student) %> |
29
+ <%= link_to 'Back', students_path %>
data/config/routes.rb ADDED
@@ -0,0 +1,13 @@
1
+ NextSges::Engine.routes.draw do
2
+ resources :responsible_others
3
+ resources :collection_note_items
4
+ resources :inscriptions
5
+ resources :school_admins
6
+ resources :administrators
7
+ resources :schools
8
+ resources :deposits
9
+ resources :collection_notes
10
+ resources :collection_types
11
+ resources :students
12
+ resources :parents
13
+ end
@@ -0,0 +1,17 @@
1
+ class CreateNextSgesSchools < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sges_schools do |t|
4
+ t.string :name
5
+ t.string :number
6
+ t.decimal :latitude
7
+ t.decimal :longitude
8
+ t.string :address
9
+ t.string :email
10
+ t.string :email2
11
+ t.string :phone
12
+ t.string :phone
13
+
14
+ t.timestamps
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ class CreateNextSgesParents < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sges_parents do |t|
4
+ t.string :first_name
5
+ t.string :middle_name
6
+ t.string :last_name
7
+ t.string :email
8
+ t.string :cellphone1
9
+ t.string :cellphone2
10
+ t.string :number
11
+ t.integer :status, null: false, default: 0
12
+ t.references :school, foreign_key: {to_table: :next_sges_schools}, index: true
13
+
14
+ t.timestamps
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ class CreateNextSgesCollectionTypes < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sges_collection_types do |t|
4
+ t.string :name
5
+ t.text :description
6
+ t.integer :frequency, null: false, default: 0
7
+ t.integer :category, null: false, default: 0
8
+ t.references :school, foreign_key: {to_table: :next_sges_schools}, index: true
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ class CreateNextSgesStudents < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sges_students do |t|
4
+ t.string :first_name
5
+ t.string :middle_name
6
+ t.string :last_name
7
+ t.string :number
8
+ t.integer :status, null: false, default: 0
9
+ t.decimal :account_balance, null: false, default: 0
10
+ t.references :parent, foreign_key: {to_table: :next_sges_parents}, index: true
11
+ t.references :school, foreign_key: {to_table: :next_sges_schools}, index: true
12
+
13
+ t.timestamps
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ class CreateNextSgesCollectionNotes < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sges_collection_notes do |t|
4
+ t.string :number
5
+ t.decimal :value, null: false, default: 0
6
+ t.integer :status, null: false, default: 0
7
+ t.references :student, foreign_key: {to_table: :next_sges_students}, index: true
8
+ t.references :school, foreign_key: {to_table: :next_sges_schools}, index: true
9
+
10
+ t.timestamps
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ class CreateNextSgesDeposits < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sges_deposits do |t|
4
+ t.string :number
5
+ t.decimal :value, default: 0, null: false
6
+ t.integer :status, default: 0, null: false
7
+ t.references :student, foreign_key: {to_table: :next_sges_students}, index: true
8
+ t.references :school, foreign_key: {to_table: :next_sges_schools}, index: true
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ class CreateNextSgesAdministrators < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sges_administrators do |t|
4
+ t.string :number
5
+ t.references :user, polymorphic: true
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ class CreateNextSgesSchoolAdmins < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sges_school_admins do |t|
4
+ t.string :number
5
+ t.references :user, polymorphic: true
6
+ t.references :school, foreign_key: {to_table: :next_sges_schools}, index: true
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,25 @@
1
+ class CreateNextSgesInscriptions < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sges_inscriptions do |t|
4
+ t.string :student_name
5
+ t.datetime :student_birthday
6
+ t.string :student_nationality
7
+ t.integer :student_indentification_type, default: 0, null: false
8
+ t.string :student_ientification_number
9
+ t.string :student_address
10
+ t.string :parent_name
11
+ t.datetime :parent_birthday
12
+ t.string :parent_nationality
13
+ t.integer :parent_indentification_type, default: 0, null: false
14
+ t.string :parent_ientification_number
15
+ t.string :parent_address
16
+ t.string :parent_cellphone1
17
+ t.string :parent_cellphone2
18
+ t.string :parent_email
19
+ t.string :documents
20
+ t.references :school, foreign_key: {to_table: :next_sges_schools}, index: true
21
+
22
+ t.timestamps
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,8 @@
1
+ class CreateJoinTableInscriptionCollectionType < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_join_table :inscriptions, :collection_types do |t|
4
+ t.index [:inscription_id, :collection_type_id], name: 'ndx_cllctn_tps_nscrptns_n_nscrptn_d_nd_cllctn_tp_d'
5
+ # t.index [:collection_type_id, :inscription_id]
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class CreateJoinTableStudentCollectionType < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_join_table :next_sges_students, :next_sges_collection_types do |t|
4
+ t.index [:next_sges_student_id, :next_sges_collection_type_id], name: 'idx_cllctn_types_students_on_student_id_and_collection_type_id'
5
+ # t.index [:collection_type_id, :student_id]
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ class AddValueToCollectionTypes < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :next_sges_collection_types, :value, :decimal, default: 0, null: false
4
+ end
5
+ end
@@ -0,0 +1,26 @@
1
+ class CreateNextSgesCollectionNoteItems < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sges_collection_note_items do |t|
4
+ t.string :name
5
+ t.text :description
6
+ t.decimal :base_value, default: 0, null: false
7
+ t.decimal :value, default: 0, null: false
8
+ t.integer :quantity, default: 1, null: false
9
+ t.datetime :date
10
+ t.string :discount_description
11
+ t.decimal :discount_percentage, default: 0, null: false
12
+ t.decimal :discount_value, default: 0, null: false
13
+ t.string :fine_description
14
+ t.decimal :fine_percentage, default: 0, null: false
15
+ t.decimal :fine_value, default: 0, null: false
16
+ t.integer :collection_type_frequency, default: 0, null: false
17
+ t.integer :collection_type_category, default: 0, null: false
18
+ t.references :collection_note, foreign_key: {to_table: :next_sges_collection_notes}, index: true
19
+ t.references :collection_type, foreign_key: {to_table: :next_sges_collection_types}, index: true
20
+ t.references :student, foreign_key: {to_table: :next_sges_students}, index: true
21
+ t.references :school, foreign_key: {to_table: :next_sges_schools}, index: true
22
+
23
+ t.timestamps
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,13 @@
1
+ class AddDiscountAdFineToCollectionType < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :next_sges_collection_types, :first_fine_percentage, :decimal, default: 0, null: false
4
+ add_column :next_sges_collection_types, :first_fine_after, :integer, default: 0, null: false
5
+ add_column :next_sges_collection_types, :second_fine_percentage, :decimal, default: 0, null: false
6
+ add_column :next_sges_collection_types, :second_fine_after, :integer, default: 0, null: false
7
+ add_column :next_sges_collection_types, :charge_automatically, :boolean, default: false, null: false
8
+ add_column :next_sges_collection_types, :status, :integer, default: 0, null: false
9
+ add_column :next_sges_collection_types, :second_child_discount, :decimal, default: 0, null: false
10
+ add_column :next_sges_collection_types, :third_child_discount, :decimal, default: 0, null: false
11
+ add_column :next_sges_collection_types, :anual_payment_discount, :decimal, default: 0, null: false
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ class RenameAnualPaymentDiscountFromNextSgesCollectionTypes < ActiveRecord::Migration[5.1]
2
+ def change
3
+ rename_column :next_sges_collection_types, :anual_payment_discount, :annual_payment_discount
4
+ end
5
+ end
@@ -0,0 +1,17 @@
1
+ class AddAccountBalanceToNextSgesParents < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :next_sges_parents, :avatar, :string
4
+ add_column :next_sges_parents, :account_balance, :decimal, default: 0, null: false
5
+ add_column :next_sges_parents, :address, :string
6
+ add_column :next_sges_parents, :identification_type, :integer, default: 0, null: false
7
+ add_column :next_sges_parents, :identification_number, :string
8
+ add_column :next_sges_parents, :job_title, :string
9
+
10
+ add_column :next_sges_students, :relation, :integer, default: 0, null: false
11
+ add_column :next_sges_students, :identification_type, :integer, default: 0, null: false
12
+ add_column :next_sges_students, :identification_number, :string
13
+ add_column :next_sges_students, :address, :string
14
+ add_column :next_sges_students, :avatar, :string
15
+ add_column :next_sges_students, :birth_date, :datetime
16
+ end
17
+ end
@@ -0,0 +1,6 @@
1
+ class RemoveStudentFromDeposit < ActiveRecord::Migration[5.1]
2
+ def change
3
+ remove_column :next_sges_deposits, :student_id
4
+ add_reference :next_sges_deposits, :parent, foreign_key: {to_table: :next_sges_parents}, index: true
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddTypeToNextSgesDeposits < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :next_sges_deposits, :mode, :integer, default: 0, null: false
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class AddDocumentsToNextSgadParents < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :next_sges_parents, :documents, :json
4
+ add_column :next_sges_students, :documents, :json
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddAvatarToNextSgesSchools < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :next_sges_schools, :avatar, :string
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class AddNifToNextSgesSchools < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :next_sges_schools, :nif, :string
4
+ add_column :next_sges_schools, :back_name, :string
5
+ add_column :next_sges_schools, :back_account_number, :string
6
+ add_column :next_sges_schools, :back_account_iban, :string
7
+ add_column :next_sges_schools, :county, :string
8
+ add_column :next_sges_schools, :province, :string
9
+ add_column :next_sges_schools, :country, :string
10
+ end
11
+ end
@@ -0,0 +1,24 @@
1
+ class CreateNextSgesResponsibleOthers < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :next_sges_responsible_others do |t|
4
+ t.string :first_name
5
+ t.string :middle_name
6
+ t.string :last_name
7
+ t.string :avatar
8
+ t.json :documents
9
+ t.integer :relation_to_parent, default: 0, null: false
10
+ t.references :parent, foreign_key: {to_table: :next_sges_parents}, index: true
11
+ t.integer :status, default: 0, null: false
12
+ t.references :school, foreign_key: {to_table: :next_sges_schools}, index: true
13
+ t.datetime :birthday
14
+ t.integer :identification_type, default: 0, null: false
15
+ t.string :identification_number
16
+ t.string :email
17
+ t.string :cellphone
18
+ t.string :address
19
+ t.string :number
20
+
21
+ t.timestamps
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,7 @@
1
+ class AddBirthdayToNextSgadStudents < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :next_sges_students, :birthday, :datetime
4
+ remove_column :next_sges_students, :birth_date
5
+ remove_column :next_sges_students, :account_balance
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ class AddCollectionNoteToDeposits < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_reference :next_sges_deposits, :collection_note, foreign_key: {to_table: :next_sges_collection_notes}
4
+ end
5
+ end
data/lib/next_sges.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "next_sges/engine"
2
+
3
+ module NextSges
4
+ # Your code goes here...
5
+ end