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

feat: P4ADEV-1636 WF ClassifyIuvActivity: define classification labels #72

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

macacia
Copy link
Collaborator

@macacia macacia commented Jan 7, 2025

Description

List of Changes

Motivation and Context

How Has This Been Tested?

  • Pre-Deploy Test
    • Unit
    • Integration (Narrow)
  • Post-Deploy Test
    • Isolated Microservice
    • Broader Integration
    • Acceptance
    • Performance & Load

Types of changes

  • PATCH - Bug fix (backwards compatible bug fixes)
  • MINOR - New feature (add functionality in a backwards compatible manner)
  • MAJOR - Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@macacia macacia marked this pull request as ready for review January 8, 2025 14:21
@Lazy
@Slf4j
@Service
public class ClassificationService {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public class ClassificationService {
public class TransferClassificationService {

.toList();

if (labels.isEmpty()) {
throw new ClassificationException("Cannot define classification");
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of throwing an exception, could we apply a default one (eg: UNKNOWN)

@@ -0,0 +1,21 @@
package it.gov.pagopa.payhub.activities.service.classifications;
Copy link
Contributor

Choose a reason for hiding this comment

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

use nested package to group them

Suggested change
package it.gov.pagopa.payhub.activities.service.classifications;
package it.gov.pagopa.payhub.activities.service.classifications.trclassifiers;

* and determine a classification label ({@link ClassificationsEnum}). Each implementation
* should handle a particular condition or set of conditions to decide the appropriate label.
*/
public interface LabelClassifier {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public interface LabelClassifier {
public interface TransferClassifier {

public class IufNoTesClassifier implements LabelClassifier {

@Override
public ClassificationsEnum define(TransferDTO transferDTO, PaymentsReportingDTO paymentsReportingDTO, TreasuryDTO treasuryDTO) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we rename the enum into TransferClassificationEnum?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This Enum is not only used for Transfers

LabelClassifier classifier = new RtIufTesClassifier();

@Test
void whenDefineThenSuccess() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void whenDefineThenSuccess() {
void givenMatchedConditionWhenDefineThenSuccess() {

}

@Test
void whenDefineThenReturnNull() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void whenDefineThenReturnNull() {
void givenUnmatchedConditionWhenDefineThenReturnNull() {

}

@Test
void whenDefineThenReturnNull() {
Copy link
Contributor

Choose a reason for hiding this comment

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

you should test also unmatched amounts

Suggested change
void whenDefineThenReturnNull() {
void givenUnmatchedConditionWhenDefineThenReturnNull() {

LabelClassifier classifier = new RtTesClassifier();

@Test
void whenDefineThenSuccess() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void whenDefineThenSuccess() {
void givenMatchedConditionWhenDefineThenSuccess() {

}

@Test
void whenDefineThenReturnNull() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void whenDefineThenReturnNull() {
void givenUnmatchedConditionWhenDefineThenReturnNull() {

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