"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "FloorPositionService", {
    enumerable: true,
    get: function() {
        return FloorPositionService;
    }
});
const _floorpositionentity = require("../../entities/floor-position.entity");
const _baseservice = require("./base.service");
const _floordto = require("../interfaces/floor.dto");
class FloorPositionService extends (0, _baseservice.BaseService)(_floorpositionentity.FloorPosition, _floordto.PositionDto) {
    constructor({ typeormService }){
        super({
            typeormService
        });
    }
    async create(dto) {
        return super.create(dto);
    }
    findPosition(floorId, x, y) {
        return this.repository.findOneBy({
            floorId,
            x,
            y
        });
    }
    findPrinterPosition(printerId) {
        return this.repository.findOneBy({
            printerId
        });
    }
    deletePrinterPositionsByPrinterId(printerId) {
        return this.repository.delete({
            printerId
        });
    }
    findPrinterPositionOnFloor(floorId, printerId) {
        return this.repository.findOneBy({
            floorId,
            printerId
        });
    }
    toDto(entity) {
        return {
            x: entity.x,
            y: entity.y,
            printerId: entity.printerId,
            floorId: entity.floorId
        };
    }
}

//# sourceMappingURL=floor-position.service.js.map