/cf

cf

Primary LanguageRuby

CF/Api

Maintainability

project for CF test.

API::School::V1

I decide to separate the api models from the rails models in order to be able to have a domain driven approach, which allow us to quickly change between versions without having to much legacy/dependency as different parts of the system can be morphed to work with different versions.

Api::School::V1::Mentor


Serializer for API Mentors

Methods

- build(mentor, calendar_client, time_zone)
  - builder pattern for api v1 mentors

- #filter_slots_by_date(date: date)
  - returns the slots available for a given date

- #slot_present?(datetime):
  - validate if date is available

- #refresh_slots!
  - remove allocated calls not longer in mentor calendar
  - nth: clears cache
  - nth: should trigger some kind to notification for user

Api::School::V1::CalendarSlot


Serializer for CalendarSlots

Models

Model information

Students


Attributes

- first_name
- last_name
- time_zone
- mentors, through: mentorship
- allocated_calls

Mentors


Attributes

- first_name
- last_name
- time_zone
- students, through: mentorships
- allocated_calls
- calendar_id

Mentorships


Attributes

  - student
  - mentor

AllocatedCalls


Attributes

- mentor
- student
- date_time
- description

External Libraries/API

Contributing

If you want to contribute download the repositorie and follow the next steps, all requests should be done trought a PR, pushing directly to main is not allowed.

Build using docker

docker-compose build

Starting up

docker-compose up -d

How to prepare your database

docker-compose exec cf bundle exec rake db:setup

Running specs

docker-compose bundle exec rspec

Style

  • Codeclimate [rubocop]

CI/CD

  • TODO