Giter VIP home page Giter VIP logo

mps's People

Contributors

jollopre avatar

Watchers

 avatar  avatar  avatar

mps's Issues

Configure ESlinter

It is needed to include ESlinter for JavaScript in order to follow best practices and code conventions.

Products Controller

Initially Read operations will be supported, therefore two actions are needed:

  • products#index: Returns a JSON with all the products available in the system
  • products#show: Returns a specific product

This issue has to provide test.

OrderItem PDF download

When trying to download a PDF for a given order item through Firefox, the PDF appears to be generated by the server, however in Firefox the dialog to download/cancel the file attachment is not prompted.
The time estimated to complete this task is 3 hours.

Add React Router library

This library will help to use the URL as the mechanism that governs what component it is displayed.

Introducing state management

In order to have more predictable changes that happen into UI state, it is desired to include a state management library such as Redux. This will benefit the interface in many ways (e.g. single source of state changes, reducing the need of cascading down methods as properties to trigger state changes, simplifying the authentication logic, making easy to display feedback messages when network requests are made, etc.)

The time estimated to complete this task is 10 hours.

Order List view

This view has to show the different orders for a given client.

  • Before the list new action will be displayed.
  • Each row should include id, created_at and updated_at values with the show action.

Refactor arrayToMap function from every reducer

Every reducer within the client implements the same function arrayToMap to convert a collection of objects into a map of objects by id.

It is desired to refactor into one function (e.g. Key_by from lodash) which receives an array and the object key candidate to be the key into the returning map.

OrderItemContainer views

The OrderItem container component is in charge of communicating with the server. This component will render different presentational components:

  • List of OrderItems for a given order id
  • Creation of an order item for a given product
  • Show action that displays details for a given order item (this might be embedded as part of the List of OrderItems)
  • Edit action that permits updating feature values

Automatise the flow to build the client

Currently, before performing any deploy, it is needed to manually build all the JS assets and place them within another directory for being server in apache.

A better approach to automatise this flow will reduce the time to deploy

Paginate views

The following view lists must be paginated:

  • Customers
  • Orders

otherwise, this will not scale when the db has a considerable amount of results. NOTE, this will not be delivered as part of the MVP.

Customers functionality

Steven is going to pass me the list of customers so that we have to create a script that populates the table customers in the database.

Prototype for Enquiry

The enquiry form has different fields to be applied for the following products:

  • Plastic Carrier Bags
  • Kraft Paper Carrier Bags
  • Luxury Paper Carrier Bags

We have identified two types of field:

  • open, which permits typing any value
  • close, which has a predefined set of values to choose (only one).

Optimise database queries

A more comprehensive review has to be made into the database queries that are generated into the API.

Automatise the flow for when a migration is needed before deploying

Currently, when a new deploy is performed. If there are server side changes at the db level, we have to manually run rake db:migrate in order to bring the database to the latest migration reflected in code.

A before deploy hook to determine whether or not that command has to be triggered will automatise this manual behaviour

Rename OrderItem to Enquiry

It is important to stick with the terminology that MP uses for creating enquiries for a quotation package. Therefore, we have to rename every place in code accordingly:

  • order_item_model.rb
  • order_items_controller.rb
  • order_items redux state
  • any UI component using orderItem or orderItems keyword

Self Signed SSL Certificate

Currently the live site is under http protocol. This means that the data between client and server is non-encrypted and "man in the middle" attacks may occur. In our last meeting discussion, we agreed to generate a "Self Signed SSL certificate" for now since the site is meant to be accessible only for employees.

@marshallpack1974 is aware that "warning" messages will appear on any browser when someone try to access to the site since the certificate is not issued and verified by a trusted authority.

This task will involve:

  • Generation of SSL SSL certificate
  • Installation on the live server
  • Test to check that everyone works
  • Automatise the above steps since we use Docker to deploy the service.

The time estimated to complete this task is 5 hours.

Create template to share across the views

The template should include at least:

  • Header: A navbar with the different links available, together with User information and sign out action.
  • Body: Where the rest of the views are rendered
  • Footer: Where the credits are displayed.

Sending email to customer regarding a quotation

Once any of the enquiries part of a quotation are ready, i.e. an EnquiryCost record includes costing price and sale price, the system should allow the user to send an email with the detailed quotation attached. The pdf should include:

  • The header (logo and MP details)
  • Sub header with Invoice address and delivery address
  • Body with each enquiry including product/features selected as well sales price
  • Total price of the quotation
  • Footer including Terms and conditions

Orders Controller

The following actions are needed:

  • GET orders#index: Returns a JSON with all the orders available in the system (not needed pagination right now).
  • POST orders#create: Create a new order given a customer_id
  • GET orders#show: Returns a JSON for a specific order_id passed. This includes details of the customer

This issue has to provide test for every action provided.

Gemfile review

Review Gemfile and remove any dependencies not needed for running Rails API only.

Create Supplier model

This model will have (at least):

  • Contact name
  • Contact surname
  • email
  • Country where the supplier is allocated (crucial for tariff and taxes)

Unit tests for models

In order to make the system more reliable, a set of unit test for each model provided will help.

Delete enquiry

The UI should provide an action to delete an enquiry which eventually sends a DELETE request for an enquiry id.

Note, if an enquiry has multiple quantities introduced, all the enquiry copies inserted in the db should be destroyed too.

Export enquiry presentation format

The format for an enquiry pdf should be formatted as follows:

  • Header including MP logo and address
  • Sub header including the delivery address
  • Body including a table with two columns. The left column describes the content of the right column. See example below:
Product Plastic Carrier Bag
Quantities 2000, 5000, 10000
Handles Black twisted paper handles

Filter customer records

In order to filter the long list of customers at Customers page, it is required to add a search box that only displays a list of customers matching the criteria typed.

The text entered will be executed against the following customer fields:

  • Company name
  • Email
  • Contact name
  • Contact surname

and it is expected to be case insensitive.

The time estimated to complete this task is 4 hours.

Edit customers

An edit customers functionality will permit to modify customer details through the UI

FeatureValues Controller

This controller holds the value associated for an order_item and a feature (according to the product that the order_item belongs to). Currently, it is only needed the following action:

  • feature_values#update: PUT/PATCH http verb that permits updating the value for a feature. To have clean data, it is needed to check whether or not the value is according to the feature_type.

This issues also requires unit tests.

OrderItems Controller

An order has many order items. The order_item resource has to be nested within order resource (e.g. http://guides.rubyonrails.org/routing.html#nested-resources). Initially, is is needed the following actions:

  • order_items#index: This will display a JSON array with quantity, product, created_at and updated_at keys for each order_item.
  • order_items#create: A post action which requires order_id and product_id to be valid.
  • order_items#show: This will display a JSON object with its own attributes as well as the order and product that belongs. If it has features_values, they have to be retrieved.
  • order_items#update: A put action which permits updating quantity or feature_values objects.

This controller has to provide test.

Sending email to supplier regarding one or more enquiries

The UI that presents a quotation, should include a functionality to send an email to a supplier. This action requires from the user:

  • Selecting the supplier from a typeahead list of suppliers
  • Selecting one or more enquiries to be sent
  • The subject of the mail (a default placeholder should be provided initially)
  • The body of the mail (a default placeholder should be provided initially)

order#create return order

When a new oder is created, currently is returned 204 status with no content. In order to reduce the number of calls to the server, it is best if is returned the object created, so that the interface is updated when a successful response call is received.

For that we have to change at the server:

  • Status code to 201 (created)
  • body to the new Order object rather than no content,

and update OrderContainer.add at the client-side.

Replace as_json in models with serializable hash

In order to select what attributes from a model will be json exported, we override as_json method in each model. However, when a model include associations (i.e. references to other models), the respective as_json is not called for the association.

By doing some research, we have figure out that overriding serializable_hash instead of as_json will automatically include the filtered attributes in associated models. (see at https://github.com/rails/rails/blob/master/activemodel/lib/active_model/serialization.rb#L139)

EnquiryCost functionality

Any time an email is sent to a supplier regarding an enquiry, a new EnquiryCost record is saved in the db. The EnquiryCost should have at least:

  • Cost Price (describes the cost and shipment to produce an specific product)
  • The supplier selected
  • Cost for sale (describes the price that will cost the customer the specific product)
  • Observations (to clarify that price)

Create models

It is required to create the following models:

  • Customer
  • Orders
  • OrderItems
  • Products
  • Features (whose values may be number, text or set of options)
  • and their relationships

It will be needed to create seeds that populate the database for development.

Display http error messages

The creation of a presentational component for displaying any HTTP error raised through client-server communication is required.

Send OrderItem to Supplier

A functionality to send a given orderItem, i.e. its PDF, to a one or more suppliers will help to speed up the manual process of sending different emails with the same content to different suppliers.

At our last meeting, it was agreed to auto-generate the email content together with the PDF attached for a given order item and automatically invoke Outlook passing that data. It has to be explored if that workflow is possible to implement.

Ideally a mockup may help to understand this workflow.

The time estimated to complete this task is 10 hours.

Rename Order to Quotation

It is important to stick with the terminology that MP uses for creating offer packages for its customers. Therefore, we have to rename every place in code accordingly:

  • order_model.rb
  • orders_controller.rb
  • orders redux state
  • any UI component using order or orders keyword

Print OrderItem

In order to export order items to be sent to suppliers, an output .pdf formatted need to be included for each order item in the system.

Move tests from Minitest to RSpec

Since RSpec provides a better organisation for tests thanks to its expressiveness, we would like to move all the server related test towards that approach.

Date filter for Orders

The list of Orders for a given customer it is expected to be long so that filters by date for created_at and updated_at will help to select the right record when the user interacts with the interface. At least filter by year is required.

The time estimated to complete this task is 2 hours.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.