"""AwsPricing model."""

import uuid
from sqlalchemy import Column, String, DECIMAL, Boolean, Date, Text
from sqlalchemy.dialects.postgresql import UUID

from src.models.base import Base


class AwsPricing(Base):
    """AWS service pricing model."""

    __tablename__ = "aws_pricing"

    id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
    service = Column(String(50), nullable=False, index=True)
    region = Column(String(50), nullable=False, index=True)
    tier = Column(String(50), default="standard", nullable=False)
    price_per_unit = Column(DECIMAL(15, 10), nullable=False)
    unit = Column(String(20), nullable=False)
    effective_from = Column(Date, nullable=False)
    effective_to = Column(Date, nullable=True)
    is_active = Column(Boolean, default=True, nullable=False)
    source_url = Column(String(500), nullable=True)
    description = Column(Text, nullable=True)
