Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9AAF3200D5B for ; Wed, 13 Dec 2017 10:03:17 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 99045160C2B; Wed, 13 Dec 2017 09:03:17 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C2800160C16 for ; Wed, 13 Dec 2017 10:03:15 +0100 (CET) Received: (qmail 83391 invoked by uid 500); 13 Dec 2017 09:03:15 -0000 Mailing-List: contact commits-help@fineract.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@fineract.apache.org Delivered-To: mailing list commits@fineract.apache.org Received: (qmail 83382 invoked by uid 99); 13 Dec 2017 09:03:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Dec 2017 09:03:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D405FDFC25; Wed, 13 Dec 2017 09:03:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: avikg@apache.org To: commits@fineract.apache.org Date: Wed, 13 Dec 2017 09:03:14 -0000 Message-Id: <8f1b42206a6b4483834e61d0686ff3ed@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/19] fineract git commit: all modules populate & import archived-at: Wed, 13 Dec 2017 09:03:17 -0000 Repository: fineract Updated Branches: refs/heads/develop bf894732d -> 98f5612ac http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountApplicationTimelineData.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountApplicationTimelineData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountApplicationTimelineData.java index d24973b..e3f8e68 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountApplicationTimelineData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountApplicationTimelineData.java @@ -119,4 +119,8 @@ public class SavingsAccountApplicationTimelineData { this.closedByFirstname = closedByFirstname; this.closedByLastname = closedByLastname; } + + public LocalDate getActivatedOnDate() { + return activatedOnDate; + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountChargeData.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountChargeData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountChargeData.java index 81245c0..ba158d0 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountChargeData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountChargeData.java @@ -78,6 +78,31 @@ public class SavingsAccountChargeData { private final Collection chargeOptions; + public SavingsAccountChargeData(Long chargeId, BigDecimal amount,LocalDate dueDate) { + this.chargeId = chargeId; + this.amount = amount; + this.dueDate = dueDate; + this.id=null; + this.accountId = null; + this.name = null; + this.chargeTimeType = null; + this.feeOnMonthDay = null; + this.feeInterval = null; + this.chargeCalculationType = null; + this.percentage = null; + this.amountPercentageAppliedTo = null; + this.currency = null; + this.amountPaid = null; + this.amountWaived = null; + this.amountWrittenOff = null; + this.amountOutstanding = null; + this.amountOrPercentage = null; + this.penalty = false; + this.isActive = null; + this.inactivationDate = null; + this.chargeOptions = null; + } + public static SavingsAccountChargeData template(final Collection chargeOptions) { final Long id = null; final Long chargeId = null; http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountData.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountData.java index 32a0630..64ff43a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountData.java @@ -19,12 +19,11 @@ package org.apache.fineract.portfolio.savings.data; import java.math.BigDecimal; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; +import java.util.*; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.fineract.infrastructure.bulkimport.constants.TemplatePopulateImportConstants; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.infrastructure.dataqueries.data.DatatableData; import org.apache.fineract.organisation.monetary.data.CurrencyData; @@ -105,6 +104,222 @@ public class SavingsAccountData { private List datatables = null; + //import field + private Long productId; + private String locale; + private String dateFormat; + private transient Integer rowIndex; + private LocalDate submittedOnDate; + + public static SavingsAccountData importInstanceIndividual(Long clientId, Long productId, Long fieldOfficerId,LocalDate submittedOnDate, + BigDecimal nominalAnnualInterestRate, EnumOptionData interestCompoundingPeriodTypeEnum, + EnumOptionData interestPostingPeriodTypeEnum,EnumOptionData interestCalculationTypeEnum, + EnumOptionData interestCalculationDaysInYearTypeEnum,BigDecimal minRequiredOpeningBalance, + Integer lockinPeriodFrequency,EnumOptionData lockinPeriodFrequencyTypeEnum, boolean applyWithdrawalFeeForTransfers, + Integer rowIndex,String externalId,Collection charges,boolean allowOverdraft, + BigDecimal overdraftLimit,String locale, String dateFormat){ + return new SavingsAccountData(clientId, productId, fieldOfficerId, submittedOnDate, nominalAnnualInterestRate, + interestCompoundingPeriodTypeEnum, interestPostingPeriodTypeEnum, interestCalculationTypeEnum, + interestCalculationDaysInYearTypeEnum, minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyTypeEnum, + applyWithdrawalFeeForTransfers, rowIndex, externalId, charges, allowOverdraft, overdraftLimit,locale,dateFormat); + + } + + private SavingsAccountData(Long clientId, Long productId, Long fieldOfficerId,LocalDate submittedOnDate, + BigDecimal nominalAnnualInterestRate, EnumOptionData interestCompoundingPeriodType, + EnumOptionData interestPostingPeriodType,EnumOptionData interestCalculationType, + EnumOptionData interestCalculationDaysInYearType,BigDecimal minRequiredOpeningBalance, + Integer lockinPeriodFrequency,EnumOptionData lockinPeriodFrequencyType, boolean withdrawalFeeForTransfers, + Integer rowIndex,String externalId,Collection charges,boolean allowOverdraft, + BigDecimal overdraftLimit,String locale, String dateFormat) { + this.id = null; + this.accountNo = null; + this.depositType = null; + this.externalId = externalId; + this.groupId = null; + this.groupName = null; + this.clientId = clientId; + this.clientName = null; + this.savingsProductId = null; + this.savingsProductName = null; + this.fieldOfficerId = fieldOfficerId; + this.fieldOfficerName = null; + this.status = null; + this.subStatus = null; + this.timeline = null; + this.currency = null; + this.nominalAnnualInterestRate = nominalAnnualInterestRate; + this.interestCompoundingPeriodType = interestCompoundingPeriodType; + this.interestPostingPeriodType = interestPostingPeriodType; + this.interestCalculationType = interestCalculationType; + this.interestCalculationDaysInYearType = interestCalculationDaysInYearType; + this.minRequiredOpeningBalance = minRequiredOpeningBalance; + this.lockinPeriodFrequency = lockinPeriodFrequency; + this.lockinPeriodFrequencyType = lockinPeriodFrequencyType; + this.withdrawalFeeForTransfers = withdrawalFeeForTransfers; + this.allowOverdraft = allowOverdraft; + this.overdraftLimit = overdraftLimit; + this.minRequiredBalance = null; + this.enforceMinRequiredBalance = false; + this.minBalanceForInterestCalculation = null; + this.onHoldFunds = null; + this.withHoldTax = false; + this.taxGroup = null; + this.lastActiveTransactionDate = null; + this.isDormancyTrackingActive = false; + this.daysToInactive = null; + this.daysToDormancy = null; + this.daysToEscheat = null; + this.summary = null; + this.transactions = null; + this.charges = charges; + this.productOptions = null; + this.fieldOfficerOptions = null; + this.interestCompoundingPeriodTypeOptions = null; + this.interestPostingPeriodTypeOptions = null; + this.interestCalculationTypeOptions = null; + this.interestCalculationDaysInYearTypeOptions = null; + this.lockinPeriodFrequencyTypeOptions = null; + this.withdrawalFeeTypeOptions = null; + this.chargeOptions = null; + this.withdrawalFee = null; + this.annualFee = null; + this.nominalAnnualInterestRateOverdraft = null; + this.minOverdraftForInterestCalculation = null; + this.datatables = null; + this.productId = productId; + this.dateFormat=dateFormat; + this.locale= locale; + this.rowIndex = rowIndex; + this.submittedOnDate=submittedOnDate; + this.savingsAmountOnHold=null; + } + + public static final Comparator ClientNameComparator = new Comparator() { + + @Override + public int compare(SavingsAccountData savings1, SavingsAccountData savings2) { + String clientOfSavings1 = savings1.getClientName().toUpperCase(Locale.ENGLISH); + String clientOfSavings2 = savings2.getClientName().toUpperCase(Locale.ENGLISH); + return clientOfSavings1.compareTo(clientOfSavings2); + } + }; + + public String getClientName() { + return clientName; + } + + public String getAccountNo() { + return accountNo; + } + + public Long getClientId() { + return clientId; + } + + public String getSavingsProductName() { + return savingsProductName; + } + + public BigDecimal getMinRequiredOpeningBalance() { + return minRequiredOpeningBalance; + } + + public SavingsAccountApplicationTimelineData getTimeline() { + return timeline; + } + + public static SavingsAccountData importInstanceGroup(Long groupId, Long productId, Long fieldOfficerId, + LocalDate submittedOnDate, + BigDecimal nominalAnnualInterestRate, EnumOptionData interestCompoundingPeriodTypeEnum, + EnumOptionData interestPostingPeriodTypeEnum,EnumOptionData interestCalculationTypeEnum, + EnumOptionData interestCalculationDaysInYearTypeEnum,BigDecimal minRequiredOpeningBalance, + Integer lockinPeriodFrequency,EnumOptionData lockinPeriodFrequencyTypeEnum, + boolean applyWithdrawalFeeForTransfers, + Integer rowIndex,String externalId,Collection charges, + boolean allowOverdraft, + BigDecimal overdraftLimit,String locale, String dateFormat){ + + return new SavingsAccountData(groupId, productId, fieldOfficerId, submittedOnDate, nominalAnnualInterestRate, + interestCompoundingPeriodTypeEnum, interestPostingPeriodTypeEnum, interestCalculationTypeEnum, + interestCalculationDaysInYearTypeEnum, minRequiredOpeningBalance, lockinPeriodFrequency, lockinPeriodFrequencyTypeEnum, + applyWithdrawalFeeForTransfers, rowIndex, externalId, charges, allowOverdraft, overdraftLimit,null,locale,dateFormat); + + } + private SavingsAccountData(Long groupId, Long productId, Long fieldOfficerId,LocalDate submittedOnDate, + BigDecimal nominalAnnualInterestRate, EnumOptionData interestCompoundingPeriodType, + EnumOptionData interestPostingPeriodType,EnumOptionData interestCalculationType, + EnumOptionData interestCalculationDaysInYearType,BigDecimal minRequiredOpeningBalance, + Integer lockinPeriodFrequency,EnumOptionData lockinPeriodFrequencyType, boolean withdrawalFeeForTransfers, + Integer rowIndex,String externalId,Collection charges,boolean allowOverdraft, + BigDecimal overdraftLimit,Long id,String locale, String dateFormat) { + this.id = id; + this.accountNo = null; + this.depositType = null; + this.externalId = externalId; + this.groupId = groupId; + this.groupName = null; + this.clientId = null; + this.clientName = null; + this.savingsProductId = null; + this.savingsProductName = null; + this.fieldOfficerId = fieldOfficerId; + this.fieldOfficerName = null; + this.status = null; + this.subStatus = null; + this.timeline = null; + this.currency = null; + this.nominalAnnualInterestRate = nominalAnnualInterestRate; + this.interestCompoundingPeriodType = interestCompoundingPeriodType; + this.interestPostingPeriodType = interestPostingPeriodType; + this.interestCalculationType = interestCalculationType; + this.interestCalculationDaysInYearType = interestCalculationDaysInYearType; + this.minRequiredOpeningBalance = minRequiredOpeningBalance; + this.lockinPeriodFrequency = lockinPeriodFrequency; + this.lockinPeriodFrequencyType = lockinPeriodFrequencyType; + this.withdrawalFeeForTransfers = withdrawalFeeForTransfers; + this.allowOverdraft = allowOverdraft; + this.overdraftLimit = overdraftLimit; + this.minRequiredBalance = null; + this.enforceMinRequiredBalance = false; + this.minBalanceForInterestCalculation = null; + this.onHoldFunds = null; + this.withHoldTax = false; + this.taxGroup = null; + this.lastActiveTransactionDate = null; + this.isDormancyTrackingActive = false; + this.daysToInactive = null; + this.daysToDormancy = null; + this.daysToEscheat = null; + this.summary = null; + this.transactions = null; + this.charges = charges; + this.productOptions = null; + this.fieldOfficerOptions = null; + this.interestCompoundingPeriodTypeOptions = null; + this.interestPostingPeriodTypeOptions = null; + this.interestCalculationTypeOptions = null; + this.interestCalculationDaysInYearTypeOptions = null; + this.lockinPeriodFrequencyTypeOptions = null; + this.withdrawalFeeTypeOptions = null; + this.chargeOptions = null; + this.withdrawalFee = null; + this.annualFee = null; + this.nominalAnnualInterestRateOverdraft = null; + this.minOverdraftForInterestCalculation = null; + this.datatables = null; + this.productId = productId; + this.dateFormat= dateFormat; + this.locale= locale; + this.rowIndex = rowIndex; + this.submittedOnDate=submittedOnDate; + this.savingsAmountOnHold=null; + } + + public Integer getRowIndex() { + return rowIndex; + } + public static SavingsAccountData instance(final Long id, final String accountNo, final EnumOptionData depositType, final String externalId, final Long groupId, final String groupName, final Long clientId, final String clientName, final Long productId, final String productName, final Long fieldOfficerId, final String fieldOfficerName, http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionData.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionData.java index bf066ed..b3073dd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionData.java @@ -21,6 +21,7 @@ package org.apache.fineract.portfolio.savings.data; import java.math.BigDecimal; import java.util.Collection; +import org.apache.fineract.infrastructure.bulkimport.constants.TemplatePopulateImportConstants; import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.organisation.monetary.data.CurrencyData; @@ -55,6 +56,73 @@ public class SavingsAccountTransactionData { // templates final Collection paymentTypeOptions; + //import fields + private transient Integer rowIndex; + private transient Long savingsAccountId; + private String dateFormat; + private String locale; + private LocalDate transactionDate; + private BigDecimal transactionAmount; + private Long paymentTypeId; + private String accountNumber; + private String checkNumber; + private String routingCode; + private String receiptNumber; + private String bankNumber; + + public static SavingsAccountTransactionData importInstance(BigDecimal transactionAmount,LocalDate transactionDate, + Long paymentTypeId,String accountNumber, String checkNumber, String routingCode, + String receiptNumber, String bankNumber,Long savingsAccountId, + SavingsAccountTransactionEnumData transactionType, Integer rowIndex,String locale,String dateFormat){ + return new SavingsAccountTransactionData(transactionAmount, transactionDate, paymentTypeId, accountNumber, + checkNumber, routingCode, receiptNumber, bankNumber, savingsAccountId, transactionType, rowIndex,locale,dateFormat); + } + + private SavingsAccountTransactionData(BigDecimal transactionAmount,LocalDate transactionDate, + Long paymentTypeId,String accountNumber, String checkNumber, String routingCode, + String receiptNumber, String bankNumber,Long savingsAccountId, + SavingsAccountTransactionEnumData transactionType, Integer rowIndex,String locale,String dateFormat){ + this.id = null; + this.transactionType = transactionType; + this.accountId = null; + this.accountNo = null; + this.date = null; + this.currency = null; + this.paymentDetailData = null; + this.amount = null; + this.outstandingChargeAmount = null; + this.runningBalance = null; + this.reversed = false; + this.transfer = null; + this.submittedOnDate = null; + this.interestedPostedAsOn = false; + this.rowIndex = rowIndex; + this.savingsAccountId=savingsAccountId; + this.dateFormat= dateFormat; + this.locale= locale; + this.transactionDate = transactionDate; + this.transactionAmount = transactionAmount; + this.paymentTypeId = paymentTypeId; + this.accountNumber = accountNumber; + this.checkNumber = checkNumber; + this.routingCode = routingCode; + this.receiptNumber = receiptNumber; + this.bankNumber = bankNumber; + this.paymentTypeOptions = null; + } + + public Integer getRowIndex() { + return rowIndex; + } + + public Long getSavingsAccountId() { + return savingsAccountId; + } + + public SavingsAccountTransactionEnumData getTransactionType() { + return transactionType; + } + public static SavingsAccountTransactionData create(final Long id, final SavingsAccountTransactionEnumData transactionType, final PaymentDetailData paymentDetailData, final Long savingsId, final String savingsAccountNo, final LocalDate date, final CurrencyData currency, final BigDecimal amount, final BigDecimal outstandingChargeAmount,final BigDecimal runningBalance, final boolean reversed, http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsActivation.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsActivation.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsActivation.java new file mode 100644 index 0000000..d9d3f40 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsActivation.java @@ -0,0 +1,60 @@ +/** + * 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.savings.data; + +import org.joda.time.LocalDate; + +import java.util.Locale; + +public class SavingsActivation { + + private final transient Integer rowIndex; + + private final LocalDate activatedOnDate; + + private final String dateFormat; + + private final String locale; + + public static SavingsActivation importInstance(LocalDate activatedOnDate, Integer rowIndex,String locale,String dateFormat){ + return new SavingsActivation(activatedOnDate,rowIndex,locale,dateFormat); + } + private SavingsActivation(LocalDate activatedOnDate, Integer rowIndex,String locale,String dateFormat ) { + this.activatedOnDate = activatedOnDate; + this.rowIndex = rowIndex; + this.dateFormat = dateFormat; + this.locale = locale; + } + + public LocalDate getActivatedOnDate() { + return activatedOnDate; + } + + public String getLocale() { + return locale; + } + + public String getDateFormat() { + return dateFormat; + } + + public Integer getRowIndex() { + return rowIndex; + } +} http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsApproval.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsApproval.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsApproval.java new file mode 100644 index 0000000..b242320 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsApproval.java @@ -0,0 +1,67 @@ +/** + * 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.savings.data; + +import org.joda.time.LocalDate; + +import java.util.Locale; + +public class SavingsApproval { + private final transient Integer rowIndex; + + private final LocalDate approvedOnDate; + + private final String dateFormat; + + private final String locale; + + private final String note; + + public static SavingsApproval importInstance(LocalDate approvedOnDate, Integer rowIndex,String locale,String dateFormat){ + return new SavingsApproval(approvedOnDate, rowIndex,locale,dateFormat); + } + + private SavingsApproval(LocalDate approvedOnDate, Integer rowIndex,String locale,String dateFormat ) { + this.approvedOnDate = approvedOnDate; + this.rowIndex = rowIndex; + this.dateFormat = dateFormat; + this.locale = locale; + this.note = ""; + } + + public LocalDate getApprovedOnDate() { + return approvedOnDate; + } + + public String getLocale() { + return locale; + } + + public String getDateFormat() { + return dateFormat; + } + + public Integer getRowIndex() { + return rowIndex; + } + + public String getNote() { + return note; + } +} http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductData.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductData.java index 277126e..99538b4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsProductData.java @@ -445,6 +445,60 @@ public class SavingsProductData { public void setDepositAccountType(String depositAccountType) { this.depositAccountType = depositAccountType; } - - + + public BigDecimal getNominalAnnualInterestRate() { + return nominalAnnualInterestRate; + } + + public CurrencyData getCurrency() { + return currency; + } + + public Integer getLockinPeriodFrequency() { + return lockinPeriodFrequency; + } + + public EnumOptionData getLockinPeriodFrequencyType() { + return lockinPeriodFrequencyType; + } + + public BigDecimal getOverdraftLimit() { + return overdraftLimit; + } + + public BigDecimal getMinRequiredOpeningBalance() { + return minRequiredOpeningBalance; + } + + public EnumOptionData getInterestCompoundingPeriodType() { + return interestCompoundingPeriodType; + } + + public EnumOptionData getInterestPostingPeriodType() { + return interestPostingPeriodType; + } + + public EnumOptionData getInterestCalculationType() { + return interestCalculationType; + } + + public EnumOptionData getInterestCalculationDaysInYearType() { + return interestCalculationDaysInYearType; + } + + public boolean isAllowOverdraft() { + return allowOverdraft; + } + + public BigDecimal getMinRequiredBalance() { + return minRequiredBalance; + } + + public Long getId() { + return id; + } + + public boolean isWithdrawalFeeForTransfers() { + return withdrawalFeeForTransfers; + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java index ff27554..954b6f7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/DepositTermDetail.java @@ -183,6 +183,7 @@ public class DepositTermDetail { final Integer inMultiplesOfInDays = this.convertToSafeDays(this.inMultiplesOfDepositTerm(), SavingsPeriodFrequencyType.fromInt(this.inMultiplesOfDepositTermType())); final Integer minDepositInDays = this.convertToSafeDays(minDepositTerm, SavingsPeriodFrequencyType.fromInt(minDepositTermType)); + if(inMultiplesOfInDays!=0) isValidInMultiplesOfPeriod = ((depositPeriodInDays - minDepositInDays) % inMultiplesOfInDays == 0); } http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java index a9704eb..b4aeae4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java @@ -160,7 +160,7 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead final Object[] queryParameters = new Object[] { clientId, depositAccountType.getValue(), currencyCode }; return this.jdbcTemplate.query(sqlBuilder.toString(), this.savingAccountMapper, queryParameters); } - + @Override public Page retrieveAll(final SearchParameters searchParameters) { @@ -178,35 +178,39 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead final Object[] objectArray = new Object[2]; objectArray[0] = hierarchySearchString; int arrayPos = 1; + if(searchParameters!=null) { + String sqlQueryCriteria = searchParameters.getSqlSearch(); + if (StringUtils.isNotBlank(sqlQueryCriteria)) { + sqlQueryCriteria = sqlQueryCriteria.replaceAll("accountNo", "sa.account_no"); + this.columnValidator.validateSqlInjection(sqlBuilder.toString(), sqlQueryCriteria); + sqlBuilder.append(" and (").append(sqlQueryCriteria).append(")"); + } - String sqlQueryCriteria = searchParameters.getSqlSearch(); - if (StringUtils.isNotBlank(sqlQueryCriteria)) { - sqlQueryCriteria = sqlQueryCriteria.replaceAll("accountNo", "sa.account_no"); - this.columnValidator.validateSqlInjection(sqlBuilder.toString(), sqlQueryCriteria); - sqlBuilder.append(" and (").append(sqlQueryCriteria).append(")"); - } - - if (StringUtils.isNotBlank(searchParameters.getExternalId())) { - sqlBuilder.append(" and sa.external_id = ?"); - objectArray[arrayPos] = searchParameters.getExternalId(); - arrayPos = arrayPos + 1; - } - - if (searchParameters.isOrderByRequested()) { - sqlBuilder.append(" order by ").append(searchParameters.getOrderBy()); + if (StringUtils.isNotBlank(searchParameters.getExternalId())) { + sqlBuilder.append(" and sa.external_id = ?"); + objectArray[arrayPos] = searchParameters.getExternalId(); + arrayPos = arrayPos + 1; + } + if(searchParameters.getOfficeId()!=null){ + sqlBuilder.append("and c.office_id =?"); + objectArray[arrayPos]=searchParameters.getOfficeId(); + arrayPos = arrayPos + 1; + } + if (searchParameters.isOrderByRequested()) { + sqlBuilder.append(" order by ").append(searchParameters.getOrderBy()); - if (searchParameters.isSortOrderProvided()) { - sqlBuilder.append(' ').append(searchParameters.getSortOrder()); + if (searchParameters.isSortOrderProvided()) { + sqlBuilder.append(' ').append(searchParameters.getSortOrder()); + } } - } - if (searchParameters.isLimited()) { - sqlBuilder.append(" limit ").append(searchParameters.getLimit()); - if (searchParameters.isOffset()) { - sqlBuilder.append(" offset ").append(searchParameters.getOffset()); + if (searchParameters.isLimited()) { + sqlBuilder.append(" limit ").append(searchParameters.getLimit()); + if (searchParameters.isOffset()) { + sqlBuilder.append(" offset ").append(searchParameters.getOffset()); + } } } - final Object[] finalObjectArray = Arrays.copyOf(objectArray, arrayPos); final String sqlCountRows = "SELECT FOUND_ROWS()"; return this.paginationHelper.fetchPage(this.jdbcTemplate, sqlCountRows, sqlBuilder.toString(), finalObjectArray, http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/data/ShareAccountChargeData.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/data/ShareAccountChargeData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/data/ShareAccountChargeData.java index 41eaf74..f1da9f4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/data/ShareAccountChargeData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/data/ShareAccountChargeData.java @@ -65,6 +65,27 @@ public class ShareAccountChargeData { private final Collection chargeOptions; + public ShareAccountChargeData(Long chargeId, BigDecimal amount) { + this.chargeId = chargeId; + this.amount = amount; + this.id = null; + this.accountId = null; + this.name = null; + this.chargeTimeType = null; + this.chargeCalculationType = null; + this.percentage = null; + this.amountPercentageAppliedTo = null; + this.currency = null; + this.amountPaid = null; + this.amountWaived = null; + this.amountWrittenOff = null; + this.amountOutstanding = null; + this.amountOrPercentage = null; + this.isActive = null; + this.chargeOptions = null; + } + + public ShareAccountChargeData(final Long id, final Long chargeId, final Long accountId, final String name, final CurrencyData currency, final BigDecimal amount, final BigDecimal amountPaid, final BigDecimal amountWaived, final BigDecimal amountWrittenOff, final BigDecimal amountOutstanding, final EnumOptionData chargeTimeType, http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/data/ShareAccountData.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/data/ShareAccountData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/data/ShareAccountData.java index d0e1f84..86ca355 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/data/ShareAccountData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/data/ShareAccountData.java @@ -23,6 +23,7 @@ import java.util.Collection; import java.util.Date; import org.apache.fineract.accounting.glaccount.data.GLAccountData; +import org.apache.fineract.infrastructure.bulkimport.constants.TemplatePopulateImportConstants; import org.apache.fineract.infrastructure.core.data.EnumOptionData; import org.apache.fineract.organisation.monetary.data.CurrencyData; import org.apache.fineract.portfolio.accountdetails.data.ShareAccountSummaryData; @@ -31,6 +32,7 @@ import org.apache.fineract.portfolio.charge.data.ChargeData; import org.apache.fineract.portfolio.products.data.ProductData; import org.apache.fineract.portfolio.savings.data.SavingsAccountData; import org.apache.fineract.portfolio.shareproducts.data.ShareProductData; +import org.joda.time.LocalDate; @SuppressWarnings("unused") public class ShareAccountData implements AccountData { @@ -80,6 +82,75 @@ public class ShareAccountData implements AccountData { private Collection charges; private Collection dividends ; + + //import fields + private Integer requestedShares; + private LocalDate submittedDate; + private Integer minimumActivePeriodFrequencyType; + private Integer lockinPeriodFrequency; + private Integer lockinPeriodFrequencyType; + private LocalDate applicationDate; + private String locale; + private transient Integer rowIndex; + private String dateFormat; + + public static ShareAccountData importInstance(Long clientId,Long productId,Integer requestedShares,String externalId, + LocalDate submittedOnDate , Integer minimumActivePeriodDays,Integer minimumActivePeriodFrequencyType, + Integer lockinPeriodFrequency,Integer lockinPeriodFrequencyType,LocalDate applicationDate, + Boolean allowDividendCalculationForInactiveClients, Collection charges, + Long defaultSavingsAccountId,Integer rowIndex,String locale, String dateFormat){ + return new ShareAccountData(clientId,productId,requestedShares,externalId,submittedOnDate,minimumActivePeriodDays, + minimumActivePeriodFrequencyType,lockinPeriodFrequency,lockinPeriodFrequencyType,applicationDate,allowDividendCalculationForInactiveClients,charges, + defaultSavingsAccountId,rowIndex,locale,dateFormat); + } + private ShareAccountData(Long clientId,Long productId,Integer requestedShares,String externalId, + LocalDate submittedDate , Integer minimumActivePeriod,Integer minimumActivePeriodFrequencyType, + Integer lockinPeriodFrequency,Integer lockinPeriodFrequencyType,LocalDate applicationDate, + Boolean allowDividendCalculationForInactiveClients, Collection charges, + Long savingsAccountId,Integer rowIndex,String locale, String dateFormat) { + + this.clientId = clientId; + this.productId = productId; + this.requestedShares=requestedShares; + this.externalId = externalId; + this.submittedDate=submittedDate; + this.minimumActivePeriod = minimumActivePeriod; + this.minimumActivePeriodFrequencyType=minimumActivePeriodFrequencyType; + this.lockinPeriodFrequency=lockinPeriodFrequency; + this.lockinPeriodFrequencyType=lockinPeriodFrequencyType; + this.applicationDate=applicationDate; + this.allowDividendCalculationForInactiveClients = allowDividendCalculationForInactiveClients; + this.dateFormat= dateFormat; + this.locale=locale; + this.charges = charges; + this.savingsAccountId = savingsAccountId; + this.rowIndex=rowIndex; + this.clientName = null; + this.savingsAccountNumber = null; + this.defaultShares = null; + this.id = null; + this.accountNo = null; + this.productName = null; + this.status = null; + this.timeline = null; + this.currency = null; + this.summary = null; + this.purchasedShares = null; + this.currentMarketPrice = null; + this.lockinPeriod = null; + this.lockPeriodTypeEnum = null; + this.minimumActivePeriodTypeEnum = null; + this.dividends = null; + this.productOptions = null; + this.chargeOptions = null; + this.lockinPeriodFrequencyTypeOptions = null; + this.minimumActivePeriodFrequencyTypeOptions = null; + this.clientSavingsAccounts = null; + } + + public Integer getRowIndex() { + return rowIndex; + } // Data for template private Collection productOptions; http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java index 481284a..7103e2d 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/api/UsersApiResource.java @@ -18,26 +18,27 @@ */ package org.apache.fineract.useradministration.api; +import java.io.InputStream; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Set; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; +import com.sun.jersey.core.header.FormDataContentDisposition; +import com.sun.jersey.multipart.FormDataParam; import org.apache.fineract.commands.domain.CommandWrapper; import org.apache.fineract.commands.service.CommandWrapperBuilder; import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService; +import org.apache.fineract.infrastructure.bulkimport.constants.UserConstants; +import org.apache.fineract.infrastructure.bulkimport.data.GlobalEntityType; +import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookPopulatorService; +import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService; import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings; @@ -52,8 +53,6 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; @Path("/users") -@Consumes({ MediaType.APPLICATION_JSON }) -@Produces({ MediaType.APPLICATION_JSON }) @Component @Scope("singleton") public class UsersApiResource { @@ -73,21 +72,29 @@ public class UsersApiResource { private final DefaultToApiJsonSerializer toApiJsonSerializer; private final ApiRequestParameterHelper apiRequestParameterHelper; private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService; + private final BulkImportWorkbookPopulatorService bulkImportWorkbookPopulatorService; + private final BulkImportWorkbookService bulkImportWorkbookService; @Autowired public UsersApiResource(final PlatformSecurityContext context, final AppUserReadPlatformService readPlatformService, final OfficeReadPlatformService officeReadPlatformService, final DefaultToApiJsonSerializer toApiJsonSerializer, final ApiRequestParameterHelper apiRequestParameterHelper, - final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService) { + final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService, + final BulkImportWorkbookPopulatorService bulkImportWorkbookPopulatorService, + final BulkImportWorkbookService bulkImportWorkbookService) { this.context = context; this.readPlatformService = readPlatformService; this.officeReadPlatformService = officeReadPlatformService; this.toApiJsonSerializer = toApiJsonSerializer; this.apiRequestParameterHelper = apiRequestParameterHelper; this.commandsSourceWritePlatformService = commandsSourceWritePlatformService; + this.bulkImportWorkbookPopulatorService=bulkImportWorkbookPopulatorService; + this.bulkImportWorkbookService=bulkImportWorkbookService; } @GET + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) public String retrieveAll(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -100,6 +107,8 @@ public class UsersApiResource { @GET @Path("{userId}") + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) public String retrieveOne(@PathParam("userId") final Long userId, @Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions, userId); @@ -117,6 +126,8 @@ public class UsersApiResource { @GET @Path("template") + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) public String template(@Context final UriInfo uriInfo) { this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions); @@ -128,6 +139,8 @@ public class UsersApiResource { } @POST + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) public String create(final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // @@ -142,6 +155,8 @@ public class UsersApiResource { @PUT @Path("{userId}") + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) public String update(@PathParam("userId") final Long userId, final String apiRequestBodyAsJson) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // @@ -156,6 +171,8 @@ public class UsersApiResource { @DELETE @Path("{userId}") + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) public String delete(@PathParam("userId") final Long userId) { final CommandWrapper commandRequest = new CommandWrapperBuilder() // @@ -166,4 +183,23 @@ public class UsersApiResource { return this.toApiJsonSerializer.serialize(result); } + + @GET + @Path("downloadtemplate") + @Produces("application/vnd.ms-excel") + public Response getUserTemplate(@QueryParam("officeId")final Long officeId,@QueryParam("staffId")final Long staffId, + @QueryParam("dateFormat") final String dateFormat) { + return bulkImportWorkbookPopulatorService.getTemplate(GlobalEntityType.USERS.toString(), officeId, staffId,dateFormat); + } + + @POST + @Path("uploadtemplate") + @Consumes(MediaType.MULTIPART_FORM_DATA) + public String postUsersTemplate(@FormDataParam("file") InputStream uploadedInputStream, + @FormDataParam("file") FormDataContentDisposition fileDetail, + @FormDataParam("locale") final String locale, @FormDataParam("dateFormat") final String dateFormat){ + final Long importDocumentId = this. bulkImportWorkbookService.importWorkbook(GlobalEntityType.USERS.toString(), uploadedInputStream,fileDetail, + locale,dateFormat); + return this.toApiJsonSerializer.serialize(importDocumentId); + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/useradministration/data/AppUserData.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/data/AppUserData.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/data/AppUserData.java index 075f4b0..9254dff 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/data/AppUserData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/data/AppUserData.java @@ -19,6 +19,7 @@ package org.apache.fineract.useradministration.data; import java.util.Collection; +import java.util.List; import java.util.Set; import org.apache.fineract.organisation.office.data.OfficeData; @@ -39,6 +40,12 @@ public class AppUserData { private final String email; private final Boolean passwordNeverExpires; + //import fields + private List roles; + private Boolean sendPasswordToEmail; + private Long staffId; + private transient Integer rowIndex; + @SuppressWarnings("unused") private final Collection allowedOffices; private final Collection availableRoles; @@ -49,6 +56,39 @@ public class AppUserData { @SuppressWarnings("unused") private Set clients; + public static AppUserData importInstance(Long officeId,Long staffId,String userName, String firstName, String lastName, + String email,Boolean sendPasswordToEmail,Boolean passwordNeverExpires, List roleIds, + Integer rowIndex){ + return new AppUserData(officeId,staffId,userName,firstName,lastName,email, + sendPasswordToEmail,passwordNeverExpires,roleIds,rowIndex); + } + private AppUserData(Long officeId,Long staffId,String username, String firstname, String lastname, + String email,Boolean sendPasswordToEmail,Boolean passwordNeverExpires, List roleIds, + Integer rowIndex) { + this.id = null; + this.username = username; + this.officeId = officeId; + this.officeName = null; + this.firstname = firstname; + this.lastname = lastname; + this.email = email; + this.passwordNeverExpires = passwordNeverExpires; + this.roles = roleIds; + this.sendPasswordToEmail = sendPasswordToEmail; + this.staffId = staffId; + this.rowIndex = rowIndex; + this.allowedOffices = null; + this.availableRoles = null; + this.selectedRoles = null; + this.staff = null; + this.isSelfServiceUser = null; + this.clients = null; + } + + public Integer getRowIndex() { + return rowIndex; + } + public static AppUserData template(final AppUserData user, final Collection officesForDropdown) { return new AppUserData(user.id, user.username, user.email, user.officeId, user.officeName, user.firstname, user.lastname, user.availableRoles, user.selectedRoles, officesForDropdown, user.staff, user.passwordNeverExpires, user.isSelfServiceUser); http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/java/org/apache/fineract/useradministration/data/RoleData.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/useradministration/data/RoleData.java b/fineract-provider/src/main/java/org/apache/fineract/useradministration/data/RoleData.java index fc5bebc..7858ab9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/useradministration/data/RoleData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/useradministration/data/RoleData.java @@ -52,4 +52,12 @@ public class RoleData implements Serializable { public int hashCode() { return this.id.hashCode(); } + + public Long getId() { + return id; + } + + public String getName() { + return name; + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/fineract/blob/210647d4/fineract-provider/src/main/resources/sql/migrations/core_db/V336__m_import_document.sql ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V336__m_import_document.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V336__m_import_document.sql new file mode 100644 index 0000000..386016e --- /dev/null +++ b/fineract-provider/src/main/resources/sql/migrations/core_db/V336__m_import_document.sql @@ -0,0 +1,39 @@ +-- +-- 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. +-- + +CREATE TABLE `m_import_document` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `document_id` int(20) NOT NULL, + `import_time` datetime NOT NULL, + `end_time` datetime DEFAULT NULL, + `entity_type` tinyint(3) NOT NULL, + `completed` tinyint(2) DEFAULT 0, + `total_records` bigint(20) DEFAULT 0, + `success_count` bigint(20) DEFAULT 0, + `failure_count` bigint(20) DEFAULT 0, + `createdby_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `import_document_id` (`document_id`), + CONSTRAINT `FK_m_import_m_document` FOREIGN KEY (`document_id`) REFERENCES `m_document` (`id`), + CONSTRAINT `FK_m_import_m_appuser` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`) +); + +INSERT INTO `m_permission` +(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) VALUES +('infrastructure','READ_IMPORT','IMPORT','READ', 0); \ No newline at end of file