-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
[Kit Redesign] Phase 1 - Change itemizable source #3750
Draft
zeeshan-haidar
wants to merge
62
commits into
rubyforgood:main
Choose a base branch
from
zeeshan-haidar:3707-change-itemizable-source
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
83347ed
KitAllocation model added for inventory in and inventory out
zeeshan-haidar 2373afb
allocate inventory in and out actions added
zeeshan-haidar 3327d74
Deallocation for inventory in and inventory out added
zeeshan-haidar 8345ef6
spec added for inventory in and inventory out when kit is allocated
zeeshan-haidar 58c8862
fixed typo error
zeeshan-haidar b30215b
test case added for kit with multiple line items
zeeshan-haidar d8d1e7b
testcases added for deallocating inventory_in and inventory_out
zeeshan-haidar bef402e
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar ded1d9e
rubocop lint applied
zeeshan-haidar e049dbc
factory_bot lint fixed
zeeshan-haidar f3fb846
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar 301a67b
removed ruby enum kit_allocation_type
zeeshan-haidar 3912f08
inventory enum added to kit_allocations
zeeshan-haidar 11be7a6
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar 256dcf3
data migration for invetory_in and invetory_out
zeeshan-haidar 592da55
rubocop linting applied
zeeshan-haidar 595b96f
column shipping_cost added to distributions
zeeshan-haidar b2b377e
added shipping_cost field on distribution form
zeeshan-haidar 6588d3b
save shipping_cost to distribution
zeeshan-haidar 44f6928
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar 9cbd420
shipping cost label added
zeeshan-haidar 9df7f46
shipping cost added to export and view
zeeshan-haidar ad078b6
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar 15693c6
backfill distribution's shipping cost
zeeshan-haidar 16defa1
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar 162a3ab
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar 02c6cd2
test case added for distribution shipping_cost
zeeshan-haidar 123afb3
fixed failing specs
zeeshan-haidar 32dd83a
for testing
zeeshan-haidar 2061c4f
fixed faling spec
zeeshan-haidar 5325b69
added test case for shipping cost field
zeeshan-haidar 3065054
added distribution shipping cost on view page
zeeshan-haidar 9ccbd6e
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar fed4645
rubocop linting fixed
zeeshan-haidar 8332212
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar 55d892a
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar 17cc4de
distribution stimulus controller added for shipping cost
zeeshan-haidar bbc1133
renamed distribution controller to destribution-delivery
zeeshan-haidar 5fb7597
PR requested changes applied
zeeshan-haidar d584002
PR requested changes applied
zeeshan-haidar 5613746
extra empty line removed
zeeshan-haidar 8536f17
removed typo error
zeeshan-haidar e19f8cd
PR requested change applied
zeeshan-haidar 2f6305a
PR requested change applied
zeeshan-haidar 4f5a04d
wrapped shipping cost with it's own div
zeeshan-haidar ca0df90
code refactored with PR requested changes
zeeshan-haidar 28d152f
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar 7182d7c
rubocop linting fixed
zeeshan-haidar 1f140f0
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar e972029
code refactored
zeeshan-haidar ae7bce2
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar df1410e
removed inventory enum from kit_allocation
zeeshan-haidar 7bb7a4e
added kit_allocation_type enum
zeeshan-haidar e19f699
renamed invetory enum to kit_allocation_type
zeeshan-haidar 6a14d6c
code refactored
zeeshan-haidar c298036
Merge branch '3656-add-shipped-to-delivery-method' of github.com:zees…
zeeshan-haidar b822b57
added itemizable module to base item class
zeeshan-haidar fc9ea26
rake task added to change itemizable_id for kits' line_items
zeeshan-haidar fe64cb6
migration added to change itemizable_id
zeeshan-haidar a357379
fixed line_item.item_id issue
zeeshan-haidar 9bba2c3
Merge branch 'main' of github.com:zeeshan-haidar/human-essentials int…
zeeshan-haidar 88c6eba
changed the view logic to fetch line_items form items instead of kits
zeeshan-haidar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
# | ||
|
||
class BaseItem < ApplicationRecord | ||
include Itemizable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, the issue had some bad wording - this has to be added to the |
||
has_many :items, dependent: :destroy, inverse_of: :base_item, foreign_key: :partner_key, primary_key: :partner_key | ||
has_many :barcode_items, as: :barcodeable, dependent: :destroy | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class ChangeItemizableId < ActiveRecord::Migration[7.0] | ||
def change | ||
Rake::Task['change_itemizable_id'].invoke | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this split into a Rake task? |
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
desc "change the itemizable_id for all kits' line items to kit.item.id" | ||
task change_itemizable_id: :environment do | ||
line_items = LineItem.where(itemizable_type: "Kit") | ||
puts "Total line_items: #{line_items.count}" | ||
|
||
line_items.each do |line_item| | ||
puts "Processing line_item with id: #{line_item.id}" | ||
item = line_item.itemizable.item | ||
|
||
item_id = line_item.item_id | ||
line_item.itemizable = item | ||
line_item.item_id = item_id | ||
|
||
line_item.save! | ||
end | ||
|
||
puts "Done..." | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should use a
join
here instead of checking partner_key.