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

Use case: As a system I want to process all the PO events, validate, trigger new business rules and update database accordingly #27

Open
juanfranblanco opened this issue Feb 11, 2020 · 0 comments

Comments

@juanfranblanco
Copy link
Member

juanfranblanco commented Feb 11, 2020

Description:
When an Purchase Order is created and / or updated a backend processing job will be pulling for events to update the internal storage of the different changes, and / or message queue other services for further processing business logic.

Business process(es)

  • Any purchase order / linked to a quote will need to be re validated and flag accordingly in case of internal issues
  • Stock will need to be allocated accordingly (if not done already) for example anyone interacting with the smart contracts directly.
  • Notifications might need to be send (users email), delivery etc.
  • Drop-shipping integration
  • Fund management
    • Release of funds when user happy with delivery
    • Release of funds when accepted cancellation (if further validation is needed)

Storage

  • Purchase orders (Change of State)
  • Quote (basket) transaction confirmed / linked to a Purchase Order.
  • Images (if any image is referenced on a purchase order, they may required to be published or format in IPFS)

Reference architecture

Web Job in Ujo backend
The usage of web jobs provides a simple way to manage, scale and error reporting. Nethereum processing based can be hooked up into web jobs to either run locally the business logic and queue further work to other "micro services".

Web job Processing Job: https://github.com/Nethereum/ujo-backend/tree/master/Ujo.Work/Ujo.WorkRegistry.WebJob
Web job Singleton: https://github.com/Nethereum/ujo-backend/blob/master/Ujo.Work/Ujo.WorkRegistry.WebJob/Functions.cs#L23
Configuration: https://github.com/Nethereum/ujo-backend/blob/master/Ujo.Work/Ujo.WorkRegistry.WebJob/ConfigurationSettings.cs

IPFS Image Processing
On disputes there might be a need to upload images that will required further processing to scale / display on UI
https://github.com/Nethereum/ujo-backend/blob/master/Ujo.Work/Ujo.Work.WebJob/Functions.cs#L22

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

No branches or pull requests

1 participant