Auto Generate Item ID - a2n-seattle/rms-app GitHub Wiki
Field | Value |
---|---|
Milestone: | Milestone |
Owner: | ¯\_(ツ)_/¯ |
Contributors: | |
Reviewer: | Jeremy Yau |
Status: | In Progress |
Why?
As a user
I want to not need to think about the id of a item
So that I'm not slowed down.
Put this as documentation on top of the class
Item IDs were created the first time around so that there's a unique reference to every item in the database. But what we found was that item IDs only acted as a deterrent to using the RMS system, so we want to remove it and just auto-generate the ID.
What?
Auto-generate the ID. The format of the ID is pretty flexible, so how we auto-generate it is really upload to the implementer.
How?
Task Breakdown
- Create method in
AddItem
to auto-generate the ID (1)- Many ways to do this, so up to the implementer of figuring out how we do this.
- Link up method in
AddItem
, to remove the need to auto-generate it. (1)- Remove
id
fromAddItemInput
- Auto-supply the ID field to the
ItemTable.create
field.- Fix Router Tests to accommodate this change.
- Mock the method, to force ID to be a certain thing for tests.
- Fix Router Tests to accommodate this change.
- Remove out the ability to supply the ID in the router.
- Fix Router Tests to accommodate this change.
- Remove
Acceptance Criteria
Scenario | Expected Response |
---|---|
When a item is created in production | Will autogenerate the id for the item |
These scenarios should be written up as tests, using the following naming convention:
'will <have expected response> when <a certain input is given>'