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

Pulled from sl master #23

Open
wants to merge 188 commits into
base: release-4.1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
7467a4d
Resolved filter data issue
aman-tunerlabs Jul 26, 2021
ba185d6
Merge pull request #16 from shikshalokam/reports-filter-issues
aman-tunerlabs Jul 26, 2021
930cfc8
Added pagination logic in survey reports
aman-tunerlabs Sep 8, 2021
689f1d6
Merge pull request #17 from shikshalokam/SB-26464
aman-tunerlabs Sep 8, 2021
077d204
LOGS: Added on improvementProjectTaskPdfGeneration
aman-g202 Sep 20, 2021
ffa25ef
LOGS: Added on improvementProjectTaskPdfGeneration
aman-g202 Sep 20, 2021
046dfec
LOGS: Added on improvementProjectTaskPdfGeneration
aman-g202 Sep 20, 2021
66ac1fb
LOGS: Added on improvementProjectTaskPdfGeneration
aman-g202 Sep 20, 2021
aa42294
Merge pull request #18 from shikshalokam/pdf-reports-issue
aman-g202 Sep 20, 2021
aab11ab
DEBUGGING: Share pdf reports issue
aman-g202 Sep 23, 2021
196d46d
DEBUGGING: Share pdf reports issue
aman-g202 Sep 23, 2021
db166f7
DEBUGGING: Share pdf reports issue
aman-g202 Sep 23, 2021
e66ff87
Merge pull request #20 from shikshalokam/pdf-reports-issue
aman-g202 Sep 23, 2021
1ee40df
DEBUGGING: Share pdf reports issue
aman-g202 Sep 23, 2021
1a662a7
Merge pull request #21 from shikshalokam/pdf-reports-issue
aman-g202 Sep 23, 2021
eb1a492
DEBUGGING: Share pdf reports issue
aman-g202 Sep 23, 2021
e58499a
Merge pull request #22 from shikshalokam/pdf-reports-issue
aman-g202 Sep 23, 2021
a8a6b22
DEBUGGING: Share pdf reports issue
aman-g202 Sep 23, 2021
ce4301f
Merge pull request #23 from shikshalokam/pdf-reports-issue
aman-g202 Sep 23, 2021
c83cdee
DEBUGGING: Share pdf reports issue
aman-g202 Sep 23, 2021
f83d06b
Merge pull request #24 from shikshalokam/pdf-reports-issue
aman-g202 Sep 23, 2021
d2f21b0
DEBUGGING: Share pdf reports issue
aman-g202 Sep 23, 2021
04e6e46
Merge pull request #25 from shikshalokam/pdf-reports-issue
aman-g202 Sep 23, 2021
7ddbf70
DEBUGGING: Entity observation report
aman-g202 Sep 24, 2021
954a863
Merge pull request #26 from shikshalokam/pdf-reports-issue
aman-g202 Sep 24, 2021
50335cb
DEBUGGING: Entity observation report
aman-g202 Sep 24, 2021
240e2c0
Merge pull request #27 from shikshalokam/pdf-reports-issue
aman-g202 Sep 24, 2021
54d8f3b
IMPROVED: getDownloadableUrl function in helper/kendra_service.js
aman-g202 Sep 24, 2021
5548a28
IMPROVED: getDownloadableUrl function in helper/kendra_service.js
aman-g202 Sep 24, 2021
048198e
Merge pull request #28 from shikshalokam/pdf-reports-issue
aman-g202 Sep 24, 2021
49b0973
DEBUGGING: Error on rimraf
aman-g202 Sep 24, 2021
d56f9f4
Merge pull request #29 from shikshalokam/pdf-reports-issue
aman-g202 Sep 24, 2021
34140ca
DEBUGGING: reports issue
aman-g202 Sep 29, 2021
3490949
Merge pull request #30 from shikshalokam/pdf-reports-issue
aman-g202 Sep 29, 2021
b8999dd
rimraf issue
aman-tunerlabs Sep 30, 2021
ac8c937
resolve conflict
aman-tunerlabs Sep 30, 2021
b0731a1
Merge pull request #31 from shikshalokam/SB-26464
aman-tunerlabs Sep 30, 2021
1b0c52a
auto build
priyanka-TL Oct 20, 2021
e53514f
Merge pull request #32 from shikshalokam/autoBuild
priyanka-TL Oct 20, 2021
89091dd
overlaping test
priyanka-TL Oct 22, 2021
b89226c
Merge pull request #33 from shikshalokam/reportFix
aks30 Oct 22, 2021
afa7ebf
fix
priyanka-TL Oct 22, 2021
1facf59
Merge pull request #34 from shikshalokam/reportFix
priyanka-TL Oct 22, 2021
e133f0f
readme & report
priyanka-TL Oct 25, 2021
267fda9
Merge pull request #35 from shikshalokam/reportFix
priyanka-TL Oct 25, 2021
bab776a
fix
priyanka-TL Oct 25, 2021
fff33be
Merge pull request #36 from shikshalokam/reportFix
priyanka-TL Oct 25, 2021
96cee62
criteria score added the api response
rakeshSgr Nov 22, 2021
eda1fd8
Merge pull request #37 from shikshalokam/SB-27101
aks30 Nov 22, 2021
aa825f7
criteria score added the api response
rakeshSgr Nov 22, 2021
bcdeca5
Merge pull request #38 from shikshalokam/SB-27101
aks30 Nov 22, 2021
170d553
report changes for observation report
rakeshSgr Nov 24, 2021
5f57a71
removed unwanted code
rakeshSgr Nov 24, 2021
a1828a7
Merge pull request #39 from shikshalokam/SB-27101
aks30 Nov 24, 2021
aa022a5
pdf design changes
rakeshSgr Nov 26, 2021
d0b83fb
view file changes added
rakeshSgr Nov 26, 2021
86c7755
removed unwanted code
rakeshSgr Nov 26, 2021
afdf447
Merge pull request #40 from shikshalokam/SB-27101
aks30 Nov 26, 2021
0870c5e
footer fix
rakeshSgr Nov 30, 2021
2c05ebc
Merge pull request #41 from shikshalokam/SB-27101
aks30 Nov 30, 2021
c082424
Merge pull request #42 from shikshalokam/4.5
rakeshSgr Nov 30, 2021
359fa57
status changes
rakeshSgr Jan 25, 2022
5749056
Merge pull request #43 from shikshalokam/statusChanges
aks30 Jan 27, 2022
9e6adeb
pdf alignment fix
rakeshSgr Feb 9, 2022
6cfae50
Merge pull request #44 from shikshalokam/pdfAllignement
aks30 Feb 9, 2022
5677d9c
pdf changes
rakeshSgr Feb 14, 2022
f370e62
Merge pull request #45 from shikshalokam/pdfAllignement
aks30 Feb 14, 2022
0054907
submission count fix
rakeshSgr Feb 16, 2022
04952af
Merge pull request #46 from shikshalokam/submissionCount
aks30 Feb 16, 2022
06625af
assigned to removed from pdf doc
rakeshSgr Mar 4, 2022
68b2785
Merge pull request #47 from shikshalokam/impPdfUpdate
aks30 Mar 4, 2022
fbde326
gotenberg options added
VISHNUDAS-tunerlabs Apr 25, 2022
574c056
ejs change
VISHNUDAS-tunerlabs Apr 25, 2022
1796312
resolves
VISHNUDAS-tunerlabs Apr 26, 2022
fddcfc6
Merge pull request #48 from shikshalokam/SB-28350_pdf
aks30 Apr 26, 2022
474c3dd
4.8 fix
VISHNUDAS-tunerlabs Apr 26, 2022
545777d
task template ejs
VISHNUDAS-tunerlabs Apr 26, 2022
068c8c8
Merge pull request #49 from shikshalokam/SB-28350_pdf
aks30 Apr 26, 2022
2556d5f
fix task pdf
VISHNUDAS-tunerlabs Apr 26, 2022
44f1502
Merge pull request #50 from shikshalokam/SB-28350_taskDoc_fix
aks30 Apr 26, 2022
307c24e
4.8 fixes
rakeshSgr Apr 27, 2022
6a0b417
debug consoles
VISHNUDAS-tunerlabs Apr 27, 2022
5d5cf1b
Merge pull request #51 from shikshalokam/SB-28350debug
aks30 Apr 27, 2022
7af21e6
gotenberg endpoint change
VISHNUDAS-tunerlabs Apr 28, 2022
4c0f3f0
Merge pull request #52 from shikshalokam/gotenberg_Debug
aks30 Apr 28, 2022
6ed2137
28350 resolves
VISHNUDAS-tunerlabs Apr 28, 2022
05bfb6d
Merge pull request #53 from shikshalokam/SB-28350_resolves
aks30 Apr 28, 2022
970df22
ejs
VISHNUDAS-tunerlabs Apr 29, 2022
843d8c7
issue resolves
VISHNUDAS-tunerlabs Apr 29, 2022
09bcfb0
fixes 28350
VISHNUDAS-tunerlabs Apr 29, 2022
2b98c1b
Merge pull request #54 from shikshalokam/28350_bug_fix
aks30 Apr 29, 2022
29436d8
check issue
priyanka-TL May 2, 2022
7d8e2ff
Merge pull request #55 from shikshalokam/fixPDF
priyanka-TL May 2, 2022
d5dfc76
link error resolve
VISHNUDAS-tunerlabs May 4, 2022
a2b10b8
project status & SB-29770
VISHNUDAS-tunerlabs May 4, 2022
9d9eae7
Merge pull request #56 from shikshalokam/SB-28350-open
aks30 May 4, 2022
2f8753c
no task progressbar error
VISHNUDAS-tunerlabs May 6, 2022
465b0fd
Merge pull request #57 from shikshalokam/28350-resolve
aks30 May 6, 2022
e2839df
SB-29876 chart title condenses error resolve
VISHNUDAS-tunerlabs May 10, 2022
f2fe9b2
resolves
VISHNUDAS-tunerlabs May 10, 2022
1abde9d
Merge pull request #58 from shikshalokam/SB-29876
aks30 May 10, 2022
c23009e
SB-29901
VISHNUDAS-tunerlabs May 11, 2022
f500117
Merge pull request #59 from shikshalokam/SB-29901
aks30 May 11, 2022
450b0aa
readme
priyanka-TL Jun 29, 2022
0be85cc
Merge pull request #60 from shikshalokam/4.10
priyanka-TL Jun 29, 2022
0713ba4
console removed
VISHNUDAS-tunerlabs Sep 7, 2022
ddfdad4
Merge pull request #61 from shikshalokam/5.0_release_fix
aks30 Sep 7, 2022
6a3d6c4
method added
VISHNUDAS-tunerlabs Sep 21, 2022
282b490
question response report
VISHNUDAS-tunerlabs Sep 21, 2022
1df9bf1
Merge pull request #62 from shikshalokam/SB-30992-QRR
aks30 Sep 21, 2022
e7dc7c0
gottenberg margin added
VISHNUDAS-tunerlabs Sep 30, 2022
706b53c
Merge pull request #63 from shikshalokam/SB-31018
aks30 Sep 30, 2022
4aabdd9
dockerfile updated - install fonts
VISHNUDAS-tunerlabs Dec 23, 2022
36c0ad2
Merge pull request #64 from shikshalokam/reportFontIssue
aks30 Dec 23, 2022
155b7d8
formdata margin added
VISHNUDAS-tunerlabs Jan 3, 2023
22b8273
Merge pull request #65 from shikshalokam/ED-720-fix
aks30 Jan 3, 2023
1f451a3
project PDF evidence fix
VISHNUDAS-tunerlabs Jan 5, 2023
1b3b8ab
Merge pull request #66 from shikshalokam/ED-725
aks30 Jan 5, 2023
13540b0
ED-723 Remark cut fix
VISHNUDAS-tunerlabs Jan 9, 2023
620193f
Merge pull request #67 from shikshalokam/ED-811
aks30 Jan 9, 2023
b5c242f
ED-723 bug fix
VISHNUDAS-tunerlabs Jan 9, 2023
5a17f7b
Merge pull request #68 from shikshalokam/ED-811
aks30 Jan 9, 2023
0253d04
ED-811 project details page split by goteberg fix
VISHNUDAS-tunerlabs Jan 9, 2023
b70a1f6
Merge pull request #69 from shikshalokam/ED-811
aks30 Jan 9, 2023
2ffee3e
ED-811 bug fix
VISHNUDAS-tunerlabs Jan 9, 2023
f01682d
Merge pull request #70 from shikshalokam/ED-811
aks30 Jan 9, 2023
11d876a
QRR bug fix
VISHNUDAS-tunerlabs Jan 10, 2023
2c24df6
Merge pull request #71 from shikshalokam/ED-811
aks30 Jan 10, 2023
e6fa37b
ED-94 added block level filter
Jan 10, 2023
04ee814
added varibale in envvaribale file
Jan 12, 2023
836535b
Optimized code
Feb 1, 2023
a5f4d37
Added user extension validation
Feb 7, 2023
a59c852
Project details page break error fix
VISHNUDAS-tunerlabs Feb 22, 2023
416ab2b
Merge pull request #73 from shikshalokam/Ed-1326
aks30 Feb 22, 2023
50efe71
ED-1326 fix
VISHNUDAS-tunerlabs Feb 22, 2023
cfb46b5
Merge pull request #74 from shikshalokam/Ed-1326
aks30 Feb 22, 2023
45f5e63
removed console log
Mar 7, 2023
bb8b1af
Added all data source and All types of solutions
Apr 10, 2023
f59d1aa
Added all data source and All types of solutions
Apr 10, 2023
028c71e
Added all data source and All types of solutions
Apr 10, 2023
79df440
Added all data source and All types of solutions
Apr 10, 2023
e3dc75d
Added Reuseable functions and Resolving all the comments
Apr 10, 2023
abc5968
Added Reuseable functions and Resolving all the comments
Apr 10, 2023
5e10877
Added Reuseable functions and Resolving all the comments
Apr 10, 2023
79a764d
Added Reuseable functions and Resolving all the comments
Apr 10, 2023
154b246
Fixed code as per comment
Apr 10, 2023
54c6dbb
Fixed code as per comment
Apr 11, 2023
4476e27
Merge pull request #72 from shikshalokam/ED-94
aks30 Apr 11, 2023
9a41801
Added PR checklist
May 2, 2023
a4950af
Merge pull request #75 from shikshalokam/PR
aks30 May 2, 2023
a80f6c2
apt font install removed due to build error
VISHNUDAS-tunerlabs May 3, 2023
8673cd3
Merge pull request #76 from shikshalokam/dockerFileChange
aks30 May 3, 2023
99f49e0
Update intervals in druid query
May 12, 2023
58c1516
Update intervals in druid query
May 12, 2023
319933a
Updated Comments and dockerfile as well
May 12, 2023
652f22b
Merge pull request #77 from shikshalokam/SetInterval
aks30 May 12, 2023
447da1f
Fixed Null value in druid query
May 29, 2023
3a3777d
changes in getIntervalFilter utils function
VISHNUDAS-tunerlabs Jun 1, 2023
6a92f50
Merge pull request #79 from shikshalokam/Block-level-filter-bug-fix
aks30 Jun 1, 2023
a927caf
Merge pull request #78 from shikshalokam/SetInterval
aks30 Jun 1, 2023
49b5d49
Added Release Notes
Jun 16, 2023
a08e6c2
Merge pull request #80 from shikshalokam/ReleaseNotes
aks30 Jun 16, 2023
377fcd2
ED-2587 Fix
VISHNUDAS-tunerlabs Jul 11, 2023
0dc1456
ED-2587 fixes
VISHNUDAS-tunerlabs Jul 11, 2023
4e89f56
Merge pull request #81 from shikshalokam/ED-2587-Fix
aks30 Jul 11, 2023
73240b6
changes for ED-2583 && ED-2584
VISHNUDAS-tunerlabs Jul 12, 2023
5e49cc8
param name change in utils getIntervalFilter fn
VISHNUDAS-tunerlabs Jul 12, 2023
b3ee8bc
Merge pull request #82 from shikshalokam/ED-2587-Fix
aks30 Jul 12, 2023
9845a2a
Added Release Tag
Jul 12, 2023
ed3d444
Merge pull request #83 from shikshalokam/ReleaseNotes
aks30 Jul 12, 2023
6d5974a
Added Setup guide and postman collection
Jul 19, 2023
26ffad6
Added Setup guide and postman collection
Jul 19, 2023
1221470
Fix for ED-56
VISHNUDAS-tunerlabs Jul 24, 2023
5cf205b
Merge pull request #85 from shikshalokam/ED-2587-Fix
aks30 Jul 24, 2023
77f40cb
Merge pull request #84 from shikshalokam/SetupGuide
aks30 Jul 24, 2023
ff4b962
Fix ED-1428
VISHNUDAS-tunerlabs Jul 25, 2023
ca60eeb
Relaease tag updated
VISHNUDAS-tunerlabs Jul 25, 2023
eb366a0
Merge pull request #86 from shikshalokam/ED-1428
aks30 Jul 25, 2023
6d44701
Release: added release note for 7.0.0
Jan 18, 2024
9a7bfd5
Merge pull request #87 from shikshalokam/release-7.0.0-notes
aks30 Jan 18, 2024
c8a03d1
high vulnerability issue fixes
praveenKDass Apr 12, 2024
071b37d
worked on PR comments
praveenKDass Apr 12, 2024
93d9c90
upgrade node version from 18 to 20
praveenKDass Apr 16, 2024
18286a4
Merge pull request #90 from shikshalokam/securityFixes-2.0
aks30 Apr 17, 2024
d50ceea
feat:api to generate report based on given stats
borkarsaish65 Jul 3, 2024
e4b4e4e
feat:added pdf generation code
borkarsaish65 Jul 3, 2024
091f02c
feat:format the files
praveenKDass Jul 4, 2024
c925db1
Merge pull request #91 from shikshalokam/kt-task/statsReport
ankit1shahu Jul 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
npm-debug.log
.vscode
logs
public
logs
4 changes: 4 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ OBSERVATION_DATASOURCE_NAME = "OBSERVATION_DATASOURCE_NAME" // Obs
OBSERVATION_EVIDENCE_DATASOURCE_NAME = "EVIDENCE_DATASOURCE_NAME" // Observation evidences data source name
SURVEY_DATASOURCE_NAME = "SURVEY_DATASOURCE_NAME" // Survey data source name
SURVEY_EVIDENCE_DATASOURCE_NAME = "SURVEY_EVIDENCE_DATASOURCE_NAME" // Survey evidence data source name
PROJECT_RESOURCE_DATASOURCE_NAME = "PROJECT_RESOURCE_DATASOURCE_NAME" // Project resource data source name
OBSERVATION_RESOURCE_DATASOURCE_NAME = "OBSERVATION_RESOURCE_DATASOURCE_NAME" // Observation resource data source name
SURVEY_RESOURCE_DATASOURCE_NAME = "SURVEY_RESOURCE_DATASOURCE_NAME" // Survey resource data source name
PROGRAM_RESOURCE_DATASOURCE_NAME = "PROGRAM_RESOURCE_DATASOURCE_NAME" // Program resource data source name
CONTENT_REPORT_THRESHOLD = 5 // Restrict number of records to be shown for container reports
ENTITY_SCORE_REPORT_THRESHOLD = 5 // Restrict number of submission for entity score report
OBSERVATION_SCORE_REPORT_THRESHOLD = 2 // Restrict number of submission per entity in observation report
Expand Down
36 changes: 36 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# Description
These recommendations are intended to promote code quality and team communication during software development. They cover a variety of topics, including ensuring that pull requests are submitted to the correct branch, documenting new methods, preserving consistency across many services, and avoiding typical blunders like accessing APIs or DB queries within loops. Sensitive data should not be uploaded, and changes to environment variables or database models should be executed consistently. Teams may work more effectively and develop higher-quality software by adhering to these standards.


