diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/data/TellerData.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/data/TellerData.java index 5b9bbc71a9c..33dc0ccfa26 100644 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/data/TellerData.java +++ b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/data/TellerData.java @@ -94,8 +94,4 @@ public static TellerData instance(final Long id, final Long officeId, final Long .setName(name).setDescription(description).setStartDate(startDate).setEndDate(endDate).setStatus(status) .setOfficeName(officeName).setHasTransactions(hasTransactions).setHasMappedCashiers(hasMappedCashiers); } - - public static TellerData lookup(final Long id, final String name) { - return new TellerData().setId(id).setName(name); - } } diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/data/TellerJournalData.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/data/TellerJournalData.java deleted file mode 100644 index 1bd2bd2c0fa..00000000000 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/data/TellerJournalData.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * 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.organisation.teller.data; - -import java.io.Serializable; -import java.time.LocalDate; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; - -/** - * {@code TellerJournalData} represents an immutable journal data object. - * - * @version 1.0.0 - * - * @since 2.0.0 - * @see java.io.Serializable - * @since 2.0.0 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -public final class TellerJournalData implements Serializable { - - private Long officeId; - private Long tellerId; - private LocalDate day; - private Double openingBalance; - private Double settledBalance; - private Double closingBalance; - private Double sumReceipts; - private Double sumPayments; - - /** - * Create a new teller journal data object. - * - * @param officeId - * - id of related office - * @param tellerId - * - id of related teller - * @param day - * - day of this journals data - * @param openingBalance - * - balance at the time of opening the teller - * @param settledBalance - * - balance at the time od settling the teller - * @param closingBalance - * - balance at the time of closing the teller - * @param sumReceipts - * - sum of all posted receipts - * @param sumPayments - * - sum of all posted payments - * @return the new created {@code TellerJournalData} - */ - public static TellerJournalData instance(final Long officeId, final Long tellerId, final LocalDate day, final Double openingBalance, - final Double settledBalance, final Double closingBalance, final Double sumReceipts, final Double sumPayments) { - return new TellerJournalData().setOfficeId(officeId).setTellerId(tellerId).setDay(day).setOpeningBalance(openingBalance) - .setSettledBalance(settledBalance).setClosingBalance(closingBalance).setSumReceipts(sumReceipts) - .setSumPayments(sumPayments); - } -} diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/data/TellerTransactionData.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/data/TellerTransactionData.java deleted file mode 100644 index bf3514029c4..00000000000 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/data/TellerTransactionData.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * 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.organisation.teller.data; - -import java.io.Serializable; -import java.time.LocalDate; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; -import org.apache.fineract.infrastructure.core.data.EnumOptionData; - -/** - * {@code TellerTransactionData} represents an immutable data object for a transction. - * - * @version 1.0.0 - * - * @since 2.0.0 - * @see java.io.Serializable - * @since 2.0.0 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@Accessors(chain = true) -public final class TellerTransactionData implements Serializable { - - private Long id; - private Long officeId; - private Long tellerId; - private Long cashierId; - private Long clientId; - private EnumOptionData type; - private Double amount; - private LocalDate postingDate; - - /** - * Creates a new teller transaction data object. - * - * @param id - * - id of the transaction - * @param officeId - * - id of the related office - * @param tellerId - * - id of the related teller - * @param cashierId - * - id of the cashier - * @param clientId - * - id of the client - * @param type - * - type of transaction (eg receipt, payment, open, close, settle) - * @param amount - * - amount of the transaction - * @param postingDate - * - posting date of the transaction - * @return the new created {@code TellerTransactionData} - */ - public static TellerTransactionData instance(final Long id, final Long officeId, final Long tellerId, final Long cashierId, - final Long clientId, final EnumOptionData type, final Double amount, final LocalDate postingDate) { - return new TellerTransactionData().setId(id).setOfficeId(officeId).setTellerId(tellerId).setCashierId(cashierId) - .setClientId(clientId).setType(type).setAmount(amount).setPostingDate(postingDate); - } -} diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerJournal.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerJournal.java deleted file mode 100644 index 67697438e54..00000000000 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerJournal.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * 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.organisation.teller.domain; - -public class TellerJournal {} diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepository.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepository.java index 2fdea2a6885..5ebef99789f 100644 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepository.java +++ b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepository.java @@ -18,7 +18,6 @@ */ package org.apache.fineract.organisation.teller.domain; -import java.util.Collection; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; @@ -28,7 +27,4 @@ * @see org.apache.fineract.organisation.teller.domain.Teller * @since 2.0.0 */ -public interface TellerRepository extends JpaRepository, JpaSpecificationExecutor { - - Collection findTellerByOfficeId(Long officeId); -} +public interface TellerRepository extends JpaRepository, JpaSpecificationExecutor {} diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepositoryWrapper.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepositoryWrapper.java index f0b335d1e41..9a69672d258 100644 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepositoryWrapper.java +++ b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerRepositoryWrapper.java @@ -40,10 +40,6 @@ public Teller findOneWithNotFoundDetection(final Long id) { return teller; } - public Teller save(final Teller teller) { - return this.repository.save(teller); - } - public Teller saveAndFlush(final Teller teller) { return this.repository.saveAndFlush(teller); } diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerStatus.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerStatus.java index aebe5033806..498c40aecd3 100644 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerStatus.java +++ b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/domain/TellerStatus.java @@ -57,24 +57,4 @@ public static TellerStatus fromInt(final Integer statusValue) { return status; } - public boolean hasStateOf(final TellerStatus state) { - return this.value.equals(state.getValue()); - } - - public boolean isPending() { - return this.value.equals(TellerStatus.PENDING.getValue()); - } - - public boolean isActive() { - return this.value.equals(TellerStatus.ACTIVE.getValue()); - } - - public boolean isClosed() { - return this.value.equals(TellerStatus.CLOSED.getValue()); - } - - public boolean isInactive() { - return this.value.equals(TellerStatus.INACTIVE.getValue()); - } - } diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/exception/TellerNotFoundException.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/exception/TellerNotFoundException.java index 677ec723e12..231c4018b28 100644 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/exception/TellerNotFoundException.java +++ b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/exception/TellerNotFoundException.java @@ -19,7 +19,6 @@ package org.apache.fineract.organisation.teller.exception; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; -import org.springframework.dao.EmptyResultDataAccessException; /** * Indicates that a teller could not be found. @@ -41,8 +40,4 @@ public class TellerNotFoundException extends AbstractPlatformResourceNotFoundExc public TellerNotFoundException(Long tellerId) { super(ERROR_MESSAGE_CODE, DEFAULT_ERROR_MESSAGE, tellerId); } - - public TellerNotFoundException(Long id, EmptyResultDataAccessException e) { - super("error.msg.teller.id.invalid", "Teller with identifier " + id + " does not exist", id, e); - } } diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/handler/CreateTellerTransactionCommandHandler.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/handler/CreateTellerTransactionCommandHandler.java deleted file mode 100644 index 5a30ba09e01..00000000000 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/handler/CreateTellerTransactionCommandHandler.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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.organisation.teller.handler; - -import lombok.RequiredArgsConstructor; -import org.apache.fineract.commands.handler.NewCommandSourceHandler; -import org.apache.fineract.infrastructure.core.api.JsonCommand; -import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; -import org.apache.fineract.organisation.teller.service.TellerTransactionWritePlatformService; - -@RequiredArgsConstructor -public class CreateTellerTransactionCommandHandler implements NewCommandSourceHandler { - - private final TellerTransactionWritePlatformService writePlatformService; - - @Override - public CommandProcessingResult processCommand(final JsonCommand command) { - return this.writePlatformService.createTellerTransaction(command); - } -} diff --git a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/service/TellerTransactionWritePlatformService.java b/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/service/TellerTransactionWritePlatformService.java deleted file mode 100644 index 13a6e58e677..00000000000 --- a/fineract-branch/src/main/java/org/apache/fineract/organisation/teller/service/TellerTransactionWritePlatformService.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.organisation.teller.service; - -import org.apache.fineract.infrastructure.core.api.JsonCommand; -import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; - -/** - * Provides the local service for adding teller transactions. - * - * @see org.apache.fineract.organisation.teller.domain.TellerTransactionRepository - * @since 2.0.0 - */ -public interface TellerTransactionWritePlatformService { - - /** - * Stores teller transactions into the data base. - * - * @param command - * the command containing the teller transaction details - * @return the result i - */ - CommandProcessingResult createTellerTransaction(JsonCommand command); -}