Spaces:
Running
Running
File size: 1,413 Bytes
9fd3989 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #!/bin/bash
echo "π POS Seed Data Quick Setup"
echo "================================"
# Check if we're in the right directory
if [ ! -f "create_seed_data_simple.py" ]; then
echo "β Please run this script from the cuatrolabs-pos-ms directory"
echo "Usage: cd cuatrolabs-pos-ms && bash quick_setup.sh"
exit 1
fi
echo "π Current directory: $(pwd)"
echo "β
In correct directory"
# Check dependencies
echo ""
echo "π Checking dependencies..."
python -c "import motor, asyncpg, dotenv" 2>/dev/null
if [ $? -eq 0 ]; then
echo "β
All dependencies available"
else
echo "β Missing dependencies. Installing..."
pip install -r seed_requirements.txt
fi
# Create seed data
echo ""
echo "π Creating seed data in MongoDB..."
python create_seed_data_simple.py
if [ $? -eq 0 ]; then
echo "β
Seed data created successfully"
else
echo "β Failed to create seed data"
exit 1
fi
# Sync to PostgreSQL
echo ""
echo "π Syncing to PostgreSQL..."
python simple_sync.py
if [ $? -eq 0 ]; then
echo "β
Sync completed successfully"
else
echo "β Sync failed"
exit 1
fi
# Verify data
echo ""
echo "π Verifying data..."
python verify_seed_data.py
echo ""
echo "π Setup complete!"
echo "================================"
echo "Merchant ID: company_cuatro_beauty_ltd"
echo "Data created: Staff, Services, Customers"
echo "Databases: MongoDB + PostgreSQL" |