@@ -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)
@@ -288,10 +296,12 @@ export async function escalateStewardship(
288296 SET status = 'escalated',
289297 last_status_at = NOW(),
290298 inactive_reason = NULL,
299+ resolution_path = $(resolutionPath),
300+ status_note = $(statusNote),
291301 updated_at = NOW()
292302 WHERE id = $(stewardshipId)
293303 RETURNING id, package_id, status, origin, version, opened_at,
294- last_status_at, inactive_reason, created_at, updated_at
304+ last_status_at, inactive_reason, resolution_path, status_note, created_at, updated_at
295305 ),
296306 _log AS (
297307 INSERT INTO stewardship_activity
@@ -304,6 +314,8 @@ export async function escalateStewardship(
304314 ` ,
305315 {
306316 stewardshipId,
317+ resolutionPath : data . resolutionPath ,
318+ statusNote : data . notes ?? null ,
307319 actorUserId : data . actorUserId ,
308320 content : `Escalated with resolution path: ${ data . resolutionPath } ` ,
309321 metadata : JSON . stringify ( {
@@ -353,11 +365,13 @@ export async function updateStewardshipStatus(
353365 UPDATE stewardships
354366 SET status = $(status),
355367 last_status_at = NOW(),
356- inactive_reason = CASE WHEN $(status) = 'inactive' THEN $(inactiveReason) ELSE NULL END,
368+ inactive_reason = CASE WHEN $(status) = 'inactive' THEN $(inactiveReason) ELSE inactive_reason END,
369+ resolution_path = NULL,
370+ status_note = $(statusNote),
357371 updated_at = NOW()
358372 WHERE id = $(stewardshipId)
359373 RETURNING id, package_id, status, origin, version, opened_at,
360- last_status_at, inactive_reason, created_at, updated_at
374+ last_status_at, inactive_reason, resolution_path, status_note, created_at, updated_at
361375 ),
362376 _log AS (
363377 INSERT INTO stewardship_activity
@@ -372,6 +386,7 @@ export async function updateStewardshipStatus(
372386 stewardshipId,
373387 status : data . status ,
374388 inactiveReason : data . inactiveReason ?? null ,
389+ statusNote : data . notes ?? null ,
375390 actorUserId : data . actorUserId ,
376391 content : `Status updated to ${ data . status } ` ,
377392 metadata : JSON . stringify ( {
0 commit comments