Coder Social home page Coder Social logo

poc-chef-client's People

Contributors

canker avatar mishelashala avatar

Watchers

 avatar  avatar  avatar

poc-chef-client's Issues

Create Event

as a partner I want to create a new event

Input Data:

  • event name
  • start date
  • expiration date
  • start hour
  • expiration hour
  • poc chuc torta unit price
  • shrimp torta unit price

Contraints:

  • event name is required and a string
  • start date must be a future date and an epoch (dto)
  • expiration date must be a future date, must be after start date and and epoch (dto)
  • start hour must be epoch
  • expiration hour must epoch
  • poc chuc torta unit price must be a non negative number
  • shrimp torta unit price must be a non negative number
  • partner must be logged in

Scenario 1
user tries to create new user with the following data

  • event name: Tortas app
  • start date: today
  • end date: tomorrow
  • start hour: 10am
  • end hour: 11am
  • poc chuc torta unitary price: 10
  • camaron torta unitary price: 12

System Response: notifies the user that the event was created


Scenario 2:

the user tries to create a new event but inputs the wrong data,

System Response: display error messages below the fields (see error list)

Error List

  • event name
    • empty name: "Is required"
  • start date:
    • empty: "Is required"
    • before current date: "Must be a future date"
    • invalid format: "Must be epoch time"
  • expiration date:
    • empty: "Is required"
    • before start date: "Must be after start date"
    • invalid format: "Must be epoch time"
  • start hour:
    • empty: "Is required"
    • not in the range (from 0 to 24 * 60): "Must be in the range from 0 to 24 * 60"
    • invalid format: "Must be a number"
  • expiration hour:
    • empty: "Is required"
    • before start hour: "Must be after start hour"
    • not in the range (from 0 to 24 * 60): "Must be in the range from 0 to 24 * 60"
    • invalid format: "Must be a number"
  • poc chuc torta unit price
    • empty: "Is required"
    • invalid format: "Must be a non-negative number"
  • shrimp torta unit price
    • empty: "Is required"
    • invalid format: "Must be a non-negative number"

View particular event

as a partner I want to view a particular event (current and/or past)


Scenario 1:

user tries to see a particular event

Sytem Reponse: shows the user the event


Scenario 2:

user tries to see a non-existing event

Sytem Reponse: notifies the user that the event doesn't exists


Scenario 3:

user tries to see a particular event, but the service is not available

Sytem Reponse: notifies the user that the service is not available

Refactor eventService

Replace promises by async/await:

getCurrentEvents: async () => {
  try {
    const res = await fetch('...');
    const data = await res.json();
    return data.events.map(EventMapper.toEntity);
  } catch(err) {
    // add proper error handling
  }
}

Bad behavior when using two state hooks

Bad behavior in currentEvents->viewEvent:
Component path: src/partner/modules/EventList/EventOrdersContainer.tsx

Correct behavior :

  1. Check all unpaid orders (first checkbox)
  2. Click on move orders to paid
  3. Now unpaid orders is empty
  4. Click on paid orders to see all paid orders
  5. Now every paid orders is showed and unchecked

Bad behavior:
When you change the tab to paid orders or unpaid orders after moving some orders,
moved orders still checked.

this happens when handleShowTabs function is called when the user change the tab to "paid orders" this modifies showPaidOrder state to true, then it calls handleCheckAll(false) to reset all the checkboxes in the current tab (in this case paid orders), but when handleCheckAll is invoked showPaidOrder state still false

Cancel Event

as a partner I want to cancel a current event


Contraints:

  • partner must be logged in

Scenario 1:
partner tries to delete an existing (and current) event

System Response: notifies the user that the event was deleted


Scenario 2:
the partner tries to delete an existing past event

System Response: notifies the partner that you cannot cancel a past event

Scenario 3:
the partner tries to delete a non-existing event

System Response: notifies the partner that the event doesn't exist


screen shot 2019-01-18 at 12 27 54

screen shot 2019-01-18 at 12 28 02

screen shot 2019-01-18 at 12 28 15

feat protect routes, only authenticated users can see them

Partner app:
protect any partner/ sub-route from no authenticated users
if user is no logged must be redirected to partner/login
not authenticated users can only go to partner/ and partner/login routes
when user is logged and go to partner/login must be redirected to partner/current-events

User app:
protect any user/ sub-route from no authenticated users
if user is no logged must be redirected to user/login
not authenticated users can only go to user/ and user/login routes
when user is logged and go to user/login must be redirected to user/my-orders

See list of current events

As a user I want to be able to see a list of current events.

Constraints:

  • user must be logged in

Scenario 1: show all

user tries to see the list of current events

System Response: shows the user the list of events (ordered from newest to oldest)


Scenario 2: no current events

user tries to see the list of current events

System Response: shows an empty list message


Scenario 3: service not available

user tries to see the list of current events, but the service is not available

System Response: notifies the user that the service is not available

Edit Event

as a partner I want to edit an existing event

Input Data:

  • event name
  • start date
  • expiration date
  • start hour
  • expiration hour
  • poc chuc torta unit price
  • shrimp torta unit price

Contraints:

  • event name is required and a string
  • start date must be a future date and an epoch (dto)
  • expiration date must be a future date, must be after start date and and epoch (dto)
  • start hour must be epoch
  • expiration hour must epoch
  • poc chuc torta unit price must be a non negative number
  • shrimp torta unit price must be a non negative number
  • partner must be logged in

