From 18ad879f00709b5dad1c7c8a9805bad0e9e8405c Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 8 Jun 2026 13:53:22 +0000 Subject: [PATCH 1/2] devcontainer: use dynamic host ports so worktrees don't collide Publish container ports without a fixed host side in the backend and asset_list compose files, and switch forwardPorts to service-qualified form. Lets a second worktree's devcontainer spin up without conflicting on host 8000/5432 (backend) or 8081 (asset_list), matching the pattern in assessment-model-sales-frontend. Co-Authored-By: Claude Opus 4.8 (1M context) --- .devcontainer/asset_list/devcontainer.json | 2 +- .devcontainer/asset_list/docker-compose.yml | 5 ++++- .devcontainer/backend/devcontainer.json | 4 ++-- .devcontainer/backend/docker-compose.yml | 10 ++++++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.devcontainer/asset_list/devcontainer.json b/.devcontainer/asset_list/devcontainer.json index dfa9ba4d..d0c9abbb 100644 --- a/.devcontainer/asset_list/devcontainer.json +++ b/.devcontainer/asset_list/devcontainer.json @@ -9,7 +9,7 @@ // Optional, just makes getting from Downloads (local env) easier "source=${localEnv:HOME},target=/home/vscode,type=bind" ], - "forwardPorts": [8081], + "forwardPorts": ["model-sal:8080"], "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/asset_list/docker-compose.yml b/.devcontainer/asset_list/docker-compose.yml index 0568393b..d567162b 100644 --- a/.devcontainer/asset_list/docker-compose.yml +++ b/.devcontainer/asset_list/docker-compose.yml @@ -12,7 +12,10 @@ services: networks: - model-net ports: - - "8081:8080" + # Host port left unspecified so Docker assigns a free one — lets multiple + # worktrees of this repo run at once without colliding. VS Code's + # forwardPorts (in devcontainer.json) forwards container :8080 to your machine. + - "8080" networks: model-net: diff --git a/.devcontainer/backend/devcontainer.json b/.devcontainer/backend/devcontainer.json index 0a78dadf..d5133df3 100644 --- a/.devcontainer/backend/devcontainer.json +++ b/.devcontainer/backend/devcontainer.json @@ -42,9 +42,9 @@ "containerEnv": { "PYTHONFLAGS": "-Xfrozen_modules=off" }, - "forwardPorts": [8000], + "forwardPorts": ["model-backend:8000"], "portsAttributes": { - "8000": { + "model-backend:8000": { "label": "FastAPI", "onAutoForward": "notify" } diff --git a/.devcontainer/backend/docker-compose.yml b/.devcontainer/backend/docker-compose.yml index cf3bb2c0..9b4873c2 100644 --- a/.devcontainer/backend/docker-compose.yml +++ b/.devcontainer/backend/docker-compose.yml @@ -10,7 +10,10 @@ services: USER_GID: ${GID:-1000} command: sleep infinity ports: - - "8000:8000" + # Host port left unspecified so Docker assigns a free one — lets multiple + # worktrees of this repo run at once without colliding. VS Code's + # forwardPorts (in devcontainer.json) forwards container :8000 to your machine. + - "8000" volumes: - ../../:/workspaces/model - ~/.gitconfig:/home/vscode/.gitconfig:ro @@ -30,7 +33,10 @@ services: image: postgres:17.4 restart: unless-stopped ports: - - 5432:5432 + # Dynamic host port (see model-backend above) so a second worktree's db + # doesn't collide on 5432. Reach it from inside the container via host + # "db:5432"; from your machine, use the forwarded port VS Code reports. + - "5432" environment: - PGDATABASE=tech_team_local_db - POSTGRES_USER=postgres From a1b4bf4e9863726bf84c3fd608c18e66b0bea0a8 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 8 Jun 2026 14:42:06 +0000 Subject: [PATCH 2/2] added 4 deal proeprties --- backend/app/db/models/hubspot_deal_data.py | 5 +++++ etl/hubspot/hubspotClient.py | 4 ++++ etl/hubspot/hubspotDataTodB.py | 8 ++++++++ etl/hubspot/hubspot_deal_differ.py | 4 ++++ 4 files changed, 21 insertions(+) diff --git a/backend/app/db/models/hubspot_deal_data.py b/backend/app/db/models/hubspot_deal_data.py index 2935f2bf..5104f377 100644 --- a/backend/app/db/models/hubspot_deal_data.py +++ b/backend/app/db/models/hubspot_deal_data.py @@ -82,6 +82,11 @@ class HubspotDealData(SQLModel, table=True): domna_survey_required: Optional[bool] = Field(default=None) domna_survey_date: Optional[datetime] = Field(default=None) + date_booking_made: Optional[datetime] = Field(default=None) + last_contact_date: Optional[datetime] = Field(default=None) + last_outbound_call: Optional[datetime] = Field(default=None) + last_outbound_email: Optional[datetime] = Field(default=None) + created_at: Optional[datetime] = Field( sa_column=Column( DateTime(timezone=True), diff --git a/etl/hubspot/hubspotClient.py b/etl/hubspot/hubspotClient.py index 1300b579..482ae460 100644 --- a/etl/hubspot/hubspotClient.py +++ b/etl/hubspot/hubspotClient.py @@ -347,6 +347,10 @@ class HubspotClient: "sent_to_iw_for_pricing", "osmosis_survey_required", "osmosis_survey_date", + "date_booking_made", + "last_contact_date", + "last_outbound_call", + "last_outbound_email", ], ) ) diff --git a/etl/hubspot/hubspotDataTodB.py b/etl/hubspot/hubspotDataTodB.py index ad5f5c33..042571da 100644 --- a/etl/hubspot/hubspotDataTodB.py +++ b/etl/hubspot/hubspotDataTodB.py @@ -293,6 +293,10 @@ class HubspotDataToDb: deal_data.get("osmosis_survey_required") ), "domna_survey_date": parse_hs_date(deal_data.get("osmosis_survey_date")), + "date_booking_made": parse_hs_date(deal_data.get("date_booking_made")), + "last_contact_date": parse_hs_date(deal_data.get("last_contact_date")), + "last_outbound_call": parse_hs_date(deal_data.get("last_outbound_call")), + "last_outbound_email": parse_hs_date(deal_data.get("last_outbound_email")), }.items(): setattr(existing, attr, value) @@ -391,6 +395,10 @@ class HubspotDataToDb: deal_data.get("osmosis_survey_required") ), domna_survey_date=parse_hs_date(deal_data.get("osmosis_survey_date")), + date_booking_made=parse_hs_date(deal_data.get("date_booking_made")), + last_contact_date=parse_hs_date(deal_data.get("last_contact_date")), + last_outbound_call=parse_hs_date(deal_data.get("last_outbound_call")), + last_outbound_email=parse_hs_date(deal_data.get("last_outbound_email")), ) def _handle_existing_photo_upload( diff --git a/etl/hubspot/hubspot_deal_differ.py b/etl/hubspot/hubspot_deal_differ.py index 9df456e6..40eef059 100644 --- a/etl/hubspot/hubspot_deal_differ.py +++ b/etl/hubspot/hubspot_deal_differ.py @@ -114,6 +114,10 @@ class HubspotDealDiffer: ("property_halted_date", "property_halted_date"), ("sent_to_iw_for_pricing", "sent_to_installer_for_pricing"), ("osmosis_survey_date", "domna_survey_date"), + ("date_booking_made", "date_booking_made"), + ("last_contact_date", "last_contact_date"), + ("last_outbound_call", "last_outbound_call"), + ("last_outbound_email", "last_outbound_email"), ] for hs_field, db_field in date_fields: