Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactor route to consider report type#516

Merged
supriya3105 merged 3 commits intodevelopfrom
refactor-report-routes
Jun 27, 2022
Merged

Refactor route to consider report type#516
supriya3105 merged 3 commits intodevelopfrom
refactor-report-routes

Conversation

@shalapatil
Copy link
Contributor

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • I have manually tested all workflows
  • I have performed a self-review of my own code
  • I have added automated tests for my code

@github-actions
Copy link

Current Code Coverage Percent of this PR:

88.64 %

Files having coverage below 100%

Impacted Files Coverage
/lib/custom_failure.rb 80.0 %
/app/services/weekly_reminder_for_missed_entries_service.rb 31.82 %
/app/controllers/users/invitations_controller.rb 86.36 %
/app/controllers/users/sessions_controller.rb 85.71 %
/app/services/invoice_payment/checkout.rb 44.0 %
/app/services/invoice_payment/pdf_generation.rb 70.97 %
/app/controllers/internal_api/v1/payment_settings_controller.rb 93.33 %
/app/controllers/internal_api/v1/profile_controller.rb 96.88 %
/app/controllers/internal_api/v1/companies_controller.rb 95.45 %
/app/controllers/internal_api/v1/wise/recipients_controller.rb 90.0 %
/app/controllers/internal_api/v1/payments/providers_controller.rb 94.74 %
/lib/benchmarking/benchmarker.rb 0.0 %

Copy link
Contributor

@rohitjoshixyz rohitjoshixyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of suggestions

# frozen_string_literal: true

module Report
module TimeEntryReport
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per rails conventions, we should name the controller in plural form. TimeEntriesController

@shalapatil shalapatil requested a review from rohitjoshixyz June 24, 2022 07:55
Copy link
Contributor

@rohitjoshixyz rohitjoshixyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on the refactoring. LGTM 🎉

@supriya3105 supriya3105 merged commit 43920da into develop Jun 27, 2022
@supriya3105 supriya3105 deleted the refactor-report-routes branch June 27, 2022 07:24
vipulnsward pushed a commit that referenced this pull request Feb 15, 2026
* Refactor route to consider report type

* Fix spec path

* Fix suggested changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants