Coder Social home page Coder Social logo

prixfixe's People

Contributors

katieprochilo avatar liliankasem avatar mikehopcroft avatar omusavi avatar spacekatt avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

prixfixe's Issues

Shorthand for fully configured product with quantified options

Suppose there was a Big Kahuna latte that consisted of an extra large latte with extra pineapple syrup. Right now there is no way to express a single, "big kahuna" alias that would represent the fully configured product.

The challenge is that SpecificEntities are not quantified like ItemInstances and aren't configured with children.

Remove "Old" from type names

CartOld, ItemInstanceOld? I assume this was from a point in time when the API was being migrated from short-order, but do we plan on cleaning up these names now?

RuleChecker.isValidChild() throws in the absence of partial key matches

In the following code, reduce() throws when predicates is empty, which can happen when there are no partial key matches for par.

    isValidChild = (par: KEY, child: KEY): boolean => {
        const predicates = this.tensorWalker(
            par,
            this.childTensor
        ) as ValidChildPredicate[];

        // Evaulate each predicate and take the logical-or
        const result = predicates
            .map(predicate => predicate(child))
            .reduce((x, y): boolean => x || y);

        return result;
    };

I suspect the fix is

        const result = predicates
            .map(predicate => predicate(child))
            .reduce((x, y): boolean => x || y, false);

We should investigate whether this is, in fact the right fix, and determine if a similar problem exists elsewhere in the codebase.

Design: avoiding special cases for 'double'

Double could be

  • the size for an espresso, e.g. double espresso
  • the number of shots in a latte, e.g. double latte

One challenge for the second case is that double is actually a quantifier for an implicit shot count, so the alias, double maps to a specific option that is quantified with 2. Our architecture currently has no way to map an alias to a specific option, let alone one that is quantified.

Shorthand for entity that is specified by an attribute

Suppose soy were an attribute for milk. If someone were to order a soy latte we'd want soy to map to soy milk. Similarly, double could be an attribute for shot, but if one were to order a double latte, we'd want double to map to double shot.

Related to item #33.

YAML loaders should provide error object to exception

When AJV reports a schema validation error we should put the AJV.ValidateFunction.errors object into the Error object that is thrown. Probably want to define a YAMLValidationError that extends TypeError and adds a field for the AJV errors.

Update tests for addSpecificEntity()

addSpecificEntity() is a WIP right now. Also, the way it is called from an AttributeInfo object has changed slightly. As a result, the entire addSpecificEntity() test is commented out right now. This test should be revisited and updated to the current state of the project.

The same goes for MatrixEntityBuilder's getKey() test, since it calls addSpecificEntity().

Unique id generators

Let's make a class that generates unique ids as a monotonic sequence of integers, starting at 1. Let's template it on types like PID, AID, OID, DID, TID, etc, and then lets either create one global one for each id namespace or make them all fields of an uber id-generator class.

Create contributing.md to detail the project's coding practices.

Contributing.md should serve as a guide to developers for the project. Some examples of what we want to include:

  • Interface naming
    • All interfaces must start with "I". e.g. "ICart" or "ICatalog"
  • Limit each line to 80 characters or less
  • Function and class documentation.
    • JSDoc

Remove dependency on short-order

prix-fixe should not depend on short-order. Current dependencies include

  • Catalog - should be moved into prix-fixe
  • IndexableItem - should be moved into prix-fixe
  • AttributeToken, EntityToken - used by MatrixEntityBuilder - should be replaced by AID and PID
  • AttributeToken, ATTRIBUTE - used by makteAttributeToken in cart.ts - remove this function
  • AttributeToken, ATTRIBUTE - used by attribute_info.test.ts - remove after changing MatrixEntityBuilder

Complete updateAttributes()

Complete *updateAttributes in CartUtils so that it:

  • Adds any new attributes to an ItemInstance
  • Replaces any attributes in the same category

Remove MODIFIER typing from Catalog

A modifier is an option with some mutual exclusivity in its category. There are now rules to handle the mutual exclusivity aspect, so MODIFIER is not useful anymore and should be removed.

Address TODO: comments

This is probably an ongoing task, but let's do the following:

  • Remove TODO: comments that are no longer valid (or have already been addressed)
  • Open issues for the more architecturally significant TODO: comments

Let's do this as a triage for now. Comments that don't meet one of the two conditions, above, will be left in place.

Travis-ci broken since 7247d8b3

Travis-ci has been broken broken since 7247d8b. It looks like we're not used to the prettier workflow introduced in gts. Let's get travis building cleanly and then investigate steps to improve our prettier workflow. Options include

  • Learning how to work with prettier
  • Disabling some prettier rules
  • Disabling prettier altogether

CartOp.addToItem() should handle mutual exclusives

Currently CartOps.addToItem() blindly adds a child item. We probably want to replace an existing item, if the new child is in an mutual exclusion class with an existing child.

Should decide whether this functionality is built into addToItem() or part of another method.

Unit tests should not rely on data files

Currently cart.test.ts depends on data files in samples. The test should probably use inlined strings instead of files.

Consider removing call to setup() from cart.test.ts. This will make the unit tests more specific in their scope.

Complete createItemInstance()

Complete *createItemInstance() in AttributeUtils so that it:

  • Returns a new ItemInstance with a UID passed in from some global function
  • The ItemInstance is configured by some set of attributes that is passed in

No pricing?

I was just working on resolving menu items from the catalog and noticed that there is no pricing information available. I would expect to see a price property on the GenericTypedEntity class for example. Are we still working on bringing in pricing or...?

PID vs OID

Are product ids (PIDs) a distinct concept from option ids (OIDs)? If the Catalog can represent either Products or Options, it seems that we need to use PIDs for both.

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.