Edit button locate, delete, group header

This commit is contained in:
ivan-pelly
2026-04-10 17:52:52 -07:00
parent b287276ec0
commit 0036e25b9c
25 changed files with 629 additions and 82 deletions
@@ -145,6 +145,23 @@ export class StudentService {
}
}
// *****************************************************************
// Deletes a goal and all its child entities (benchmarks, progress
// events, event-benchmark links).
// *****************************************************************
async deleteGoal(studentId: string, goalId: string): Promise<ApiResult> {
try {
const result = await firstValueFrom(
this.http.delete<ResponseResult<void>>(`${this.base}/api/Student/${studentId}/goals/${goalId}`)
);
return result.success
? ApiResult.empty()
: ApiResult.fail(result.message);
} catch (error) {
return ApiResult.fail(describeHttpError(error as HttpErrorResponse));
}
}
// *****************************************************************
// Creates a new progress event, optionally with benchmark
// associations. Returns the new progress event ID on success.
@@ -178,6 +195,22 @@ export class StudentService {
}
}
// *****************************************************************
// Deletes a progress event and its benchmark associations.
// *****************************************************************
async deleteProgressEvent(studentId: string, progressEventId: string): Promise<ApiResult> {
try {
const result = await firstValueFrom(
this.http.delete<ResponseResult<void>>(`${this.base}/api/Student/${studentId}/progress-events/${progressEventId}`)
);
return result.success
? ApiResult.empty()
: ApiResult.fail(result.message);
} catch (error) {
return ApiResult.fail(describeHttpError(error as HttpErrorResponse));
}
}
// *****************************************************************
// Returns a full progress report for a student within a date
// range, including goals, events, and benchmark associations.
@@ -221,6 +254,22 @@ export class StudentService {
}
}
// *****************************************************************
// Deletes a student and all associated data.
// *****************************************************************
async deleteStudent(studentId: string): Promise<ApiResult> {
try {
const result = await firstValueFrom(
this.http.delete<ResponseResult<void>>(`${this.base}/api/Student/${studentId}`)
);
return result.success
? ApiResult.empty()
: ApiResult.fail(result.message);
} catch (error) {
return ApiResult.fail(describeHttpError(error as HttpErrorResponse));
}
}
// *****************************************************************
// Returns benchmarks for a given student.
// *****************************************************************
@@ -269,6 +318,22 @@ export class StudentService {
}
}
// *****************************************************************
// Deletes a benchmark and its progress-event associations.
// *****************************************************************
async deleteBenchmark(studentId: string, benchmarkId: string): Promise<ApiResult> {
try {
const result = await firstValueFrom(
this.http.delete<ResponseResult<void>>(`${this.base}/api/Student/${studentId}/benchmarks/${benchmarkId}`)
);
return result.success
? ApiResult.empty()
: ApiResult.fail(result.message);
} catch (error) {
return ApiResult.fail(describeHttpError(error as HttpErrorResponse));
}
}
// *****************************************************************
// Requests an AI-generated benchmark recommendation for a goal.
// *****************************************************************