FINERACT-2374: Advance Accounting rule for classification type

This commit is contained in:
Jose Alberto Hernandez
2025-09-30 12:27:45 +02:00
committed by Adam Saghy
parent 6d3e5fa150
commit cb70555485
31 changed files with 1023 additions and 66 deletions
@@ -53,7 +53,9 @@ public final class AccountingConstants {
INCOME_FROM_CHARGE_OFF_PENALTY(18), //
INCOME_FROM_GOODWILL_CREDIT_INTEREST(19), //
INCOME_FROM_GOODWILL_CREDIT_FEES(20), //
INCOME_FROM_GOODWILL_CREDIT_PENALTY(21); //
INCOME_FROM_GOODWILL_CREDIT_PENALTY(21), //
CLASSIFICATION_INCOME(22), //
;
private final Integer value;
@@ -185,6 +187,9 @@ public final class AccountingConstants {
INCOME_FROM_CAPITALIZATION("incomeFromCapitalizationAccountId"), //
BUY_DOWN_EXPENSE("buyDownExpenseAccountId"), //
INCOME_FROM_BUY_DOWN("incomeFromBuyDownAccountId"), //
CAPITALIZED_INCOME_CLASSIFICATION_TO_INCOME_ACCOUNT_MAPPINGS("capitalizedIncomeClassificationToIncomeAccountMappings"), //
BUYDOWN_FEE_CLASSIFICATION_TO_INCOME_ACCOUNT_MAPPINGS("buydownfeeClassificationToIncomeAccountMappings"), //
CLASSIFICATION_CODE_VALUE_ID("classificationCodeValueId"), //
;
private final String value;
@@ -0,0 +1,31 @@
/**
* 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.accounting.journalentry.data;
import java.math.BigDecimal;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Getter
public class AdvancedMappingtDTO {
private final Long referenceValueId;
private final BigDecimal amount;
}
@@ -0,0 +1,36 @@
/**
* 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.accounting.producttoaccountmapping.data;
import java.io.Serializable;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class ClassificationToGLAccountData implements Serializable {
private static final long serialVersionUID = 1L;
private CodeValueData classificationCodeValue;
private GLAccountData incomeAccount;
}
@@ -0,0 +1,134 @@
/**
* 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.codes.api;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* Created by sanyam on 30/7/17.
*/
public final class CodeValuesApiResourceSwagger {
private CodeValuesApiResourceSwagger() {
}
@Schema(description = "GetCodeValuesDataResponse")
public static final class GetCodeValuesDataResponse {
private GetCodeValuesDataResponse() {
}
@Schema(example = "1")
public Long id;
@Schema(example = "Passport")
public String name;
@Schema(example = "Passport information")
public String description;
@Schema(example = "0")
public Integer position;
@Schema(example = "true")
public Boolean active;
@Schema(example = "false")
public Boolean mandatory;
}
@Schema(description = "PostCodeValuesDataRequest")
public static final class PostCodeValuesDataRequest {
private PostCodeValuesDataRequest() {
}
@Schema(example = "Passport")
public String name;
@Schema(example = "true")
public Boolean isActive;
@Schema(example = "Passport information")
public String description;
@Schema(example = "0")
public Integer position;
}
@Schema(description = "PostCodeValueDataResponse")
public static final class PostCodeValueDataResponse {
private PostCodeValueDataResponse() {
}
@Schema(example = "4")
public Long resourceId;
@Schema(example = "4")
public Long subResourceId;
}
@Schema(description = "PutCodeValuesDataRequest")
public static final class PutCodeValuesDataRequest {
private PutCodeValuesDataRequest() {
}
@Schema(example = "Passport")
public String name;
@Schema(example = "Passport information")
public String description;
@Schema(example = "0")
public Integer position;
@Schema(example = "true")
public Boolean isActive;
}
@Schema(description = "PutCodeValueDataResponse")
public static final class PutCodeValueDataResponse {
private PutCodeValueDataResponse() {
}
private static final class PutCodeValuechangesSwagger {
private PutCodeValuechangesSwagger() {}
@Schema(example = "Passport")
public String name;
@Schema(example = "Passport information")
public String description;
@Schema(example = "0")
public Integer position;
}
@Schema(example = "4")
public Long resourceId;
public PutCodeValuechangesSwagger changes;
}
@Schema(description = "DeleteCodeValueDataResponse")
public static final class DeleteCodeValueDataResponse {
private DeleteCodeValueDataResponse() {
}
@Schema(example = "4")
public Long resourceId;
}
}
@@ -0,0 +1,110 @@
/**
* 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.codes.api;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* Created by sanyam on 29/7/17.
*/
final class CodesApiResourceSwagger {
private CodesApiResourceSwagger() {
// this class is only for Swagger Live Documentation
}
@Schema(description = "GetCodesResponse")
public static final class GetCodesResponse {
private GetCodesResponse() {
}
@Schema(example = "1")
public Long id;
@Schema(example = "Education")
public String name;
@Schema(example = "true")
public boolean systemDefined;
}
@Schema(description = "PostCodesRequest")
public static final class PostCodesRequest {
private PostCodesRequest() {
}
@Schema(example = "MyNewCode")
public String name;
}
@Schema(description = "PostCodesResponse")
public static final class PostCodesResponse {
private PostCodesResponse() {
}
@Schema(example = "4")
public Long resourceId;
}
@Schema(description = "PutCodesRequest")
public static final class PutCodesRequest {
private PutCodesRequest() {
}
@Schema(example = "MyNewCode(changed)")
public String name;
}
@Schema(description = "PutCodesResponse")
public static final class PutCodesResponse {
private PutCodesResponse() {
}
private static final class PutCodesApichangesSwagger {
private PutCodesApichangesSwagger() {}
@Schema(example = "MyNewCode(changed)")
public String name;
}
@Schema(example = "4")
public Long resourceId;
public PutCodesApichangesSwagger changes;
}
@Schema(description = "DeleteCodesResponse")
public static final class DeleteCodesResponse {
private DeleteCodesResponse() {
}
@Schema(example = "4")
public Long resourceId;
}
}
@@ -0,0 +1,36 @@
/**
* 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.codes.mapper;
import java.util.List;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.codes.domain.CodeValue;
import org.apache.fineract.infrastructure.core.config.MapstructMapperConfig;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
@Mapper(config = MapstructMapperConfig.class)
public interface CodeValueMapper {
@Mapping(target = "name", source = "label")
CodeValueData map(CodeValue source);
List<CodeValueData> map(List<CodeValue> source);
}