## Type of change
Please choose appropriate options.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Enhancement (additive changes to improve performance)
- [ ] This change requires a documentation update

## Checklist

- [ ] It's critical to avoid making needless file modifications in contributions, such as adding new lines, console logs, or additional spaces, to guarantee cleaner and more efficient code. Furthermore, eliminating unnecessary imports from a file might enhance code readability and efficiency.
- [ ] Ensure that the pull request is assigned to the right base branch and that the development branch name contains the JIRA Task Id. Furthermore, each commit message should include the JIRA Task Id in the manner "ED-100: message".
- [ ] Only update packages if it is mentioned and authorized in the design document, and make sure that you have the required permissions.
- [ ] Avoid making API and database queries inside a loop as it can lead to performance issues and slow down the system.
- [ ] When calling another function inside a given function, add comments explaining the purpose and meaning of the passed arguments and expected return values.
- [ ] If adding a blank argument in a function, add a comment explaining the reason for the blank argument.
- [ ] Before submitting a pull request, do a self-review of your code to ensure there are no conflicts with the base branch and all comments have been addressed.
- [ ] Before merging a pull request, it's important to have other team members review it to catch any potential errors or issues
- [ ] To maintain code integrity, it's important to remove all related changes when removing code during a code review.
- [ ] If new constants, endpoints, or utility functions are introduced, it is important to check if they already exist in the service to avoid any duplication.
- [ ] Whenever a new environment variable is added to a service, it's important to ensure that the necessary changes are made to related files such as ".env.sample" and "envVariables.js" to maintain consistency and avoid errors. Additionally, the new environment variable should be added to the devops repository to ensure that it is properly documented and accessible to the team.
- [ ] When adding a new function to a service, it is important to document it with relevant information such as the name, parameters, and return value in a consistent format across all services. Additionally, if there are any changes to the API response, ensure that the documentation in the controllers is updated accordingly.
- [ ] Write a clear and concise commit message that describes the changes made.
- [ ] Maintain consistent function signature and code across all services when adding a function to multiple services. Implement changes to database models in all services that use the same model.
- [ ] Use only let and const. Do not use var.
- [ ] Make common functions for repetitive code blocks.
- [ ] Avoid uploading sensitive information such as secret tokens or passwords in pull requests to ensure data security.
- [ ] Maintain consistent indentation and spacing throughout the code.


2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ typings/
config/config.json
tmp/*
package-lock.json
keycloak-public-keys/
.vscode/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12
FROM node:20

WORKDIR /opt/reports

Expand Down
112 changes: 111 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,113 @@
# ml-reports-service
Manage Learn reports service

This is ml-reports-services, the managed-learn component responsible for creating reports for observation, survey, projects and programs within the managed learn services.

# Setup Guide

## Pre-Requisite

- Install any IDE in your system(eg: VScode etc..)
- Install nodejs from : https://nodejs.org/en/download/

Basic understanding of git and github is recommended.

- https://www.youtube.com/watch?v=RGOj5yH7evk&t=2s
- https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F

## Setup ml-reports-services

### Clone the service repository onto your system

- Create a new folder where you want to clone the repository.
- Navigate to that directory using the terminal.
- Execute the git commands to clone the repository using the provided link from the code tab.

Git link

https://github.com/shikshalokam/ml-reports-service.git

command to clone

git clone https://github.com/shikshalokam/ml-reports-service.git

### Create .env file

Create a file named `.env` and copy the environment-specific data corresponding to that service into the `.env` file.

# Environment configurations file
APPLICATION_PORT = "3000" // Application port number
APPLICATION_ENV = "development" // Application running enviornment

INTERNAL_ACCESS_TOKEN = "Fg*************yr" // Internal access token for accessing internal service APIs

#Druid configuration
DRUID_URL = "http://localhost:9042" // Druid connection url
OBSERVATION_DATASOURCE_NAME = "OBSERVATION_DATASOURCE_NAME" // Observation data source name
OBSERVATION_EVIDENCE_DATASOURCE_NAME = "EVIDENCE_DATASOURCE_NAME" // Observation evidences data source name
SURVEY_DATASOURCE_NAME = "SURVEY_DATASOURCE_NAME" // Survey data source name
SURVEY_EVIDENCE_DATASOURCE_NAME = "SURVEY_EVIDENCE_DATASOURCE_NAME" // Survey evidence data source name
PROJECT_RESOURCE_DATASOURCE_NAME = "PROJECT_RESOURCE_DATASOURCE_NAME" // Project resource data source name
OBSERVATION_RESOURCE_DATASOURCE_NAME = "OBSERVATION_RESOURCE_DATASOURCE_NAME" // Observation resource data source name
SURVEY_RESOURCE_DATASOURCE_NAME = "SURVEY_RESOURCE_DATASOURCE_NAME" // Survey resource data source name
PROGRAM_RESOURCE_DATASOURCE_NAME = "PROGRAM_RESOURCE_DATASOURCE_NAME" // Program resource data source name
CONTENT_REPORT_THRESHOLD = 5 // Restrict number of records to be shown for container reports
ENTITY_SCORE_REPORT_THRESHOLD = 5 // Restrict number of submission for entity score report
OBSERVATION_SCORE_REPORT_THRESHOLD = 2 // Restrict number of submission per entity in observation report
EVIDENCE_THRESHOLD = 3 // Restrict number of evidence per questions

#Gotenberg configuration
GOTENBERG_URL = "http://localhost:3000" // Gotenberg service URL

# ML Survey Service
ML_SURVEY_SERVICE_URL = "http://ml-survey-service:3000" // ML survey service URL

# ML Core Service
ML_CORE_SERVICE_URL = "http://ml-core-service:3000" // ML Core Service URL

# OFFLINE TOKEN VALIDATION
KEYCLOAK_PUBLIC_KEY_PATH = "keycloak-public-keys" // Keycloak public keys path

### Install Dependencies

To install dependencies from a `package.json` file in Visual Studio Code, you can use the integrated terminal. Here are the steps:

- Open the integrated terminal by going to View > Terminal or using the shortcut Ctrl+` (backtick).
- In the terminal, navigate to the directory where the package.json file is located.
- Run the command `npm install` or `yarn install`, depending on your preferred package manager.
- The package manager will read the package.json file and install all the dependencies specified in it.
- Wait for the installation process to complete. You should see progress indicators or a success message for each installed dependency.
- Once the installation is finished, the dependencies listed in the package.json file will be installed in a node_modules directory in your project.

### Setting the keycloak

- Create a folder on service directory named: `keycloak-public-keys`
- Inside that folder create a file `GRxxx....................xxxxx60fA`

**for keycloak file please contact Backend Team**

### Setup Database

The Reports service will communicate with the ML Core and ML Survey services to retrieve data from MongoDB for generating reports and analytics. Additionally, it will interact with Druid for the reporting and analytics functionalities.

### DB Schema

The schema serves as a blueprint for creating and maintaining the database that supports the ML reports services data storage and retrieval operations.

![ML-Reports Service](https://ml-services-uploads.s3.ap-south-1.amazonaws.com/DBSchema/ML-Reports.png)

[Click here](https://ml-services-uploads.s3.ap-south-1.amazonaws.com/DBSchema/ML-Reports.pdf) for DB schema and corresponding examples in a PDF format.

### Postman Collection

The ML Reports Service Postman Collection is a comprehensive resource for interacting with the ML Core Service. It includes organized endpoints, detailed documentation, and example workflows, providing a valuable reference for developers. Leverage this collection to enhance productivity and collaboration in ML Services.

[Click here](https://documenter.getpostman.com/view/7997930/2s946chuaT)

## IMPORTANT:

Always work on branches. **Never make changes to master**.

Creating a branch from master.

For more information on git you can use :
https://education.github.com/git-cheat-sheet-education.pdf
25 changes: 13 additions & 12 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,19 @@ app.set('port', port);

app.all("*", (req, res, next) => {

console.log("-------Request log starts here------------------");
console.log(
"%s %s on %s from ",
req.method,
req.url,
new Date(),
req.headers["user-agent"]
);
console.log("Request Headers: ", req.headers);
console.log("Request Body: ", req.body);
console.log("Request Files: ", req.files);
console.log("-------Request log ends here------------------");
console.log({"Debugging ML Reports Service": true});
// console.log("-------Request log starts here------------------");
// console.log(
// "%s %s on %s from ",
// req.method,
// req.url,
// new Date(),
// req.headers["user-agent"]
// );
// console.log("Request Headers: ", req.headers);
// console.log("Request Body: ", req.body);
// console.log("Request Files: ", req.files);
// console.log("-------Request log ends here------------------");


next();
Expand Down
55 changes: 55 additions & 0 deletions auto_build_deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@Library('deploy-conf') _
node('build-slave') {
try {
String ANSI_GREEN = "\u001B[32m"
String ANSI_NORMAL = "\u001B[0m"
String ANSI_BOLD = "\u001B[1m"
String ANSI_RED = "\u001B[31m"
String ANSI_YELLOW = "\u001B[33m"

ansiColor('xterm') {
timestamps {
stage('Checkout') {
tag_name = env.JOB_NAME.split("/")[-1]
pre_checks()
if (!env.hub_org) {
println(ANSI_BOLD + ANSI_RED + "Uh Oh! Please set a Jenkins environment variable named hub_org with value as registery/sunbidrded" + ANSI_NORMAL)
error 'Please resolve the errors and rerun..'
} else
println(ANSI_BOLD + ANSI_GREEN + "Found environment variable named hub_org with value as: " + hub_org + ANSI_NORMAL)
}
cleanWs()
def scmVars = checkout scm
checkout scm: [$class: 'GitSCM', branches: [[name: "refs/tags/$tag_name"]], userRemoteConfigs: [[url: scmVars.GIT_URL]]]
build_tag = tag_name + "_" + env.BUILD_NUMBER
commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
artifact_version = tag_name + "_" + commit_hash
echo "build_tag: " + build_tag

// stage Build
env.NODE_ENV = "build"
print "Environment will be : ${env.NODE_ENV}"
sh('git submodule update --init')
sh('git submodule update --init --recursive --remote')
sh('chmod 777 build.sh')
sh("./build.sh ${build_tag} ${env.NODE_NAME} ${hub_org}")


// stage ArchiveArtifacts
archiveArtifacts "metadata.json"
currentBuild.description = "${build_tag}"

}
}
currentBuild.result = "SUCCESS"
slack_notify(currentBuild.result, tag_name)
email_notify()
auto_build_deploy()
}
catch (err) {
currentBuild.result = "FAILURE"
slack_notify(currentBuild.result, tag_name)
email_notify()
throw err
}
}
41 changes: 41 additions & 0 deletions common/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* name : constants.js
* author : Ankit Shahu
* created-date : 10-April-2023
* Description : This is to keep all the hard code value in form of variable.
*/


/**
* Description : projection passed by frontend
*/
exports.ResourceTypeProjection = {
DISTRICT:"district",
BLOCK:"block",
ORGANISATION:"organisation"

}

/**
* Description : resource type passed by frontend
*/
exports.ResourceType = {
PROGRAM:"program",
SOLUTION:"solution"
}

/**
* Description : solution type passed by frontend
*/
exports.SolutionType = {
PROJECT : "improvementProject",
OBSERVATION: "observation",
SURVEY :"survey"
}

/**
* Description : druid query interval for raw data-source
*/
exports.druidQueryInterval = {
RAW_DATA_SOURCE_INTERVAL : "1901-01-01T00:00+00:00/2101-01-01T00:00:00+00:00",
}
15 changes: 14 additions & 1 deletion common/druid_queries.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@

"entity_solution_score_query" : {"queryType":"groupBy","dataSource":"ml_observation_qa","dimensions":["questionName","questionExternalId","questionResponseType","minScore","maxScore","observationSubmissionId","school","schoolName","questionId","completedDate","observationName","solutionId","solutionName"],"aggregations":[{"type":"count","name":"count"}],"granularity":"all","postAggregations":[],"intervals":"1901-01-01T00:00:00+00:00/2101-01-01T00:00:00+00:00","filter":{"type":"and","fields":[{"type":"or","fields":[{"type":"selector","dimension":"questionResponseType","value":"radio"},{"type":"selector","dimension":"questionResponseType","value":"multiselect"},{"type":"selector","dimension":"questionResponseType","value":"slider"}]},{"type":"and","fields":[{"type":"selector","dimension":"","value":"" },{"type":"selector","dimension":"solutionId","value":""}]}]},"limitSpec":{"type":"default","limit":10000,"columns":[{"dimension":"count","direction":"descending"}]}},

"observations_by_entity" : {"queryType":"groupBy","dataSource":"ml_observation_dev","granularity":"all","dimensions":["entityId","entityName","observationName","observationSubmissionId","createdAt"],"filter":{"type":"or","fields":[]},"aggregations":[],"postAggregations":[],"intervals":["1901-01-01T00:00:00+00:00/2101-01-01T00:00:00+00:00"]}
"observations_by_entity" : {"queryType":"groupBy","dataSource":"ml_observation_dev","granularity":"all","dimensions":["entityId","entityName","observationName","observationSubmissionId","createdAt"],"filter":{"type":"or","fields":[]},"aggregations":[],"postAggregations":[],"intervals":["1901-01-01T00:00:00+00:00/2101-01-01T00:00:00+00:00"]},

"question_response_query" : {"queryType":"scan","dataSource":"sl-observation","resultFormat": "list","columns":[ "solutionName", "criteriaName", "domainName", "questionName", "programName", "questionResponseLabel", "observationSubmissionId", "questionResponseType", "questionId", "questionSequenceByEcm","solution_type"],"filter": {"type":"and","fields": [ { "type": "or", "fields": [ { "type": "selector", "dimension": "questionResponseType", "value": "radio" }, { "type": "selector", "dimension": "questionResponseType", "value": "multiselect" }, { "type": "selector", "dimension": "questionResponseType", "value": "slider" } ] } ] },"intervals":"1901-01-01T00:00:00+00:00/2101-01-01T00:00:00+00:00"},

"solution_distric_level_query": {"queryType": "groupBy","dataSource": "","dimensions": ["district_name", "district_externalId"],"granularity": "all","intervals": "","filter": {"type": "and","fields": [{"type": "not","field": {"type": "selector","dimension": "district_externalId","value": null}}]}},

"solution_organisations_level_query": {"queryType": "groupBy","dataSource": "","dimensions": ["organisation_id", "organisation_name"],"granularity": "all","intervals": "","filter": {"type": "and","fields": [{"type": "not","field": {"type": "selector","dimension": "organisation_id","value": null}}]}},

"solution_block_level_query": {"queryType": "groupBy","dataSource": "","dimensions": ["block_externalId", "block_name"],"granularity": "all","intervals": "","filter": {"type": "and","fields": [{"type": "not","field": {"type": "selector","dimension": "block_externalId","value": null}}]}},

"program_distric_level_query": {"queryType": "groupBy","dataSource": "","dimensions": ["district_name", "district_externalId"],"granularity": "all","intervals": "","filter": {"type": "and","fields": [{"type": "not","field": {"type": "selector","dimension": "district_externalId","value": null}}]}},

"program_organisations_level_query": {"queryType": "groupBy","dataSource": "","dimensions": ["organisation_id", "organisation_name"],"granularity": "all","intervals": "","filter": {"type": "and","fields": [{"type": "not","field": {"type": "selector","dimension": "organisation_id","value": null}}]}},

"program_block_level_query": {"queryType": "groupBy","dataSource": "","dimensions": ["block_externalId", "block_name"],"granularity": "all","intervals": "","filter": {"type": "and","fields": [{"type": "not","field": {"type": "selector","dimension": "block_externalId","value": null}}]}}
}
Loading