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

[ETL] Incorrect table name used for undoing exits and cancels #112

Closed
Tracked by #1672 ...
mahalakshme opened this issue Nov 6, 2024 · 4 comments
Closed
Tracked by #1672 ...

[ETL] Incorrect table name used for undoing exits and cancels #112

mahalakshme opened this issue Nov 6, 2024 · 4 comments
Assignees

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Nov 6, 2024

Issue:

org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [delete from "poweratuat"."indivi_exit_compensation_in_case_exit"
using "poweratuat"."indivi_exit_compensation_in_case"
where "poweratuat"."indivi_exit_compensation_in_case_exit".id = "poweratuat"."indivi_exit_compensation_in_case".id
and "poweratuat"."indivi_exit_compensation_in_case".program_exit_date_time is null;]
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:99)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1538)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:393)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:431)

Tech analysis:

  • The program enrolment table name is not always a substring of program exit table name like coded here
  • In power org, exit table is truncated table name, and enrolment table is full name without any truncation.
  • Similar case for encounter cancel table names like coded here

AC:

  • The ETLs of power and poweratuat in prerelease should pass after the fix
  • Create general encounter type with name 'maternity benefit claims documentationaaaaaaaaaaaa' for subject type 'Individual' and check for the case in this card. Applicable for program encounter as well.
  • This and this cards AC should continue to work as expected.

Questions:

exit and cancel suffixes added at two places when truncated. - just by searching for exit we can find the usage

Test suggestions

Good to test with few orgs which has exit table issue(power org has this) and general encounter/program encounter issue and normal case as well is my opinion.

@mahalakshme mahalakshme converted this from a draft issue Nov 6, 2024
@mahalakshme mahalakshme changed the title [ETL] Incorrect table name used for undoing exits [ETL] Incorrect table name used for undoing exits and cancels Nov 6, 2024
@mahalakshme mahalakshme moved this from In Analysis to In Analysis Review in Avni Product Nov 6, 2024
@mahalakshme mahalakshme mentioned this issue Nov 6, 2024
@mahalakshme mahalakshme moved this from In Analysis Review to Ready in Avni Product Nov 8, 2024
@himeshr himeshr self-assigned this Nov 21, 2024
@himeshr himeshr moved this from Ready to In Progress in Avni Product Nov 21, 2024
@himeshr
Copy link
Contributor

himeshr commented Nov 21, 2024

Caused an urgent issue for Shelter.. raised as ticket

@himeshr himeshr moved this from In Progress to Code Review Ready in Avni Product Nov 21, 2024
@petmongrels petmongrels moved this from Code Review Ready to In Code Review in Avni Product Nov 21, 2024
@petmongrels petmongrels moved this from In Code Review to QA Ready in Avni Product Nov 21, 2024
@himeshr
Copy link
Contributor

himeshr commented Nov 21, 2024

Since the issue is encountered after recent data-fix in prod env DB, this can currently only be tested on local using dump.
Marking it Tech-qa.

himeshr added a commit that referenced this issue Nov 21, 2024
@himeshr
Copy link
Contributor

himeshr commented Nov 21, 2024

Successfull completed ETL schema run for Shelter org dump on local.

@himeshr himeshr closed this as completed Nov 21, 2024
@github-project-automation github-project-automation bot moved this from QA Ready to Done in Avni Product Nov 21, 2024
himeshr added a commit to avniproject/avni-server that referenced this issue Nov 21, 2024
himeshr added a commit to avniproject/avni-server that referenced this issue Nov 21, 2024
himeshr added a commit to avniproject/avni-server that referenced this issue Nov 21, 2024
…ocal db when it fails to perform create_db_user() action
himeshr added a commit to avniproject/avni-server that referenced this issue Nov 21, 2024
himeshr added a commit to avniproject/avni-server that referenced this issue Nov 21, 2024
@mahalakshme mahalakshme moved this from Done to QA Ready in Avni Product Nov 22, 2024
@vinayvenu vinayvenu reopened this Nov 22, 2024
@github-project-automation github-project-automation bot moved this from QA Ready to Triaged in Avni Product Nov 22, 2024
@mahalakshme mahalakshme moved this from Triaged to In QA in Avni Product Nov 22, 2024
@mahalakshme
Copy link
Contributor Author

tested with power - enrolment -> exit -> undo exit
shelter for program encounter -> cancel -> undo cancel by syncing with details from different mobile
both above in tables where exit/cancel table names are truncated and original tables whose names not truncated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants