forked from apache/fineract
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FINERACT-669 client transfer details
- Loading branch information
1 parent
ed5c696
commit 85fae55
Showing
9 changed files
with
236 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
...ider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientTransferDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/** | ||
* 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.client.domain; | ||
|
||
import java.util.Date; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.Table; | ||
import javax.persistence.Temporal; | ||
import javax.persistence.TemporalType; | ||
|
||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom; | ||
|
||
@SuppressWarnings("serial") | ||
@Entity | ||
@Table(name = "m_client_transfer_details") | ||
public class ClientTransferDetails extends AbstractPersistableCustom<Long> { | ||
|
||
@Column(name = "client_id", length = 20, unique = true, nullable = false) | ||
private Long clientId; | ||
|
||
@Column(name = "from_office_id", nullable = false) | ||
private Long fromOfficeId; | ||
|
||
@Column(name = "to_office_id", nullable = false) | ||
private Long toOfficeId; | ||
|
||
@Column(name = "proposed_transfer_date", nullable = true) | ||
@Temporal(TemporalType.DATE) | ||
private Date proposedTransferDate; | ||
|
||
@Column(name = "transfer_type", nullable = false) | ||
private Integer transferEventType; | ||
|
||
@Column(name = "submitted_on", nullable = false) | ||
@Temporal(TemporalType.DATE) | ||
private Date submittedOn; | ||
|
||
@Column(name = "submitted_by", nullable = false) | ||
private Long submittedBy; | ||
|
||
protected ClientTransferDetails() { | ||
} | ||
|
||
private ClientTransferDetails(final Long clientId, final Long fromOfficeId, final Long toOfficeId, | ||
final Date proposedTransferDate, final Integer transferEventType, final Date submittedOn, | ||
final Long submittedBy) { | ||
this.clientId = clientId; | ||
this.fromOfficeId = fromOfficeId; | ||
this.toOfficeId = toOfficeId; | ||
this.proposedTransferDate = proposedTransferDate; | ||
this.transferEventType = transferEventType; | ||
this.submittedOn = submittedOn; | ||
this.submittedBy = submittedBy; | ||
} | ||
|
||
public static ClientTransferDetails instance(final Long clientId, final Long fromOfficeId, final Long toOfficeId, | ||
final Date proposedTransferDate, final Integer transferEventType, final Date submittedOn, | ||
final Long submittedBy) { | ||
return new ClientTransferDetails(clientId, fromOfficeId, toOfficeId, proposedTransferDate, transferEventType, | ||
submittedOn, submittedBy); | ||
|
||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...ain/java/org/apache/fineract/portfolio/client/domain/ClientTransferDetailsRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* 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.client.domain; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||
|
||
public interface ClientTransferDetailsRepository | ||
extends JpaRepository<ClientTransferDetails, Long>, JpaSpecificationExecutor<ClientTransferDetails> { | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...a/org/apache/fineract/portfolio/client/domain/ClientTransferDetailsRepositoryWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
*/ | ||
|
||
package org.apache.fineract.portfolio.client.domain; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class ClientTransferDetailsRepositoryWrapper { | ||
|
||
private final ClientTransferDetailsRepository repository; | ||
|
||
@Autowired | ||
public ClientTransferDetailsRepositoryWrapper(final ClientTransferDetailsRepository repository) { | ||
this.repository = repository; | ||
} | ||
|
||
public void save(final ClientTransferDetails clientTransferDetails) { | ||
this.repository.save(clientTransferDetails); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ract-provider/src/main/resources/sql/migrations/core_db/V349__client_transfer_details.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
-- | ||
-- 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. | ||
-- | ||
|
||
ALTER TABLE `m_client` | ||
ADD COLUMN `proposed_transfer_date` DATE NULL DEFAULT NULL AFTER `email_address`; | ||
|
||
CREATE TABLE `m_client_transfer_details` ( | ||
`id` BIGINT(20) NOT NULL AUTO_INCREMENT, | ||
`client_id` BIGINT(20) NOT NULL, | ||
`from_office_id` BIGINT(20) NOT NULL, | ||
`to_office_id` BIGINT(20) NOT NULL, | ||
`proposed_transfer_date` DATE NULL DEFAULT NULL, | ||
`transfer_type` TINYINT(2) NOT NULL, | ||
`submitted_on` DATE NOT NULL, | ||
`submitted_by` BIGINT(20) NOT NULL, | ||
PRIMARY KEY (`id`), | ||
INDEX `FK_m_client_transfer_details_m_client` (`client_id`), | ||
INDEX `FK_m_client_transfer_details_m_office` (`from_office_id`), | ||
INDEX `FK_m_client_transfer_details_m_office_2` (`to_office_id`), | ||
INDEX `FK_m_client_transfer_details_m_appuser` (`submitted_by`), | ||
CONSTRAINT `FK_m_client_transfer_details_m_appuser` FOREIGN KEY (`submitted_by`) REFERENCES `m_appuser` (`id`), | ||
CONSTRAINT `FK_m_client_transfer_details_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), | ||
CONSTRAINT `FK_m_client_transfer_details_m_office` FOREIGN KEY (`from_office_id`) REFERENCES `m_office` (`id`), | ||
CONSTRAINT `FK_m_client_transfer_details_m_office_2` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`) | ||
); |