from dataclasses import dataclass
from typing import List, Optional
from q2_sdk.models.recursive_encoder import JsonSerializable
[docs]
@dataclass
class BaseAlert(JsonSerializable):
"""Base alert class with attributes that all alerts will need"""
serial: int
"""Unique alert serial number"""
description: str
"""Description of the alert; e.g. 'Card Limit Change'"""
account: Optional[str] = None
"""Account description; e.g. '0000000041 L 1001 Standard Open End'"""
account_serial: Optional[int] = None
"""Account serial number; used for ACCOUNT_SERIAL, SHARE_SERIAL, CARD_SERIAL, etc"""
serial_type: Optional[str] = None
"""Serial type; e.g. 'ACCOUNT_SERIAL' or 'CARD_SERIAL'"""
category: Optional[str] = None
"""Category code; e.g. 'DEP' or 'PMP'"""
category_serial: Optional[int] = None
"""Category serial number; e.g. 2 is Card Limit Change, 5 is Deposit Posted, etc"""
contact_method: Optional[str] = None
"""Contact method value"""
contact_address: Optional[str] = None
"""Email address or phone number"""
person_contact_serial: Optional[int] = None
"""PERSON_CONTACT_SERIAL number"""
days_before_event: Optional[int] = None
"""Number of days before event that the alert should trigger"""
[docs]
@dataclass
class TransactionAlert(BaseAlert):
"""Alert model for transaction-type alerts such as Deposit Posted"""
minimum_amount: Optional[str] = None
"""Minimum amount to trigger alert"""
maximum_amount: Optional[str] = None
"""Maximum amount to trigger alert"""
[docs]
@dataclass
class AlertType(JsonSerializable):
"""Model that describes the options available for an Alert Type"""
target_serial: int
"""Serial number of the alert type"""
description: str = ""
"""Description of the alert type; e.g. 'Card Limit Change'"""
message: str = ""
"""Default user-facing message for the alert type"""
status: str = ""
"""Status of the alert type; e.g. 'Open'"""
category: str = ""
"""Category code; e.g. 'DEP' or 'PMP'"""
channel_serial: int = 0
"""Serial number of the alert type's channel"""
account_option: bool = False
"""True if the alert type is available for Accounts, False otherwise"""
share_option: bool = False
"""True if the alert type is available for Shares, False otherwise"""
loan_option: bool = False
"""True if the alert type is available for Loans, False otherwise"""
card_option: bool = False
"""True if the alert type is available for Cards, False otherwise"""
login_option: bool = False
"""True if the alert type is available for Logins, False otherwise"""
minimum_amount_option: bool = False
"""True if alert type supports a Minimum Amount parameter, False otherwise"""
maximum_amount_option: bool = False
"""True if the alert type supports a Maximum Amount parameter, False otherwise"""
days_before_event_option: bool = False
"""True if the alert type supports a Days Before Event parameter, False otherwise"""
[docs]
@dataclass
class AlertsEnrollment(JsonSerializable):
"""Model for ALERT_ENROLLMENT search result by Person Serial"""
person_serial: int
"""Person Serial number sent in the request"""
alerts: List[BaseAlert]
"""Alerts associated with the Person Serial"""