Skip to content

Commit

Permalink
Merge pull request #158 from AllianceBioversityCIAT/staging
Browse files Browse the repository at this point in the history
* Fixed Removed validation for DAC Score in IPSR module
  • Loading branch information
JuanGuzman-io authored Sep 8, 2023
2 parents 1f35b50 + 7006672 commit 86bc03c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ export class ResultsInnovationPackagesValidationModuleRepository extends Reposit
r.climate_change_tag_level_id IS NULL
OR r.climate_change_tag_level_id = 0
)
OR (
r.nutrition_tag_level_id IS NULL
OR r.nutrition_tag_level_id = 0
)
OR (
r.environmental_biodiversity_tag_level_id IS NULL
OR r.environmental_biodiversity_tag_level_id = 0
)
OR (
r.poverty_tag_level_id IS NULL
OR r.poverty_tag_level_id = 0
)
OR (
r.gender_tag_level_id = 3
AND (
Expand All @@ -75,47 +63,7 @@ export class ResultsInnovationPackagesValidationModuleRepository extends Reposit
AND e.youth_related
AND e.is_active = 1
) = 0
)
OR (
r.nutrition_tag_level_id = 3
AND (
SELECT
COUNT(*)
FROM
evidence e
WHERE
e.result_id = r.id
AND e.nutrition_related
AND e.is_active = 1
) = 0
)
OR (
r.environmental_biodiversity_tag_level_id = 3
AND (
SELECT
COUNT(*)
FROM
evidence e
WHERE
e.result_id = r.id
AND e.environmental_biodiversity_related
AND e.is_active = 1
) = 0
)
OR (
r.poverty_tag_level_id = 3
AND (
SELECT
COUNT(*)
FROM
evidence e
WHERE
e.result_id = r.id
AND e.poverty_related
AND e.is_active = 1
) = 0
)
THEN FALSE
) THEN FALSE
ELSE TRUE
END AS validation
FROM
Expand Down
4 changes: 2 additions & 2 deletions onecgiar-pr-server/src/api/results/result.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ export class ResultRepository
}

/**
* !Revisar asignacion de de parametros sql
* @param id
* @param allowDeleted
* @param version
Expand Down Expand Up @@ -301,7 +300,8 @@ export class ResultRepository
and rc.is_active > 0
left join clarisa_countries cc on
cc.id = rc.country_id
${!allowDeleted ? 'where r.is_active > 0' : ''}
where r.result_type_id not in (10,11)
${!allowDeleted ? 'and r.is_active > 0' : ''}
group by
r.id,
r.title,
Expand Down

0 comments on commit 86bc03c

Please sign in to comment.