sis_core 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/sis/core/academic_programme.rb +7 -0
  3. data/app/models/sis/core/academic_year.rb +1 -0
  4. data/app/models/sis/core/applicant.rb +1 -1
  5. data/app/models/sis/core/application.rb +47 -0
  6. data/app/models/sis/core/application_document.rb +10 -0
  7. data/app/models/sis/core/application_setup.rb +14 -0
  8. data/app/models/sis/core/document_requirement.rb +10 -0
  9. data/app/models/sis/core/{program_type.rb → document_type.rb} +1 -1
  10. data/app/models/sis/core/exam.rb +15 -0
  11. data/app/models/sis/core/exam_result.rb +19 -0
  12. data/app/models/sis/core/exam_setup.rb +7 -0
  13. data/app/models/sis/core/programme.rb +7 -0
  14. data/app/models/sis/core/programme_level.rb +6 -0
  15. data/app/models/sis/core/programme_type.rb +6 -0
  16. data/app/models/sis/core/semester.rb +2 -0
  17. data/db/migrate/{20200307072142_create_sis_core_academic_years.rb → 20200105072142_create_sis_core_academic_years.rb} +2 -1
  18. data/db/migrate/{20200307072246_create_sis_core_semesters.rb → 20200106072246_create_sis_core_semesters.rb} +0 -0
  19. data/db/migrate/20200106130428_create_sis_core_programmes.rb +10 -0
  20. data/db/migrate/20200106132035_create_sis_core_academic_programmes.rb +21 -0
  21. data/db/migrate/20200106132521_create_sis_core_application_setups.rb +19 -0
  22. data/db/migrate/20200106133034_create_sis_core_document_requirements.rb +19 -0
  23. data/db/migrate/20200106133937_create_sis_core_applicants.rb +1 -3
  24. data/db/migrate/20200107094449_create_sis_core_applications.rb +26 -0
  25. data/db/migrate/20200107101638_create_sis_core_application_documents.rb +16 -0
  26. data/db/migrate/20200107302251_create_sis_core_exam_setups.rb +15 -0
  27. data/db/migrate/20200107333411_create_sis_core_exams.rb +17 -0
  28. data/db/migrate/20200107434658_create_sis_core_exam_results.rb +18 -0
  29. data/db/migrate/20200307033100_create_sis_core_courses.rb +2 -2
  30. data/db/migrate/20200307072006_create_sis_core_students.rb +2 -2
  31. data/lib/sis/core/engine.rb +0 -2
  32. data/lib/sis/core/version.rb +1 -1
  33. data/lib/sis_core.rb +3 -0
  34. data/spec/factories/sis/core/academic_programmes.rb +8 -0
  35. data/spec/factories/sis/core/academic_years.rb +2 -1
  36. data/spec/factories/sis/core/applicants.rb +2 -4
  37. data/spec/factories/sis/core/application_documents.rb +7 -0
  38. data/spec/factories/sis/core/application_setups.rb +9 -0
  39. data/spec/factories/sis/core/applications.rb +16 -0
  40. data/spec/factories/sis/core/document_requirements.rb +9 -0
  41. data/spec/factories/sis/core/document_types.rb +5 -0
  42. data/spec/factories/sis/core/exam_results.rb +8 -0
  43. data/spec/factories/sis/core/exam_setups.rb +8 -0
  44. data/spec/factories/sis/core/exams.rb +10 -0
  45. data/spec/factories/sis/core/instructor_courses.rb +2 -2
  46. data/spec/factories/sis/core/instructors.rb +2 -2
  47. data/spec/factories/sis/core/programme_levels.rb +5 -0
  48. data/spec/factories/sis/core/programme_types.rb +5 -0
  49. data/spec/factories/sis/core/programmes.rb +6 -0
  50. data/spec/factories/sis/core/semesters.rb +1 -1
  51. data/spec/factories/sis/core/staffs.rb +31 -28
  52. data/spec/factories/sis/core/students.rb +5 -5
  53. metadata +65 -17
  54. data/app/models/sis/core/attached_document.rb +0 -8
  55. data/app/models/sis/core/enrollment_application.rb +0 -9
  56. data/app/models/sis/core/program.rb +0 -9
  57. data/db/migrate/20200106001016_create_sis_core_field_of_studies.rb +0 -9
  58. data/db/migrate/20200106130428_create_sis_core_programs.rb +0 -10
  59. data/db/migrate/20200108094449_create_sis_core_enrollment_applications.rb +0 -10
  60. data/db/migrate/20200108101638_create_sis_core_attached_documents.rb +0 -11
  61. data/spec/factories/sis/core/attached_documents.rb +0 -7
  62. data/spec/factories/sis/core/enrollment_applications.rb +0 -7
  63. data/spec/factories/sis/core/field_of_studies.rb +0 -6
  64. data/spec/factories/sis/core/program_types.rb +0 -5
  65. data/spec/factories/sis/core/programs.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d6d06580eeab8666073ed41a67aec635989681c89ac979d8303ec85e0adf15f
