@fdm-monster/server
Version:
FDM Monster is a bulk OctoPrint, Klipper, PrusaLink and BambuLab manager to set up, configure and monitor 3D printers. Our aim is to provide neat overview over your farm.
44 lines (43 loc) • 1.16 kB
JavaScript
import { BaseService } from "./base.service.js";
import { FloorPosition } from "../../entities/floor-position.entity.js";
import { PositionDto } from "../interfaces/floor.dto.js";
//#region src/services/orm/floor-position.service.ts
var FloorPositionService = class extends BaseService(FloorPosition, PositionDto) {
async create(dto) {
return super.create(dto);
}
findPosition(floorId, x, y) {
return this.repository.findOneBy({
floorId,
x,
y
});
}
/**
* Find the printer across any floor, usually to see if it has been moved elsewhere.
* @param printerId The printer which position to be looked up.
*/
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
};
}
};
//#endregion
export { FloorPositionService };
//# sourceMappingURL=floor-position.service.js.map