- Versioning is going to progress as follows: +0.01 for small bugs fixes, visual effects implementations, user experience improvements, small code refactoring +0.1 for bigger implementations, big code refactoring, big changes in the program logic +1 if complete new functionality/page is added, or for massive changes being deployed at once
Web aplication released to production with the following capabilities:
-
Create, Read, Update, and Delete customers through MongoDB Customer Info includes Company Name, Email, Phone Number, Profile pic, Contact name, street address, city address, state address, and zip code.
-
Create, Read, and Delete invoices through MongoDB Invoice info includes: Customer info, date of service, invoice number, subtotal, tax percentage, corresponding tax, total price Currently, 5 states are available for auto tax calculation. They are:
- NJ
- NY
- PA
- CT
- FL
- For states othen than those, tax calculation is not available
- Superseded in v1.21: all 50 states are supported.
-
Access individual customers profile, where it is possible to Read, Update, and Delete their personal information as well as read and delete their corresponding invoices.
-
Access Invoices from the main page, where they are organized by Recent to Old order Even invoices that had their corresponding company deleted can be accessed and downloaded
-
On the PDF page, it is possible to download the current invoice to a local directory, and it is not possible to save the pdf twice to prevent duplicates
-
Nav bar at the top with top of the page and home options is available on all pages
-
Line block to create Customers, Generate Invoice, and go to the invoices part
-
Customers Card part where is possible to access their profile page, edit, and delete their information
-
Invoices List part with all invoices organized recent to Old
-
Full customers info with options to update and delete their info
-
Invoices list with all the invoices that corresponds to the customer being accessed
-
Fields to enter all customer info, with checks and validations to essential fields, and formatting rules to some fields
-
Essential fields are: Company Name, Phone number, Email, Zip Code, Contact Name
-
The following fields require specific formats that are specified to the user: Phone number, Email, Zip Code
-
Fields to edit every Customer Info
-
Same checks, validity, and formatting rules as in the Create Customer page
-
Ability to generate Invoices with pre-loaded Customer information
-
Update button that allows customer info to be changed before Invoice generation
-
fields for all invoice info and operations
-
generate button that directs the customer to the PDF page for a last check
-
Options to save invoice in the DB and edit it if any mistake is seen
-
Visualization of the final PDF with zoom, navigations, download options, and print options
- Added Version Log and Control to keep track of implementations and bugs fixed
- "file-saver" dependency was added
-
A download button was added so the file is downloaded with a personalized name that follows #invoice number - company name pattern for better organization
-
Fixed a bug that would crash the page if the user hit the home button while having information loaded
-
PDF title now also follows the pattern of #invoice number - company name
-
Save Invoice Button now becomes disabled after user saves it once to prevent duplicates
-
New rules for company name were added, these rules excludes characters that are not allowed by Windows directory. This change was made to prevent conflict when saving invoices
-
Visual effects for errors in formatting/verification were improved to help user see specifically which field is failing validation
-
Company Name is now a mandatory field for customer creation, while contact name is no longer a requirement
-
Company name field were adapted to the new rules of windows directory characters
-
Visual effects for errors in formatting/verification were improved to help user see specifically which field is failing validation
-
Company Name is now a mandatory field, while contact name is no longer a requirement
-
Introduced Table form as a alternative to Job Description. This is intended to make it easier to "itemize" and organize the invoice.
-
All necessary corrections and adjustments were done to support this new feature.
- Adjusted the pdf format to display, dynamically, the table content or the Job Description, depending on how the invoice was created.
-
added a month filter component that will filter the invoices based on the month selected out of the calendar.
-
added download invoice option within the table, which is compatible with the month filtering and profile page invoices.
-
Phone number field now allows the input of 10 straight digits (XXXXXXXXXX) and will format it once unfocused.
-
All of 50 US States are now supported in this web application. All tax information was imported and is now available to use.
- refactored switch case function to a taxRateDictionary for cleaningness and effectiveness purposes.
- refactored the table styles components.
- Client mistakes no longer answer 500: a malformed id or an undecodable URL, a value of the wrong type and a disallowed CORS origin now answer 400 (or 403 for the origin), with no internal details in the message.
- A duplicate-key error answers 409. Any other unexpected error answers 500 with a generic message; the real message is only logged.
- The validators and the tax controller reject wrong-typed values (a number for a phone number, company name or state) instead of failing; an email over 150 characters is an invalid email, and a final price must be fully numeric.
- Added a ForbiddenError (403) class.
- A customer's phone number is stored as its 10 digits (
"(555) 123-4567"is saved as"5551234567"), and the unique index onphoneNumbermakes the database refuse a duplicate. A phone number that matches another customer in any accepted format answers 409 on create and update. - The server builds the customer index before it starts listening, and exits with a clear error if it cannot.
- A duplicate that reaches the database through a race answers 409
A record with this value already exists. - Customers already stored are not rewritten; a number stored in another format is not matched until the stored numbers are normalized.
- The customer list caps
limitat 100 and falls back to the defaults (limit20,page1) for a value that is not a whole number of 1 or more, instead of passing it to the database (a negative or non-numericpageno longer answers 500).
dateOfServiceon an invoice is now a real calendar date writtenYYYY-MM-DD:POST /api/v1/invoicesanswers 400Date of service must be a real date in YYYY-MM-DD formatfor a value that is not a string in that format or is not a real date (10/27/2026,2026-02-30,2026-13-01, a number).- It is stored as a Date at UTC midnight, and every answer that returns an invoice sends it back as
YYYY-MM-DD, whatever the server time zone. - Invoices already stored are not rewritten (#141); a stored
MM/DD/YYYYvalue is read in the server's local time and can come back a day off, and a value that is not a date is left out of the answer.
invoiceNumberon an invoice is now required:POST /api/v1/invoicesanswers 400Invoice number is requiredfor a missing, blank or non-string value. It stays a string and is stored trimmed, so prefixes such asINV-0042keep working.- A unique index on
invoiceNumbermakes the database refuse a duplicate: an invoice whose number (after trimming, exact match) is already used answers 409A record with this value already exists. - The index is partial, so invoices stored before this version without a number do not collide with each other.
- The server builds the invoice index before it starts listening, next to the customer index. A local database that already holds duplicate invoice numbers cannot build it, so the server exits at startup with a clear error until the duplicates are resolved (the migration in #141 reports them). Invoices already stored are not rewritten.
- The invoice page blocks a number already in the list and warns, without blocking, about a gap or a lower number; the PDF page shows the API's message when saving fails.
- Every money amount on an invoice is an integer number of cents:
subtotalCents,taxCents,finalPriceCents, and per lineunitPriceCentsandlineTotalCents.finalPrice,subtotalandtableDataare gone from the model, replaced by these andlineItems: [{ description, quantity, unitPriceCents, lineTotalCents }].taxRatestays a percentage (7.25) and is now required. POST /api/v1/invoicescomputes the line totals, the subtotal, the tax and the final price on the server (ADR-004) and ignores any such figure the client sends. The tax rate comes fromstateAddress, which is now required and must be a state in the tax table. With nolineItems,subtotalCentsis required.- Rounding: a line total is quantity × unit price rounded half-up to a cent; the tax is subtotal × rate rounded half-up once for the invoice; the final price is their sum.
- A float, negative or string amount (including
"12abc"), a quantity of 0 or less or with more than 2 decimals, a blank description, and a missing or unknown state each answer 400. A result that is not a safe integer answers 400. - Invoices already stored keep their old dollar fields and show none of the new ones; they are converted in #141.
POST /api/v1/tax/calculatetakes{ subtotalCents, taxRate }(wasjobPriceandtaxRate) and answers{ subtotalCents, taxRate, taxCents, finalPriceCents }(wasjobPrice,taxAmount,finalPrice), through the same functions as invoices.- Parsing is strict (#145): a numeric string or a partly numeric value such as
"12abc"in either input answers 400. A rate has at most 3 decimals. - Every tax message,
/tax/rate's included, now comes fromRESPONSE_MESSAGES(ADR-005)./tax/rateanswers as before.
- Breaking: every endpoint is now under
/api/v2/(/api/v2/customers,/api/v2/invoices,/api/v2/tax)./api/v1/is gone and has no alias: a request to it answers 404Route not found./now answersversion: "v2.0". The frontend'sAPI_ENDPOINTSuses the new paths. - The request and answer shapes are those of v1.26; nothing else changes in the API.
npm run migrate:v2(NODEAPI/scripts/v2Migration.js) converts an existing database once;-- --dry-runlists everything and writes nothing. The procedure (stop the API,mongodump, dry run, run, check, restore) is in "Migrating a database from before v2.0" inDocs/README.md.- Customers: phone numbers become their 10 digits.
- Invoices:
dateOfService(MM/DD/YYYYorMMDDYYYY) becomes a Date at UTC midnight;invoiceNumberis trimmed; the money is recomputed by today's rules intolineItems,subtotalCents,taxCents,finalPriceCentsandtaxRate(the stored rate, or the state's when it has none), andfinalPrice,subtotalandtableDataare removed. An invoice with no line rows keeps its stored subtotal and haslineItems: []. - A final price can change by a cent or more, because the old rows were computed in floating point; each invoice whose final price changes is listed as a notice.
- A record it cannot convert (an unreadable date, a bad line row, no state, a phone number that is not 10 digits) is left as it is and listed with its
_idand the reason. Phone numbers that collide once normalized, and equal invoice numbers, are listed and left as they are, and the unique index that they block is not built; fix them by hand and run it again. Nothing is deleted or merged, and a second run changes nothing.