S18 Added OR Tools rules for scheduling show
All checks were successful
Build, test and publish / verify (push) Successful in 6m12s
All checks were successful
Build, test and publish / verify (push) Successful in 6m12s
This commit is contained in:
@@ -2,6 +2,7 @@ import { inject, Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { forkJoin, Observable } from 'rxjs';
|
||||
import {
|
||||
Coach,
|
||||
DanceGroup,
|
||||
Dancer,
|
||||
DancerRequest,
|
||||
@@ -29,6 +30,7 @@ export class SchoolApi {
|
||||
dancers: this.http.get<Dancer[]>(`${base}/dancers`),
|
||||
groups: this.http.get<DanceGroup[]>(`${base}/dance-groups`),
|
||||
shows: this.http.get<Show[]>(`${base}/shows`),
|
||||
coaches: this.http.get<Coach[]>(`${base}/coaches`),
|
||||
});
|
||||
}
|
||||
saveSchool(body: SchoolRequest, id?: number): Observable<School> {
|
||||
@@ -52,6 +54,20 @@ export class SchoolApi {
|
||||
{ timeout: 1860000 },
|
||||
);
|
||||
}
|
||||
saveAssignments(schoolId: number, showId: number, assignments: number[][]): Observable<Show> {
|
||||
return this.http.put<Show>(`${this.base}/${schoolId}/shows/${showId}/assignments`, {
|
||||
assignments,
|
||||
});
|
||||
}
|
||||
finalize(schoolId: number, showId: number): Observable<Show> {
|
||||
return this.http.post<Show>(`${this.base}/${schoolId}/shows/${showId}/finalize`, null);
|
||||
}
|
||||
linkCoach(schoolId: number, dancerId: number, coachId?: number): Observable<Coach> {
|
||||
return this.save<Coach>(`${this.base}/${schoolId}/coaches`, { dancerId }, coachId);
|
||||
}
|
||||
unlinkCoach(schoolId: number, coachId: number): Observable<void> {
|
||||
return this.http.delete<void>(`${this.base}/${schoolId}/coaches/${coachId}/dancer`);
|
||||
}
|
||||
delete(kind: ResourceKind, schoolId: number, id: number): Observable<void> {
|
||||
const collection = { school: '', dancer: '/dancers', group: '/dance-groups', show: '/shows' }[
|
||||
kind
|
||||
|
||||
Reference in New Issue
Block a user