4
- data.tar.gz: 2f34eb2200e4a15dc40775f8c1fac1006ec1b588be232f6d10b50483dec87d01
3
+ metadata.gz: a88af09f30c54f634169a0051ad20db0e505581463a8b94af3baf6cfc10b9f17
4
+ data.tar.gz: ebe53808d2a44ab226f2bc4f8d9e087e9504586eac604286bbe1c16b9d35dad0
5
5
  SHA512:
6
- metadata.gz: a4916c93eaf0adab13edd713779386a00ceacca0618e19a5fe56841cebda7d8dedafdd270956471d740ea884c5841f24dbe812f336fd6f30b6656ed4045baaed
7
- data.tar.gz: 3d7d5c4deb881a3f94d708176af6d3847bea0c675f02cd93590ddbde8ebb6354416c31ff05625fc89044c096edb8a6fbeeab74f04144410f9aad4b234aaada7e
6
+ metadata.gz: a422801f3afecd6e9e7ca9f2b7c5aeb03caebdf0dcbdffe10e446b9aa4f7f87cbfc8f882a40879d21533fd3a049e04a91885d263c4b67c6656d7b25f411094c9
7
+ data.tar.gz: 27c8b0c2091c608f81193b01af3973769e9281c161a2f6283b568fb6bca725bbe38543d6c00e814fc155774285d752e46e021524bc40e040dcb617e3abd2feee
@@ -0,0 +1,7 @@
1
+ module Sis::Core
2
+ class AcademicProgramme < ApplicationRecord
3
+ belongs_to :programme
4
+ belongs_to :programme_type
5
+ belongs_to :programme_level
6
+ end
7
+ end
@@ -1,6 +1,7 @@
1
1
  module Sis
2
2
  module Core
3
3
  class AcademicYear < ApplicationRecord
4
+ validates :year, presence: true, uniqueness: true, case_sensitive: false
4
5
  end
5
6
  end
6
7
  end
@@ -1,7 +1,7 @@
1
1
  module Sis
2
2
  module Core
3
3
  class Applicant < ApplicationRecord
4
- validates :first_name, :middle_name, :last_name, :email, :phone_number, presence: true
4
+ validates :full_name, :email, :phone_number, presence: true
5
5
  validates :email, uniqueness: true
6
6
  end
7
7
  end
@@ -0,0 +1,47 @@
1
+ module Sis
2
+ module Core
3
+ class Application < ApplicationRecord
4
+ include AASM
5
+
6
+ # Gender types
7
+ MALE = 'Male'.freeze
8
+ FEMALE = 'Female'.freeze
9
+
10
+ aasm column: :status do
11
+ state :draft, initial: true
12
+ state :submitted, :under_review, :accepted, :rejected, :selected_for_exam, :selected_for_admission
13
+
14
+ event :submit do
15
+ transitions from: :draft, to: :submitted
16
+ end
17
+
18
+ event :review do
19
+ transitions from: [:submitted, :rejected, :accepted], to: :under_review
20
+ end
21
+
22
+ event :accept do
23
+ transitions from: :under_review, to: :accepted
24
+ end
25
+
26
+ event :reject do
27
+ transitions from: :under_review, to: :rejected
28
+ end
29
+
30
+ event :select_for_exam do
31
+ transitions from: :accepted, to: :selected_for_exam
32
+ end
33
+
34
+ event :select_for_admission do
35
+ transitions from: :selected_for_exam, to: :selected_for_admission
36
+ end
37
+
38
+ end
39
+
40
+ validates :full_name, :email, :age, :gender, :nationality, :status, presence: true
41
+ validates :payment_information, presence: true, if: :payment_made
42
+
43
+ belongs_to :applicant
44
+ belongs_to :academic_programme
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,10 @@
1
+ module Sis
2
+ module Core
3
+ class ApplicationDocument < ApplicationRecord
4
+ validates :document, presence: true
5
+
6
+ belongs_to :application
7
+ belongs_to :document_requirement
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ module Sis::Core
2
+ class ApplicationSetup < ApplicationRecord
3
+ OPEN = 'Open'.freeze
4
+ CLOSED = 'Closed'.freeze
5
+
6
+ belongs_to :academic_programme
7
+ belongs_to :target_semester, class_name: 'Sis::Core::Semester'
8
+ has_many :document_requirements
9
+
10
+ validates :start_date, :end_date, :status, presence: true
11
+ validates :status, inclusion: [OPEN, CLOSED]
12
+
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ module Sis
2
+ module Core
3
+ class DocumentRequirement < ApplicationRecord
4
+ belongs_to :document_type
5
+ belongs_to :application_setup
6
+
7
+ validates :original, :copy, presence: true
8
+ end
9
+ end
10
+ end
@@ -1,6 +1,6 @@
1
1
  module Sis
