92 lines
2.7 KiB
Python
92 lines
2.7 KiB
Python
import uuid
|
|
from datetime import datetime
|
|
from typing import Optional, Dict, Any
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
from app.services.pricing import default_service_pricing
|
|
|
|
|
|
class SiteSettingsBase(BaseModel):
|
|
site_name: str = ""
|
|
tagline: Optional[str] = None
|
|
logo_url: Optional[str] = None
|
|
footer_text: Optional[str] = None
|
|
social_links: Dict[str, Any] = {}
|
|
automatic_member_notifications_enabled: bool = True
|
|
nz_public_holiday_notifications_enabled: bool = True
|
|
invoice_reminder_notifications_enabled: bool = True
|
|
invoice_day_of_week: int = 1
|
|
bookings_enabled: bool = True
|
|
walks_enabled: bool = True
|
|
messages_enabled: bool = True
|
|
two_factor_enabled: bool = True
|
|
audit_history_enabled: bool = True
|
|
experiments_enabled: bool = True
|
|
|
|
|
|
class SiteSettingsUpdate(BaseModel):
|
|
site_name: Optional[str] = None
|
|
tagline: Optional[str] = None
|
|
logo_url: Optional[str] = None
|
|
footer_text: Optional[str] = None
|
|
social_links: Optional[Dict[str, Any]] = None
|
|
automatic_member_notifications_enabled: Optional[bool] = None
|
|
nz_public_holiday_notifications_enabled: Optional[bool] = None
|
|
invoice_reminder_notifications_enabled: Optional[bool] = None
|
|
invoice_day_of_week: Optional[int] = None
|
|
bookings_enabled: Optional[bool] = None
|
|
walks_enabled: Optional[bool] = None
|
|
messages_enabled: Optional[bool] = None
|
|
two_factor_enabled: Optional[bool] = None
|
|
audit_history_enabled: Optional[bool] = None
|
|
experiments_enabled: Optional[bool] = None
|
|
|
|
|
|
class FeatureSettingsBase(BaseModel):
|
|
bookings_enabled: bool = True
|
|
walks_enabled: bool = True
|
|
messages_enabled: bool = True
|
|
two_factor_enabled: bool = True
|
|
audit_history_enabled: bool = True
|
|
experiments_enabled: bool = True
|
|
|
|
|
|
class FeatureSettingsUpdate(BaseModel):
|
|
bookings_enabled: Optional[bool] = None
|
|
walks_enabled: Optional[bool] = None
|
|
messages_enabled: Optional[bool] = None
|
|
two_factor_enabled: Optional[bool] = None
|
|
audit_history_enabled: Optional[bool] = None
|
|
experiments_enabled: Optional[bool] = None
|
|
|
|
|
|
class FeatureSettingsResponse(FeatureSettingsBase):
|
|
pass
|
|
|
|
|
|
class ServicePricingSettingsResponse(BaseModel):
|
|
service_pricing: Dict[str, Any] = Field(default_factory=default_service_pricing)
|
|
|
|
|
|
class ServicePricingSettingsUpdate(BaseModel):
|
|
service_pricing: Dict[str, Any]
|
|
|
|
|
|
class PlannerWeatherDay(BaseModel):
|
|
code: int
|
|
max: int
|
|
min: int
|
|
|
|
|
|
class PlannerWeatherResponse(BaseModel):
|
|
fetched_at: datetime
|
|
weather: Dict[str, PlannerWeatherDay]
|
|
|
|
|
|
class SiteSettingsResponse(SiteSettingsBase):
|
|
id: uuid.UUID
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|