func (p *postgres) InsertLaptopRestriction(lr *models.LaptopRestrictions) error {
	ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
	defer cancel()

	query := `INSERT INTO laptop_restrictions (start_date, end_date, laptop_id, reservation_id,
			  created_at, updated_at, restriction_id)
			  VALUES ($1, $2, $3, $4, $5, $6, $7)`
	_, err := p.DB.ExecContext(ctx, query,
		lr.StartDate,
		lr.EndDate,
		lr.LaptopID,
		lr.ReservationID,
		time.Now(),
		time.Now(),
		lr.RestrictionID)
	if err != nil {
		return err
	}

	return nil
}
// InsertLaptopRestriction inserts a laptop restriction into the database
InsertLaptopRestriction inserts a laptop restriction into the database
// InsertLaptopRestriction inserts a laptop restriction into the database
func (p *postgres) InsertLaptopRestriction(lr *models.LaptopRestrictions) error {
	ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
	defer cancel()
	query := `INSERT INTO laptop_restrictions (start_date, end_date, laptop_id, reservation_id,
			  created_at, updated_at, restriction_id)
			  VALUES ($1, $2, $3, $4, $5, $6, $7)`
	_, err := p.DB.ExecContext(ctx, query,
		lr.StartDate,
		lr.EndDate,
		lr.LaptopID,
		lr.ReservationID,
		time.Now(),
		time.Now(),
		lr.RestrictionID)
	if err != nil {
		return err
	}
	return nil
}
func ( p * postgres ) InsertLaptopRestriction ( lr * models . LaptopRestrictions ) error { ctx , cancel := context . WithTimeout ( context . Background ( ) , 3 * time . Second ) defer cancel ( ) query := `INSERT INTO laptop_restrictions (start_date, end_date, laptop_id, reservation_id,
			  created_at, updated_at, restriction_id)
			  VALUES ($1, $2, $3, $4, $5, $6, $7)` _ , err := p . DB . ExecContext ( ctx , query , lr . StartDate , lr . EndDate , lr . LaptopID , lr . ReservationID , time . Now ( ) , time . Now ( ) , lr . RestrictionID ) if err != nil { return err } return nil }
InsertLaptopRestriction inserts a laptop restriction into the database
InsertLaptopRestriction inserts a laptop restriction into the database