Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo scenario: order history component #1483

Closed
6 tasks done
dhmlau opened this issue Jun 26, 2018 · 3 comments · Fixed by loopbackio/loopback4-example-shopping#12
Closed
6 tasks done

Demo scenario: order history component #1483

dhmlau opened this issue Jun 26, 2018 · 3 comments · Fixed by loopbackio/loopback4-example-shopping#12

Comments

@dhmlau
Copy link
Member

dhmlau commented Jun 26, 2018

Description / Steps to reproduce / Feature proposal

As part of the e-commerce store demo scenario in #1476, this task is to create the order history component. Data related to user profile, stored in a database.

Taken from comment below

Acceptance Criteria

  • using the same GitHub demo app repo as User Profile component
  • Define Order model with the following properties:
    Model Relation: Customer has a hasMany relation with Order
    • order id (required)
    • customer email / id (required)
    • products (Array of product ids) (required)
    • total (optional)
  • Use Cloudant as the datasource, use a Docker image to run a Cloudant instance. Configure Travis CI to start a Cloudant docker instance of tests
  • Create Order controller that exposes REST APIs with endpoints:
    • Create new order
    • Return orders with a given customer id

Note: Implementation should come with test coverage and follow the best practices outlined in https://loopback.io/doc/en/lb4/Testing-your-application.html.

@dhmlau
Copy link
Member Author

dhmlau commented Jul 30, 2018

@bajtos , this is the acceptance criteria i'm thinking of. Please review, then we can put it up in the description of this ticket.

Acceptance Criteria

  • using the same GitHub demo app repo as User Profile component
  • Define Order model with the following properties:
    Model Relation: Customer has a hasMany relation with Order
    • order id (required)
    • customer email / id (required)
    • products (Array of product ids) (required)
    • total (optional)
  • Use MySQL as the datasource, use a Docker image to run a MySQL instance. Configure Travis CI to start a MySQL docker instance of tests
  • Create Order controller that exposes REST APIs with endpoints:
    • Create new order
    • Return all orders
    • Return orders with a given customer id

Note: Suggesting to use MySQL to cover the usage of SQL database.

@bajtos
Copy link
Member

bajtos commented Jul 31, 2018

should we have the order history stored in a different database to show the heterogeneity?

Let's keep things simple and store orders in the same database as user profiles. We can always modify the demo later if we decide we want to showcase storing related data in different backing databases.

Use MySQL as the datasource, use a Docker image to run a MySQL instance. Configure Travis CI to start a MySQL docker instance of tests

Let's use the same database as we are using for User profiles. Also AFAIK, there is no free (Lite) plan for hosting MySQL on IBM Cloud. Using MySQL would complicate our deployment.

Create Order controller that exposes REST APIs with endpoints:

  • Create new order
  • Return all orders
  • Return orders with a given customer id

I think the following two endpoints are enough:

  • Create a new order for the given customer (user) identified by id
  • List all orders of a given customer (user) identified by id

The rest of the acceptance criteria look good to me.

I hope it goes without saying that the implementation should come with test coverage and follow the best practices outlined in https://loopback.io/doc/en/lb4/Testing-your-application.html.

@dhmlau
Copy link
Member Author

dhmlau commented Jul 31, 2018

Thanks @bajtos . It makes sense -- create a basic app first then add in more variations later.
Acceptance criteria has been updated.

@virkt25 , could you please make sure we estimate this for our next estimation meeting? since it's part of the Aug milestone. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants