| Server IP : 216.92.14.13 / Your IP : 216.73.217.126 Web Server : Apache System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 User : rmlac2fmr ( 1040637) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/home/rmlac2fmr/ |
Upload File : |
#!/usr/bin/env python3
"""
JBT Travel Ops — Duncan Chinnock Profile Diagnosis
"""
import json
import os
import sys
candidates = [
'db.json',
'./data/db.json',
os.path.expanduser('~/public_html/jn.com/ops/data/db.json')
]
db_path = next((c for c in candidates if os.path.exists(c)), None)
if not db_path:
print("ERROR: Could not find db.json")
sys.exit(1)
with open(db_path, 'r') as f:
db = json.load(f)
print(f"Reading: {db_path}\n")
# Find Chinnock person(s)
persons = [p for p in db.get('persons', [])
if 'chinnock' in (p.get('lastName','') or '').lower()
or 'chinnock' in (p.get('firstName','') or '').lower()]
print("=" * 70)
print(f"PERSON PROFILES — {len(persons)} found")
print("=" * 70)
for p in persons:
print(f"\n--- ID: {p.get('id')} ---")
for k, v in p.items():
if v not in (None, '', [], {}, False):
print(f" {k}: {v}")
person_ids = {p.get('id') for p in persons}
# Find all linked records
print("\n" + "=" * 70)
print("TRAVEL REQUESTS LINKED TO EITHER PROFILE")
print("=" * 70)
reqs = []
for r in db.get('travelRequests', []):
if r.get('personId') in person_ids \
or 'chinnock' in (r.get('submittedName','') or '').lower() \
or 'chinnock' in (r.get('lastName','') or '').lower():
reqs.append(r)
print(f"\nREQ ID: {r.get('id')}")
print(f" showId: {r.get('showId')}")
print(f" personId: {r.get('personId')}")
print(f" submittedName: {r.get('submittedName','')}")
print(f" submittedEmail: {r.get('submittedEmail','')}")
print(f" status: {r.get('status','')}")
print(f" travelMethod: {r.get('travelMethod','')}")
print(f" source: {r.get('source','')}")
print(f" submittedDate: {r.get('submittedDate','')}")
req_ids = {r.get('id') for r in reqs}
# Assignments
print("\n" + "=" * 70)
print("ASSIGNMENTS")
print("=" * 70)
for a in db.get('assignments', []):
if a.get('personId') in person_ids:
print(f" {a.get('id')}: personId={a.get('personId')} -> showId={a.get('showId')}")
# Hotel bookings
print("\n" + "=" * 70)
print("HOTEL BOOKINGS")
print("=" * 70)
for h in db.get('hotelBookings', []):
if h.get('personId') in person_ids:
print(f"\n HOTEL ID: {h.get('id')}")
for k, v in h.items():
if v not in (None, '', [], {}, False):
print(f" {k}: {v}")
# Per Diems
print("\n" + "=" * 70)
print("PER DIEMS")
print("=" * 70)
for pd in db.get('perDiems', []):
if pd.get('personId') in person_ids or pd.get('reqId') in req_ids:
print(f"\n PD ID: {pd.get('id')}")
for k, v in pd.items():
if v not in (None, '', [], {}, False):
print(f" {k}: {v}")
# Approvals
print("\n" + "=" * 70)
print("APPROVALS")
print("=" * 70)
for ap in db.get('approvals', []):
if ap.get('personId') in person_ids:
print(f" {ap.get('id')}: personId={ap.get('personId')} type={ap.get('type','')} status={ap.get('status','')}")
# Bookings (legacy)
print("\n" + "=" * 70)
print("BOOKINGS (legacy collection)")
print("=" * 70)
for b in db.get('bookings', []):
if b.get('personId') in person_ids:
print(f" {b.get('id')}: personId={b.get('personId')} showId={b.get('showId')}")
# Notes
print("\n" + "=" * 70)
print("NOTES")
print("=" * 70)
for n in db.get('notes', []):
if n.get('personId') in person_ids:
print(f" {n.get('id')}: personId={n.get('personId')} {n.get('text','')[:80]}")
# Summary by person ID
print("\n" + "=" * 70)
print("SUMMARY: WHAT'S LINKED TO EACH PROFILE")
print("=" * 70)
for p in persons:
pid = p.get('id')
email = p.get('email','')
print(f"\n{pid} ({email}):")
print(f" - Travel Requests: {len([r for r in reqs if r.get('personId')==pid])}")
print(f" - Assignments: {len([a for a in db.get('assignments',[]) if a.get('personId')==pid])}")
print(f" - Hotel Bookings: {len([h for h in db.get('hotelBookings',[]) if h.get('personId')==pid])}")
print(f" - Per Diems: {len([pd for pd in db.get('perDiems',[]) if pd.get('personId')==pid])}")
print(f" - Approvals: {len([ap for ap in db.get('approvals',[]) if ap.get('personId')==pid])}")