github-actions[bot]
Automated deployment from GitHub Actions: a9d5a91de63ad7224bafe6039fb2b7479388fbf4
0a8c81b Download test_epic10.py from VLTA-AI/dropshop: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/VLTA-AI/dropshop/resolve/main/test_epic10.py
- Command line
-
hf download hf://spaces/VLTA-AI/dropshop/test_epic10.py
-
curl -L -o test_epic10.py https://huggingface.co/spaces/VLTA-AI/dropshop/resolve/main/test_epic10.py
1.1 kB
| import os | |
| import uuid | |
| from sqlmodel import select | |
| from src.models.database import get_session | |
| from src.models.product_idea import ProductIdea | |
| from src.models.customer_order import CustomerOrder, OrderStatus | |
| session = next(get_session()) | |
| # 1. Update the existing product idea with a mock supplier_url | |
| product_id = '9c2f0357-b690-4392-ac2f-67a5850a7bc2' | |
| idea = session.exec(select(ProductIdea).where(ProductIdea.id == product_id)).first() | |
| if idea: | |
| idea.supplier_url = "https://detail.1688.com/offer/88888888.html" | |
| session.add(idea) | |
| print("Updated ProductIdea with supplier_url.") | |
| else: | |
| print("ProductIdea not found.") | |
| # 2. Create a mock order | |
| order_id = str(uuid.uuid4()) | |
| order = CustomerOrder( | |
| id=order_id, | |
| customer_email="test@example.com", | |
| stripe_session_id="cs_test_xxx", | |
| shopify_order_id="1001", | |
| amount_usd=39.99, # Safe amount | |
| source_platform="1688", | |
| status=OrderStatus.RECEIVED, | |
| shopify_sku=product_id, | |
| quantity=1, | |
| mapped_1688_variant_id=product_id | |
| ) | |
| session.add(order) | |
| session.commit() | |
| print(f"Created Mock Order ID: {order_id}") | |