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

Refactor: Updated document creation logic and file structure #12

Merged
merged 2 commits into from
May 6, 2024

Conversation

HlexNC
Copy link

@HlexNC HlexNC commented May 6, 2024

I have refactored the document creation logic and file structure to improve code organization and maintainability. This includes removing deprecated logic files and renaming the unit test file. Additionally, I have updated the document-generation-lib structure to use the documentManager module instead of the documentLibrary module. This change ensures that the document creation endpoints use the correct module for creating documents and buffers. The changes have been thoroughly tested and are ready for review.

@HlexNC ➜ /workspaces/UNIC-Document-Conversion-API/document-generation-lib (refactor/document-generation-restructure) $ npm test

> @universityofnicosia/[email protected] test
> jest

  console.log
    /workspaces/UNIC-Document-Conversion-API/document-generation-lib/tests_output/testDocument.docx has been created.

      at WriteStream.log (src/utils/officegenHelper.js:96:15)

  console.log
    /workspaces/UNIC-Document-Conversion-API/document-generation-lib/tests_output/testDocumentWithTable.docx has been created.

      at WriteStream.log (src/utils/officegenHelper.js:96:15)

 PASS  tests/document.test.js
  Document Gen API Tests
    ✓ should create a document with titles, text, and code blocks (82 ms)
    ✓ should generate a buffer for a document with paragraph content (33 ms)
    ✓ should create a document with a table (50 ms)

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        0.573 s, estimated 1 s
Ran all test suites.
@HlexNC ➜ /workspaces/UNIC-Document-Conversion-API/document-generation-lib (refactor/document-generation-restructure) $ 

@HlexNC HlexNC merged commit a2ff3e4 into main May 6, 2024
2 checks passed
@HlexNC HlexNC deleted the refactor/document-generation-restructure branch May 6, 2024 21:21
@HlexNC HlexNC self-assigned this May 7, 2024
@HlexNC HlexNC added refactor Code changes that improve structure and readability without modifying behavior. optimization Improvements to code performance and efficiency. labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Improvements to code performance and efficiency. refactor Code changes that improve structure and readability without modifying behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant