I, as the hyper committed, busy individual who is looking to be more fiscally responsible, should be able to add a category or edit the parameters of a pre-existing category. The creation of these categories will allow for the understanding of how I spend my money, and it will allow for the better organization of it. Thinking of these categories, in it of itself, is an exercise. Whether that be the name or the spending limit.
CREATE
Creating a category should be present on the home page, within the Categories section.
EDIT
Present within the 'Category Details' page,
Acceptance Criteria
WIREFRAME
The form should take into account the category ERD:
WHEN, the user selects on either 'Create a Category' on the home page or 'Edit Category' on the category details page, a modal should appear that allows for the creation or the editing of the category form.
Dependencies
ALL TESTING DATA SHOULD BE CREATED (POST/PATCH).
ALL NECESSARY API CALLS SHOULD BE WRITTEN. A SEPERATE ISSUE TICKET WILL BE CREATED FOR THIS ONCE FULL FUNCTIONALITY IS MAPPED AND DECIDED.
8 - Mutual dependency. The home page isn't complete without the ability to produce this form, and the testing of this form isn't complete without the, at least, half-way completion of the homepage.
10 - Mutual dependency. The category details page isn't complete without the ability to produce this form, and the testing of this form isn't complete without the, at least, half-way completion of the homepage.
Dev Notes
The edit form and the creation form will share the same component. It's just the routing that's different.
Depending on the UI library used, the form will look different, but the functionality will work the exact same.
Dependent on POST and PATCH API call, which will be completed all in a singular ticket.
EXAMPLE FROM SIMPLY BOOKS
BOOKS > NEW.JS
import React from 'react';
import BookForm from '../../components/forms/BookForm';
// TODO: create a reusable form to add/edit book and render in this view
export default function AddBook() {
return <BookForm />;
}
'EDIT' - SEEN WITHIN BOOKS > EDIT > [FIREBASEKEY].JS, DEPENDENT ON FORM COMPONENT FOR COMPLETION
import { React, useEffect, useState } from 'react';
import { useRouter } from 'next/router';
import { getSingleBook } from '../../../api/bookData';
import BookForm from '../../../components/forms/BookForm';
export default function EditBook() {
const [editItem, setEditItem] = useState({});
const router = useRouter();
// TODO: grab the firebasekey
const { firebaseKey } = router.query;
// TODO: make a call to the API to get the book data
useEffect(() => {
getSingleBook(firebaseKey).then(setEditItem);
}, [firebaseKey]);
// TODO: pass object to form
return (<BookForm obj={editItem} />);
}
BOTH EDIT AND CREATE FOR CATEGORY WERE SUCCESSFULLY IMPLEMENTED.
Lessons Learned:
It's all about the shape of data. What types are you handling? How do you handle it upon submission? How do you ensure this data can be displayed and acted upon in a functional way? If you don't know this - you'll run into a lot of issues.
User Story
I, as the hyper committed, busy individual who is looking to be more fiscally responsible, should be able to add a category or edit the parameters of a pre-existing category. The creation of these categories will allow for the understanding of how I spend my money, and it will allow for the better organization of it. Thinking of these categories, in it of itself, is an exercise. Whether that be the name or the spending limit.
Acceptance Criteria
WIREFRAME
The form should take into account the category ERD:
WHEN, the user selects on either 'Create a Category' on the home page or 'Edit Category' on the category details page, a modal should appear that allows for the creation or the editing of the category form.
Dependencies
8 - Mutual dependency. The home page isn't complete without the ability to produce this form, and the testing of this form isn't complete without the, at least, half-way completion of the homepage.
10 - Mutual dependency. The category details page isn't complete without the ability to produce this form, and the testing of this form isn't complete without the, at least, half-way completion of the homepage.
Dev Notes
EXAMPLE FROM SIMPLY BOOKS
BOOKS > NEW.JS
BOOKFORM.JS
'EDIT' - SEEN WITHIN BOOKS > EDIT > [FIREBASEKEY].JS, DEPENDENT ON FORM COMPONENT FOR COMPLETION