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

Feature/212 apprenticeship info #225

Merged
merged 6 commits into from
Oct 28, 2020
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 @@ -4,36 +4,35 @@
/></ng-container>
<ng-container
*ngIf="
company.apprenticeshipManagerPerson?.LastName &&
company.apprenticeshipManagerPerson?.FirstName
company.apprenticeshipManager?.Lastname &&
company.apprenticeshipManager?.Firstname
"
>
{{ company.apprenticeshipManagerPerson.LastName }}
{{ company.apprenticeshipManagerPerson.FirstName }}<br />
{{ company.apprenticeshipManager.Lastname }}
{{ company.apprenticeshipManager.Firstname }}<br />
</ng-container>
<ng-container *ngIf="company.apprenticeshipManagerPerson?.AddressLine1"
>{{ company.apprenticeshipManagerPerson.AddressLine1 }}<br
<ng-container *ngIf="company.apprenticeshipManager?.AddressLine1"
>{{ company.apprenticeshipManager.AddressLine1 }}<br
/></ng-container>
<ng-container *ngIf="company.apprenticeshipManagerPerson?.AddressLine2"
>{{ company.apprenticeshipManagerPerson.AddressLine2 }}<br
<ng-container *ngIf="company.apprenticeshipManager?.AddressLine2"
>{{ company.apprenticeshipManager.AddressLine2 }}<br
/></ng-container>
<ng-container
*ngIf="
company.apprenticeshipManagerPerson?.Zip &&
company.apprenticeshipManagerPerson?.Location
company.apprenticeshipManager?.PostalCode &&
company.apprenticeshipManager?.Location
"
>{{ company.apprenticeshipManagerPerson.Zip }}
{{ company.apprenticeshipManagerPerson.Location }}<br
>{{ company.apprenticeshipManager.PostalCode }}
{{ company.apprenticeshipManager.Location }}<br
/></ng-container>
<ng-container *ngIf="company.apprenticeshipManagerPerson?.PhoneBusiness">
<a href="tel:{{ company.apprenticeshipManagerPerson.PhoneBusiness }}"
>{{ company.apprenticeshipManagerPerson.PhoneBusiness }}<br /></a
<ng-container *ngIf="company.apprenticeshipManager?.PhoneBusiness">
<a href="tel:{{ company.apprenticeshipManager.PhoneBusiness }}"
>{{ company.apprenticeshipManager.PhoneBusiness }}<br /></a
></ng-container>
<ng-container *ngIf="company.apprenticeshipManagerPerson | erzPersonEmail">
<a
href="mailto:{{ company.apprenticeshipManagerPerson | erzPersonEmail }}"
>{{ company.apprenticeshipManagerPerson | erzPersonEmail }}</a
></ng-container
<ng-container *ngIf="company.apprenticeshipManager | erzPersonEmail">
<a href="mailto:{{ company.apprenticeshipManager | erzPersonEmail }}">{{
company.apprenticeshipManager | erzPersonEmail
}}</a></ng-container
>
</address>
<div class="subentry" *ngIf="company.apprenticeshipContract.ContractDateFrom">
Expand All @@ -43,22 +42,22 @@
company.apprenticeshipContract.ContractDateTo | date: 'dd.MM.yyyy'
}}
</div>
<div *ngIf="company.jobTrainerPerson" class="subentry">
<div *ngIf="company.jobTrainer" class="subentry">
{{ 'shared.profile.job-trainer' | translate }}:
<address>
{{ company.jobTrainerPerson.LastName }}
{{ company.jobTrainerPerson.FirstName }}<br />
<ng-container *ngIf="company.jobTrainerPerson.PhoneBusiness">
<a href="tel:{{ company.jobTrainerPerson.PhoneBusiness }}"
>{{ company.jobTrainerPerson.PhoneBusiness }}<br /></a
{{ company.jobTrainer.Lastname }}
{{ company.jobTrainer.Firstname }}<br />
<ng-container *ngIf="company.jobTrainer.PhoneBusiness">
<a href="tel:{{ company.jobTrainer.PhoneBusiness }}"
>{{ company.jobTrainer.PhoneBusiness }}<br /></a
></ng-container>
<ng-container *ngIf="company.jobTrainerPerson.PhoneMobile">
<a href="tel:{{ company.jobTrainerPerson.PhoneMobile }}"
>{{ company.jobTrainerPerson.PhoneMobile }}<br /></a
<ng-container *ngIf="company.jobTrainer.PhoneMobile">
<a href="tel:{{ company.jobTrainer.PhoneMobile }}"
>{{ company.jobTrainer.PhoneMobile }}<br /></a
></ng-container>
<ng-container *ngIf="company.jobTrainerPerson | erzPersonEmail">
<a href="mailto:{{ company.jobTrainerPerson | erzPersonEmail }}">{{
company.jobTrainerPerson | erzPersonEmail
<ng-container *ngIf="company.jobTrainer | erzPersonEmail">
<a href="mailto:{{ company.jobTrainer | erzPersonEmail }}">{{
company.jobTrainer | erzPersonEmail
}}</a></ng-container
>
</address>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { buildTestModuleMetadata } from 'src/spec-helpers';
import { StudentProfileApprenticeshipCompanyComponent } from './student-profile-apprenticeship-company.component';
import { buildApprenticeshipContract, buildPerson } from 'src/spec-builders';
import {
buildApprenticeshipContract,
buildApprenticeshipManager,
buildJobTrainer,
} from 'src/spec-builders';

describe('StudentProfileApprenticeshipCompanyComponent', () => {
let component: StudentProfileApprenticeshipCompanyComponent;
Expand All @@ -23,8 +27,8 @@ describe('StudentProfileApprenticeshipCompanyComponent', () => {
component = fixture.componentInstance;
component.company = {
apprenticeshipContract: buildApprenticeshipContract(123, 10, 20),
jobTrainerPerson: buildPerson(10),
apprenticeshipManagerPerson: buildPerson(20),
jobTrainer: buildJobTrainer(10),
apprenticeshipManager: buildApprenticeshipManager(20),
};
fixture.detectChanges();
});
Expand Down
28 changes: 28 additions & 0 deletions src/app/shared/models/apprenticeship-manager.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as t from 'io-ts';
import { Maybe, Option } from './common-types';

const ApprenticeshipManager = t.type({
// HRef: t.string,
Email: t.string,
Email2: Option(t.string),
PhoneBusiness: t.string,
// PhoneMobile: Option(t.string),
CompanyName: t.string,
// CompanyNameAddition: Option(t.string),
Firstname: Option(t.string),
// MiddleName: Option(t.string),
Lastname: Option(t.string),
// FormOfAddress: Option(t.string),
// Gender: t.union([t.literal('M'), t.literal('F'), t.literal('X')]),
AddressLine1: t.string,
AddressLine2: Maybe(t.string),
PostalCode: t.string,
Location: t.string,
// Country: Option(t.string),
// CountryId: t.string,
// CorrespondenceAddress: Option(t.string),
// CorrespondencePersonId: t.number,
Id: t.number,
});
type ApprenticeshipManager = t.TypeOf<typeof ApprenticeshipManager>;
export { ApprenticeshipManager };
26 changes: 26 additions & 0 deletions src/app/shared/models/job-trainer.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import * as t from 'io-ts';
import { Maybe, Option } from './common-types';

const JobTrainer = t.type({
// HRef: t.string,
Email: Option(t.string),
Email2: Option(t.string),
PhoneBusiness: Option(t.string),
PhoneMobile: Option(t.string),
Firstname: t.string,
// MiddleName: Option(t.string),
Lastname: t.string,
// FormOfAddress: Option(t.string),
// Gender: t.union([t.literal('M'), t.literal('F'), t.literal('X')]),
// AddressLine1: Maybe(t.string),
// AddressLine2: Maybe(t.string),
// PostalCode: Option(t.string),
// Location: Option(t.string),
// Country: Option(t.string),
// CountryId: t.string,
// CorrespondenceAddress: Option(t.string),
// CorrespondencePersonId: t.number,
Id: t.number,
});
type JobTrainer = t.TypeOf<typeof JobTrainer>;
export { JobTrainer };
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { TestBed } from '@angular/core/testing';
import { buildTestModuleMetadata } from '../../../spec-helpers';

import { ApprenticeshipManagersRestService } from './apprenticeship-managers-rest.service';

describe('ApprenticeshipManagerRestService', () => {
beforeEach(() => TestBed.configureTestingModule(buildTestModuleMetadata({})));

it('should be created', () => {
const service: ApprenticeshipManagersRestService = TestBed.inject(
ApprenticeshipManagersRestService
);
expect(service).toBeTruthy();
});
});
16 changes: 16 additions & 0 deletions src/app/shared/services/apprenticeship-managers-rest.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { HttpClient } from '@angular/common/http';
import { Inject, Injectable } from '@angular/core';
import { SETTINGS, Settings } from '../../settings';
import { ApprenticeshipManager } from '../models/apprenticeship-manager.model';
import { RestService } from './rest.service';

@Injectable({
providedIn: 'root',
})
export class ApprenticeshipManagersRestService extends RestService<
typeof ApprenticeshipManager
> {
constructor(http: HttpClient, @Inject(SETTINGS) settings: Settings) {
super(http, settings, ApprenticeshipManager, 'ApprenticeshipManagers');
}
}
17 changes: 17 additions & 0 deletions src/app/shared/services/job-trainers-rest.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { TestBed } from '@angular/core/testing';
import { buildTestModuleMetadata } from '../../../spec-helpers';

import { JobTrainersRestService } from './job-trainers-rest.service';

describe('JobTrainersRestService', () => {
beforeEach(() => {
TestBed.configureTestingModule(buildTestModuleMetadata({}));
});

it('should be created', () => {
const service: JobTrainersRestService = TestBed.inject(
JobTrainersRestService
);
expect(service).toBeTruthy();
});
});
14 changes: 14 additions & 0 deletions src/app/shared/services/job-trainers-rest.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { HttpClient } from '@angular/common/http';
import { Inject, Injectable } from '@angular/core';
import { SETTINGS, Settings } from '../../settings';
import { JobTrainer } from '../models/job-trainer.model';
import { RestService } from './rest.service';

@Injectable({
providedIn: 'root',
})
export class JobTrainersRestService extends RestService<typeof JobTrainer> {
constructor(http: HttpClient, @Inject(SETTINGS) settings: Settings) {
super(http, settings, JobTrainer, 'JobTrainers');
}
}
Loading