Scenario 1
user tries to edit an existing event with the following data

  • event name: Tortas app
  • start date: today
  • end date: tomorrow
  • start hour: 10am
  • end hour: 11am
  • poc chuc torta unitary price: 10
  • camaron torta unitary price: 12

System Response: notifies the user that the event was edited


Scenario 2:

the user tries to edit an existing event but inputs the wrong data,

System Response: display error messages below the fields (see error list)

Scenario 3: user tries to edit a non-existing event

System Response: notifies the user that the event doesn't exist

Error List

  • event name
    • empty name: "Is required"
  • start date:
    • empty: "Is required"
    • before current date: "Must be a future date"
    • invalid format: "Must be epoch time"
  • expiration date:
    • empty: "Is required"
    • before start date: "Must be after start date"
    • invalid format: "Must be epoch time"
  • start hour:
    • empty: "Is required"
    • not in the range (from 0 to 24 * 60): "Must be in the range from 0 to 24 * 60"
    • invalid format: "Must be a number"
  • expiration hour:
    • empty: "Is required"
    • before start hour: "Must be after start hour"
    • not in the range (from 0 to 24 * 60): "Must be in the range from 0 to 24 * 60"
    • invalid format: "Must be a number"
  • poc chuc torta unit price
    • empty: "Is required"
    • invalid format: "Must be a non-negative number"
  • shrimp torta unit price
    • empty: "Is required"
    • invalid format: "Must be a non-negative number"

screen shot 2019-01-16 at 11 45 04

screen shot 2019-01-16 at 11 48 22

No more default exports

Every file now must have named exports, no more default exports

And every layer directory should have an index.ts that exports everything

Example:

// mappers/EventMapper
export const toEntity = () => {
  // ...
}

// mappers/index.ts
import * as EventMapper from './EventMapper'

export { EventMapper }

// services/EventService
import { EventMapper } from 'mappers'

Mark orders (from a particular event) as paid

as a partner I want to mark one or many orders from a particular event as paid


Scenario 1:

partner tries to mark one or many orders as paid

System Response: notifies the user that those orders were marked as paid


Scenario 2:

partner tries to mark one or many non-existing orders as paid

System Response: notifies the user that those orders doesn't exist


Scenario 3:

partner tries to mark one or many orders as paid but the service is not available

System Response: notifies the user that the service is not available


screen shot 2019-01-16 at 12 10 07

screen shot 2019-01-16 at 11 48 22

See list of past events

As a user I want to be able to see a list of past events.

Constraints:

  • user must be logged in

Scenario 1: show all

user tries to see the list of past events

System Response: shows the user the list of events (ordered from newest to oldest)


Scenario 2: no past events

user tries to see the list of past events

System Response: shows an empty list message


Scenario 3: service not available

user tries to see the list of past events, but the service is not available

System Response: notifies the user that the service is not available

feat-add-splash-view

Add a splash view

  • set this view as default route
  • Must redirect to user/login
  • Must redirect to partner/login

view:
Screenshot from 2019-04-05 10-14-02

feat add login partner view

Requires:
username
password

Constrains:
Both username and password must be an string

Scenario 1:
User types an username that doesn't exist:
System response: "Username doesn't exist"

Scenario 2:
User types a wrong password:
System response: "Invalid password"

Scenario 3:
User types correct username and password,
System response: Redirect user to current events view

View:

Screenshot from 2019-04-04 09-13-22

Mark orders (from a particular event) as not paid

as a partner I want to mark one or many orders from a particular event as not paid


Scenario 1:

partner tries to mark one or many orders as not paid

System Response: notifies the user that those orders were marked as not paid


Scenario 2:

partner tries to mark one or many non-existing orders as not paid

System Response: notifies the user that those orders doesn't exist


Scenario 3:

partner tries to mark one or many orders as not paid but the service is not available

System Response: notifies the user that the service is not available


screen shot 2019-01-16 at 11 48 22

screen shot 2019-01-16 at 12 14 07

screen shot 2019-01-16 at 12 14 15

screen shot 2019-01-16 at 12 14 22

implement cancel order

Constraints: cannot cancel a past order, only a current one.

Expected behavior: notify the user when the order is cancelled.

Here's the design:
Screen Shot 2019-03-13 at 10 14 56
Screen Shot 2019-03-13 at 10 15 02

update readme

We must keep the README file up to date. Please add the missing info

unify `NewEventMapper` and `EventMapper`

We don't need to have multiple mappers for the same entity

// mappers/Event.ts
const toEvent = (eventDto: IEventDto): IEvent => {}
const toEventDto = (event: IEvent): IEventDto => {}

const toNewEvent = (newEventDto: INewEventDto): INewEvent => {}
const toNewEventDto = (newEvent: INewEvent): INewEventDto => {}

Mark event as finished

as a partner I want to mark an event as finished.


Scenario 1:

partner tries to mark a current event as finished

System Response: notifies the user that the event has been marked as finished.


Scenario 2:

partner tries to mark a non-existing event as finished

System Response: notifies the user that the event doesn't exist


Scenario 3:

partner tries to mark a past event as finished

System Response: notifies the user that the event has been marked as finished


screen shot 2019-01-18 at 12 32 16

screen shot 2019-01-18 at 12 32 29

Add absolute import support

We need to add support for absolute imports

// good
import { EventMapper } from 'mappers'

// bad :(
import { EventMapper } from '../../mappers/'

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.