Comments (6)
Suggested roadmap strategy:
- The nice thing about kits is that they are currently a separate table besides items. Most of the information lives in Items, which is where we plan on it living long-term.
- Based on this, we can keep the "write to kits, sync to items" behavior along with our changes until we are confident that we can remove it. Updating kits already updates the associated item, so we are essentially just moving our "source of truth" from Kits to Items, without any loss of data.
- The main weirdness will be with line_items - we are moving the itemizable_id from a kit to an item. I think this should be a relatively benign change - since items have a 1:1 relationship with kits in this case, we aren't losing any data.
Suggested work items:
-
Change itemizable_id source:
- Add the
Itemizable
module to the baseItem
class. - Add a migration to change the
itemizable_id
for all kits' line items to instead point to the kit's item. Back up the DB first! - Update views and allocation / deallocation logic to work with the item's line items instead of the kits.
- Add the
-
Create new models:
- Create new
KitItem
andConcreteItem
models, add thetype
field, copy code as needed and add associations as needed (line_items). - Add a migration to assign the type
KitItem
to all items that have akit_id
. The other columns should more or less line up and we shouldn't need to worry about changing them.
- Create new
-
Update view to use new models
- Views should use KitItems instead of Items + Kits. Again, we can use the feature flag to key off how the views and any other code (e.g. parameters) look.
- Simplify views to avoid checks on whether an item has a kit or not - in most cases we can either remove the check entirely, or we would want to change the check to whether the item has line items or not.
-
General cleanup and code fixes
- Go through the rest of the codebase and ensure that all code that's looking at kits is (feature-flagged to) look at KitItems instead.
-
Release and monitor
-
Put out the release. Monitor how the feature is used and if we see any errors. Revert if there are any. Put out fixes and repeat.
-
Cleanup kits
- Once we are satisfied that the release is successful, we can remove the old Kits and Item classes and any code on the "false" branch of the feature flag.
- Stop writing to the Kits table.
-
Clean up data
- Drop the kits table and remove kit_id from Items.
-
Future improvements
- Create issues for future improvements - most importantly being able to see all line items in any item if it has them, on any page that displays items.
from human-essentials.
For discussion on Sunday.
from human-essentials.
This issue has been inactive for 244 hours (10.17 days) and will be automatically unassigned after 116 more hours (4.83 days).
from human-essentials.
This issue has been inactive for 364 hours (15.17 days) and is past the limit of 360 hours (15.00 days) so is being unassigned.
from human-essentials.
This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.
from human-essentials.
Automatically unassigned after 7 days of inactivity.
from human-essentials.
Related Issues (20)
- Improvements to how distribution new works HOT 6
- bin/setup broken (as of rails 7.1.3.2) HOT 3
- Flaky distribution test
- Investigate Custom Devise Mailer HOT 1
- Merge line items at request save. Not just for children anymore. () HOT 1
- Rework landing page to use bootstrap instead of tailwind
- [PACKS] # 1 Add custom request units at organizational level HOT 1
- [PACKS] #2 Add reporting units to items HOT 2
- [PACKS] #3 Allowing the selection of custom request units in partner request
- [PACKS] # 4 Show the custom units when displaying the request to the partner HOT 3
- [PACKS] #5 Add custom request units (if any) to the confirmation email for partner requests.
- [PACKS] # 6 Add custom request units to partner's request list HOT 6
- [PACKS] # 7 Show custom request units in banks' request view
- [PACKS] #8 New / Edit Distribution for the banks shows custom request units, if applicable
- [PACKS] # 9 Distribution printout for banks includes custom request units, if applicable
- [PACKS] #10 Add custom request units to Request export
- [PACKS] 11: Add ability to print all outstanding requests as pick-lists
- [PACKS] #12 Item view should include all fields (including new custom request units)
- [PACKS] #13 Calcuate Product Totals
- Bank Request View -- only show fulfillment column if partner has default location
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from human-essentials.