title: Stock Oversell in ExpressJs
body: <p>I have been building authentication software for group owners for over a year now, and it is purpose is to add stock to the product and release a drop that a lot of people would try to cop it before it gets OOS (Out Of Stock) I have tried express-queue, express-enqueue and many more like it to ensure only certain people gets the product and not oversell but nothing have worked for me as it either oversell or just loops around using those modules and never goes to the checkout page, what is the best way to do like a stock management tool where it only sells what is set and doesn't oversell, keep in mind i use Stripe Checkout</p>
  <pre><code>app.post(&quot;/chargestripe&quot;, queueStock.getMiddleware(), urlEncoded, async (req, res) =&gt; {
    sql.query(`SELECT * FROM admins;`, (errMysql, resMysql) =&gt; {
      (async () =&gt; {
      const session = await stripe.checkout.sessions.create({
        payment_method_types: ['card'],
        subscription_data: {
          items: [{
            plan: resMysql[0].plan_id,
          }],
          trial_from_plan: true,
        },
        billing_address_collection: 'required',
        success_url: `http://localhost/success?session_id={CHECKOUT_SESSION_ID}`,
        cancel_url: `http://localhost/cancel`,
      });
      io.of('/dashboard').emit('valid', {
          session: session.id
      });
      })();
    });
  });
  </code></pre>
  <p>The point of this is once someone click purchase it creates a session and then redirects him to the purchase page if it was successful it redirects him to the success page and proceed by giving him his membership else it will just go to the <code>/cancel</code> page, my Database has a column  called <code>key_stock</code> which is basically an <code>INT</code> that represents the stock and if there is a way to fix such issue i would really appreciate it as it has been like this all the time and I couldn't find a solution what-so-ever thank you.</p>