title: Suggestion on a subscription based database schema
body: <p>I'm creating a subscription based service with payment gateway, discounts and other feature. I am stuck at a point on how to manage the subscriptions, transactions and invoice.</p>
  
  <p><strong>My tables are:</strong> (I've listed only the relevant tables below )</p>
  
  <ul>
  <li>users</li>
  <li>packages (package_id being the P.K )</li>
  <li>subscriptions</li>
  <li>transactions</li>
  <li>transaction_details</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/5sWX8.png" alt="DB Schema"></p>
  
  <p>Using the above structure I won't be able to create/ store the invoice, won't be able to apply any discount for the subscription and difficult to manage any refund/ cancellation. </p>
  
  <p>Any suggestions to improve the structure would be highly appreciated. </p>