feat: Add Findagram and FindADispo consumer frontends
- Add findagram.co React frontend with product search, brands, categories - Add findadispo.com React frontend with dispensary locator - Wire findagram to backend /api/az/* endpoints - Update category/brand links to route to /products with filters - Add k8s manifests for both frontends - Add multi-domain user support migrations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
77
findadispo/backend/models.py
Normal file
77
findadispo/backend/models.py
Normal file
@@ -0,0 +1,77 @@
|
||||
from sqlalchemy import Column, Integer, String, Float, Boolean, DateTime, ForeignKey, Text, JSON
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.sql import func
|
||||
from database import Base
|
||||
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = "users"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
email = Column(String(255), unique=True, index=True, nullable=False)
|
||||
hashed_password = Column(String(255), nullable=False)
|
||||
full_name = Column(String(255))
|
||||
phone = Column(String(50))
|
||||
default_location = Column(String(255))
|
||||
is_active = Column(Boolean, default=True)
|
||||
is_verified = Column(Boolean, default=False)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
# Notification preferences
|
||||
notify_price_alerts = Column(Boolean, default=True)
|
||||
notify_new_dispensaries = Column(Boolean, default=False)
|
||||
notify_weekly_digest = Column(Boolean, default=True)
|
||||
notify_promotions = Column(Boolean, default=False)
|
||||
|
||||
# Relationships
|
||||
saved_searches = relationship("SavedSearch", back_populates="user", cascade="all, delete-orphan")
|
||||
alerts = relationship("PriceAlert", back_populates="user", cascade="all, delete-orphan")
|
||||
|
||||
|
||||
class SavedSearch(Base):
|
||||
__tablename__ = "saved_searches"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
|
||||
name = Column(String(255), nullable=False)
|
||||
query = Column(String(255))
|
||||
filters = Column(JSON) # Store filters as JSON
|
||||
results_count = Column(Integer, default=0)
|
||||
last_used = Column(DateTime(timezone=True), server_default=func.now())
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
# Relationship
|
||||
user = relationship("User", back_populates="saved_searches")
|
||||
|
||||
|
||||
class PriceAlert(Base):
|
||||
__tablename__ = "price_alerts"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
|
||||
product_name = Column(String(255), nullable=False)
|
||||
dispensary_id = Column(Integer)
|
||||
dispensary_name = Column(String(255))
|
||||
target_price = Column(Float, nullable=False)
|
||||
current_price = Column(Float)
|
||||
is_active = Column(Boolean, default=True)
|
||||
is_triggered = Column(Boolean, default=False)
|
||||
triggered_at = Column(DateTime(timezone=True))
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
# Relationship
|
||||
user = relationship("User", back_populates="alerts")
|
||||
|
||||
|
||||
class ContactMessage(Base):
|
||||
__tablename__ = "contact_messages"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
name = Column(String(255), nullable=False)
|
||||
email = Column(String(255), nullable=False)
|
||||
subject = Column(String(255))
|
||||
message = Column(Text, nullable=False)
|
||||
is_read = Column(Boolean, default=False)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
Reference in New Issue
Block a user