feat(notification): add target_mode enum constraint and merge register-notifications script
- Add NotificationTargetMode enum (new_users/exist_users/all_users/user_ids) - Create Alembic migrations: drop duplicate indexes, add target_mode column - Merge register-notifications.sh into dev-migrate.sh sync-notifications subcommand - Shorten notification config path: static/notification/notifications -> static/notifications - Update registration flow to dispatch notifications by target_mode - Add is_first_registration to RegisterBonusResult for first-time user detection - Remove dead code: link_published_notifications_to_user - Update welcome_points.yaml to target new_users only - Add 44 unit tests + 1 integration test, all passing
This commit is contained in:
@@ -6,12 +6,13 @@ ENV_FILE="$ROOT_DIR/.env"
|
||||
ENV_LOADER="$ROOT_DIR/infra/scripts/lib/env.sh"
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 {migrate|init-data|bootstrap}"
|
||||
echo "Usage: $0 {migrate|init-data|sync-notifications|bootstrap}"
|
||||
echo ""
|
||||
echo "Commands:"
|
||||
echo " migrate Run database migrations only"
|
||||
echo " init-data Initialize seed data only"
|
||||
echo " bootstrap Run migrations + init-data"
|
||||
echo " migrate Run database migrations only"
|
||||
echo " init-data Initialize seed data only"
|
||||
echo " sync-notifications Sync static notification configs to DB"
|
||||
echo " bootstrap Run migrations + init-data + sync-notifications"
|
||||
echo ""
|
||||
echo "Note: Requires redis service running (docker compose up -d redis)"
|
||||
exit 1
|
||||
@@ -37,6 +38,11 @@ case "${1:-}" in
|
||||
echo "=== Running Init Data ==="
|
||||
PYTHONPATH=backend/src uv run python -m core.runtime.cli init-data
|
||||
;;
|
||||
sync-notifications)
|
||||
shift
|
||||
echo "=== Running Sync Notifications ==="
|
||||
PYTHONPATH=backend/src uv run python -m core.runtime.cli sync-notifications "$@"
|
||||
;;
|
||||
bootstrap)
|
||||
echo "=== Running Bootstrap ==="
|
||||
PYTHONPATH=backend/src uv run python -m core.runtime.cli bootstrap
|
||||
|
||||
Reference in New Issue
Block a user