Operations¶
Operational workflows.
Entity Relationship Diagram¶
Entities¶
iris.domain.operations.entities
¶
Operations domain entities: PurchaseOrder, Requisition, RequestForQuote, Material, Supplier.
PurchaseOrder
¶
Bases: NamedEntity
A purchase order issued to a supplier from a specific branch.
Represents the formal commitment to buy materials from a Supplier.
The monetary breakdown (amount, tax, discount, total) mirrors the
structure of SaleOrder; line items are modelled as
PurchaseOrderItem instances.
PurchaseOrderItem
¶
A single line item within a purchase order, referencing a material and its pricing.
Requisition
¶
Bases: NamedEntity
An internal request for materials pending review and approval.
Initiates the procurement workflow. is_approved starts as
False; approval is recorded via the RequisitionApproved domain
event, which sets approved_by and approved_date in a new
immutable instance.
RequisitionItem
¶
A single material line within a requisition.
Links a Material and a requested quantity to a parent
Requisition. sequence preserves the display order of items
in the requisition form.
RequestForQuote
¶
Bases: NamedEntity
A formal request for pricing sent to a supplier.
Issued after a Requisition is approved, targeting a specific
Supplier. Triggers the RequestForQuoteIssued domain event.
Line items are modelled as RequestForQuoteItem instances.
RequestForQuoteItem
¶
A single material line within a request for quote.
Specifies the Material and quantity being priced. sequence
preserves ordering across the items of the parent
RequestForQuote.
Material
¶
Bases: NamedEntity
A consumable material or reagent used in laboratory operations.
The materials catalog. material_type classifies the item (e.g.
"reagent", "consumable"); sku and catalog_code map to
external supplier references. is_active gates whether the material
can appear in new RequisitionItem records.
Supplier
¶
Bases: NamedEntity
An external supplier from which materials are purchased.
Stores all contact and fiscal information needed to raise a
PurchaseOrder or RequestForQuote. Tax fields support local
invoicing requirements; since records the start of the commercial
relationship.
Objects¶
iris.domain.operations.objects
¶
Operations domain value objects (currently empty).
Repositories¶
iris.domain.operations.repositories
¶
Repository interfaces for the operations domain.
MaterialRepository
¶
SupplierRepository
¶
RequisitionRepository
¶
Bases: CrudRepository[Requisition]
CRUD repository for Requisition entities.
RequestForQuoteRepository
¶
Bases: CrudRepository[RequestForQuote]
CRUD repository for RequestForQuote entities.
PurchaseOrderRepository
¶
Bases: CrudRepository[PurchaseOrder]
CRUD repository for PurchaseOrder entities.
Events¶
iris.domain.operations.events
¶
Domain events for the operations bounded context.
MaterialCreated
¶
Emitted when a new material is added to the operations catalog.
MaterialDeactivated
¶
Emitted when a material is deactivated and removed from active use.
SupplierRegistered
¶
Emitted when a new supplier is registered in the system.
SupplierUpdated
¶
Emitted when a supplier's information is updated.
RequisitionCreated
¶
Emitted when a new material requisition is submitted.
RequisitionApproved
¶
Emitted when a material requisition is approved.
RequestForQuoteIssued
¶
Emitted when a request for quote is issued to a supplier.
PurchaseOrderCreated
¶
Emitted when a new purchase order is created and sent to a supplier.
PurchaseOrderReceived
¶
Emitted when materials from a purchase order are received at the laboratory.
Exceptions¶
iris.domain.operations.exceptions
¶
Exceptions for the operations domain.
OperationsError
¶
Bases: Exception
Base exception for the operations domain.
MaterialNotFoundError
¶
Bases: OperationsError
Raised when a material cannot be found by the given identifier.
SupplierNotFoundError
¶
Bases: OperationsError
Raised when a supplier cannot be found by the given identifier.
RequisitionNotFoundError
¶
Bases: OperationsError
Raised when a requisition cannot be found by the given identifier.
RequisitionAlreadyApprovedError
¶
Bases: OperationsError
Raised when attempting to approve a requisition that is already approved.
PurchaseOrderNotFoundError
¶
Bases: OperationsError
Raised when a purchase order cannot be found by the given identifier.
RequestForQuoteNotFoundError
¶
Bases: OperationsError
Raised when a request for quote cannot be found by the given identifier.