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

Item Refactor #314

Closed
2 tasks done
armahillo opened this issue Apr 29, 2018 · 1 comment
Closed
2 tasks done

Item Refactor #314

armahillo opened this issue Apr 29, 2018 · 1 comment
Assignees
Labels
BLOCKER This issue blocks others and should be prioritized In Progress refactor

Comments

@armahillo
Copy link
Collaborator

armahillo commented Apr 29, 2018

Changes to Item

Use separate tables, not STI

  • Create a CanonicalItem type that will be replicated into Item on Org creation
  • Create a method that automates the replication (no overwrites, but no direct duplicates)
    -- [ ] If possible, integrate existing Item records to work with CanonicalItem
~~~- [ ] Make the "key" be programmatically generated and idempotent.~~~
- [x] Administrative users can manage `CanonicalItem`s, normal users cannot see those CRUD tasks
- [x] Regular users can maintain their own `Item`s, adding, modifying, deleting, etc, but any `Item` they add must root in a `CanonicalItem` (N.B. care should be taken when deleting an item that has previously been used by `Donation`, `Distribution`, etc)
- [x] Add a way to "hide" an Item when it's requested to be deleted but has prior history
- [x] Refactor "size" into a field, instead of just being in the name (so it can be filtered, etc)

## Changes to BarcodeItem

- [x] Global `BarcodeItem`s are rooted with `CanonicalItem`
- [x] Local `BarcodeItem`s are rooted with `Item`
- [x] `BarcodeItem` link to `Item` is polymorphic

## Workflow for new organization signup
1. New org signs up 
2. Canonical items are replicated into regular items for the org 
3. Org then does whatever kind of modifications they want to those items (full CRUD), adds more, deletes any that have never held inventory, etc.
@armahillo armahillo added refactor BLOCKER This issue blocks others and should be prioritized labels Apr 29, 2018
@armahillo
Copy link
Collaborator Author

TODO: Add scopes to display CanonicalItem types that have been created in last 30 days and are not currently among the item types of the current user. Display those as a notification to the signed-in user so they can opt-in if they want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLOCKER This issue blocks others and should be prioritized In Progress refactor
Projects
None yet
Development

No branches or pull requests

3 participants