Skip to content
Snippets Groups Projects
Commit 9e5e0d0c authored by Isaac Evavold's avatar Isaac Evavold
Browse files

ROENROLL-1779 add basic DARS API endpoints


Co-authored-by: default avatarScott Berg <saberg3@wisc.edu>
parent d16dca73
No related branches found
No related tags found
No related merge requests found
import { Component, ViewChild, ElementRef } from '@angular/core';
import { MatSidenav } from '@angular/material';
import { DarsApiService } from '../services/api.service';
@Component({
selector: 'cse-dars-view',
......@@ -47,4 +48,6 @@ export class DARSViewComponent {
plan: 12345,
},
];
constructor(private api: DarsApiService) {}
}
export interface AuditMetadata {
darsJobId: string;
darsAuditRunDate: string;
sisEmplId: string;
darsInstitutionCode: string;
darsInstitutionCodeDescription: string;
darsDegreeProgramCode: string;
darsStatusOfDegreeAuditRequest: string;
darsHonorsOptionCode: string;
darsHonorsOptionDescription: string;
darsDegreeAuditReportId: number;
darsCatalogYearTerm: string;
whichEnrolledCoursesIncluded: string;
degreePlannerPlanName: string;
}
export interface DegreeProgram {
darsDegreeProgramCode: string;
darsInstitutionCode: string;
darsInstitutionCodeDescription: string;
darsDegreeProgramDescription: string;
}
export interface HonorsOption {
darsInstitutionCode: string;
darsHonorsOptionCode: string;
darsHonorsOptionDescription: string;
}
export interface Institution {
darsInstitutionCode: string;
darsInstitutionCodeDescription: string;
}
import { AuditMetadata } from './audit-metadata';
export interface StudentDegreeProgram {
darsDegreeProgramCode: string;
darsInstitutionCode: string;
darsCatalogYearTerm: string;
darsAlternateCatalogYearTerm1: string;
sisAcademicPlanCode: string;
sisAcademicPlanDescription: string;
sisAcademicPlanDeclareDate: string;
sisAcademicSubPlanCode: string;
sisAcademicSubPlanDescription: string;
auditRequestBody: AuditMetadata;
}
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
import { DegreeProgram } from '../models/degree-program';
import { AuditMetadata } from '../models/audit-metadata';
import { StudentDegreeProgram } from '../models/student-degree-program';
import { environment } from './../../../environments/environment';
const HTTP_OPTIONS = {
headers: new HttpHeaders({
'Content-Type': 'applications/json',
}),
};
@Injectable({ providedIn: 'root' })
export class DarsApiService {
constructor(private http: HttpClient) {}
/**
* Get all degree programs, honors, and institution data.
*
* All the data for institutions, honors, and degree programs is static.
* The backend is going to cache all this data in S3 and create a single
* endpoint for us to hit and get all of it!
*/
public getStaticData(): Observable<DegreeProgram[]> {
return new Observable();
}
/**
* Get a students degree programs.
*/
public getStudentDegreePrograms(emplid: number) {
const url = `${environment.apiDarsUrl}/student-degree-programs/${emplid}`;
return this.http.get<StudentDegreeProgram[]>(url, HTTP_OPTIONS);
}
/**
* Get audit metadata for all audits a user has.
*/
public getAudits(): Observable<AuditMetadata[]> {
const url = `${environment.apiDarsUrl}/audit-metadata`;
return this.http.get<AuditMetadata[]>(url, HTTP_OPTIONS);
}
/**
* Get a single audit.
*/
public getAudit(reportId: number): Observable<any> {
const url = `${environment.apiDarsUrl}/reports/${reportId}`;
return this.http.get<any>(url, HTTP_OPTIONS);
}
/**
* Request a new audit
*/
public newAudit(): Observable<AuditMetadata> {
const url = `${environment.apiDarsUrl}/single-audit-requests`;
return this.http.post<AuditMetadata>(url, HTTP_OPTIONS);
}
}
......@@ -4,5 +4,6 @@ export const environment = {
apiPlannerUrl: '/api/planner/v1',
apiSearchUrl: '/api/search/v1',
apiEnrollUrl: '/api/enroll/v1',
apiDarsUrl: '',
snackbarDuration: 4000,
};
......@@ -9,6 +9,7 @@ export const environment = {
apiPlannerUrl: '/api/planner/v1',
apiSearchUrl: '/api/search/v1',
apiEnrollUrl: '/api/enroll/v1',
apiDarsUrl: 'https://gateway.test.api.wisc.edu/v1/dars',
snackbarDuration: 4000,
useNewDARSView: true,
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment