FINERACT-2198: Extend Manual Journal entry to support Asset Externalization

This commit is contained in:
Jose Alberto Hernandez
2025-07-07 13:59:33 +02:00
committed by Adam Saghy
parent 4feee70a7a
commit 0c1ca2baba
16 changed files with 190 additions and 21 deletions
@@ -0,0 +1,34 @@
/**
* 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.investor.exception;
import org.apache.fineract.infrastructure.core.domain.ExternalId;
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
public class ExternalAssetOwnerNotFoundException extends AbstractPlatformResourceNotFoundException {
public ExternalAssetOwnerNotFoundException(ExternalId externalId) {
super("error.msg.external.asset.owner.external.id",
String.format("External asset owner with external id: %s does not found", externalId.getValue()), externalId.getValue());
}
public ExternalAssetOwnerNotFoundException(Long id) {
super("error.msg.external.asset.owner.id", String.format("External asset owner with id: %s does not found", id), id);
}
}
@@ -18,6 +18,7 @@
*/
package org.apache.fineract.investor.service;
import org.apache.fineract.accounting.journalentry.domain.JournalEntry;
import org.apache.fineract.investor.domain.ExternalAssetOwner;
import org.apache.fineract.investor.domain.ExternalAssetOwnerTransfer;
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
@@ -27,4 +28,6 @@ public interface AccountingService {
void createJournalEntriesForSaleAssetTransfer(Loan loan, ExternalAssetOwnerTransfer transfer, ExternalAssetOwner previousOwner);
void createJournalEntriesForBuybackAssetTransfer(Loan loan, ExternalAssetOwnerTransfer transfer);
void createMappingToOwner(ExternalAssetOwner owner, JournalEntry journalEntry);
}
@@ -120,7 +120,8 @@ public class AccountingServiceImpl implements AccountingService {
return journalEntryList;
}
private void createMappingToOwner(final ExternalAssetOwner owner, final JournalEntry journalEntry) {
@Override
public void createMappingToOwner(final ExternalAssetOwner owner, final JournalEntry journalEntry) {
if (owner == null) {
return;
}