2
2
  module Core
3
- class ProgramType < Lookup
3
+ class DocumentType < Lookup
4
4
  end
5
5
  end
6
6
  end
@@ -0,0 +1,15 @@
1
+ module Sis
2
+ module Core
3
+ class Exam < ApplicationRecord
4
+ belongs_to :exam_setup
5
+
6
+ validates :title, :start, :finish, :pass_point, :points, presence: true
7
+
8
+ before_validation :set_pass_point
9
+
10
+ def set_pass_point
11
+ self.pass_point = self.points / 2 unless self.pass_point || !self.points
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,19 @@
1
+ module Sis
2
+ module Core
3
+ class ExamResult < ApplicationRecord
4
+ PASS = 'Pass'.freeze
5
+ FAIL = 'Fail'.freeze
6
+
7
+ belongs_to :exam
8
+ belongs_to :application
9
+
10
+ validates :points, presence: true
11
+
12
+ before_validation :set_status
13
+
14
+ def set_status
15
+ self.status = (exam && exam.pass_point >= points) ? PASS : FAIL
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,7 @@
1
+ module Sis::Core
2
+ class ExamSetup < ApplicationRecord
3
+ belongs_to :application_setup
4
+
5
+ validates :date, :hours, :venue, presence: true
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Sis
2
+ module Core
3
+ class Programme < ApplicationRecord
4
+ validates :code, :name, presence: true, uniqueness: true
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ module Sis
2
+ module Core
3
+ class ProgrammeLevel < Lookup
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Sis
2
+ module Core
3
+ class ProgrammeType < Lookup
4
+ end
5
+ end
6
+ end
@@ -2,6 +2,8 @@ module Sis
2
2
  module Core
3
3
  class Semester < ApplicationRecord
4
4
  belongs_to :academic_year
5
+
6
+ validates :name, presence: true
5
7
  end
6
8
  end
7
9
  end
@@ -1,7 +1,8 @@
1
1
  class CreateSisCoreAcademicYears < ActiveRecord::Migration[6.0]
2
2
  def change
3
3
  create_table :sis_core_academic_years do |t|
4
- t.string :year, null: false
4
+ t.string :year, null: false, unique: true
5
+ t.string :label
5
6
 
6
7
  t.timestamps
7
8
  end
@@ -0,0 +1,10 @@
1
+ class CreateSisCoreProgrammes < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :sis_core_programmes do |t|
4
+ t.string :code, null: false, unique: true
5
+ t.string :name, null: false, unique: true
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,21 @@
1
+ class CreateSisCoreAcademicProgrammes < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :sis_core_academic_programmes do |t|
4
+ t.integer :duration, null: false
5
+ t.references :programme,
6
+ null: false,
7
+ index: { name: 'ap_on_programme_indx' },
8
+ foreign_key: { to_table: :sis_core_programmes }
9
+ t.references :programme_type,
10
+ null: false,
11
+ index: { name: 'ap_on_pt_indx' },
12
+ foreign_key: { to_table: :sis_core_lookups }
13
+ t.references :programme_level,
14
+ null: false,
15
+ index: { name: 'ap_on_pl_indx' },
16
+ foreign_key: { to_table: :sis_core_lookups }
17
+
18
+ t.timestamps
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,19 @@
1
+ class CreateSisCoreApplicationSetups < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :sis_core_application_setups do |t|
4
+ t.date :start_date, null: false
5
+ t.date :end_date, null: false
6
+ t.string :status, null: false, default: 'Open'
7
+ t.references :academic_programme,
8
+ null: false,
9
+ index: { name: 'as_on_ap_indx' },
10
+ foreign_key: { to_table: :sis_core_academic_programmes }
11
+ t.references :target_semester,
12
+ null: false,
13
+ index: { name: 'as_on_ts_indx' },
14
+ foreign_key: { to_table: :sis_core_semesters }
15
+
16
+ t.timestamps
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ class CreateSisCoreDocumentRequirements < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :sis_core_document_requirements do |t|
4
+ t.integer :original, null: false, default: 0
5
+ t.integer :copy, null: false, default: 0
6
+ t.string :remark
7
+ t.references :document_type,
8
+ null: false,
9
+ index: { name: 'adr_on_dc_indx' },
10
+ foreign_key: { to_table: :sis_core_lookups }
11
+ t.references :application_setup,
12
+ null: false,
13
+ index: { name: 'adr_on_as_indx' },
14
+ foreign_key: { to_table: :sis_core_application_setups }
15
+
16
+ t.timestamps
17
+ end
18
+ end
19
+ end
@@ -1,9 +1,7 @@
1
1
  class CreateSisCoreApplicants < ActiveRecord::Migration[6.0]
2
2
  def change
3
3
  create_table :sis_core_applicants do |t|
