import fuelPumpModel from "./fuelPump.model"

export class FuelPumpService {

    async getAll() {
        return await fuelPumpModel.find();
    }

    async getById(
        id:string
    ){
        return await fuelPumpModel.findById(
            id
        );
    }

    async create(
        data:any
    ){
        return await fuelPumpModel.create(
            data
        );
    }

    async update(
        id:string,
        data:any
    ){
        return await fuelPumpModel.findByIdAndUpdate(
            id,
            data,
            {
                new:true
            }
        );
    }

    async delete(
        id:string
    ){
        return await fuelPumpModel.findByIdAndDelete(
            id
        );
    }
}

