I’d setup the data structure like this

cart
cart items
discount codes

discount codes would have:
type - free shipping, percentage, fixed price etc
value
orders_count
max uses (all customers)
expiry date
one time (per customer)
status - active, inactive, expired
code
product categories (used to filter products if needed)

when add discount to order then lookup the discount to see if it is valid - I’d just use a status and expiry here
if valid then apply the discount to the order - here you’d have front end custom events filtered to the type of discount
if invalid show error

in the backend each time an order is processed I’d update the discount code properties and status
also have an expiry workflow here to change the status once the discount expires

in terms of updating the cart items, you could do this on the front end since the cart items would likely be less than 100 so a change list of things would work fine

I generally try to avoid “terminate” as it just feels unnecessary if you have the right conditions on custom events

you could do this
event - terminate - event - terminate - event
but that involves checking conditions 5 times so it’s less wu to do
event - event - event
ie 3 conditions to check

the only time a terminate would be more efficient is if the conditions to check after it are heavy - but most conditions I use are aggregate count > 0 or existing page data conditions which are very lightweight.