Aye Aye Aung #112
openBuy Election Package By User
100%
Description
To implement a "buy package by user" functionality, you'll need a mechanism to allow users to purchase a pricing package, associate the package with the user, and store the relevant details in the database.
user_packages_tbl
id (BIGINT UNSIGNED)
user_id (BIGINT UNSIGNED) <- foreign key
package_id (BIGINT UNSIGNED) <- foreign key
start_date (TIMESTAMP)
end_date (TIMESTAMP)
status (ENUM('new', 'used'))
created_at (TIMESTAMP)
updated_at (TIMESTAMP)
Updated by Aye Aye Aung 11 months ago
Buy package data explanation:
User 1 (AAA):
Package: Free Package (Package 1)
Start Date: Current timestamp (NOW())
End Date: 1 year from the start date (DATE_ADD(NOW(), get data from setting table))
Status: 'new' (not used yet)
User 2 (BBB):
Package: Standard Package (Package 2)
Start Date: Current timestamp (NOW())
End Date: 1 year from the start date (DATE_ADD(NOW(), get data from setting table))
Status: 'new' (not used yet)
User 3 (CCC):
Package: Premium Package (Package 3)
Start Date: Current timestamp (NOW())
End Date: 1 year from the start date (DATE_ADD(NOW(), get data from setting table))
Status: 'used'