from django.db import models
from adminapp.models  import User,bike

# Create your models here.

class BikeRent(models.Model):
    user = models.ForeignKey(User,on_delete=models.CASCADE)
    bike = models.ForeignKey(bike,on_delete=models.CASCADE)
    start_time = models.DateTimeField(auto_now_add=True)
    end_time = models.DateTimeField(null=True,blank=True)
    created_at = models.DateTimeField(auto_now_add=True)
    is_returned = models.BooleanField(default=False)
    addhar_image = models.ImageField(upload_to='bikers_addhar')
    is_paid = models.BooleanField(default=False)
    price = models.FloatField(null=True,blank=True)
    payment_mode = models.CharField(max_length=255,null=True,blank=True)

# models.py

class Payment(models.Model):
    razorpay_order_id = models.CharField(max_length=255)
    razorpay_payment_id = models.CharField(max_length=255)
    razorpay_signature = models.CharField(max_length=255)
    verified = models.BooleanField(default=False)
    created_at = models.DateTimeField(auto_now_add=True)



