Skip to content

Commit

Permalink
config: #10 annotate models
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianrbp committed Aug 12, 2024
1 parent 144f589 commit 44fbbc9
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/app/models/availability.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: availabilities
#
# id :bigint not null, primary key
# engineer_id :bigint not null
# week :string
# day :string
# time :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class Availability < ApplicationRecord
belongs_to :engineer

Expand Down
2 changes: 2 additions & 0 deletions backend/app/models/company_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# contract_end_date :datetime
# created_at :datetime not null
# updated_at :datetime not null
# contract_start_week :string
# contract_end_week :string
#
class CompanyService < ApplicationRecord
has_many :company_service_engineers, dependent: :destroy
Expand Down
2 changes: 2 additions & 0 deletions backend/app/models/shift.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# end_time :time
# created_at :datetime not null
# updated_at :datetime not null
# start_hour :integer
# end_hour :integer
#
class Shift < ApplicationRecord
belongs_to :company_service
Expand Down
12 changes: 12 additions & 0 deletions backend/spec/factories/availabilities.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: availabilities
#
# id :bigint not null, primary key
# engineer_id :bigint not null
# week :string
# day :string
# time :integer
# created_at :datetime not null
# updated_at :datetime not null
#
FactoryBot.define do
factory :availability do
engineer
Expand Down
2 changes: 2 additions & 0 deletions backend/spec/factories/company_services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# contract_end_date :datetime
# created_at :datetime not null
# updated_at :datetime not null
# contract_start_week :string
# contract_end_week :string
#
FactoryBot.define do
factory :company_service do
Expand Down
12 changes: 12 additions & 0 deletions backend/spec/models/availability_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: availabilities
#
# id :bigint not null, primary key
# engineer_id :bigint not null
# week :string
# day :string
# time :integer
# created_at :datetime not null
# updated_at :datetime not null
#
require 'rails_helper'

RSpec.describe Availability, type: :model do
Expand Down
10 changes: 10 additions & 0 deletions backend/spec/models/company_service_engineer_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# == Schema Information
#
# Table name: company_service_engineers
#
# id :bigint not null, primary key
# company_service_id :bigint not null
# engineer_id :bigint not null
# created_at :datetime not null
# updated_at :datetime not null
#
require 'rails_helper'

RSpec.describe CompanyServiceEngineer, type: :model do
Expand Down
2 changes: 2 additions & 0 deletions backend/spec/models/company_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# contract_end_date :datetime
# created_at :datetime not null
# updated_at :datetime not null
# contract_start_week :string
# contract_end_week :string
#
require 'rails_helper'

Expand Down
10 changes: 10 additions & 0 deletions backend/spec/models/engineer_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# == Schema Information
#
# Table name: engineers
#
# id :bigint not null, primary key
# name :string
# color :string
# created_at :datetime not null
# updated_at :datetime not null
#
require 'rails_helper'

RSpec.describe Engineer, type: :model do
Expand Down
15 changes: 15 additions & 0 deletions backend/spec/models/shift_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# == Schema Information
#
# Table name: shifts
#
# id :bigint not null, primary key
# company_service_id :bigint not null
# week :string
# day :string
# start_time :time
# end_time :time
# created_at :datetime not null
# updated_at :datetime not null
# start_hour :integer
# end_hour :integer
#
require 'rails_helper'

RSpec.describe Shift, type: :model do
Expand Down

0 comments on commit 44fbbc9

Please sign in to comment.