2021年2月9日星期二

Order/payments/bank details/ database design modeling

everyone. I am building a web app for a local client in which users will buy a product. To buy a product users will have to choose a package from available packages eg standard package, and installment package. If the user chooses a standard package, he will have to pay the total price of the product and if the user chooses an installment package, he will have to pay on monthly basis or you can say in installments. It means if the user chooses the installment package then there will be columns likes no of remaining installments, no of paid installments, total paid amount, and the remaining amount somewhere in the databse. All payments will be manual since this is the first phase of the app. Here manual means that the user will transfer product amount to the bank, which has been already mentioned by admin. After the transaction, he will enter the paid amount, transaction id, and other bank details from which he has already sent money to the admin bank account. Admin will verify this transaction detail from his end. First let's consider the installment package. If the user pays a monthly installment, he will see a recent payment record on one side of the order page. The record will contain columns like payment_id , transaction id, bank name, paid amount, etc. The tables I have designed are something like this.

 packages_table   --------------   pak_id     package_name      order_table  -----------  order_id    pak_id    product_id    order_status    created_at        payment_detail  --------------  payment_id    order_id    paid_amount    payment_status         bank_detail  -----------  bank_id    payment_id    bank_name    transaction_id    

Now my questions are as follows

  • Is this design/model is acceptable?
  • If the user chooses an installment package then where I should place columns like no of remaining installments, paid installments, total paid amount, and remaining amount.
  • if the user chooses a standard package then where should I place paid amount column?
  • should I create two different tables? one for installment and the other for standard packages?
  • how to normalize this design
https://stackoverflow.com/questions/66130727/order-payments-bank-details-database-design-modeling February 10, 2021 at 11:58AM

没有评论:

发表评论