fix: selfpayMode state vars + monolith.sh TPV port + closures report

- Add missing selfpayMode/closePin state vars in admin POS page
- Add selfpayMode/closeSessionRequiresPin/closeSessionPin to PosTerminal interface
- Fix ClosedSession type in reporting/closures to match cash-close endpoint
- Add smtpReportEmail to admin StoreSettings interface
- monolith.sh: add TPV service (port 3002), reorder ports:
  API 3000, ADMIN 3001, TPV 3002, FRONTEND 3003, STOREFRONT 3004
- Add apps/pos to install_dependencies in monolith.sh
This commit is contained in:
chattie
2026-08-23 09:41:21 +02:00
parent 57c1781789
commit 725a02527a
4 changed files with 43 additions and 16 deletions

View File

@@ -11,13 +11,14 @@ ACTION="${2:-}"
RUNTIME_ROOT="${MDV_RUNTIME_DIR:-$PROJECT_DIR/.runtime}"
RUNTIME_DIR="$RUNTIME_ROOT/$MODE"
BACKEND_PORT="${BACKEND_PORT:-3000}"
ADMIN_PORT="${ADMIN_PORT:-3001}"
TPV_PORT="${TPV_PORT:-3002}"
FRONTEND_PORT="${FRONTEND_PORT:-3003}"
ADMIN_PORT="${ADMIN_PORT:-3004}"
STOREFRONT_PORT="${STOREFRONT_PORT:-3005}"
STOREFRONT_PORT="${STOREFRONT_PORT:-3004}"
START_TIMEOUT="${START_TIMEOUT:-90}"
WATCH_INTERVAL="${WATCH_INTERVAL:-5}"
SERVICES=(backend frontend admin storefront)
SERVICES=(backend admin tpv frontend storefront)
usage() {
cat <<'EOF'
@@ -75,10 +76,11 @@ API_PUBLIC_URL="${API_PUBLIC_URL:-http://$LAN_ADDRESS:$BACKEND_PORT}"
service_port() {
case "$1" in
backend) echo "$BACKEND_PORT" ;;
frontend) echo "$FRONTEND_PORT" ;;
admin) echo "$ADMIN_PORT" ;;
storefront) echo "$STOREFRONT_PORT" ;;
backend) echo "$BACKEND_PORT" ;;
admin) echo "$ADMIN_PORT" ;;
tpv) echo "$TPV_PORT" ;;
frontend) echo "$FRONTEND_PORT" ;;
storefront) echo "$STOREFRONT_PORT" ;;
esac
}
@@ -185,7 +187,7 @@ start_infrastructure() {
install_dependencies() {
local install_command=(npm install)
[[ "$MODE" == "prod" ]] && install_command=(npm ci)
for dir in "$PROJECT_DIR" "$PROJECT_DIR/apps/admin" "$PROJECT_DIR/frontend" "$PROJECT_DIR/storefront"; do
for dir in "$PROJECT_DIR" "$PROJECT_DIR/apps/admin" "$PROJECT_DIR/apps/pos" "$PROJECT_DIR/frontend" "$PROJECT_DIR/storefront"; do
echo "[INFO] ${install_command[*]}${dir#$PROJECT_DIR/}"
(cd "$dir" && "${install_command[@]}")
done
@@ -257,6 +259,12 @@ spawn_service() {
prod:admin)
(cd "$PROJECT_DIR/apps/admin" && nohup env NEXT_PUBLIC_API_URL="$API_PUBLIC_URL" node node_modules/next/dist/bin/next start --hostname 0.0.0.0 --port "$port" >"$log" 2>&1 < /dev/null & disown; echo $! >"$pidfile")
;;
dev:tpv)
(cd "$PROJECT_DIR/apps/pos" && nohup env NEXT_PUBLIC_API_URL="$API_PUBLIC_URL" node node_modules/next/dist/bin/next dev --hostname 0.0.0.0 --port "$port" >"$log" 2>&1 < /dev/null & disown; echo $! >"$pidfile")
;;
prod:tpv)
(cd "$PROJECT_DIR/apps/pos" && nohup env NEXT_PUBLIC_API_URL="$API_PUBLIC_URL" node node_modules/next/dist/bin/next start --hostname 0.0.0.0 --port "$port" >"$log" 2>&1 < /dev/null & disown; echo $! >"$pidfile")
;;
dev:frontend)
(cd "$PROJECT_DIR/frontend" && nohup env NEXT_PUBLIC_API_URL="$API_PUBLIC_URL" node node_modules/next/dist/bin/next dev --hostname 0.0.0.0 --port "$port" >"$log" 2>&1 < /dev/null & disown; echo $! >"$pidfile")
;;
@@ -384,8 +392,10 @@ print_urls() {
Mode: $MODE
LAN IP: $LAN_ADDRESS
Customer frontend: http://$LAN_ADDRESS:$FRONTEND_PORT/
Backend (API): http://$LAN_ADDRESS:$BACKEND_PORT/health
Admin backoffice: http://$LAN_ADDRESS:$ADMIN_PORT/
POS TPV: http://$LAN_ADDRESS:$TPV_PORT/
Customer frontend: http://$LAN_ADDRESS:$FRONTEND_PORT/
SEO storefront: http://$LAN_ADDRESS:$STOREFRONT_PORT/
Backend health: http://$LAN_ADDRESS:$BACKEND_PORT/health
Swagger/OpenAPI: http://$LAN_ADDRESS:$BACKEND_PORT/docs