4
- t.string :first_name, null: false
5
- t.string :middle_name, null: false
6
- t.string :last_name, null: false
4
+ t.string :full_name, null: false
7
5
  t.string :email, null: false, unique: true
8
6
  t.string :phone_number, null: false
9
7
 
@@ -0,0 +1,26 @@
1
+ class CreateSisCoreApplications < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :sis_core_applications do |t|
4
+ t.string :full_name, null: false
5
+ t.string :email, null: false
6
+ t.integer :age, null: false
7
+ t.string :gender, null: false
8
+ t.string :nationality, null: false
9
+ t.string :status, null: false, default: 'Draft'
10
+ t.boolean :payment_made, null: false, default: false
11
+ t.string :address
12
+ t.string :payment_information
13
+ t.date :application_date
14
+ t.references :applicant,
15
+ null: false,
16
+ index: { name: 'applications_on_applicant_indx' },
17
+ foreign_key: { to_table: :sis_core_applicants }
18
+ t.references :academic_programme,
19
+ null: false,
20
+ index: { name: 'applications_on_ap_indx' },
21
+ foreign_key: { to_table: :sis_core_academic_programmes }
22
+
23
+ t.timestamps
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,16 @@
1
+ class CreateSisCoreApplicationDocuments < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :sis_core_application_documents do |t|
4
+ t.string :document, null: false
5
+ t.references :document_requirement,
6
+ null: false,
7
+ index: { name: 'ad_on_adr_indx' },
8
+ foreign_key: { to_table: :sis_core_document_requirements }
9
+ t.references :application,
10
+ null: false,
11
+ index: { name: 'ad_on_application_indx' },
12
+ foreign_key: { to_table: :sis_core_applications }
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ class CreateSisCoreExamSetups < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :sis_core_exam_setups do |t|
4
+ t.date :date, null: false
5
+ t.float :hours, null: false
6
+ t.string :venue, null: false
7
+ t.references :application_setup,
8
+ null: false,
9
+ index: { name: 'es_on_as_indx' },
10
+ foreign_key: { to_table: :sis_core_application_setups }
11
+
12
+ t.timestamps
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ class CreateSisCoreExams < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :sis_core_exams do |t|
4
+ t.string :title, null: false
5
+ t.datetime :start, null: false
6
+ t.datetime :finish, null: false
7
+ t.float :points, null: false
8
+ t.float :pass_point, null: false
9
+ t.references :exam_setup,
10
+ null: false,
11
+ index: { name: 'exams_on_es_indx' },
12
+ foreign_key: { to_table: :sis_core_exam_setups }
13
+
14
+ t.timestamps
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ class CreateSisCoreExamResults < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :sis_core_exam_results do |t|
4
+ t.float :points, null: false
5
+ t.string :status, null: false
6
+ t.references :exam,
7
+ null: false,
8
+ index: { name: 'er_on_exam_indx' },
9
+ foreign_key: { to_table: :sis_core_exams }
10
+ t.references :application,
11
+ null: false,
12
+ index: { name: 'er_on_application_indx' },
13
+ foreign_key: { to_table: :sis_core_applications }
14
+
15
+ t.timestamps
16
+ end
17
+ end
18
+ end
@@ -8,10 +8,10 @@ class CreateSisCoreCourses < ActiveRecord::Migration[6.0]
8
8
  t.float :ects, null: false
9
9
  t.float :lecture_hours, null: false
10
10
  t.float :lab_hours, null: false
11
- t.references :program,
11
+ t.references :academic_programme,
12
12
  index: { name: 'program_on_courses_indx' },
13
13
  null: false,
14
- foreign_key: { to_table: :sis_core_programs }
14
+ foreign_key: { to_table: :sis_core_academic_programmes }
15
15
 
16
16
  t.timestamps
17
17
  end
@@ -5,10 +5,10 @@ class CreateSisCoreStudents < ActiveRecord::Migration[6.0]
5
5
  t.string :full_name, null: false
6
6
  t.date :date_of_birth, null: false
7
7
  t.string :nationality, null: false
8
- t.references :program,
8
+ t.references :academic_programme,
9
9
  index: { name: 'program_on_student_indx' },
10
10
  null: false,
11
- foreign_key: { to_table: :sis_core_programs }
11
+ foreign_key: { to_table: :sis_core_academic_programmes }
12
12
 
13
13
  t.timestamps
14
14
  end
@@ -1,5 +1,3 @@
1
- require 'devise_token_auth'
2
-
3
1
  module Sis
4
2
  module Core
5
3
  class Engine < ::Rails::Engine
@@ -1,5 +1,5 @@
1
1
  module Sis
2
2
  module Core
3
- VERSION = '1.0.3'.freeze
3
+ VERSION = '1.0.4'.freeze
4
4
  end
5
5
  end
@@ -1,2 +1,5 @@
1
1
  require 'sis/core'
