CALEB FETZER

Hello! I'm Caleb. I am a developer from Perth. WA.

GoodsIn Warranty

Nov 10, 2018

A full stack application currently in development that allows easy creation of warranty claims and sent in advance item claims. Wholesalers often have the issue of keeping track of repaired goods or returned goods, and in other cases providing items/goods in advance before receiving the faulty item back.

The purpose of this application is to easily see and resolve outstanding claims, whilst offering additional functionality over traditional data stores, such as a flat-file Excel database.

Dashboard

The dashboard allows users to grab a quick summary of the latest entered claims, as well as see the claims per month. Dashboard Panel In a small table, you are given some basic context which also is linkable back to the individual claims. The dashboard page also provides a summary of the types of claims made, with some action buttons above to provide quick access to relevant sections.

The chart is rendered by Chart.js and grabs data from the Claim model. It represents the total amount of claims created in a month and covers both “Unresolved” and “Sent in Advance” claims.

In order for the data to get displayed under the chart, the index route queries the Claim data model for the total amount of claims, initialises an object and then counts the total number of claims by month and date.

//Initialise object keys and default values to 0
var countByMonth = {
      jan: 0, feb: 0, mar: 0,
      apr: 0, may: 0, jun: 0, 
      jul: 0, aug: 0, sep: 0,
      oct: 0, nov: 0, dec: 0
    };
// Loop over the claims
for (var i = 0; i < results.claims.length; i++) {
  countByMonth[Object.keys(countByMonth)[moment(results.claims[i].date).month()]]++;
}

The countByMonth variable is looped over, where each property is accessed and then increased after being matched with the results.claims[i] value.

Moment.js is used to get the month representation from the date returned by the claim query.

The technology stack includes: - Express.js - Node.js - MongoDB