felicity-lims/felicity/apps/instrument/repository.py

54 lines
1.5 KiB
Python
Raw Normal View History

2024-07-21 21:44:22 +08:00
from felicity.apps.abstract import BaseRepository
2024-07-28 03:52:31 +08:00
from felicity.apps.instrument.entities import (CalibrationCertificate,
Instrument,
InstrumentCalibration,
InstrumentCompetence,
InstrumentType,
LaboratoryInstrument, Method)
2024-07-21 15:06:51 +08:00
SEQUENCE_BEGIN = 5
SEQUENCE_CUTOFF = 10
2024-07-21 21:44:22 +08:00
class MethodRepository(BaseRepository[Method]):
2024-07-21 15:06:51 +08:00
def __init__(self) -> None:
2024-07-21 21:44:22 +08:00
super().__init__(Method)
2024-07-21 15:06:51 +08:00
2024-07-28 03:52:31 +08:00
2024-07-21 21:44:22 +08:00
class InstrumentRepository(BaseRepository[Instrument]):
2024-07-21 15:06:51 +08:00
def __init__(self) -> None:
2024-07-21 21:44:22 +08:00
super().__init__(Instrument)
2024-07-21 15:06:51 +08:00
2024-07-28 03:52:31 +08:00
2024-07-21 21:44:22 +08:00
class LaboratoryInstrumentRepository(
BaseRepository[LaboratoryInstrument],
):
2024-07-28 03:52:31 +08:00
def __init__(
self,
):
2024-07-21 21:44:22 +08:00
super().__init__(LaboratoryInstrument)
2024-07-21 15:06:51 +08:00
2024-07-28 03:52:31 +08:00
class InstrumentTypeRepository(BaseRepository[InstrumentType]):
2024-07-21 15:06:51 +08:00
def __init__(self) -> None:
2024-07-21 21:44:22 +08:00
super().__init__(InstrumentType)
2024-07-21 15:06:51 +08:00
2024-07-28 03:52:31 +08:00
class InstrumentCalibrationRepository(BaseRepository[InstrumentCalibration]):
2024-07-21 15:06:51 +08:00
def __init__(self) -> None:
2024-07-21 21:44:22 +08:00
super().__init__(InstrumentCalibration)
2024-07-21 15:06:51 +08:00
2024-07-28 03:52:31 +08:00
class CalibrationCertificateRepository(BaseRepository[CalibrationCertificate]):
2024-07-21 15:06:51 +08:00
def __init__(self) -> None:
2024-07-21 21:44:22 +08:00
super().__init__(CalibrationCertificate)
class InstrumentCompetenceRepository(
BaseRepository[InstrumentCompetence],
):
2024-07-28 03:52:31 +08:00
def __init__(
self,
):
2024-07-21 21:44:22 +08:00
super().__init__(InstrumentCompetence)