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

page: individual intent casting #39

Closed
ahdinosaur opened this issue Jun 19, 2017 · 12 comments
Closed

page: individual intent casting #39

ahdinosaur opened this issue Jun 19, 2017 · 12 comments
Assignees
Labels
Milestone

Comments

@ahdinosaur
Copy link
Member

ahdinosaur commented Jun 19, 2017

depends on #44 and #49.

job story: when my group is ready to begin an order, i should be assigned a TaskPlan to cast my individual intent, where i can say my { desired, minimum, maximum } values for how much i want to order for each product offered by the order supplier given the price specifications.

branch: feature/page-individual-intent-casting

@sarah-arrrgh
Copy link
Member

sarah-arrrgh commented Aug 22, 2017

TODO:

  • wire up the component to a page with a route
  • on dash, add another active task cast your intent for order x after an order has started
  • figure out how complete the intent casting component is

@sarah-arrrgh
Copy link
Member

sarah-arrrgh commented Aug 22, 2017

Services and hooks

Compared with FA, we didn't develop the backend, we just used API routes that Sebastian built for us to interact with the database.

On Cobuy, Dogstack uses Feathers to generate and manage our API.
Feathers - service. Service refers to a collection of API routes for doing CRUD of a topic*, so we end up having an agent service and a order service etc.
e.g. if we want to create an order, we use the order service, and call .create on it if we want to

Hooks
If you have a basic service, you can attach hooks to that service. Hooks = functions that run either before a service attempts an operation (CRUD), or after it's successful, or if it errors.


*topic = a thing, like an order or an agent. FA = domain

CRUD = CREATE, READ, UPDATE, DELETE
Feathers READ = FIND or GET
Feather DELETE = REMOVE
https://docs.feathersjs.com/api/services.html

const myService = {
  find(params) {},
  get(id, params) {},
  create(data, params) {},
  update(id, data, params) {},
  patch(id, data, params) {},
  remove(id, params) {},
  setup(app, path) {}
}

app.use('/my-service', myService);

@sarah-arrrgh
Copy link
Member

syntax for reduxForm / higher-order components:

const higherOrderComponent = (component) => {
  const nextComponent = (props) => {
    return h(component, props)
  }
  return nextComponent
}

@sarah-arrrgh
Copy link
Member

examples:

function doubleFunction (fn) {
  return () => {
    return fn() * 2
  }
}

const four = () => 4
const eight = doubleFunction(four)
const eight = () => doubleFunction(four)()

@sarah-arrrgh
Copy link
Member

sarah-arrrgh commented Aug 23, 2017

Status report:

  • hard-coded avocado offering into CastIntentTask component - need to update with actual supplier offerings once page: add products and prices #36 is completed
  • wire up handleSubmit
  • how to put order name into locales file (currently "cast your intent for order x" hardcoded in)

@sarah-arrrgh
Copy link
Member

Thursday things:

Dan and Mikey met yesterday to discuss the Tapin/Cobuy relationship, and what exactly Tapin needs Cobuy to do. This lead to a change in plan that affects this ticket, whereby we no longer want a user to order using min/desired/max, as schools will be buying in whole outers already (so outers won't need to be split && orders wont need to be tweaked).

TODO:

  • unwire the current min/desired/max intent casting component
  • hook up a new intent casting component (likely displaying a list of available products and prices

@sarah-arrrgh
Copy link
Member

@ahdinosaur
keen to get your opinion on where to go exactly with this ticket. wondering if it might be blocked by #36?

@ahdinosaur
Copy link
Member Author

hey @sarah-arrrgh, re-opening #49 (comment) for you. i think it makes sense to re-implement that component given the new requirements as a standalone task, then doing this task would be creating a list using this components given the available products.

@ahdinosaur
Copy link
Member Author

wondering if it might be blocked by #36?

@sarah-arrrgh it shouldn't be. we can assume that the products have already been creating according to the documented data model, which you can mock using fake data for now.

@sarah-arrrgh
Copy link
Member

dependent on #49 to continue with this

@sarah-arrrgh
Copy link
Member

sarah-arrrgh commented Sep 13, 2017

End of day report

  • finished intent casting components in storybook, including rendering price point sub-component
  • fixed castIntent hook after rebase

TODO

  • wire up single product view component into intent casting page
    • task recipe specifies which component renders (change container or tell container to render different component)

Blocks:

@iainkirkpatrick
Copy link
Member

IMO this is done for now - we can extend the intent casting flows with other tickets, but the core is there

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

Successfully merging a pull request may close this issue.

5 participants