reactioncommerce / kinetic

Kinetic introduces a suite of opinionated admin tools that internal teams can use to manage and run their stores on Open Commerce.
Apache License 2.0
7 stars 3 forks source link

Promotions: Notifications or alerts about jobs that may be processing #180

Open node82 opened 1 year ago

node82 commented 1 year ago

When a Promotion is enabled, it takes a little while to show as Active it does show in the upcoming tab as enabled but does take awhile before showing in the active tab with no indication that anything is processing.

it shows once a batch job is performed: (reaction api) INFO @reactioncommerce/api-plugin-promotions: Completed processing batch of cart promotion checks (totalModified=0, totalUnchanged=1, numberOfCarts=1, version=0.0.0, file=checkCartForPromotionChange.js)

it may be helpful to communicate on the front end kinetic UX to the operator that it is processing. Like an alert, or status notification that a job is processing , has an error, and or has completed.

brent-hoover commented 1 year ago

@node82 I think the idea here is that normally you are creating promotions before the time not enabling them in real time. Is this an actual use case of creating a promotion that needs to be enabled in real time?

@vannguyenn @vanpho93 any ideas on an easy way to implement this?

vannguyenn commented 1 year ago

If I understand correctly, we want KInetic to show the jobs running on the server related to the Promotions. I think firstly we need to create an API endpoint to check if there is any running process and then use polling or websocket to request the API endpoint to show the alert on the client (Kinetic)

node82 commented 1 year ago

that is true. in most cases you would set them up in advance, and schedule them for a later date. it was just the experience when pushing a promotion live intraday, or on short scheduled notice, which does occur from time to time, if i recall maybe once or twice a month depending upon the promotion.