@@ -9,6 +9,8 @@ export interface StewardshipRecord {
99 openedAt : string | null
1010 lastStatusAt : string | null
1111 inactiveReason : string | null
12+ resolutionPath : string | null
13+ statusNote : string | null
1214 createdAt : string
1315 updatedAt : string
1416}
@@ -17,6 +19,7 @@ export interface StewardshipStewardRecord {
1719 id : string
1820 stewardshipId : string
1921 userId : string
22+ name : string | null
2023 role : string
2124 assignedAt : string
2225 assignedBy : string | null
@@ -89,6 +92,7 @@ function mapStewardStewardRow(row: Record<string, unknown>): StewardshipStewardR
8992 id : String ( row . id ) ,
9093 stewardshipId : String ( row . stewardship_id ) ,
9194 userId : String ( row . user_id ) ,
95+ name : null ,
9296 role : String ( row . role ) ,
9397 assignedAt : toIso ( row . assigned_at ) ,
9498 assignedBy : row . assigned_by ? String ( row . assigned_by ) : null ,
@@ -105,6 +109,8 @@ function mapStewardshipRow(row: Record<string, unknown>): StewardshipRecord {
105109 openedAt : row . opened_at ? toIso ( row . opened_at ) : null ,
106110 lastStatusAt : row . last_status_at ? toIso ( row . last_status_at ) : null ,
107111 inactiveReason : row . inactive_reason ? String ( row . inactive_reason ) : null ,
112+ resolutionPath : row . resolution_path ? String ( row . resolution_path ) : null ,
113+ statusNote : row . status_note ? String ( row . status_note ) : null ,
108114 createdAt : toIso ( row . created_at ) ,
109115 updatedAt : toIso ( row . updated_at ) ,
110116 }
@@ -116,7 +122,7 @@ export async function getStewardshipById(
116122) : Promise < StewardshipRecord | null > {
117123 const row : Record < string , unknown > | null = await qx . selectOneOrNone (
118124 `SELECT id, package_id, status, origin, version, opened_at, last_status_at,
119- inactive_reason, created_at, updated_at
125+ inactive_reason, resolution_path, status_note, created_at, updated_at
120126 FROM stewardships
121127 WHERE id = $(id)` ,
122128 { id } ,
@@ -151,12 +157,14 @@ export async function openStewardshipByPurl(
151157 FROM pkg
152158 ON CONFLICT (package_id) DO UPDATE
153159 SET status = 'open',
154- opened_at = COALESCE(stewardships.opened_at, NOW() ),
160+ opened_at = NOW(),
155161 last_status_at = NOW(),
156162 inactive_reason = NULL,
163+ resolution_path = NULL,
164+ status_note = NULL,
157165 updated_at = NOW()
158166 RETURNING id, package_id, status, origin, version, opened_at,
159- last_status_at, inactive_reason, created_at, updated_at
167+ last_status_at, inactive_reason, resolution_path, status_note, created_at, updated_at
160168 ),
161169 _log AS (
162170 INSERT INTO stewardship_activity (stewardship_id, actor_user_id, actor_type, activity_type, content)
@@ -319,10 +327,12 @@ export async function escalateStewardship(
319327 SET status = 'escalated',
320328 last_status_at = NOW(),
321329 inactive_reason = NULL,
330+ resolution_path = $(resolutionPath),
331+ status_note = $(statusNote),
322332 updated_at = NOW()
323333 WHERE id = $(stewardshipId)
324334 RETURNING id, package_id, status, origin, version, opened_at,
325- last_status_at, inactive_reason, created_at, updated_at
335+ last_status_at, inactive_reason, resolution_path, status_note, created_at, updated_at
326336 ),
327337 _log AS (
328338 INSERT INTO stewardship_activity
@@ -335,6 +345,8 @@ export async function escalateStewardship(
335345 ` ,
336346 {
337347 stewardshipId,
348+ resolutionPath : data . resolutionPath ,
349+ statusNote : data . notes ?? null ,
338350 actorUserId : data . actorUserId ,
339351 content : `Escalated with resolution path: ${ data . resolutionPath } ` ,
340352 metadata : JSON . stringify ( {
@@ -384,11 +396,13 @@ export async function updateStewardshipStatus(
384396 UPDATE stewardships
385397 SET status = $(status),
386398 last_status_at = NOW(),
387- inactive_reason = CASE WHEN $(status) = 'inactive' THEN $(inactiveReason) ELSE NULL END,
399+ inactive_reason = CASE WHEN $(status) = 'inactive' THEN $(inactiveReason) ELSE inactive_reason END,
400+ resolution_path = NULL,
401+ status_note = $(statusNote),
388402 updated_at = NOW()
389403 WHERE id = $(stewardshipId)
390404 RETURNING id, package_id, status, origin, version, opened_at,
391- last_status_at, inactive_reason, created_at, updated_at
405+ last_status_at, inactive_reason, resolution_path, status_note, created_at, updated_at
392406 ),
393407 _log AS (
394408 INSERT INTO stewardship_activity
@@ -403,6 +417,7 @@ export async function updateStewardshipStatus(
403417 stewardshipId,
404418 status : data . status ,
405419 inactiveReason : data . inactiveReason ?? null ,
420+ statusNote : data . notes ?? null ,
406421 actorUserId : data . actorUserId ,
407422 content : `Status updated to ${ data . status } ` ,
408423 metadata : JSON . stringify ( {
0 commit comments