Commit graph

1202 commits

Author SHA1 Message Date
Khalim Conn-Kowlessar
240b633928 add PIBI measure selector to property drawer
Adds PibiMeasureSelector component (issue #254) inside the drawer's
PIBI section. Approvers see a checkbox multi-select listing proposed +
instructed measures; approved measures are pre-ticked. Non-approvers
retain the existing read-only chip list. Saves via POST
/api/portfolio/[portfolioId]/pibi-measures and invalidates the query
cache on success.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 19:14:33 +00:00
Khalim Conn-Kowlessar
1e5eb09c3e add pibi-measures route
Adds POST /api/portfolio/[portfolioId]/pibi-measures (approver-gated)
that accepts { dealId, measureNames[] } and delegates to
selectPibiMeasures. Also adds a GET handler that returns the current
pibi_ordered selection, approved measures, and instructed measures for
a deal — used by the drawer's PIBI selector to pre-populate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 19:14:20 +00:00
Khalim Conn-Kowlessar
091388692e add pibi-selection service
Implements selectPibiMeasures (issue #254): replaces all pibi_ordered
rows for a deal, then pushes the new list to HubSpot under
measures_for_pibi_ordered via syncMeasuresFieldToHubSpot. Mirrors the
instruct-measure service; no approval rows touched.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 19:14:12 +00:00
Khalim Conn-Kowlessar
c5083cbc78 add instruct-measure drawer form
Approver-only catalogue dropdown + submit button at the bottom of the
Measures section with optimistic chip rendering, error surfacing, and
the out-of-order soft warning when technical-approved measures already
exist on the deal.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 18:58:01 +00:00
Khalim Conn-Kowlessar
7de92cf5ea add instruct-measure service, route and soft-warning helper
Approver-only flow that records an instructed measure in
user_defined_deal_measures, auto-creates a deal_measure_approvals row +
event in a single tx, then pushes the instructed list to HubSpot under
instructed_measures. When the deal has no proposed measures and no prior
approvals, also pushes the new measure as proposed_measures so the deal
has a coherent starting point. Soft-warning helper surfaces the
out-of-order case for the drawer (and later slices).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 18:56:48 +00:00
Khalim Conn-Kowlessar
4181af6d15 add syncMeasuresFieldToHubSpot helper
Generic push for multi-value HubSpot deal properties (semicolon-separated)
with the same ECONNRESET retry pattern as pushDealPropertiesToHubSpot.
Returns a discriminated ok result so callers can stamp pushed_at only on
success. Slice 4 (PIBI selections) will reuse the same helper.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 18:56:19 +00:00
Khalim Conn-Kowlessar
54e093891d add user_defined_deal_measures table migration and schema
Track instructed and pibi-ordered measures locally with a source enum,
created-by user, and HubSpot sync timestamps so issue #253 can persist
approver instructions and slice 4 can reuse the table for PIBI selections.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 18:56:09 +00:00
Khalim Conn-Kowlessar
a69dac1fca add editable domna survey section and cypress spec
Replaces the read-only Domna InfoRow block with a DomnaEditor that lets
approvers set a free-text survey type and a survey date with optimistic
update + error surfacing, mirroring the halted-state editor. Non-approvers
keep the read-only InfoRow view. Cypress spec covers the approver flow
end-to-end with a reload-persistence check.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 18:38:17 +00:00
Khalim Conn-Kowlessar
1336d90c8d add domna survey fields to deal-properties registry
Plug `domna_survey_type` and `domna_survey_date` into
DEAL_PROPERTY_FIELDS, gated on the approver capability and reusing the
shared string-or-null + ISO date schemas. Drops the now-unused boolean
column types from the field registry. Vitest cases cover validation,
capability gating, HubSpot mapping, independent setting and clear-to-null.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 18:37:57 +00:00
Khalim Conn-Kowlessar
73a365468a migrate domna_survey_required -> domna_survey_type
Drops the too-coarse boolean column and adds a free-text
`domna_survey_type` column on hubspot_deal_data so an approver can record
the survey kind directly. Updates the Drizzle schema, the HubspotDeal
type, and the live-tracking page mapping to expose the new column.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 18:37:38 +00:00
Khalim Conn-Kowlessar
3070f2c763 add editable halted state section and cypress spec
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 18:26:18 +00:00
Khalim Conn-Kowlessar
e020b3fd83 add halted state fields and approver capability gate
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 18:24:43 +00:00
Khalim Conn-Kowlessar
3d08a423a6 add editable PIBI dates section and cypress spec 2026-05-05 14:34:05 +00:00
Khalim Conn-Kowlessar
b8befe56fe add deal-properties PATCH endpoint and update service 2026-05-05 14:33:59 +00:00
Jun-te Kim
7d1e573965 refactor 2026-05-05 14:21:20 +00:00
Khalim Conn-Kowlessar
0fe8dd0ac9 open detail drawer at Measures section on row click 2026-05-05 12:10:08 +00:00
Khalim Conn-Kowlessar
75c0cde009 widen drawer and add stage-ordered read-only sections 2026-05-05 12:09:57 +00:00
Khalim Conn-Kowlessar
998f36f1df surface new per-deal workflow fields on HubspotDeal type 2026-05-05 12:09:51 +00:00
Khalim Conn-Kowlessar
486427f73d add vitest harness with parser and getRequiredDocs unit tests 2026-05-05 11:26:02 +00:00
Khalim Conn-Kowlessar
35d0af4474 share parseMeasures helper, accept ; and , separators 2026-05-05 11:25:54 +00:00
Khalim Conn-Kowlessar
dc3bfa73d3 extract MEASURE_NAMES catalogue and MeasureName type 2026-05-05 11:25:45 +00:00
Khalim Conn-Kowlessar
b100c15052 Fetching user data from users hubspot table 2026-05-01 16:32:04 +00:00
Khalim Conn-Kowlessar
0a6a01caaf added hubspot user table 2026-04-30 19:16:35 +00:00
Khalim Conn-Kowlessar
d9929a6163 added additional fields to the db 2026-04-30 17:01:51 +01:00
Khalim Conn-Kowlessar
2957caf986 Added new fields to db 2026-04-30 14:34:39 +01:00
Daniel Roth
f7b35f04a8 make column unique 2026-04-28 16:11:33 +00:00
Daniel Roth
b696f823a4 add new fk column uploaded_file_id 2026-04-28 16:08:31 +00:00
Daniel Roth
302464329c missing migration files 2026-04-28 08:16:56 +00:00
Daniel Roth
3ecc03bec0 migration 2026-04-28 08:16:13 +00:00
Daniel Roth
2f87bf2f38 make previous migration files in line with db 2026-04-28 08:15:54 +00:00
Daniel Roth
b74585ff21 migration 2026-04-27 16:27:56 +00:00
Daniel Roth
593be49773 rename pvcFrame to frameMaterial and make nullable 2026-04-27 16:25:36 +00:00
Daniel Roth
be4b764832 revert migration 2026-04-27 16:22:49 +00:00
Jun-te Kim
a7eef6db85 get rid of useeffect 2026-04-27 16:00:33 +00:00
Daniel Roth
173468aa9d migration 2026-04-27 14:38:06 +00:00
Daniel Roth
e6e91f6278 make window transmissionDataSource text not integer 2026-04-27 14:37:12 +00:00
Jun-te Kim
a37fd03202 added domna tech password 2026-04-27 11:59:53 +00:00
Jun-te Kim
c3cc123a6f save working progress 2026-04-24 15:57:30 +00:00
Jun-te Kim
9f8ea85fed Merge remote-tracking branch 'origin/main' into feature/onbarding_of_addresses 2026-04-24 11:16:46 +00:00
Daniel Roth
be2a191908 migration 2026-04-24 11:05:12 +00:00
Daniel Roth
fead8582c6 make property_id and portfolio_id foreign keys nullable 2026-04-24 11:03:01 +00:00
Daniel Roth
b4e2370ddc migration 2026-04-24 10:31:04 +00:00
Daniel Roth
bec81c986f address columns not null 2026-04-24 10:30:35 +00:00
Daniel Roth
a595f9482e revert previous commit 2026-04-24 10:29:23 +00:00
Daniel Roth
3014136e99 address columns notnull 2026-04-24 10:25:33 +00:00
Daniel Roth
cb59f435ad comments 2026-04-24 09:48:15 +00:00
Daniel Roth
f74666212d migration 2026-04-23 16:52:07 +00:00
Daniel Roth
62a31126a2 remove accidental duplicate epcpropertydetails table 2026-04-23 16:48:24 +00:00
Daniel Roth
fa38abfc8c Merge branch 'main' into feature/new-epc-tables 2026-04-23 16:25:05 +00:00
Daniel Roth
2960b99c8b tables for new epc data 2026-04-23 15:49:53 +00:00