Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Line Items Entries API for Generate Invoice #250

Merged
merged 9 commits into from
Apr 14, 2022

Conversation

aniketkaushik
Copy link
Contributor

@aniketkaushik aniketkaushik commented Apr 12, 2022

Notion card

https://saeloun.notion.site/Fetch-the-entries-from-time-tracking-for-generate-invoice-Back-end-972e95bc0abf454385bb510cdb6e0769

API
http://127.0.0.1:3000/internal_api/v1/generate_invoice/1?page=2&selected_entries[]=1&selected_entries[]=2

items per page is 10 (means 10 line item entries will be fetched on a single API call)
selected_entries (entries which are already selected and we want to skip them in the next api call)

{
  "new_line_item_entries": [
    {
      "id": 13,
      "first_name": "Vipul",
      "last_name": "A M",
      "date": "2022-04-06",
      "description": "Worked on Project_1_Client_1_saeloun_India",
      "rate": "5000.0",
      "qty": 60
    },
    {
      "id": 14,
      "first_name": "Vipul",
      "last_name": "A M",
      "date": "2022-04-07",
      "description": "Worked on Project_1_Client_1_saeloun_India",
      "rate": "5000.0",
      "qty": 60
    },
    {
      "id": 15,
      "first_name": "Vipul",
      "last_name": "A M",
      "date": "2022-04-08",
      "description": "Worked on Project_1_Client_1_saeloun_India",
      "rate": "5000.0",
      "qty": 60
    },
    {
      "id": 16,
      "first_name": "Vipul",
      "last_name": "A M",
      "date": "2022-04-09",
      "description": "Worked on Project_1_Client_1_saeloun_India",
      "rate": "5000.0",
      "qty": 60
    },
    {
      "id": 17,
      "first_name": "Vipul",
      "last_name": "A M",
      "date": "2022-04-10",
      "description": "Worked on Project_1_Client_1_saeloun_India",
      "rate": "5000.0",
      "qty": 60
    },
    {
      "id": 18,
      "first_name": "Vipul",
      "last_name": "A M",
      "date": "2022-04-11",
      "description": "Worked on Project_1_Client_1_saeloun_India",
      "rate": "5000.0",
      "qty": 60
    },
    {
      "id": 19,
      "first_name": "Vipul",
      "last_name": "A M",
      "date": "2022-04-12",
      "description": "Worked on Project_1_Client_1_saeloun_India",
      "rate": "5000.0",
      "qty": 60
    },
    {
      "id": 20,
      "first_name": "Vipul",
      "last_name": "A M",
      "date": "2022-04-13",
      "description": "Worked on Project_1_Client_1_saeloun_India",
      "rate": "5000.0",
      "qty": 60
    },
    {
      "id": 21,
      "first_name": "Vipul",
      "last_name": "A M",
      "date": "2022-04-14",
      "description": "Worked on Project_1_Client_1_saeloun_India",
      "rate": "5000.0",
      "qty": 60
    },
    {
      "id": 22,
      "first_name": "Vipul",
      "last_name": "A M",
      "date": "2022-04-15",
      "description": "Worked on Project_1_Client_1_saeloun_India",
      "rate": "5000.0",
      "qty": 60
    }
  ],
  "pagy": {
    "scaffold_url": "/internal_api/v1/generate_invoice/1?page=__pagy_page__&selected_entries[]=1&selected_entries[]=2&items=10",
    "page": 2,
    "count": 174,
    "in": 10,
    "items": 10,
    "pages": 18,
    "prev": 1,
    "next": 3,
    "last": 18
  }
}

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

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

@pr-triage pr-triage bot added the PR: draft label Apr 12, 2022
@vipulnsward vipulnsward temporarily deployed to miru-review-pr-250 April 12, 2022 16:45 Inactive
@vipulnsward vipulnsward temporarily deployed to miru-review-pr-250 April 12, 2022 17:31 Inactive
@vipulnsward vipulnsward temporarily deployed to miru-review-pr-250 April 13, 2022 11:26 Inactive
@github-actions
Copy link

Current Code Coverage Percent of this PR:

91.03 %

Files having coverage below 100%

Impacted Files Coverage
/app/controllers/clients_controller.rb 94.44 %
/app/controllers/invoices_controller.rb 66.67 %
/app/controllers/concerns/timesheet.rb 75.0 %
/app/models/project.rb 90.32 %
/app/controllers/users/registrations_controller.rb 40.0 %
/app/controllers/users/sessions_controller.rb 25.0 %
/app/controllers/users/omniauth_callbacks_controller.rb 25.0 %
/app/controllers/users/passwords_controller.rb 41.67 %
/app/controllers/internal_api/v1/timesheet_entry_controller.rb 40.0 %
/app/controllers/internal_api/v1/projects_controller.rb 75.0 %
/app/controllers/internal_api/v1/timesheet_entry/bulk_action_controller.rb 50.0 %

@aniketkaushik aniketkaushik marked this pull request as ready for review April 13, 2022 11:32
@aniketkaushik aniketkaushik changed the title Line iteams api New Line Items Entries API for Generate Invoice Apr 13, 2022
Copy link
Member

@akhilgkrishnan akhilgkrishnan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@keshavbiswa keshavbiswa left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@apoorv-mishra apoorv-mishra left a comment

Choose a reason for hiding this comment

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

LGTM!

@aditya-vector aditya-vector merged commit bfd9e7f into develop Apr 14, 2022
@aditya-vector aditya-vector deleted the line-iteams-api branch April 14, 2022 06:00
@pr-triage pr-triage bot added the PR: merged label Apr 14, 2022
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.

6 participants