FINERACT-1694: Storing events upon raising
This commit is contained in:
committed by
Arnold Gálovics
parent
a04aa45368
commit
699f61a9e1
@@ -26,6 +26,9 @@ dependencies {
|
||||
|
||||
// implementation dependencies are directly used (compiled against) in src/main (and src/test)
|
||||
//
|
||||
implementation(
|
||||
project(path: ':fineract-avro-schemas')
|
||||
)
|
||||
implementation(
|
||||
'org.springframework.boot:spring-boot-starter-web',
|
||||
'org.springframework.boot:spring-boot-starter-security',
|
||||
@@ -38,7 +41,7 @@ dependencies {
|
||||
'org.springframework.integration:spring-integration-event',
|
||||
'org.springframework.integration:spring-integration-jms',
|
||||
|
||||
|
||||
'org.apache.avro:avro',
|
||||
'jakarta.ws.rs:jakarta.ws.rs-api',
|
||||
'org.glassfish.jersey.media:jersey-media-multipart',
|
||||
|
||||
|
||||
+6
-5
@@ -93,7 +93,7 @@ import org.apache.fineract.portfolio.loanproduct.service.LoanProductReadPlatform
|
||||
import org.apache.fineract.portfolio.paymenttype.data.PaymentTypeData;
|
||||
import org.apache.fineract.portfolio.paymenttype.service.PaymentTypeReadPlatformService;
|
||||
import org.apache.fineract.portfolio.products.data.ProductData;
|
||||
import org.apache.fineract.portfolio.products.service.ProductReadPlatformService;
|
||||
import org.apache.fineract.portfolio.products.service.ShareProductReadPlatformService;
|
||||
import org.apache.fineract.portfolio.savings.DepositAccountType;
|
||||
import org.apache.fineract.portfolio.savings.data.DepositProductData;
|
||||
import org.apache.fineract.portfolio.savings.data.FixedDepositProductData;
|
||||
@@ -132,7 +132,7 @@ public class BulkImportWorkbookPopulatorServiceImpl implements BulkImportWorkboo
|
||||
private final SavingsAccountReadPlatformService savingsAccountReadPlatformService;
|
||||
private final CodeValueReadPlatformService codeValueReadPlatformService;
|
||||
private final SavingsProductReadPlatformService savingsProductReadPlatformService;
|
||||
private final ProductReadPlatformService productReadPlatformService;
|
||||
private final ShareProductReadPlatformService shareProductReadPlatformService;
|
||||
private final ChargeReadPlatformService chargeReadPlatformService;
|
||||
private final DepositProductReadPlatformService depositProductReadPlatformService;
|
||||
private final RoleReadPlatformService roleReadPlatformService;
|
||||
@@ -149,7 +149,8 @@ public class BulkImportWorkbookPopulatorServiceImpl implements BulkImportWorkboo
|
||||
final SavingsAccountReadPlatformService savingsAccountReadPlatformService,
|
||||
final CodeValueReadPlatformService codeValueReadPlatformService,
|
||||
final SavingsProductReadPlatformService savingsProductReadPlatformService,
|
||||
final ProductReadPlatformService productReadPlatformService, final ChargeReadPlatformService chargeReadPlatformService,
|
||||
final ShareProductReadPlatformService shareProductReadPlatformService,
|
||||
final ChargeReadPlatformService chargeReadPlatformService,
|
||||
final DepositProductReadPlatformService depositProductReadPlatformService,
|
||||
final RoleReadPlatformService roleReadPlatformService) {
|
||||
this.officeReadPlatformService = officeReadPlatformService;
|
||||
@@ -167,7 +168,7 @@ public class BulkImportWorkbookPopulatorServiceImpl implements BulkImportWorkboo
|
||||
this.savingsAccountReadPlatformService = savingsAccountReadPlatformService;
|
||||
this.codeValueReadPlatformService = codeValueReadPlatformService;
|
||||
this.savingsProductReadPlatformService = savingsProductReadPlatformService;
|
||||
this.productReadPlatformService = productReadPlatformService;
|
||||
this.shareProductReadPlatformService = shareProductReadPlatformService;
|
||||
this.chargeReadPlatformService = chargeReadPlatformService;
|
||||
this.depositProductReadPlatformService = depositProductReadPlatformService;
|
||||
this.roleReadPlatformService = roleReadPlatformService;
|
||||
@@ -536,7 +537,7 @@ public class BulkImportWorkbookPopulatorServiceImpl implements BulkImportWorkboo
|
||||
}
|
||||
|
||||
private List<ShareProductData> fetchSharedProducts() {
|
||||
List<ProductData> productDataList = productReadPlatformService.retrieveAllProducts(0, 50).getPageItems();
|
||||
List<ProductData> productDataList = shareProductReadPlatformService.retrieveAllProducts(0, 50).getPageItems();
|
||||
List<ShareProductData> sharedProductDataList = new ArrayList<>();
|
||||
if (productDataList != null) {
|
||||
for (ProductData data : productDataList) {
|
||||
|
||||
+16
@@ -41,6 +41,8 @@ public class FineractProperties {
|
||||
|
||||
private FineractRemoteJobMessageHandlerProperties remoteJobMessageHandler;
|
||||
|
||||
private FineractEventsProperties events;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class FineractTenantProperties {
|
||||
@@ -119,4 +121,18 @@ public class FineractProperties {
|
||||
private String requestQueueName;
|
||||
private String brokerUrl;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class FineractEventsProperties {
|
||||
|
||||
private FineractExternalEventsProperties external;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class FineractExternalEventsProperties {
|
||||
|
||||
private boolean enabled;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
@Configuration
|
||||
@EnableJpaAuditing
|
||||
@EnableJpaRepositories(basePackages = "org.apache.fineract.**.domain")
|
||||
@EnableJpaRepositories(basePackages = { "org.apache.fineract.**.domain", "org.apache.fineract.**.repository" })
|
||||
@EnableConfigurationProperties(JpaProperties.class)
|
||||
@Import(JpaAuditingHandlerRegistrar.class)
|
||||
public class JPAConfig extends JpaBaseConfiguration {
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.repository;
|
||||
|
||||
import org.apache.fineract.infrastructure.event.external.repository.domain.ExternalEvent;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface ExternalEventRepository extends JpaRepository<ExternalEvent, Long> {}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.repository.domain;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||
|
||||
@Entity
|
||||
@Table(name = "m_external_event")
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
public class ExternalEvent extends AbstractPersistableCustom {
|
||||
|
||||
@Column(name = "type", nullable = false)
|
||||
private String type;
|
||||
|
||||
@Basic(fetch = FetchType.LAZY)
|
||||
@Lob
|
||||
@Column(name = "data", nullable = false, columnDefinition = "BLOB NOT NULL")
|
||||
private byte[] data;
|
||||
|
||||
@Column(name = "created_at", nullable = false)
|
||||
private OffsetDateTime createdAt;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "status", nullable = false)
|
||||
@Setter
|
||||
private ExternalEventStatus status;
|
||||
|
||||
@Column(name = "sent_at", nullable = false)
|
||||
@Setter
|
||||
private OffsetDateTime sentAt;
|
||||
|
||||
@Column(name = "idempotency_key", nullable = false)
|
||||
private String idempotencyKey;
|
||||
|
||||
@Column(name = "business_date", nullable = false)
|
||||
private LocalDate businessDate;
|
||||
|
||||
public ExternalEvent(String type, byte[] data, String idempotencyKey) {
|
||||
this.type = type;
|
||||
this.data = data;
|
||||
this.idempotencyKey = idempotencyKey;
|
||||
this.createdAt = DateUtils.getOffsetDateTimeOfTenant();
|
||||
this.status = ExternalEventStatus.TO_BE_SENT;
|
||||
this.businessDate = DateUtils.getBusinessLocalDate();
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.repository.domain;
|
||||
|
||||
public enum ExternalEventStatus {
|
||||
TO_BE_SENT, SENT
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BulkBusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DelayedExternalEventService {
|
||||
|
||||
private final ThreadLocal<List<BusinessEvent<?>>> localEventStorage = ThreadLocal.withInitial(ArrayList::new);
|
||||
|
||||
private final ExternalEventService delegate;
|
||||
|
||||
public <T> void enqueueEvent(BusinessEvent<T> event) {
|
||||
if (event == null) {
|
||||
throw new IllegalArgumentException("event cannot be null");
|
||||
}
|
||||
|
||||
localEventStorage.get().add(event);
|
||||
}
|
||||
|
||||
public boolean hasEnqueuedEvents() {
|
||||
return !localEventStorage.get().isEmpty();
|
||||
}
|
||||
|
||||
public void postEnqueuedEvents() {
|
||||
List<BusinessEvent<?>> enqueuedEvents = localEventStorage.get();
|
||||
if (enqueuedEvents.isEmpty()) {
|
||||
throw new IllegalStateException("No events have been enqueued");
|
||||
}
|
||||
|
||||
delegate.postEvent(new BulkBusinessEvent(enqueuedEvents));
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.infrastructure.event.external.repository.ExternalEventRepository;
|
||||
import org.apache.fineract.infrastructure.event.external.repository.domain.ExternalEvent;
|
||||
import org.apache.fineract.infrastructure.event.external.service.idempotency.ExternalEventIdempotencyKeyGenerator;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.BusinessEventSerializerFactory;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional
|
||||
public class ExternalEventService {
|
||||
|
||||
private final ExternalEventRepository repository;
|
||||
private final ExternalEventIdempotencyKeyGenerator idempotencyKeyGenerator;
|
||||
private final BusinessEventSerializerFactory serializerFactory;
|
||||
|
||||
public <T> void postEvent(BusinessEvent<T> event) {
|
||||
if (event == null) {
|
||||
throw new IllegalArgumentException("event cannot be null");
|
||||
}
|
||||
|
||||
String eventType = event.getType();
|
||||
String idempotencyKey = idempotencyKeyGenerator.generate(event);
|
||||
try {
|
||||
byte[] data = serializerFactory.create(event).serialize(event);
|
||||
ExternalEvent externalEvent = new ExternalEvent(eventType, data, idempotencyKey);
|
||||
|
||||
repository.save(externalEvent);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Error while serializing event " + event.getClass().getSimpleName(), e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.idempotency;
|
||||
|
||||
import java.util.UUID;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class DefaultExternalEventIdempotencyKeyGenerator implements ExternalEventIdempotencyKeyGenerator {
|
||||
|
||||
@Override
|
||||
public <T> String generate(BusinessEvent<T> event) {
|
||||
return UUID.randomUUID().toString();
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.idempotency;
|
||||
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
|
||||
public interface ExternalEventIdempotencyKeyGenerator {
|
||||
|
||||
<T> String generate(BusinessEvent<T> event);
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization;
|
||||
|
||||
import java.util.Comparator;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
public class BusinessEventSerializerComparator implements Comparator<BusinessEventSerializer> {
|
||||
|
||||
@Override
|
||||
public int compare(BusinessEventSerializer o1, BusinessEventSerializer o2) {
|
||||
int o1Order = getOrderOrDefault(o1);
|
||||
int o2Order = getOrderOrDefault(o2);
|
||||
return Integer.compare(o1Order, o2Order);
|
||||
}
|
||||
|
||||
private int getOrderOrDefault(BusinessEventSerializer serializer) {
|
||||
Order orderAnnotation = serializer.getClass().getAnnotation(Order.class);
|
||||
if (orderAnnotation != null) {
|
||||
return orderAnnotation.value();
|
||||
} else {
|
||||
return Ordered.LOWEST_PRECEDENCE;
|
||||
}
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class BusinessEventSerializerFactory {
|
||||
|
||||
private final List<BusinessEventSerializer> serializers;
|
||||
|
||||
public BusinessEventSerializerFactory(List<BusinessEventSerializer> serializers) {
|
||||
this.serializers = serializers.stream().sorted(new BusinessEventSerializerComparator()).toList();
|
||||
}
|
||||
|
||||
public <T> BusinessEventSerializer create(BusinessEvent<T> event) {
|
||||
for (BusinessEventSerializer serializer : serializers) {
|
||||
if (serializer.canSerialize(event)) {
|
||||
return serializer;
|
||||
}
|
||||
}
|
||||
throw new IllegalStateException("There's no serializer that's capable of serializing a " + event.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.client;
|
||||
|
||||
import org.apache.fineract.avro.client.v1.ClientDataV1;
|
||||
import org.apache.fineract.portfolio.client.data.ClientData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ClientDataMapper {
|
||||
|
||||
ClientDataV1 map(ClientData source);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.fixeddeposit;
|
||||
|
||||
import org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountDataV1;
|
||||
import org.apache.fineract.portfolio.savings.data.FixedDepositAccountData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface FixedDepositAccountDataMapper {
|
||||
|
||||
FixedDepositAccountDataV1 map(FixedDepositAccountData source);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.generic;
|
||||
|
||||
import org.apache.fineract.avro.generic.v1.CommandProcessingResultV1;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface CommandProcessingResultMapper {
|
||||
|
||||
CommandProcessingResultV1 map(CommandProcessingResult source);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan;
|
||||
|
||||
import org.apache.fineract.avro.loan.v1.LoanAccountDataV1;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanAccountData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface LoanAccountDataMapper {
|
||||
|
||||
LoanAccountDataV1 map(LoanAccountData source);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan;
|
||||
|
||||
import org.apache.fineract.avro.loan.v1.LoanChargeDataV1;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface LoanChargeDataMapper {
|
||||
|
||||
LoanChargeDataV1 map(LoanChargeData source);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan;
|
||||
|
||||
import org.apache.fineract.avro.loan.v1.LoanProductDataV1;
|
||||
import org.apache.fineract.portfolio.loanproduct.data.LoanProductData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface LoanProductDataMapper {
|
||||
|
||||
LoanProductDataV1 map(LoanProductData source);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan;
|
||||
|
||||
import org.apache.fineract.avro.loan.v1.LoanTransactionDataV1;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanTransactionData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface LoanTransactionDataMapper {
|
||||
|
||||
LoanTransactionDataV1 map(LoanTransactionData source);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.recurringdeposit;
|
||||
|
||||
import org.apache.fineract.avro.recurringdeposit.v1.RecurringDepositAccountDataV1;
|
||||
import org.apache.fineract.portfolio.savings.data.RecurringDepositAccountData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface RecurringDepositAccountDataMapper {
|
||||
|
||||
RecurringDepositAccountDataV1 map(RecurringDepositAccountData source);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.savings;
|
||||
|
||||
import org.apache.fineract.avro.savings.v1.SavingsAccountDataV1;
|
||||
import org.apache.fineract.portfolio.savings.data.SavingsAccountData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface SavingsAccountDataMapper {
|
||||
|
||||
SavingsAccountDataV1 map(SavingsAccountData source);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.share;
|
||||
|
||||
import org.apache.fineract.avro.share.v1.ShareAccountDataV1;
|
||||
import org.apache.fineract.portfolio.shareaccounts.data.ShareAccountData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ShareAccountDataMapper {
|
||||
|
||||
ShareAccountDataV1 map(ShareAccountData source);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.mapper.share;
|
||||
|
||||
import org.apache.fineract.avro.share.v1.ShareProductDataV1;
|
||||
import org.apache.fineract.portfolio.shareproducts.data.ShareProductData;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ShareProductDataMapper {
|
||||
|
||||
ShareProductDataV1 map(ShareProductData source);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
|
||||
public interface BusinessEventSerializer {
|
||||
|
||||
<T> boolean canSerialize(BusinessEvent<T> event);
|
||||
|
||||
<T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException;
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.client;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.client.v1.ClientDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.client.ClientDataMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.client.ClientBusinessEvent;
|
||||
import org.apache.fineract.portfolio.client.data.ClientData;
|
||||
import org.apache.fineract.portfolio.client.service.ClientReadPlatformService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class ClientBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final ClientReadPlatformService service;
|
||||
private final ClientDataMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof ClientBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
ClientBusinessEvent event = (ClientBusinessEvent) rawEvent;
|
||||
ClientData data = service.retrieveOne(event.get().getId());
|
||||
ClientDataV1 avroDto = mapper.map(data);
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.fixeddeposit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.fixeddeposit.FixedDepositAccountDataMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.deposit.FixedDepositAccountBusinessEvent;
|
||||
import org.apache.fineract.portfolio.savings.DepositAccountType;
|
||||
import org.apache.fineract.portfolio.savings.data.FixedDepositAccountData;
|
||||
import org.apache.fineract.portfolio.savings.service.DepositAccountReadPlatformService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class FixedDepositAccountBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final DepositAccountReadPlatformService service;
|
||||
private final FixedDepositAccountDataMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof FixedDepositAccountBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
FixedDepositAccountBusinessEvent event = (FixedDepositAccountBusinessEvent) rawEvent;
|
||||
FixedDepositAccountData data = (FixedDepositAccountData) service.retrieveOne(DepositAccountType.FIXED_DEPOSIT, event.get().getId());
|
||||
FixedDepositAccountDataV1 avroDto = mapper.map(data);
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.group;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.generic.v1.CommandProcessingResultV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.generic.CommandProcessingResultMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.group.GroupsBusinessEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class GroupsBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final CommandProcessingResultMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof GroupsBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
GroupsBusinessEvent event = (GroupsBusinessEvent) rawEvent;
|
||||
CommandProcessingResultV1 avroDto = mapper.map(event.get());
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.loan;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.loan.v1.LoanTransactionAdjustmentDataV1;
|
||||
import org.apache.fineract.avro.loan.v1.LoanTransactionDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan.LoanTransactionDataMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanAdjustTransactionBusinessEvent;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanTransactionData;
|
||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
|
||||
import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class LoanAdjustTransactionBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final LoanReadPlatformService service;
|
||||
private final LoanTransactionDataMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof LoanAdjustTransactionBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
LoanAdjustTransactionBusinessEvent event = (LoanAdjustTransactionBusinessEvent) rawEvent;
|
||||
LoanTransaction transactionToAdjust = event.get().getTransactionToAdjust();
|
||||
LoanTransaction newTransactionDetail = event.get().getNewTransactionDetail();
|
||||
LoanTransactionData transactionToAdjustData = service.retrieveLoanTransaction(transactionToAdjust.getLoan().getId(),
|
||||
transactionToAdjust.getId());
|
||||
LoanTransactionData newTransactionDetailData = service.retrieveLoanTransaction(newTransactionDetail.getLoan().getId(),
|
||||
newTransactionDetail.getId());
|
||||
LoanTransactionDataV1 transactionToAdjustAvroDto = mapper.map(transactionToAdjustData);
|
||||
LoanTransactionDataV1 newTransactionDetailAvroDto = mapper.map(newTransactionDetailData);
|
||||
LoanTransactionAdjustmentDataV1 avroDto = new LoanTransactionAdjustmentDataV1(transactionToAdjustAvroDto,
|
||||
newTransactionDetailAvroDto);
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.loan;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.loan.v1.LoanAccountDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan.LoanAccountDataMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.LoanBusinessEvent;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanAccountData;
|
||||
import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class LoanBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final LoanReadPlatformService service;
|
||||
private final LoanAccountDataMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof LoanBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
LoanBusinessEvent event = (LoanBusinessEvent) rawEvent;
|
||||
LoanAccountData data = service.retrieveOne(event.get().getId());
|
||||
LoanAccountDataV1 avroDto = mapper.map(data);
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.loan;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.loan.v1.LoanChargeDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan.LoanChargeDataMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.charge.LoanChargeBusinessEvent;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
|
||||
import org.apache.fineract.portfolio.loanaccount.service.LoanChargeReadPlatformService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class LoanChargeBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final LoanChargeReadPlatformService service;
|
||||
private final LoanChargeDataMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof LoanChargeBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
LoanChargeBusinessEvent event = (LoanChargeBusinessEvent) rawEvent;
|
||||
LoanChargeData data = service.retrieveLoanChargeDetails(event.get().getId(), event.get().getLoan().getId());
|
||||
LoanChargeDataV1 avroDto = mapper.map(data);
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.loan;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.loan.v1.LoanProductDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan.LoanProductDataMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.product.LoanProductBusinessEvent;
|
||||
import org.apache.fineract.portfolio.loanproduct.data.LoanProductData;
|
||||
import org.apache.fineract.portfolio.loanproduct.service.LoanProductReadPlatformService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class LoanProductBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final LoanProductReadPlatformService service;
|
||||
private final LoanProductDataMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof LoanProductBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
LoanProductBusinessEvent event = (LoanProductBusinessEvent) rawEvent;
|
||||
LoanProductData data = service.retrieveLoanProduct(event.get().getId());
|
||||
LoanProductDataV1 avroDto = mapper.map(data);
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.loan;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.loan.v1.LoanTransactionDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.loan.LoanTransactionDataMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.loan.transaction.LoanTransactionBusinessEvent;
|
||||
import org.apache.fineract.portfolio.loanaccount.data.LoanTransactionData;
|
||||
import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class LoanTransactionBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final LoanReadPlatformService service;
|
||||
private final LoanTransactionDataMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof LoanTransactionBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
LoanTransactionBusinessEvent event = (LoanTransactionBusinessEvent) rawEvent;
|
||||
LoanTransactionData data = service.retrieveLoanTransaction(event.get().getLoan().getId(), event.get().getId());
|
||||
LoanTransactionDataV1 avroDto = mapper.map(data);
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.recurringdeposit;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.recurringdeposit.v1.RecurringDepositAccountDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.recurringdeposit.RecurringDepositAccountDataMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.deposit.RecurringDepositAccountBusinessEvent;
|
||||
import org.apache.fineract.portfolio.savings.DepositAccountType;
|
||||
import org.apache.fineract.portfolio.savings.data.RecurringDepositAccountData;
|
||||
import org.apache.fineract.portfolio.savings.service.DepositAccountReadPlatformService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class RecurringDepositAccountBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final DepositAccountReadPlatformService service;
|
||||
private final RecurringDepositAccountDataMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof RecurringDepositAccountBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
RecurringDepositAccountBusinessEvent event = (RecurringDepositAccountBusinessEvent) rawEvent;
|
||||
RecurringDepositAccountData data = (RecurringDepositAccountData) service.retrieveOne(DepositAccountType.RECURRING_DEPOSIT,
|
||||
event.get().getId());
|
||||
RecurringDepositAccountDataV1 avroDto = mapper.map(data);
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.savings;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.savings.v1.SavingsAccountDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.savings.SavingsAccountDataMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.savings.SavingsAccountBusinessEvent;
|
||||
import org.apache.fineract.portfolio.savings.data.SavingsAccountData;
|
||||
import org.apache.fineract.portfolio.savings.service.SavingsAccountReadPlatformService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SavingsAccountBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final SavingsAccountReadPlatformService service;
|
||||
private final SavingsAccountDataMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof SavingsAccountBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
SavingsAccountBusinessEvent event = (SavingsAccountBusinessEvent) rawEvent;
|
||||
SavingsAccountData data = service.retrieveOne(event.get().getId());
|
||||
SavingsAccountDataV1 avroDto = mapper.map(data);
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.share;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.share.v1.ShareAccountDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.share.ShareAccountDataMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.share.ShareAccountBusinessEvent;
|
||||
import org.apache.fineract.portfolio.shareaccounts.data.ShareAccountData;
|
||||
import org.apache.fineract.portfolio.shareaccounts.service.ShareAccountReadPlatformService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class ShareAccountBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final ShareAccountReadPlatformService service;
|
||||
private final ShareAccountDataMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof ShareAccountBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
ShareAccountBusinessEvent event = (ShareAccountBusinessEvent) rawEvent;
|
||||
ShareAccountData data = service.retrieveOne(event.get().getId(), false);
|
||||
ShareAccountDataV1 avroDto = mapper.map(data);
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.event.external.service.serialization.serializer.share;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.fineract.avro.share.v1.ShareProductDataV1;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.mapper.share.ShareProductDataMapper;
|
||||
import org.apache.fineract.infrastructure.event.external.service.serialization.serializer.BusinessEventSerializer;
|
||||
import org.apache.fineract.infrastructure.event.external.service.support.ByteBufferConverter;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.BusinessEvent;
|
||||
import org.apache.fineract.portfolio.businessevent.domain.share.ShareProductDividentsCreateBusinessEvent;
|
||||
import org.apache.fineract.portfolio.products.service.ShareProductReadPlatformService;
|
||||
import org.apache.fineract.portfolio.shareproducts.data.ShareProductData;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class ShareProductDividentsCreateBusinessEventSerializer implements BusinessEventSerializer {
|
||||
|
||||
private final ShareProductReadPlatformService service;
|
||||
private final ShareProductDataMapper mapper;
|
||||
private final ByteBufferConverter byteBufferConverter;
|
||||
|
||||
@Override
|
||||
public <T> boolean canSerialize(BusinessEvent<T> event) {
|
||||
return event instanceof ShareProductDividentsCreateBusinessEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> byte[] serialize(BusinessEvent<T> rawEvent) throws IOException {
|
||||
ShareProductDividentsCreateBusinessEvent event = (ShareProductDividentsCreateBusinessEvent) rawEvent;
|
||||
ShareProductData data = (ShareProductData) service.retrieveOne(event.get(), false);
|
||||
ShareProductDataV1 avroDto = mapper.map(data);
|
||||
ByteBuffer buffer = avroDto.toByteBuffer();
|
||||
return byteBufferConverter.convert(buffer);
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.apache.fineract.infrastructure.event.external.service.support;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ByteBufferConverter {
|
||||
|
||||
public byte[] convert(ByteBuffer buffer) {
|
||||
byte[] bytes = new byte[buffer.remaining()];
|
||||
buffer.get(bytes);
|
||||
buffer.position(buffer.position() - bytes.length);
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, 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.
|
||||
*/
|
||||
package org.apache.fineract.portfolio.businessevent.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BulkBusinessEvent extends AbstractBusinessEvent<List<BusinessEvent<?>>> {
|
||||
|
||||
public BulkBusinessEvent(List<BusinessEvent<?>> value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "BulkBusinessEvent";
|
||||
}
|
||||
}
|
||||
+2
@@ -21,4 +21,6 @@ package org.apache.fineract.portfolio.businessevent.domain;
|
||||
public interface BusinessEvent<T> {
|
||||
|
||||
T get();
|
||||
|
||||
String getType();
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class ClientActivateBusinessEvent extends ClientBusinessEvent {
|
||||
public ClientActivateBusinessEvent(Client value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "ClientActivateBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class ClientCreateBusinessEvent extends ClientBusinessEvent {
|
||||
public ClientCreateBusinessEvent(Client value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "ClientCreateBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class ClientRejectBusinessEvent extends ClientBusinessEvent {
|
||||
public ClientRejectBusinessEvent(Client value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "ClientRejectBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class FixedDepositAccountCreateBusinessEvent extends FixedDepositAccountB
|
||||
public FixedDepositAccountCreateBusinessEvent(FixedDepositAccount value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "FixedDepositAccountCreateBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class RecurringDepositAccountCreateBusinessEvent extends RecurringDeposit
|
||||
public RecurringDepositAccountCreateBusinessEvent(RecurringDepositAccount value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "RecurringDepositAccountCreateBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class CentersCreateBusinessEvent extends GroupsBusinessEvent {
|
||||
public CentersCreateBusinessEvent(CommandProcessingResult value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "CentersCreateBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class GroupsCreateBusinessEvent extends GroupsBusinessEvent {
|
||||
public GroupsCreateBusinessEvent(CommandProcessingResult value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "GroupsCreateBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanAcceptTransferBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanAcceptTransferBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanAcceptTransferBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -30,6 +30,11 @@ public class LoanAdjustTransactionBusinessEvent extends AbstractBusinessEvent<Lo
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanAdjustTransactionBusinessEvent";
|
||||
}
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public static class Data {
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanApplyOverdueChargeBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanApplyOverdueChargeBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanApplyOverdueChargeBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanApprovedBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanApprovedBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanApprovedBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanCloseAsRescheduleBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanCloseAsRescheduleBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanCloseAsRescheduleBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanCloseBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanCloseBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanCloseBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanCreatedBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanCreatedBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanCreatedBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanDisbursalBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanDisbursalBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanDisbursalBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanInitiateTransferBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanInitiateTransferBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanInitiateTransferBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanInterestRecalculationBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanInterestRecalculationBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanInterestRecalculationBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanReassignOfficerBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanReassignOfficerBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanReassignOfficerBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanRejectTransferBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanRejectTransferBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanRejectTransferBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanRejectedBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanRejectedBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanRejectedBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanRemoveOfficerBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanRemoveOfficerBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanRemoveOfficerBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanUndoApprovalBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanUndoApprovalBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanUndoApprovalBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanUndoDisbursalBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanUndoDisbursalBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanUndoDisbursalBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanUndoLastDisbursalBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanUndoLastDisbursalBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanUndoLastDisbursalBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanWithdrawTransferBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanWithdrawTransferBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanWithdrawTransferBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanAddChargeBusinessEvent extends LoanChargeBusinessEvent {
|
||||
public LoanAddChargeBusinessEvent(LoanCharge value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanAddChargeBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanDeleteChargeBusinessEvent extends LoanChargeBusinessEvent {
|
||||
public LoanDeleteChargeBusinessEvent(LoanCharge value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanDeleteChargeBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanUpdateChargeBusinessEvent extends LoanChargeBusinessEvent {
|
||||
public LoanUpdateChargeBusinessEvent(LoanCharge value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanUpdateChargeBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanWaiveChargeBusinessEvent extends LoanChargeBusinessEvent {
|
||||
public LoanWaiveChargeBusinessEvent(LoanCharge value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanWaiveChargeBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanWaiveChargeUndoBusinessEvent extends LoanChargeBusinessEvent {
|
||||
public LoanWaiveChargeUndoBusinessEvent(LoanCharge value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanWaiveChargeUndoBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanProductCreateBusinessEvent extends LoanProductBusinessEvent {
|
||||
public LoanProductCreateBusinessEvent(LoanProduct value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanProductCreateBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanChargePaymentPostBusinessEvent extends LoanTransactionBusinessE
|
||||
public LoanChargePaymentPostBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanChargePaymentPostBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -26,4 +26,9 @@ public class LoanChargePaymentPreBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanChargePaymentPreBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanChargePaymentPreBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanChargeRefundBusinessEvent extends LoanTransactionBusinessEvent
|
||||
public LoanChargeRefundBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanChargeRefundBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanCreditBalanceRefundPostBusinessEvent extends LoanTransactionBus
|
||||
public LoanCreditBalanceRefundPostBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanCreditBalanceRefundPostBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -26,4 +26,9 @@ public class LoanCreditBalanceRefundPreBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanCreditBalanceRefundPreBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanCreditBalanceRefundPreBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanForeClosurePostBusinessEvent extends LoanTransactionBusinessEve
|
||||
public LoanForeClosurePostBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanForeClosurePostBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -26,4 +26,9 @@ public class LoanForeClosurePreBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanForeClosurePreBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanForeClosurePreBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanRefundPostBusinessEvent extends LoanTransactionBusinessEvent {
|
||||
public LoanRefundPostBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanRefundPostBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -26,4 +26,9 @@ public class LoanRefundPreBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanRefundPreBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanRefundPreBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanTransactionGoodwillCreditPostBusinessEvent extends LoanTransact
|
||||
public LoanTransactionGoodwillCreditPostBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanTransactionGoodwillCreditPostBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -26,4 +26,9 @@ public class LoanTransactionGoodwillCreditPreBusinessEvent extends LoanBusinessE
|
||||
public LoanTransactionGoodwillCreditPreBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanTransactionGoodwillCreditPreBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanTransactionMakeRepaymentPostBusinessEvent extends LoanTransacti
|
||||
public LoanTransactionMakeRepaymentPostBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanTransactionMakeRepaymentPostBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -26,4 +26,9 @@ public class LoanTransactionMakeRepaymentPreBusinessEvent extends LoanBusinessEv
|
||||
public LoanTransactionMakeRepaymentPreBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanTransactionMakeRepaymentPreBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanTransactionMerchantIssuedRefundPostBusinessEvent extends LoanTr
|
||||
public LoanTransactionMerchantIssuedRefundPostBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanTransactionMerchantIssuedRefundPostBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -26,4 +26,9 @@ public class LoanTransactionMerchantIssuedRefundPreBusinessEvent extends LoanBus
|
||||
public LoanTransactionMerchantIssuedRefundPreBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanTransactionMerchantIssuedRefundPreBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanTransactionPayoutRefundPostBusinessEvent extends LoanTransactio
|
||||
public LoanTransactionPayoutRefundPostBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanTransactionPayoutRefundPostBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -26,4 +26,9 @@ public class LoanTransactionPayoutRefundPreBusinessEvent extends LoanBusinessEve
|
||||
public LoanTransactionPayoutRefundPreBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanTransactionPayoutRefundPreBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanTransactionRecoveryPaymentPostBusinessEvent extends LoanTransac
|
||||
public LoanTransactionRecoveryPaymentPostBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanTransactionRecoveryPaymentPostBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -26,4 +26,9 @@ public class LoanTransactionRecoveryPaymentPreBusinessEvent extends LoanBusiness
|
||||
public LoanTransactionRecoveryPaymentPreBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanTransactionRecoveryPaymentPreBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanUndoWrittenOffBusinessEvent extends LoanTransactionBusinessEven
|
||||
public LoanUndoWrittenOffBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanUndoWrittenOffBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanWaiveInterestBusinessEvent extends LoanTransactionBusinessEvent
|
||||
public LoanWaiveInterestBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanWaiveInterestBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class LoanWrittenOffPostBusinessEvent extends LoanTransactionBusinessEven
|
||||
public LoanWrittenOffPostBusinessEvent(LoanTransaction value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanWrittenOffPostBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -26,4 +26,9 @@ public class LoanWrittenOffPreBusinessEvent extends LoanBusinessEvent {
|
||||
public LoanWrittenOffPreBusinessEvent(Loan value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "LoanWrittenOffPreBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class SavingsActivateBusinessEvent extends SavingsAccountBusinessEvent {
|
||||
public SavingsActivateBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "SavingsActivateBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class SavingsApproveBusinessEvent extends SavingsAccountBusinessEvent {
|
||||
public SavingsApproveBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "SavingsApproveBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class SavingsCloseBusinessEvent extends SavingsAccountBusinessEvent {
|
||||
public SavingsCloseBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "SavingsCloseBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class SavingsCreateBusinessEvent extends SavingsAccountBusinessEvent {
|
||||
public SavingsCreateBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "SavingsCreateBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class SavingsPostInterestBusinessEvent extends SavingsAccountBusinessEven
|
||||
public SavingsPostInterestBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "SavingsPostInterestBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -25,4 +25,9 @@ public class SavingsRejectBusinessEvent extends SavingsAccountBusinessEvent {
|
||||
public SavingsRejectBusinessEvent(SavingsAccount value) {
|
||||
super(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return "SavingsRejectBusinessEvent";
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user