Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3313 - Content: Ministry: Accounts #4269

Merged
merged 4 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export class CreateStudentAccountApplicationAPIInDTO {

export class StudentAccountApplicationSummaryAPIOutDTO {
id: number;
fullName: string;
lastName: string;
givenNames: string;
dateOfBirth: string;
submittedDate: Date;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import {
StudentAccountApplicationApprovalAPIInDTO,
StudentAccountApplicationSummaryAPIOutDTO,
} from "./models/student-account-application.dto";
import { getUserFullName } from "../../utilities";
import { CustomNamedError } from "@sims/utilities";
import { IUserToken } from "../../auth/userToken.interface";
import {
Expand Down Expand Up @@ -79,7 +78,9 @@ export class StudentAccountApplicationAESTController extends BaseController {
await this.studentAccountApplicationsService.getPendingStudentAccountApplications();
return accountApplications.map((accountApplication) => ({
id: accountApplication.id,
fullName: getUserFullName(accountApplication.user),
lastName: accountApplication.user.lastName,
givenNames: accountApplication.user.firstName,
dateOfBirth: accountApplication.submittedData.dateOfBirth,
submittedDate: accountApplication.submittedDate,
}));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { User } from "@sims/sims-db";
import { StudentInfo } from "../student/student.service.models";

/**
Expand Down Expand Up @@ -33,3 +34,14 @@ export type StudentAccountApplicationApprovalModel = StudentInfo &
export interface AccountApplicationSubmittedData {
sinConsent: boolean;
}

/**
* Data needed to obtain a list of student account applications
* waiting to be assessed by the Ministry.
*/
export interface StudentAccountApplicationSummary {
id: number;
user: User;
submittedData: { dateOfBirth?: string };
submittedDate: Date;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
AccountApplicationSubmittedData,
StudentAccountApplicationApprovalModel,
StudentAccountApplicationCreateModel,
StudentAccountApplicationSummary,
} from "./student-account-applications.models";
import { StudentService } from "../student/student.service";
import { CustomNamedError } from "@sims/utilities";
Expand Down Expand Up @@ -49,12 +50,13 @@ export class StudentAccountApplicationsService extends RecordDataModelService<St
* @returns list of pending student account applications.
*/
async getPendingStudentAccountApplications(): Promise<
StudentAccountApplication[]
StudentAccountApplicationSummary[]
> {
return this.repo.find({
select: {
id: true,
submittedDate: true,
submittedData: true as unknown,
user: { firstName: true, lastName: true },
},
relations: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export interface CreateStudentAccountApplicationAPIInDTO {

export interface StudentAccountApplicationSummaryAPIOutDTO {
id: number;
fullName: string;
lastName: string;
givenNames: string;
dateOfBirth: string;
submittedDate: Date;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<header-navigator title="Student requests" subTitle="Accounts" />
</template>
<body-header
title="Requested accounts"
subTitle="Make a determination for students requesting to login with a Basic BCeID."
title="Pending account requests"
subTitle="Basic BCeID account requests that require ministry review."
:recordsCount="accountApplications?.length"
>
</body-header>
Expand All @@ -25,7 +25,13 @@
}}</span>
</template>
</Column>
<Column header="Name" field="fullName" bodyClass="w-100"></Column>
<Column header="Given names" field="givenNames"></Column>
<Column header="Last name" field="lastName"></Column>
<Column header="Date of birth" headerClass="text-no-wrap"
><template #body="slotProps">
<span>{{ dateOnlyLongString(slotProps.data.dateOfBirth) }}</span>
</template>
</Column>
<Column header="Action">
<template #body="slotProps">
<v-btn
Expand Down
Loading