Hi Mohsin,
I would suggest a different flow to calculate that numberReservationSpotsRemaining attribute so that it will be more reliable and accurate.
Whenever a reservation is confirmed, you should create an object called Reservation which has a boolean attribute called isConfirmed and a dateTime attribute called ReservationDate. Whenever a user confirms a reservation this object will be created and associated to them.
On this object, you can have an after commit event which retrieves all the confirmed Reservation objects for the given dateTime and counts them. The numberReservationSpotsRemaining can be set by subtracting the confirmed count from the total available reservations on the given date. This way you can be sure that the remaining count is always accurate.
Note, for the example above I used date to filter the reservation objects but if the reservations are associated to a specific event object, then you could use that association, in addition to the confirmed boolean, to retrieve all the objects that should be counted as reservations.
You will also need to add a way to handle if the remainingReservationSpotsRemaining ever gets to 0.
There are more plenty more potential features to improve your user experience, depending on your use case, but I hope this gets you going in the right direction!