-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3649 from alphagov/pp-13332-return-exemption-object
Add Exemption object to Ledger Specification
- Loading branch information
Showing
6 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,4 +74,4 @@ public ZonedDateTime getCreatedDate() { | |
public PaymentInstrumentType getType() { | ||
return type; | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/uk/gov/pay/ledger/transaction/model/Exemption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package uk.gov.pay.ledger.transaction.model; | ||
|
||
import java.util.Objects; | ||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.OBJECT) | ||
public class Exemption { | ||
|
||
@Schema( | ||
example = "true", | ||
description = "It is set when the exemption has been requested or when we know that it has not been requested." | ||
) | ||
private boolean requested; | ||
|
||
public Exemption(boolean requested) { | ||
this.requested = requested; | ||
} | ||
|
||
@JsonProperty("requested") | ||
public boolean getRequested() { | ||
return requested; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof Exemption)) return false; | ||
|
||
Exemption exemption = (Exemption) o; | ||
|
||
return requested == exemption.requested; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(requested); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters