from __future__ import annotations
from onegov.core.orm.mixins import content_property, dict_property
from onegov.recipient import GenericRecipient, GenericRecipientCollection
from typing import TYPE_CHECKING
if TYPE_CHECKING:
    from sqlalchemy.orm import Session
[docs]
class ResourceRecipient(GenericRecipient):
[docs]
    __mapper_args__ = {'polymorphic_identity': 'resource'} 
[docs]
    daily_reservations: dict_property[bool | None] = content_property() 
[docs]
    new_reservations: dict_property[bool | None] = content_property() 
[docs]
    customer_messages: dict_property[bool | None] = content_property() 
[docs]
    internal_notes: dict_property[bool | None] = content_property() 
[docs]
    send_on: dict_property[list[str] | None] = content_property() 
[docs]
    rejected_reservations: dict_property[bool | None] = content_property() 
[docs]
    resources: dict_property[list[str] | None] = content_property() 
 
[docs]
class ResourceRecipientCollection(
    GenericRecipientCollection[ResourceRecipient]
):
    def __init__(self, session: Session) -> None:
        super().__init__(session, type='resource')