package service;

import JDBC.ParkingSpotJDBC;
import pojo.ParkingSpot;

import java.util.List;

public class ParkingSpotService {
    ParkingSpotJDBC db = new ParkingSpotJDBC();
    public void occupySpot(int spot_id) throws Exception {
        db.setSpotStatus(spot_id);
    }

    public void releaseSpot(int spot_id) throws Exception {
        db.resetSpotStatus(spot_id);
    }

    public List<ParkingSpot> getAllSpots() throws Exception {
        return db.selectAllSpots();
    }
    public ParkingSpot getParkingSpot(int spot_id) throws Exception {
        return db.getSpot(spot_id);

    }
}



