Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Extend CRUD operations #10

Closed
equilibrium999 opened this issue Jul 10, 2018 · 2 comments
Closed

Extend CRUD operations #10

equilibrium999 opened this issue Jul 10, 2018 · 2 comments

Comments

@equilibrium999
Copy link

Hi SAP,
I'm not sure if it is the right place to ask. And this is not an issue.
I've followed this repo and found it very informative and interesting.
Just one more thing is I'm curious about how to extend CRUD operations. For example, I need to validate values passed to backend before creating a sales order. How can I implement that?

Regards,

Tri

@skrishnakumar
Copy link
Contributor

Hello @equilibrium999

To my understanding, you would like to do some pre-processing before the sales order is created.
in espm we have used apache olingo for the oData/REST services. So, the SalesOrder creation is exposed via oData and the creation of the same is triggered in the UI using ajax.

https://github.com/SAP/cloud-espm-v2/blob/master/espm-cloud-web/src/main/webapp/webshop/controller/Checkout.controller.js

Line 334

The actual creation of the Sales Order is happening in
https://github.com/SAP/cloud-espm-v2/blob/master/espm-cloud-jpa/src/main/java/com/sap/espm/model/SalesOrderHeader.java

you can use the @PrePersist tag to do some processing.

Hope that this helps

@skrishnakumar
Copy link
Contributor

closing this ticket for now

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

No branches or pull requests

2 participants