Skip to content

Commit a1dcea8

Browse files
committed
fix(demo): correctly generate category values again
demo generated center, gender, etc. have been broken
1 parent ae9e103 commit a1dcea8

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

src/app/child-dev-project/children/demo-data-generators/aser/demo-aser-generator.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ export class DemoAserGeneratorService extends DemoDataGenerator<Entity> {
5151
aserResult.math = this.selectNextSkillLevel(
5252
mathLevels.slice(1),
5353
previousResult.math,
54-
).id;
54+
);
5555
aserResult.english = this.selectNextSkillLevel(
5656
readingLevels.slice(1),
5757
previousResult.english,
58-
).id;
58+
);
5959
aserResult[firstLanguage] = this.selectNextSkillLevel(
6060
readingLevels.slice(1),
6161
previousResult[firstLanguage],
62-
).id;
62+
);
6363

6464
data.push(aserResult);
6565

src/app/child-dev-project/children/demo-data-generators/demo-child-generator.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ export class DemoChildGenerator extends DemoDataGenerator<Entity> {
3636
child.name = faker.person.firstName() + " " + faker.person.lastName();
3737
child.projectNumber = id;
3838
child.religion = faker.helpers.arrayElement(religions);
39-
child.gender = faker.helpers.arrayElement(genders.slice(1)).id;
39+
child.gender = faker.helpers.arrayElement(genders.slice(1));
4040
child.dateOfBirth = new DateWithAge(faker.dateOfBirth(5, 20));
4141
child.motherTongue = faker.helpers.arrayElement(languages);
42-
child.center = faker.helpers.arrayElement(centersWithProbability).id;
42+
child.center = faker.helpers.arrayElement(centersWithProbability);
4343
child.phone =
4444
"+" +
4545
faker.number.int({ min: 10, max: 99 }) +

src/app/child-dev-project/children/demo-data-generators/educational-material/demo-educational-material-generator.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class DemoEducationalMaterialGeneratorService extends DemoDataGenerator<E
7272
to: faker.getEarlierDateOrToday(child["dropoutDate"]),
7373
});
7474
entity.materialAmount = faker.helpers.arrayElement([1, 1, 1, 2, 3]);
75-
entity.materialType = faker.helpers.arrayElement(materials).id;
75+
entity.materialType = faker.helpers.arrayElement(materials);
7676

7777
return entity;
7878
}

src/app/child-dev-project/children/demo-data-generators/observations/demo-historical-data-generator.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ export class DemoHistoricalDataGenerator extends DemoDataGenerator<Entity> {
5252
const historicalDataOfChild = [...Array(countOfData)].map(() => {
5353
const historicalData = createEntityOfType("HistoricalEntityData");
5454
for (const attribute of attributes) {
55-
historicalData[attribute] =
56-
faker.helpers.arrayElement(ratingAnswers).id;
55+
historicalData[attribute] = faker.helpers.arrayElement(ratingAnswers);
5756
}
5857
historicalData.date = faker.date.past();
5958
historicalData.relatedEntity = child.getId();

0 commit comments

Comments
 (0)