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

Frontend API Bundle #831

Open
dpfaffenbauer opened this issue Feb 23, 2019 · 13 comments
Open

Frontend API Bundle #831

dpfaffenbauer opened this issue Feb 23, 2019 · 13 comments
Assignees

Comments

@dpfaffenbauer
Copy link
Member

Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes

In order for CoreShop to be used in PWA/SPA we need a proper Frontend API.

  • Define what API Endpoints we need.
@dpfaffenbauer dpfaffenbauer added this to the 2.1.0 milestone Feb 23, 2019
@davidhoeck
Copy link
Contributor

Products and Categories

Method Description Parameters
GET All Products page or skip and limit
GET Single Product by ID productId
GET All Categories hierarchic with subcategories maxDepth
GET Single Category with its subcategories categoryId maxDepth
GET All products of a single category categoryId, maxDepth, page or skip and limit

Cart

Method Description Parameters
POST Add Product to the cart productId quantity
PUT Update CartItem cartItemId productId quantity
DELETE Remove CartItem from Cart cartItemId
GET Get the Cart cartIdentifier(optional)
POST Add a discount/voucher code to the cart code
DELETE Remove a discount/voucher code from the cart code

Checkout

Method Description Parameters
GET All Checkout steps
PUT Persist a cart step stepIdentifier
POST Create a new address for the customer -
DELETE Remove an address of the customer addressId

@dpfaffenbauer dpfaffenbauer modified the milestones: 2.1.0, 2.2.0 Sep 13, 2019
@solverat
Copy link
Contributor

solverat commented Oct 4, 2019

Cart

  • Add multiple items

Index

@solverat solverat changed the title Definition of Frontend API Bundle Frontend API Bundle Oct 4, 2019
@dpfaffenbauer
Copy link
Member Author

@dpfaffenbauer dpfaffenbauer removed this from the 2.2.0 milestone Feb 19, 2020
@dpfaffenbauer
Copy link
Member Author

Multiple ways of actually doing this:

  • Custom FrontendAPI Bundle with API Platform
  • Integration with DataHub

@davidhoeck you are working on something like this right?

@davidhoeck
Copy link
Contributor

@dpfaffenbauer yes - but still under heavy development and we are trying to find the right architecture. problem is basically that datahub is not built for performance because schema cannot be cached and is initialized on every request

@dpfaffenbauer
Copy link
Member Author

Will you open source what you have?

@dkarlovi
Copy link
Contributor

@davidhoeck can we fix the "not built for performance" upstream? I'd expect them to cache metadata in prod, same as any other integration.

@davidhoeck
Copy link
Contributor

@dkarlovi nope they don't. the schema get's initialized every time. when you take a look at a data hub request with blackfire, you see that the graph (queries + mutations) is built basically every request. I tried to implement a cache layer, but there was a loss of the resolver information.

@davidhoeck
Copy link
Contributor

@dpfaffenbauer yep, but we will migrate it to coreshop 3 before that.

@dkarlovi
Copy link
Contributor

@davidhoeck that's unfortunate. I'll check it out in Blackfire, thanks for the hint! 🍻

@dkarlovi
Copy link
Contributor

Note for the above list, "All products" (and basically any listing) should by default support search, filter and sort params.

@davidhoeck
Copy link
Contributor

@dkarlovi well, product listing is handled by the native data hub listing. CoreShop Index is a little bit more complex to use and we did not have implement it yet.

@dkarlovi
Copy link
Contributor

We actually have a very custom Elasticsearch based Index which uses the Coreshop interfaces, but implements the search & filter stuff on our own. Not sure this would work by default via the Datahub feature, I'd expect it to be more tightly linked to Pimcore's implementation and database (which here doesn't exist).

I didn't look into it, but wanted to note listings should expect to accept filters, search and sort related params, for completeness sake.

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

No branches or pull requests

4 participants