Add sale management feature for admin panel

- Add database migration for sale fields (percentage, active, dates)
- Update API to handle sale operations and bulk updates
- Create SaleManager component for admin interface
- Update FilamentTableV2 to display sale prices on frontend
- Add sale column in admin dashboard
- Implement sale price calculations with strikethrough styling
This commit is contained in:
DaX
2025-07-05 14:48:31 +02:00
parent c0682e1969
commit 0df9d5d294
10 changed files with 354 additions and 5 deletions

39
scripts/deploy-api-update.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
echo "Deploying API update to EC2 instance..."
# Get instance ID
INSTANCE_ID="i-03956ecf32292d7d9"
# Create update script
cat > /tmp/update-api.sh << 'EOF'
#!/bin/bash
cd /home/ubuntu/filamenteka-api
# Backup current server.js
cp server.js server.js.backup
# Download the updated server.js from GitHub
curl -o server.js https://raw.githubusercontent.com/daxdax89/Filamenteka/sale/api/server.js
# Restart the service
sudo systemctl restart node-api
echo "API server updated and restarted"
EOF
# Send command to EC2 instance
aws ssm send-command \
--region eu-central-1 \
--instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunShellScript" \
--parameters "commands=[
'cd /home/ubuntu/filamenteka-api',
'cp server.js server.js.backup',
'curl -o server.js https://raw.githubusercontent.com/daxdax89/Filamenteka/sale/api/server.js',
'sudo systemctl restart node-api',
'sudo systemctl status node-api'
]" \
--output json
echo "Command sent. Check AWS Systems Manager for execution status."