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

features/Doc processor #504

Draft
wants to merge 117 commits into
base: master
Choose a base branch
from
Draft

features/Doc processor #504

wants to merge 117 commits into from

Conversation

Fernando-hub527
Copy link
Collaborator

Description

This feature enables the generation of PDFs from serialized documents. To achieve this, the PDF template creation process is decoupled from the document generation, as outlined in RFC.

Related Issue

#390

Checklist

check with "x", ONLY IF APPLIED to your change

  • All methods associated with structs has func (<first letter of struct> *struct) method() {} name style.
  • Wrote unit tests for new/changed features.
  • Followed the unit test when,should naming pattern.
  • All mocks created with m := mocks.NewConstructor(t).
  • All mocks using m.EXPECT().MethodName() method to mock methods.
  • Updated docs/doc.go and docs/*
  • Updated example_test.go.
  • Updated README.md
  • New public methods/structs/interfaces has comments upside them explaining they responsibilities
  • Executed make dod with none issues pointed out by golangci-lint

Define interfaces that the pdf generator will depend on
create component package
add generate method in component mappers
refactor document to allow defining page lists
create a factory that wrapper the creation of components
to facilitate the creation of unit tests
fix page list creation
use abstract factory to create components
Rename interfaces to non-names not used by Maroto
The list should allow applying list behavior to any component
@Fernando-hub527 Fernando-hub527 marked this pull request as draft January 2, 2025 20:36
Copy link

codecov bot commented Jan 2, 2025

Codecov Report

Attention: Patch coverage is 72.29465% with 425 lines in your changes missing coverage. Please review.

Project coverage is 81.73%. Comparing base (6923857) to head (7d8c3c8).

Files with missing lines Patch % Lines
pkg/processor/mappers/propsmapper/consts.go 0.00% 56 Missing ⚠️
pkg/processor/processorprovider/Maroto.go 76.48% 24 Missing and 12 partials ⚠️
pkg/processor/mappers/components/rowmapper/row.go 74.73% 19 Missing and 4 partials ⚠️
pkg/processor/mappers/propsmapper/text.go 0.00% 19 Missing ⚠️
pkg/processor/mappers/documentmapper/document.go 86.37% 10 Missing and 8 partials ⚠️
pkg/processor/mappers/propsmapper/metadata.go 0.00% 18 Missing ⚠️
pkg/processor/mappers/propsmapper/customfont.go 0.00% 17 Missing ⚠️
pkg/processor/mappers/propsmapper/font.go 0.00% 17 Missing ⚠️
pkg/processor/mappers/propsmapper/signature.go 0.00% 14 Missing ⚠️
pkg/processor/loader/loader.go 74.47% 6 Missing and 6 partials ⚠️
... and 23 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #504      +/-   ##
==========================================
- Coverage   87.94%   81.73%   -6.21%     
==========================================
  Files          61       96      +35     
  Lines        2330     3864    +1534     
==========================================
+ Hits         2049     3158    +1109     
- Misses        246      609     +363     
- Partials       35       97      +62     
Flag Coverage Δ
unittests 81.73% <72.30%> (-6.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Fernando-hub527
Copy link
Collaborator Author

I've marked this PR as a draft since I still need to work on the documentation and add more tests. I'd also appreciate any feedback on the feature.

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

Successfully merging this pull request may close these issues.

2 participants