8000 Devices API by apoorv1316 · Pull Request #1699 · saeloun/miru-web · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Devices API #1699

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

Merged
merged 13 commits into from
Jun 26, 2024
Merged

Devices API #1699

merged 13 commits into from
Jun 26, 2024

Conversation

apoorv1316
Copy link
Collaborator
@apoorv1316 apoorv1316 commented Mar 12, 2024

What

  • Add insurance details to devices
  • Add support for bulk operations
Screenshot 2024-03-12 at 2 38 21 PM

@@ -39,7 +32,11 @@ def device

def device_params
params.require(:device).permit(
:device_type, :name, :serial_number, specifications: {}
add_devices: [:device_type, :name, :serial_number, :is_insured, :insurance_bought_date, :insurance_expiry_date,
Copy link
Collaborator

Choose a reason for hiding this comment

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

expected_attributes = [:device_type, :name, :serial_number, :is_insured, :insurance_bought_date, :insurance_expiry_date, specifications: [:processor, :ram, :graphics]]

add_devices: expected_attributes,
update_devices: expected_attributes + [:id]
remove_devices: []

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

# user_id :bigint not null
# id :bigint not null, primary key
# device_type :string default("laptop")
# insurance_bought_date :date
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is insurance_bought_date == insurance_start_date?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

using insurance_activation_date now

Copy link
Collaborator
@nisusam nisusam left a comment

Choose a reason for hiding this comment

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

Are we maintaining histories of insurance? Anyways, We can tackle it in a new PR.

Rest LGTM!

@apoorv1316 apoorv1316 merged commit 2b874c7 into develop Jun 26, 2024
1 check passed
@apoorv1316 apoorv1316 deleted the devices-api-bulk branch June 26, 2024 05:19
apoorv1316 added a commit that referenced this pull request Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0