Skip to content

Commit

Permalink
Modify the attributes in the gate component
Browse files Browse the repository at this point in the history
  • Loading branch information
kunyao-cofinity-x committed Nov 4, 2024
1 parent f521c74 commit 701a719
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class BusinessPartnerDb(
var addressConfidence: ConfidenceCriteriaDb?,

@Column(name = "externalSequenceTimestamp")
var currentness: Instant? = null,
var externalSequenceTimestamp: Instant? = null,

) : BaseEntity() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class BusinessPartnerMappings {
bpnS = dto.site.siteBpn,
bpnA = dto.address.addressBpn,
postalAddress = toPostalAddress(dto.address),
currentness = try {
externalSequenceTimestamp = try {
getTimestampToInstant(dto.externalSequenceTimestamp)
} catch (e: Exception) {
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ class BusinessPartnerService(

val hasChanges = changeType == ChangelogType.CREATE || compareUtil.hasChanges(upsertData, partnerToUpsert)
val shouldUpdate = when {
upsertData.currentness == null -> true
existingPartner?.currentness == null -> true
else -> upsertData.currentness!!.isAfter(existingPartner.currentness)
upsertData.externalSequenceTimestamp == null -> true
existingPartner?.externalSequenceTimestamp == null -> true
else -> upsertData.externalSequenceTimestamp!!.isAfter(existingPartner.externalSequenceTimestamp)
}

if (hasChanges && shouldUpdate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class BusinessPartnerComparisonUtil {
entity.identifiers != persistedBP.identifiers ||
entity.states != persistedBP.states ||
entity.classifications != persistedBP.classifications ||
entity.currentness != persistedBP.currentness ||
entity.externalSequenceTimestamp != persistedBP.externalSequenceTimestamp ||
postalAddressHasChanges(entity.postalAddress, persistedBP.postalAddress)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BusinessPartnerCopyUtil {
legalEntityConfidence = fromPartner.legalEntityConfidence
siteConfidence = fromPartner.siteConfidence
addressConfidence = fromPartner.addressConfidence
currentness = fromPartner.currentness
externalSequenceTimestamp = fromPartner.externalSequenceTimestamp

nameParts.replace(fromPartner.nameParts)
roles.replace(fromPartner.roles)
Expand Down

0 comments on commit 701a719

Please sign in to comment.