-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add getallrecords api #19
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
Conversation
WalkthroughThis update enhances the API's database and entity management, refines GraphQL service operations, and expands the Postman collection. Key changes include modifications to database migration scripts, entity attribute updates, improved JSON and date handling in GraphQL services, and the addition of a new GraphQL query in the Postman collection. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Out of diff range and nitpick comments (1)
apps/api/src/modules/summary/dto/summary-response.dto.ts (1)
1-1
: Ensure that all imported entities are used within the file to avoid unnecessary imports.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (3)
apps/api/src/upload/3b5ce3d6-008e-49a5-978b-3f06568763ea_db2.jpg
is excluded by!**/*.jpg
apps/api/src/upload/85cb702d-cb72-4c12-b83c-5e45004b63b8_db2.jpg
is excluded by!**/*.jpg
apps/api/src/upload/cd641a77-d215-4ce5-b83c-73c7ddf2237d_Screenshot_2.jpg
is excluded by!**/*.jpg
Files selected for processing (11)
- apps/api/Transcript Summarization.postman_collection.json (1 hunks)
- apps/api/src/config/typeorm/configuration.ts (1 hunks)
- apps/api/src/database/migrations/1715278578144-migration.ts (4 hunks)
- apps/api/src/main.ts (1 hunks)
- apps/api/src/modules/summary/dto/summary-response.dto.ts (1 hunks)
- apps/api/src/modules/summary/entities/summary.entity.ts (2 hunks)
- apps/api/src/modules/summary/summary.resolver.ts (2 hunks)
- apps/api/src/modules/summary/summary.service.ts (3 hunks)
- apps/api/src/schema.gpl (1 hunks)
- apps/api/src/upload/272d2fc7-1081-4684-ab7c-8d2e6aa0cb44_Transcript Summarizer Kickoff.vtt (1 hunks)
- apps/api/src/upload/8ac6f94d-732a-4462-b6b9-ecdb991aebf3_example_1.json (1 hunks)
Files not summarized due to errors (1)
- apps/api/src/upload/272d2fc7-1081-4684-ab7c-8d2e6aa0cb44_Transcript Summarizer Kickoff.vtt: Error: Message exceeds token limit
Files skipped from review due to trivial changes (2)
- apps/api/src/schema.gpl
- apps/api/src/upload/8ac6f94d-732a-4462-b6b9-ecdb991aebf3_example_1.json
Additional Context Used
GitHub Check Runs (1)
lint failure (3)
apps/api/src/modules/summary/summary.resolver.ts: [failure] 1-1:
'Int' is defined but never used
Additional comments not posted (58)
apps/api/src/modules/summary/dto/summary-response.dto.ts (1)
18-22
: The constructor provides default values foroffset
andlimit
. This is a good practice as it ensures that these values are always initialized, preventing potential runtime errors.apps/api/src/config/typeorm/configuration.ts (1)
19-19
: Changing themigrationsTableName
from 'jobs' to 'jobDetails' might require corresponding updates in existing migration scripts and database schemas to ensure consistency.apps/api/src/modules/summary/summary.resolver.ts (1)
19-24
: ThefindAll
query method correctly uses theQueryOptionsDto
to allow flexible querying. This is a good practice as it enhances the API's flexibility and usability.apps/api/src/main.ts (1)
20-20
: Reducing the number of files that can be uploaded simultaneously from 5 to 1 without adjusting the maximum file size might impact user experience. Consider whether this change aligns with user needs and system requirements.apps/api/src/modules/summary/entities/summary.entity.ts (1)
22-31
: AllowingoutputText
andmodifiedOn
to be nullable is a significant change. Ensure that this aligns with the business logic and that the database schema is updated accordingly to avoid data integrity issues.apps/api/src/database/migrations/1715278578144-migration.ts (1)
Line range hint
22-52
: The changes in default values and data types in the migration script should be carefully reviewed to ensure they align with the application's data handling and storage requirements.Verification successful
The changes in default values and data types in the migration script are consistently reflected in the corresponding entity definitions within the application. Here are the specific points of alignment:
- Input and Output Fields: Both
input_file
andoutput_text
are defined with appropriate nullability in the entity file.- Timestamp Fields: The
created_on
andmodified_on
fields use the correct decorators in the entity file, aligning with their definitions in the migration script.- User Fields: The default values for
created_by
andmodified_by
are consistent between the migration script and the entity file.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if the changes in the migration script are reflected in the corresponding entity definitions and used consistently across the application. # Test: Search for entity definitions and usage of the changed fields. Expect: Consistent definitions and usage. rg --type ts $'job_status'Length of output: 258
Script:
#!/bin/bash # Description: Verify if the changes in the migration script for other fields are reflected in the corresponding entity definitions and used consistently across the application. # Test: Search for entity definitions and usage of the fields 'input_file', 'output_text', 'created_on', 'modified_on', 'created_by', 'modified_by'. Expect: Consistent definitions and usage. rg --type ts $'input_file|output_text|created_on|modified_on|created_by|modified_by'Length of output: 1342
apps/api/src/modules/summary/summary.service.ts (1)
Line range hint
15-68
: ExtendingCoreService
inSummaryService
and implementingfindAllJobs
with dynamic query options enhances the modularity and reusability of the service. This is a good practice as it allows for more flexible data querying.apps/api/Transcript Summarization.postman_collection.json (1)
74-118
: The new POST request "FetchAllRecords" is well-defined with appropriate headers and a detailed GraphQL query. This addition should enhance the API testing capabilities and provide a practical way to test the newgetAllRecords
endpoint.apps/api/src/upload/272d2fc7-1081-4684-ab7c-8d2e6aa0cb44_Transcript Summarizer Kickoff.vtt (50)
1-1
: Ensure the file starts with the correct VTT header.
3-5
: First dialogue segment is correctly formatted.
7-10
: Second dialogue segment is correctly formatted.
12-14
: Third dialogue segment is correctly formatted.
16-23
: Fourth dialogue segment is correctly formatted.
25-31
: Fifth dialogue segment is correctly formatted.
33-41
: Sixth dialogue segment is correctly formatted.
43-47
: Seventh dialogue segment is correctly formatted.
49-61
: Eighth dialogue segment is correctly formatted.
63-67
: Ninth dialogue segment is correctly formatted.
69-75
: Tenth dialogue segment is correctly formatted.
77-83
: Eleventh dialogue segment is correctly formatted.
85-93
: Twelfth dialogue segment is correctly formatted.
95-99
: Thirteenth dialogue segment is correctly formatted.
101-107
: Fourteenth dialogue segment is correctly formatted.
109-121
: Fifteenth dialogue segment is correctly formatted.
123-127
: Sixteenth dialogue segment is correctly formatted.
129-137
: Seventeenth dialogue segment is correctly formatted.
139-147
: Eighteenth dialogue segment is correctly formatted.
149-152
: Nineteenth dialogue segment is correctly formatted.
154-160
: Twentieth dialogue segment is correctly formatted.
162-174
: Twenty-first dialogue segment is correctly formatted.
176-188
: Twenty-second dialogue segment is correctly formatted.
190-192
: Twenty-third dialogue segment is correctly formatted.
194-206
: Twenty-fourth dialogue segment is correctly formatted.
208-218
: Twenty-fifth dialogue segment is correctly formatted.
220-222
: Twenty-sixth dialogue segment is correctly formatted.
224-227
: Twenty-seventh dialogue segment is correctly formatted.
229-231
: Twenty-eighth dialogue segment is correctly formatted.
233-235
: Twenty-ninth dialogue segment is correctly formatted.
237-239
: Thirtieth dialogue segment is correctly formatted.
241-244
: Thirty-first dialogue segment is correctly formatted.
246-248
: Thirty-second dialogue segment is correctly formatted.
250-254
: Thirty-third dialogue segment is correctly formatted.
256-260
: Thirty-fourth dialogue segment is correctly formatted.
262-266
: Thirty-fifth dialogue segment is correctly formatted.
268-270
: Thirty-sixth dialogue segment is correctly formatted.
272-274
: Thirty-seventh dialogue segment is correctly formatted.
276-278
: Thirty-eighth dialogue segment is correctly formatted.
280-283
: Thirty-ninth dialogue segment is correctly formatted.
285-287
: Fortieth dialogue segment is correctly formatted.
289-292
: Forty-first dialogue segment is correctly formatted.
294-296
: Forty-second dialogue segment is correctly formatted.
298-305
: Forty-third dialogue segment is correctly formatted.
307-310
: Forty-fourth dialogue segment is correctly formatted.
312-314
: Forty-fifth dialogue segment is correctly formatted.
316-319
: Forty-sixth dialogue segment is correctly formatted.
321-324
: Forty-seventh dialogue segment is correctly formatted.
326-330
: Forty-eighth dialogue segment is correctly formatted.
332-334
: Forty-ninth dialogue segment is correctly formatted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- apps/api/src/database/migrations/1715278578144-migration.ts (4 hunks)
- apps/api/src/modules/summary/summary.resolver.ts (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- apps/api/src/database/migrations/1715278578144-migration.ts
- apps/api/src/modules/summary/summary.resolver.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Out of diff range and nitpick comments (1)
apps/api/src/common/graphql/services/core.service.ts (1)
88-90
: Use parameter expansion correctly for 'in' operator.The use of parameter expansion in the 'in' operator condition is correct, but ensure that the value passed is always an array to avoid SQL errors. This ties back to the JSON parsing logic which should robustly handle errors to ensure
value
is an array.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/api/src/common/graphql/services/core.service.ts (4 hunks)
Additional comments not posted (1)
apps/api/src/common/graphql/services/core.service.ts (1)
60-61
: Ensure type safety when converting string to Date.The conversion of
value
to aDate
object is implicitly cast back to a string. This could lead to potential type mismatches or errors in date comparisons. Verify that this conversion and the subsequent usage in the query are handled correctly.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- apps/api/src/database/migrations/1715278578144-migration.ts (3 hunks)
- apps/api/src/modules/summary/entities/summary.entity.ts (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- apps/api/src/database/migrations/1715278578144-migration.ts
- apps/api/src/modules/summary/entities/summary.entity.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/api/src/common/graphql/services/core.service.ts (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/api/src/common/graphql/services/core.service.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- apps/api/Transcript Summarization.postman_collection.json (1 hunks)
- apps/api/src/modules/summary/entities/summary.entity.ts (2 hunks)
Files not reviewed due to errors (1)
- apps/api/Transcript Summarization.postman_collection.json (no review received)
Files skipped from review as they are similar to previous changes (1)
- apps/api/src/modules/summary/entities/summary.entity.ts
@ramraut-osm Fix the example its still using job_id |
Updated |
API PR Checklist
Pre-requisites
PR Details
PR details have been updated as per the given format (see below)
feat: add admin login endpoint
)Additional Information
ready for review
should be added if the PR is ready to be reviewed)Description:
Added getAllRecords API which will fetch all the records from DB as per conditions mentioned in query.
Related changes:
Screenshots:
Add any screenshots as required.
Query request and response:
Query:
Response:
Documentation changes:
Test suite output:
Pending actions:
Additional notes:
Summary by CodeRabbit
outputFile
tooutputText
in summary entities and mademodifiedOn
field nullable to enhance flexibility in data handling.