2
2
  require 'sis/core/engine'
3
+ require 'devise_token_auth'
4
+ require 'aasm'
5
+ require 'active_model_serializers'
@@ -0,0 +1,8 @@
1
+ FactoryBot.define do
2
+ factory :academic_programme, class: Sis::Core::AcademicProgramme do
3
+ association :programme
4
+ association :programme_type
5
+ association :programme_level
6
+ duration { 4 }
7
+ end
8
+ end
@@ -1,5 +1,6 @@
1
1
  FactoryBot.define do
2
- factory :sis_core_academic_year, class: 'AcademicYear' do
2
+ factory :academic_year, class: Sis::Core::AcademicYear do
3
3
  year { '2000/01' }
4
+ label { 'Academic year of 2000/01' }
4
5
  end
5
6
  end
@@ -1,8 +1,6 @@
1
1
  FactoryBot.define do
2
- factory :applicant, class: 'Sis::Core::Applicant' do
3
- first_name { FFaker::Name.name }
4
- middle_name { FFaker::Name.name }
5
- last_name { FFaker::Name.name }
2
+ factory :applicant, class: Sis::Core::Applicant do
3
+ full_name { FFaker::Name.name }
6
4
  email { FFaker::Internet.email }
7
5
  phone_number { FFaker::PhoneNumber.phone_number }
8
6
  end
@@ -0,0 +1,7 @@
1
+ FactoryBot.define do
2
+ factory :application_document, class: Sis::Core::ApplicationDocument do
3
+ document { FFaker::Name.name }
4
+ association :document_requirement
5
+ association :application
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ FactoryBot.define do
2
+ factory :application_setup, class: Sis::Core::ApplicationSetup do
3
+ association :academic_programme
4
+ association :target_semester, factory: :semester
5
+ start_date { Date.today - 15.days }
6
+ end_date { Date.today + 15.days }
7
+ status { 'Open' }
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ FactoryBot.define do
2
+ factory :application, class: Sis::Core::Application do
3
+ full_name { FFaker::Name.name }
4
+ email { FFaker::Internet.email }
5
+ age { FFaker::Random.rand(20..30) }
6
+ gender { Sis::Core::Application::MALE }
7
+ nationality { FFaker::Address.country }
8
+ status { :draft }
9
+ payment_made { false }
10
+ payment_information { nil }
11
+ address { FFaker::Address.street_address }
12
+ application_date { Date.today }
13
+ association :applicant
14
+ association :academic_programme
15
+ end
16
+ end
@@ -0,0 +1,9 @@
1
+ FactoryBot.define do
2
+ factory :document_requirement, class: Sis::Core::DocumentRequirement do
3
+ association :document_type
4
+ association :application_setup
5
+ original { 1 }
6
+ copy { 1 }
7
+ remark { FFaker::Name.name }
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ FactoryBot.define do
2
+ factory :document_type, class: Sis::Core::DocumentType, parent: :lookup do
3
+ type { 'Sis::Core::DocumentType' }
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ FactoryBot.define do
2
+ factory :exam_result, class: Sis::Core::ExamResult do
3
+ association :exam
4
+ association :application
5
+ points { 15 }
6
+ status { Sis::Core::ExamResult::PASS }
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ FactoryBot.define do
2
+ factory :exam_setup, class: Sis::Core::ExamSetup do
3
+ date { Date.today }
4
+ hours { 3 }
5
+ venue { FFaker::Name.name }
6
+ association :application_setup
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ FactoryBot.define do
2
+ factory :exam, class: Sis::Core::Exam do
3
+ title { FFaker::Name.name }
4
+ start { Time.zone.parse('5:00 AM') }
5
+ finish { Time.zone.parse('6:00 AM') }
6
+ points { 30 }
7
+ pass_point { 15 }
8
+ association :exam_setup
9
+ end
10
+ end
@@ -1,6 +1,6 @@
1
1
  FactoryBot.define do
2
2
  factory :instructor_course, class: 'Sis::Core::InstructorCourse' do
3
- association :instructor
4
- association :course
3
+ # association :instructor
4
+ # association :course
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  FactoryBot.define do
2
2
  factory :instructor, class: 'Sis::Core::Instructor' do
3
- full_name { FFaker::Name.name }
4
- date_of_birth { Date.new(2000, 1, 1) }
3
+ # full_name { FFaker::Name.name }
4
+ # date_of_birth { Date.new(2000, 1, 1) }
5
5
  end
6
6
  end
@@ -0,0 +1,5 @@
1
+ FactoryBot.define do
2
+ factory :programme_level, class: Sis::Core::ProgrammeLevel, parent: :lookup do
3
+ type { 'Ecom::Core::ProgrammeLevel' }
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ FactoryBot.define do
2
+ factory :programme_type, class: Sis::Core::ProgrammeType, parent: :lookup do
3
+ type { 'Sis::Core::ProgrammeType' }
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ FactoryBot.define do
2
+ factory :programme, class: Sis::Core::Programme do
3
+ code { FFaker::Name.name }
4
+ name { FFaker::Name.name }
5
+ end
6
+ end
@@ -1,5 +1,5 @@
1
1
  FactoryBot.define do
2
- factory :semester, class: 'Sis::Core::Semester' do
2
+ factory :semester, class: Sis::Core::Semester do
3
3
  association :academic_year
4
4
  name { FFaker::Name.name }
5
5
  description { FFaker::Name.name }
@@ -1,32 +1,35 @@
1
1
  FactoryBot.define do
2
- SINGLE = 'Single'.freeze
3
- MARRIED = 'Married'.freeze
4
- MARITAL_STATUS = [SINGLE, MARRIED].freeze
5
2
  factory :staff, class: 'Sis::Core::Staff' do
6
- user
7
- job_title { FFaker::Job.title }
8
- job_level { FFaker::Company.position }
9
- department { FFaker::Education.school_name }
10
- date_of_employment { FFaker::Time.date }
11
- salary { [2000, 5500.5, 10_000, 20_000].sample }
12
- remark { FFaker::Lorem.sentence }
13
- mothers_name { FFaker::Name.name }
14
- education_level { FFaker::Education.degree }
15
- phone_number { FFaker::PhoneNumber.phone_number }
16
- place_of_birth { FFaker::Address.city }
17
- marital_status { %w[Single Married].sample }
18
- region { FFaker::Address.city }
19
- zone { FFaker::Address.neighborhood }
20
- wereda { [1, 2, 5, 13].sample }
21
- kebele { [1, 2, 5, 13].sample }
22
- passport_number { FFaker::Guid.guid }
23
- id_number { FFaker::Guid.guid }
24
- emergency_contact_name { FFaker::Name.name }
25
- emergency_contact_phone { FFaker::PhoneNumber.phone_number }
26
- relation_to_emergency_contact do
27
- %w[mother,father,brother,spouse].sample
28
- end
29
- created_at { FFaker::Time.datetime }
30
- updated_at { FFaker::Time.datetime }
3
+
31
4
  end
5
+ # SINGLE = 'Single'.freeze
6
+ # MARRIED = 'Married'.freeze
7
+ # MARITAL_STATUS = [SINGLE, MARRIED].freeze
8
+ # factory :staff, class: 'Sis::Core::Staff' do
9
+ # user
10
+ # job_title { FFaker::Job.title }
11
+ # job_level { FFaker::Company.position }
12
+ # department { FFaker::Education.school_name }
13
+ # date_of_employment { FFaker::Time.date }
14
+ # salary { [2000, 5500.5, 10_000, 20_000].sample }
15
+ # remark { FFaker::Lorem.sentence }
16
+ # mothers_name { FFaker::Name.name }
17
+ # education_level { FFaker::Education.degree }
18
+ # phone_number { FFaker::PhoneNumber.phone_number }
19
+ # place_of_birth { FFaker::Address.city }
20
+ # marital_status { %w[Single Married].sample }
21
+ # region { FFaker::Address.city }
22
+ # zone { FFaker::Address.neighborhood }
23
+ # wereda { [1, 2, 5, 13].sample }
24
+ # kebele { [1, 2, 5, 13].sample }
25
+ # passport_number { FFaker::Guid.guid }
26
+ # id_number { FFaker::Guid.guid }
27
+ # emergency_contact_name { FFaker::Name.name }
28
+ # emergency_contact_phone { FFaker::PhoneNumber.phone_number }
29
+ # relation_to_emergency_contact do
30
+ # %w[mother,father,brother,spouse].sample
31
+ # end
32
+ # created_at { FFaker::Time.datetime }
33
+ # updated_at { FFaker::Time.datetime }
34
+ # end
32
35
  end
@@ -1,9 +1,9 @@
1
1
  FactoryBot.define do
2
2
  factory :student, class: 'Sis::Core::Student' do
3
- student_id { FFaker::Name.name }
4
- full_name { FFaker::Name.name }
5
- date_of_birth { Date.new(2000, 1, 1) }
6
- nationality { FFaker::Name.name }
7
- association :program
3
+ # student_id { FFaker::Name.name }
4
+ # full_name { FFaker::Name.name }
5
+ # date_of_birth { Date.new(2000, 1, 1) }
6
+ # nationality { FFaker::Name.name }
7
+ # association :program
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sis_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-19 00:00:00.000000000 Z
11
+ date: 2020-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aasm
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: active_model_serializers
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.10.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.10.0
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: devise_token_auth
15
43
  requirement: !ruby/object:Gem::Requirement
@@ -140,19 +168,27 @@ files:
140
168
  - README.md
141
169
  - Rakefile
142
170
  - app/controllers/sis/core/application_controller.rb
171
+ - app/models/sis/core/academic_programme.rb
143
172
  - app/models/sis/core/academic_year.rb
144
173
  - app/models/sis/core/applicant.rb
174
+ - app/models/sis/core/application.rb
175
+ - app/models/sis/core/application_document.rb
145
176
  - app/models/sis/core/application_record.rb
146
- - app/models/sis/core/attached_document.rb
177
+ - app/models/sis/core/application_setup.rb
147
178
  - app/models/sis/core/course.rb
148
179
  - app/models/sis/core/course_registration.rb
149
- - app/models/sis/core/enrollment_application.rb
180
+ - app/models/sis/core/document_requirement.rb
181
+ - app/models/sis/core/document_type.rb
182
+ - app/models/sis/core/exam.rb
183
+ - app/models/sis/core/exam_result.rb
184
+ - app/models/sis/core/exam_setup.rb
150
185
  - app/models/sis/core/field_of_study.rb
151
186
  - app/models/sis/core/instructor.rb
152
187
  - app/models/sis/core/instructor_course.rb
153
188
  - app/models/sis/core/lookup.rb
154
- - app/models/sis/core/program.rb
155
- - app/models/sis/core/program_type.rb
189
+ - app/models/sis/core/programme.rb
190
+ - app/models/sis/core/programme_level.rb
191
+ - app/models/sis/core/programme_type.rb
156
192
  - app/models/sis/core/semester.rb
157
193
  - app/models/sis/core/staff.rb
158
194
  - app/models/sis/core/student.rb
@@ -161,18 +197,23 @@ files:
161
197
  - config/initializers/devise_token_auth.rb
162
198
  - config/routes.rb
163
199
  - db/migrate/20200105061717_create_sis_core_lookups.rb
164
- - db/migrate/20200106001016_create_sis_core_field_of_studies.rb
165
- - db/migrate/20200106130428_create_sis_core_programs.rb
200
+ - db/migrate/20200105072142_create_sis_core_academic_years.rb
201
+ - db/migrate/20200106072246_create_sis_core_semesters.rb
202
+ - db/migrate/20200106130428_create_sis_core_programmes.rb
203
+ - db/migrate/20200106132035_create_sis_core_academic_programmes.rb
204
+ - db/migrate/20200106132521_create_sis_core_application_setups.rb
205
+ - db/migrate/20200106133034_create_sis_core_document_requirements.rb
166
206
  - db/migrate/20200106133937_create_sis_core_applicants.rb
207
+ - db/migrate/20200107094449_create_sis_core_applications.rb
208
+ - db/migrate/20200107101638_create_sis_core_application_documents.rb
209
+ - db/migrate/20200107302251_create_sis_core_exam_setups.rb
210
+ - db/migrate/20200107333411_create_sis_core_exams.rb
211
+ - db/migrate/20200107434658_create_sis_core_exam_results.rb
167
212
  - db/migrate/20200108092202_devise_token_auth_create_users.rb
168
- - db/migrate/20200108094449_create_sis_core_enrollment_applications.rb
169
- - db/migrate/20200108101638_create_sis_core_attached_documents.rb
170
213
  - db/migrate/20200307033100_create_sis_core_courses.rb
171
214
  - db/migrate/20200307071511_create_sis_core_instructors.rb
172
215
  - db/migrate/20200307071736_create_sis_core_instructor_courses.rb
173
216
  - db/migrate/20200307072006_create_sis_core_students.rb
174
- - db/migrate/20200307072142_create_sis_core_academic_years.rb
175
- - db/migrate/20200307072246_create_sis_core_semesters.rb
176
217
  - db/migrate/20200307072317_create_sis_core_course_registrations.rb
177
218
  - db/migrate/20200316120805_create_sis_core_staffs.rb
178
219
  - db/migrate/20200319074334_modify_user.rb
@@ -181,18 +222,25 @@ files:
181
222
  - lib/sis/core/version.rb
182
223
  - lib/sis_core.rb
183
224
  - lib/tasks/sis_core_tasks.rake
225
+ - spec/factories/sis/core/academic_programmes.rb
184
226
  - spec/factories/sis/core/academic_years.rb
185
227
  - spec/factories/sis/core/applicants.rb
186
- - spec/factories/sis/core/attached_documents.rb
228
+ - spec/factories/sis/core/application_documents.rb
229
+ - spec/factories/sis/core/application_setups.rb
230
+ - spec/factories/sis/core/applications.rb
187
231
  - spec/factories/sis/core/course_registrations.rb
188
232
  - spec/factories/sis/core/courses.rb
189
- - spec/factories/sis/core/enrollment_applications.rb
190
- - spec/factories/sis/core/field_of_studies.rb
233
+ - spec/factories/sis/core/document_requirements.rb
234
+ - spec/factories/sis/core/document_types.rb
235
+ - spec/factories/sis/core/exam_results.rb
236
+ - spec/factories/sis/core/exam_setups.rb
237
+ - spec/factories/sis/core/exams.rb
191
238
  - spec/factories/sis/core/instructor_courses.rb
