Merge pull request #148 in TEA/mina-sidor-fa-web from bugfix/TV-696-Telefonnummer-i-deltagarkortet-visar-undefined- to next
Squashed commit of the following: commit be0b5ebe0fdb568e4264354010f147cd18deceee Author: Daniel Appelgren <daniel.appelgren@arbetsformedlingen.se> Date: Tue Sep 28 11:29:03 2021 +0200 id ska vara genomforandeReferens commit f5d294d827b5254e444e77ec389a9de2ce7ec25c Author: Daniel Appelgren <daniel.appelgren@arbetsformedlingen.se> Date: Tue Sep 28 09:39:09 2021 +0200 telefonnummer visas inte ifall något av landskod eller telefonnummer saknas
This commit is contained in:
@@ -15,13 +15,18 @@ export interface ContactInformation {
|
|||||||
|
|
||||||
export function mapResponseToContactInformation(data: ContactInformationResponse): ContactInformation {
|
export function mapResponseToContactInformation(data: ContactInformationResponse): ContactInformation {
|
||||||
const { fornamn, efternamn, personnummer, epost, telekomadresser, adresser } = data;
|
const { fornamn, efternamn, personnummer, epost, telekomadresser, adresser } = data;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
firstName: fornamn || '',
|
firstName: fornamn || '',
|
||||||
lastName: efternamn || '',
|
lastName: efternamn || '',
|
||||||
fullName: fornamn && efternamn ? `${fornamn} ${efternamn}` : '',
|
fullName: fornamn && efternamn ? `${fornamn} ${efternamn}` : '',
|
||||||
ssn: personnummer ? mapStringToSsn(personnummer) : '',
|
ssn: personnummer ? mapStringToSsn(personnummer) : '',
|
||||||
email: epost || '',
|
email: epost || '',
|
||||||
phoneNumbers: telekomadresser ? telekomadresser.map(phoneNumber => mapResponseToPhoneNumber(phoneNumber)) : [],
|
phoneNumbers: telekomadresser
|
||||||
|
? telekomadresser
|
||||||
|
.filter(phoneNumber => phoneNumber.landskod && phoneNumber.nummer_utan_inledande_nolla)
|
||||||
|
.map(phoneNumber => mapResponseToPhoneNumber(phoneNumber))
|
||||||
|
: [],
|
||||||
addresses: adresser ? adresser.map(address => mapResponseToAddress(address)) : null,
|
addresses: adresser ? adresser.map(address => mapResponseToAddress(address)) : null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ function generateAvrop(amount = 10, deltagare, handledare) {
|
|||||||
fornamn: currentDeltagare.contact.fornamn,
|
fornamn: currentDeltagare.contact.fornamn,
|
||||||
efternamn: currentDeltagare.contact.efternamn,
|
efternamn: currentDeltagare.contact.efternamn,
|
||||||
deltagare: `${currentDeltagare.contact.fornamn} ${currentDeltagare.contact.efternamn}`,
|
deltagare: `${currentDeltagare.contact.fornamn} ${currentDeltagare.contact.efternamn}`,
|
||||||
genomforandeReferens: faker.datatype.number({ min: 100000000, max: 999999999 }),
|
genomforandeReferens: currentDeltagare.genomforandeReferens,
|
||||||
orgId: faker.datatype.uuid(),
|
orgId: faker.datatype.uuid(),
|
||||||
leverantorId: faker.datatype.number({ min: 1000, max: 99999 }),
|
leverantorId: faker.datatype.number({ min: 1000, max: 99999 }),
|
||||||
organisationsnummer: organization.organizationNumber,
|
organisationsnummer: organization.organizationNumber,
|
||||||
|
|||||||
@@ -44,9 +44,12 @@ function generateDeltagare(amount = 10) {
|
|||||||
const educationLevel = EDUCATION_LEVELS[Math.floor(Math.random() * EDUCATION_LEVELS.length)];
|
const educationLevel = EDUCATION_LEVELS[Math.floor(Math.random() * EDUCATION_LEVELS.length)];
|
||||||
const sunKod = SUN_KODER[Math.floor(Math.random() * SUN_KODER.length)];
|
const sunKod = SUN_KODER[Math.floor(Math.random() * SUN_KODER.length)];
|
||||||
|
|
||||||
|
const genomforandeReferens = faker.datatype.number({ min: 100000000, max: 999999999 });
|
||||||
|
|
||||||
const deltagare = {
|
const deltagare = {
|
||||||
id,
|
id: genomforandeReferens,
|
||||||
sokandeId: id,
|
sokandeId: id,
|
||||||
|
genomforandeReferens,
|
||||||
contact: {
|
contact: {
|
||||||
fornamn,
|
fornamn,
|
||||||
efternamn,
|
efternamn,
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ router.render = (req, res) => {
|
|||||||
startdatumAvrop,
|
startdatumAvrop,
|
||||||
slutdatumAvrop,
|
slutdatumAvrop,
|
||||||
hasAvbrott,
|
hasAvbrott,
|
||||||
genomforandeReferens,
|
genomforandeReferens: genomforandeReferens.toString(),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user