create wb-api parser

This commit is contained in:
Fiden committed 2026-07-01 03:28:17 +03:00
commit 7a78dfc7aa
61 files changed
+11245

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
FROM_START="${1:-2024-01-01}"
TO_END="${2:-2026-06-30}"
for endpoint in sales orders incomes; do
for m in $(seq 0 60); do
from=$(date -d "$FROM_START +$m month" +%F)
to=$(date -d "$from +1 month -1 day" +%F)
[[ "$from" > "$TO_END" ]] && break
[[ "$to" > "$TO_END" ]] && to="$TO_END"
echo "=== $endpoint $from -> $to ==="
php -d memory_limit=1024M artisan wb:sync --endpoint="$endpoint" --from="$from" --to="$to"
done
echo
done
php -d memory_limit=1024M artisan wb:sync --endpoint=stocks --stocks-date="$FROM_START"