"""Hypothesis strategies for pyfortis property-based testing."""

from __future__ import annotations

from hypothesis import strategies as st

from pyfortis._types import Order, Position, Side


orders = st.builds(
    Order,
    order_id=st.text(min_size=1, max_size=20, alphabet="abcdefghijklmnopqrstuvwxyz0123456789-"),
    instrument=st.sampled_from(["AAPL", "GOOGL", "MSFT", "TSLA", "AMZN"]),
    side=st.sampled_from([Side.BUY, Side.SELL]),
    quantity=st.floats(min_value=1, max_value=100000, allow_nan=False, allow_infinity=False),
    price=st.floats(min_value=0.01, max_value=10000.0, allow_nan=False, allow_infinity=False),
    portfolio=st.just("default"),
)

positions = st.builds(
    Position,
    instrument=st.sampled_from(["AAPL", "GOOGL", "MSFT", "TSLA", "AMZN"]),
    quantity=st.floats(min_value=-10000, max_value=10000, allow_nan=False, allow_infinity=False),
    avg_price=st.floats(min_value=0.01, max_value=10000.0, allow_nan=False, allow_infinity=False),
    current_price=st.floats(min_value=0.01, max_value=10000.0, allow_nan=False, allow_infinity=False),
    portfolio=st.just("default"),
)

returns_data = st.lists(
    st.floats(min_value=-0.5, max_value=0.5, allow_nan=False, allow_infinity=False),
    min_size=0,
    max_size=100,
)
