Skip to content

Commit

Permalink
Fix filtering criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Dec 13, 2023
1 parent f07d4be commit 687025d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/src/modules/h3-data/h3-data.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ export class H3DataRepository extends Repository<H3Data> {
dto.originIds,
dto.t1SupplierIds,
dto.producerIds,
dto.businessUnitIds,
dto.locationTypes,
baseQueryExtend,
false,
Expand Down Expand Up @@ -459,6 +460,7 @@ export class H3DataRepository extends Repository<H3Data> {
dto.originIds,
dto.t1SupplierIds,
dto.producerIds,
dto.businessUnitIds,
dto.locationTypes,
baseQueryExtend,
true,
Expand Down Expand Up @@ -513,6 +515,7 @@ export class H3DataRepository extends Repository<H3Data> {
dto.originIds,
dto.t1SupplierIds,
dto.producerIds,
dto.businessUnitIds,
dto.locationTypes,
baseQueryExtend,
true,
Expand All @@ -530,6 +533,7 @@ export class H3DataRepository extends Repository<H3Data> {
originIds?: string[],
t1SupplierIds?: string[],
producerIds?: string[],
businessUnitIds?: string[],
locationTypes?: LOCATION_TYPES[],
baseQueryExtend?: (baseQuery: SelectQueryBuilder<any>) => void,
scenarioComparisonQuantiles?: boolean,
Expand All @@ -545,6 +549,7 @@ export class H3DataRepository extends Repository<H3Data> {
t1SupplierIds,
producerIds,
originIds,
businessUnitIds,
locationTypes,
);

Expand Down Expand Up @@ -669,6 +674,7 @@ export class H3DataRepository extends Repository<H3Data> {
t1SupplierIds?: string[],
producerIds?: string[],
originIds?: string[],
businessUnitIds?: string[],
locationTypes?: string[],
): SelectQueryBuilder<any> {
if (materialIds) {
Expand All @@ -691,6 +697,11 @@ export class H3DataRepository extends Repository<H3Data> {
originIds,
});
}
if (businessUnitIds) {
subqueryBuilder.andWhere('sl.businessUnitId IN (:...businessUnitIds)', {
businessUnitIds,
});
}
if (locationTypes) {
subqueryBuilder.andWhere('sl.locationType IN (:...locationTypes)', {
locationTypes,
Expand Down

0 comments on commit 687025d

Please sign in to comment.