192
239
  - spec/factories/sis/core/instructors.rb
193
240
  - spec/factories/sis/core/lookups.rb
194
- - spec/factories/sis/core/program_types.rb
195
- - spec/factories/sis/core/programs.rb
241
+ - spec/factories/sis/core/programme_levels.rb
242
+ - spec/factories/sis/core/programme_types.rb
243
+ - spec/factories/sis/core/programmes.rb
196
244
  - spec/factories/sis/core/semesters.rb
197
245
  - spec/factories/sis/core/staffs.rb
198
246
  - spec/factories/sis/core/students.rb
@@ -1,8 +0,0 @@
1
- module Sis
2
- module Core
3
- class AttachedDocument < ApplicationRecord
4
- validates :document, :document_type, presence: true
5
- belongs_to :enrollment_application, class_name: 'Sis::Core::EnrollmentApplication'
6
- end
7
- end
8
- end
@@ -1,9 +0,0 @@
1
- module Sis
2
- module Core
3
- class EnrollmentApplication < ApplicationRecord
4
- validates :status, presence: true
5
- belongs_to :applicant, class_name: 'Sis::Core::Applicant'
6
- belongs_to :program, class_name: 'Sis::Core::Program'
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Sis
2
- module Core
3
- class Program < ApplicationRecord
4
- belongs_to :program_type, class_name: 'Sis::Core::ProgramType', foreign_key: 'lookup_id'
5
- belongs_to :field_of_study, class_name: 'Sis::Core::FieldOfStudy'
6
- validates :mode_of_attendance, presence: true
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- class CreateSisCoreFieldOfStudies < ActiveRecord::Migration[6.0]
2
- def change
3
- create_table :sis_core_field_of_studies do |t|
4
- t.string :name
5
- t.references :lookup, index: true, null: false, foreign_key: { to_table: :sis_core_lookups }
6
- t.timestamps
7
- end
8
- end
9
- end
@@ -1,10 +0,0 @@
1
- class CreateSisCorePrograms < ActiveRecord::Migration[6.0]
2
- def change
3
- create_table :sis_core_programs do |t|
4
- t.string :mode_of_attendance, null: false
5
- t.references :lookup, index: true, null: false, foreign_key: { to_table: :sis_core_lookups }
6
- t.references :field_of_study, index: true, null: false, foreign_key: { to_table: :sis_core_field_of_studies }
7
- t.timestamps
8
- end
9
- end
10
- end
@@ -1,10 +0,0 @@
1
- class CreateSisCoreEnrollmentApplications < ActiveRecord::Migration[6.0]
2
- def change
3
- create_table :sis_core_enrollment_applications do |t|
4
- t.string :status, null: false
5
- t.references :applicant, index: true, null: false, foreign_key: { to_table: :sis_core_applicants }
6
- t.references :program, index: true, null: false, foreign_key: { to_table: :sis_core_programs }
7
- t.timestamps
8
- end
9
- end
10
- end
@@ -1,11 +0,0 @@
1
- class CreateSisCoreAttachedDocuments < ActiveRecord::Migration[6.0]
2
- def change
3
- create_table :sis_core_attached_documents do |t|
4
- t.string :document, null: false
5
- t.string :document_type, null: false
6
- t.references :enrollment_application, index: true, null: false,
7
- foreign_key: { to_table: :sis_core_enrollment_applications }
8
- t.timestamps
9
- end
10
- end
11
- end
@@ -1,7 +0,0 @@
1
- FactoryBot.define do
2
- factory :attached_document, class: 'Sis::Core::AttachedDocument' do
3
- document { FFaker::Name.name }
4
- document_type { FFaker::Name.name }
5
- association :enrollment_application
6
- end
7
- end
@@ -1,7 +0,0 @@
1
- FactoryBot.define do
2
- factory :enrollment_application, class: 'Sis::Core::EnrollmentApplication' do
3
- status { FFaker::Name.name }
4
- association :applicant
5
- association :program
6
- end
7
- end
@@ -1,6 +0,0 @@
1
- FactoryBot.define do
2
- factory :field_of_study, class: 'Sis::Core::FieldOfStudy' do
3
- name { FFaker::Name.name }
4
- association :program_type
5
- end
6
- end
@@ -1,5 +0,0 @@
1
- FactoryBot.define do
2
- factory :program_type, class: 'Sis::Core::ProgramType', parent: :lookup do
3
- type { 'Sis::Core::ProgramType' }
4
- end
5
- end
@@ -1,7 +0,0 @@
1
- FactoryBot.define do
2
- factory :program, class: 'Sis::Core::Program' do
3
- mode_of_attendance { FFaker::Name.name }
4
- association :program_type
5
- association :field_of_study
6
- end
7
- end