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

17830 - EFT TDI17 Parser #1275

Merged
merged 2 commits into from
Oct 6, 2023
Merged

17830 - EFT TDI17 Parser #1275

merged 2 commits into from
Oct 6, 2023

Conversation

ochiu
Copy link
Collaborator

@ochiu ochiu commented Oct 4, 2023

Issue #:
bcgov/entity#17830

Description of changes:

  • EFT TDI17 Parser with test cases and utils for generating file payload

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the sbc-pay license (Apache 2.0).

@ochiu ochiu marked this pull request as ready for review October 4, 2023 19:00
@ochiu ochiu requested review from seeker25 and Jxio as code owners October 4, 2023 19:00
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Merging #1275 (4fda4dc) into main (79924ce) will increase coverage by 0.18%.
Report is 18 commits behind head on main.
The diff coverage is 97.95%.

@@            Coverage Diff             @@
##             main    #1275      +/-   ##
==========================================
+ Coverage   91.45%   91.64%   +0.18%     
==========================================
  Files         186      197      +11     
  Lines       11319    11621     +302     
==========================================
+ Hits        10352    10650     +298     
- Misses        967      971       +4     
Flag Coverage Δ
payapi 93.80% <100.00%> (+0.07%) ⬆️
paymentreconciliationsqueue 92.71% <97.50%> (+1.26%) ⬆️

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

Files Coverage Δ
pay-api/src/pay_api/models/invoice.py 100.00% <100.00%> (ø)
pay-api/src/pay_api/models/statement.py 97.67% <100.00%> (+0.05%) ⬆️
...api/src/pay_api/resources/v1/account_statements.py 100.00% <100.00%> (ø)
pay-api/src/pay_api/services/statement.py 97.47% <100.00%> (+0.57%) ⬆️
pay-api/src/pay_api/utils/converter.py 100.00% <100.00%> (ø)
pay-api/src/pay_api/utils/enums.py 100.00% <100.00%> (ø)
pay-api/src/pay_api/version.py 100.00% <100.00%> (ø)
...econciliations/src/reconciliations/eft/__init__.py 100.00% <100.00%> (ø)
...conciliations/src/reconciliations/eft/eft_enums.py 100.00% <100.00%> (ø)
...onciliations/src/reconciliations/eft/eft_errors.py 100.00% <100.00%> (ø)
... and 6 more

... and 4 files with indirect coverage changes

self.record_type = self.content[0:1]
self.validate_record_type(EFTConstants.TRANSACTION_RECORD_TYPE.value)

self.ministry_code = self.content[1:3].strip()
Copy link
Collaborator

@seeker25 seeker25 Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we include a link to the spec? Or a comment listing the spec?

That way the next person knows where we are building this from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment with the spec in eft_base

@seeker25
Copy link
Collaborator

seeker25 commented Oct 6, 2023

We should probably put in a unit test where we use a real file (non programmatically) and it parses the expected result

You're using factories to build it which could be incorrect in the first place

EG. some of the EJV unit tests do that

@ochiu
Copy link
Collaborator Author

ochiu commented Oct 6, 2023

We should probably put in a unit test where we use a real file (non programmatically) and it parses the expected result

You're using factories to build it which could be incorrect in the first place

EG. some of the EJV unit tests do that

Sounds good I will do this.

Update:

I took a look at the EJV tests, it seems to manually writes the content with parameterized strings. For the EFT Parser I have included a test sample file and a test to read this file and assert the parsing results.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ochiu
Copy link
Collaborator Author

ochiu commented Oct 6, 2023

I bumped the versions, for pay-api as I added models in relation to EFT processing and for this component.

@@ -11,6 +11,50 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# TDI17 File Specifications
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect this helps a ton

Copy link
Collaborator

@seeker25 seeker25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@seeker25 seeker25 merged commit 90fc03c into bcgov:main Oct 6, 2023
11 checks passed
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