Feature Complete (Untested)

This commit is contained in:
2025-08-08 11:56:56 -05:00
parent 4019e921d3
commit f38eff12cd
6 changed files with 590 additions and 1 deletions

View File

@@ -323,12 +323,64 @@ shopify-price-updater/
## Available Scripts
### Immediate Execution Scripts
- `npm start` - Run the price updater (defaults to update mode for backward compatibility)
- `npm run update` - Run the price update script (explicitly set to update mode)
- `npm run rollback` - Run the price rollback script (set prices to compare-at prices)
- `npm run debug-tags` - Analyze all product tags in your store
- `npm test` - Run the test suite (if implemented)
### Scheduled Execution Scripts
- `npm run schedule-update` - Run scheduled price update (requires SCHEDULED_EXECUTION_TIME environment variable)
- `npm run schedule-rollback` - Run scheduled price rollback (requires SCHEDULED_EXECUTION_TIME environment variable)
#### Scheduling Examples
**Schedule a sale to start at 10:30 AM on December 25th:**
```bash
# Set environment variable and run
set SCHEDULED_EXECUTION_TIME=2024-12-25T10:30:00 && npm run schedule-update
```
**Schedule a sale to end (rollback) at midnight on January 1st:**
```bash
# Set environment variable and run
set SCHEDULED_EXECUTION_TIME=2025-01-01T00:00:00 && npm run schedule-rollback
```
**Schedule with specific timezone (EST):**
```bash
# Set environment variable with timezone and run
set SCHEDULED_EXECUTION_TIME=2024-12-25T10:30:00-05:00 && npm run schedule-update
```
**Using .env file for scheduling:**
```env
# Add to your .env file
SCHEDULED_EXECUTION_TIME=2024-12-25T10:30:00
OPERATION_MODE=update
TARGET_TAG=sale
PRICE_ADJUSTMENT_PERCENTAGE=10
```
Then run: `npm run schedule-update`
**Common scheduling scenarios:**
- **Black Friday sale start**: Schedule price decreases for Friday morning
- **Sale end**: Schedule rollback to original prices after promotion period
- **Seasonal pricing**: Schedule price adjustments for seasonal campaigns
- **Flash sales**: Schedule short-term promotional pricing
- **Holiday promotions**: Schedule price changes for specific holidays
**Note**: When using scheduled execution, the script will display a countdown and wait until the specified time before executing the price updates. You can cancel the scheduled operation by pressing Ctrl+C during the waiting period.
## License
This project is provided as-is for educational and commercial use. Please test thoroughly before using in production environments.