Refactor route to consider report type#516
Conversation
Current Code Coverage Percent of this PR:88.64 %Files having coverage below 100%
|
rohitjoshixyz
left a comment
There was a problem hiding this comment.
A couple of suggestions
| # frozen_string_literal: true | ||
|
|
||
| module Report | ||
| module TimeEntryReport |
There was a problem hiding this comment.
Just a suggestion and you can take the call if you want to change it or not. I would prefer to keep the service namespaces consistent with the controller namespacing in which they are being used.
i.e: app/controllers/reports/time_entry_controller could have its services defined in app/services/reports/time_entry/result_service.rb and so on
| end | ||
|
|
||
| it "is not permitted to view time entry report" do | ||
| it "is not permitted to view cliet details" do |
There was a problem hiding this comment.
Typo
| it "is not permitted to view cliet details" do | |
| it "is not permitted to view client details" do |
| # frozen_string_literal: true | ||
|
|
||
| class InternalApi::V1::ReportsController < InternalApi::V1::ApplicationController | ||
| class InternalApi::V1::Reports::TimeEntryController < InternalApi::V1::ApplicationController |
There was a problem hiding this comment.
As per rails conventions, we should name the controller in plural form. TimeEntriesController
rohitjoshixyz
left a comment
There was a problem hiding this comment.
Thank you for working on the refactoring. LGTM 🎉
* Refactor route to consider report type * Fix spec path * Fix suggested changes
Notion card
Summary
For reports page, we will have multiple types of reports. So, now api routes will look like "......./reports/time_entry" instead of "....../reports"
Did refactoring for other related code also
Preview
Type of change
Please delete options that are not relevant.
not work as expected)
How Has This Been Tested?
Checklist: