Fineract Asset Externalization models
- [x] Liquibase database model - [x] JPA model - [x] API endpoint without implementation - [x] API endpoint requirements - [x] Json Serialization and Deserialization and dependencies - [x] New Authentication check interface to the core level - [x] CommandWrapperBuilder and dependencies
This commit is contained in:
committed by
Arnold Gálovics
parent
6e69e66b86
commit
da1aa9e5a8
+79
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* 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.api;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.NotImplementedException;
|
||||
import org.apache.fineract.infrastructure.security.service.PlatformUserRightsContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Path("/external-asset-owners")
|
||||
@Component
|
||||
@Tag(name = "External Asset Owners", description = "External Asset Owners")
|
||||
@RequiredArgsConstructor
|
||||
public class ExternalAssetOwnersApiResource {
|
||||
|
||||
private final PlatformUserRightsContext platformUserRightsContext;
|
||||
|
||||
@POST
|
||||
@Path("/transfers/loans/{loanId}")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
public String transferRequestWithLoanId(@PathParam("loanId") final Long loanId,
|
||||
@QueryParam("command") @Parameter(description = "command") final String commandParam,
|
||||
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||
platformUserRightsContext.isAuthenticated();
|
||||
|
||||
throw new NotImplementedException("Not implemented yet");
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/transfers/loans//external-id/{loanExternalId}")
|
||||
@Consumes({ MediaType.APPLICATION_JSON })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
public String transferRequestWithLoanExternalId(@PathParam("loanExternalId") final Long loanId,
|
||||
@QueryParam("command") @Parameter(description = "command") final String commandParam,
|
||||
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||
platformUserRightsContext.isAuthenticated();
|
||||
|
||||
throw new NotImplementedException("Not implemented yet");
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/transfers")
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
public String getTransfer(
|
||||
@QueryParam("transferExternalId") @Parameter(description = "transferExternalId") final String transferExternalId,
|
||||
@QueryParam("loanId") @Parameter(description = "loanId") final String loanId,
|
||||
@QueryParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId) {
|
||||
platformUserRightsContext.isAuthenticated();
|
||||
|
||||
throw new NotImplementedException("Not implemented yet");
|
||||
}
|
||||
}
|
||||
+39
@@ -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.investor.data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ExternalTransferData {
|
||||
|
||||
private final Long transferId;
|
||||
private final ExternalTransferOwnerData owner;
|
||||
private final ExternalTransferLoanMappingData loan;
|
||||
private final String transferExternalId;
|
||||
private final BigDecimal purchasePriceRatio;
|
||||
private final LocalDate settlementDate;
|
||||
private final ExternalTransferStatus status;
|
||||
private final LocalDate effectiveFrom;
|
||||
private final LocalDate effectiveTo;
|
||||
private final String dateFormat;
|
||||
private final String locale;
|
||||
}
|
||||
+28
@@ -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.investor.data;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ExternalTransferLoanMappingData {
|
||||
|
||||
private final Long loanId;
|
||||
private final String externalId;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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.data;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ExternalTransferOwnerData {
|
||||
|
||||
private final String externalId;
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* 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.data;
|
||||
|
||||
public enum ExternalTransferStatus {
|
||||
ACTIVE, DECLINED, PENDING, BUYBACK, CANCELLED
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* 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.domain;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@Table(name = "m_external_asset_owner")
|
||||
public class ExternalAssetOwner extends AbstractAuditableCustom {
|
||||
|
||||
@Column(name = "external_id", nullable = false, length = 100, unique = true)
|
||||
private String externalId;
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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.domain;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
public interface ExternalAssetOwnerRepository
|
||||
extends JpaRepository<ExternalAssetOwner, Long>, JpaSpecificationExecutor<ExternalAssetOwner> {
|
||||
|
||||
}
|
||||
+60
@@ -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.investor.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Table(name = "m_external_asset_owner_transfer")
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@Entity
|
||||
public class ExternalAssetOwnerTransfer extends AbstractAuditableCustom {
|
||||
|
||||
@Column(name = "owner_id")
|
||||
private Long ownerId;
|
||||
|
||||
@Column(name = "external_id", length = 100)
|
||||
private String externalId;
|
||||
|
||||
@Column(name = "status", length = 50)
|
||||
private String status;
|
||||
|
||||
@Column(name = "purchase_price_ratio", precision = 19, scale = 6)
|
||||
private BigDecimal purchasePriceRatio;
|
||||
|
||||
@Column(name = "settlement_date")
|
||||
private LocalDate settlementDate;
|
||||
|
||||
@Column(name = "effective_date_from")
|
||||
private LocalDate effectiveDateFrom;
|
||||
|
||||
@Column(name = "effective_date_to")
|
||||
private LocalDate effectiveDateTo;
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* 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.domain;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Table(name = "m_external_asset_owner_transfer_loan_mapping")
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@Entity
|
||||
public class ExternalAssetOwnerTransferLoanMapping extends AbstractAuditableCustom {
|
||||
|
||||
@Column(name = "loan_id", nullable = false)
|
||||
private Long loanId;
|
||||
|
||||
@Column(name = "owner_transfer_id")
|
||||
private Long ownerTransferId;
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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.domain;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
public interface ExternalAssetOwnerTransferRepository
|
||||
extends JpaRepository<ExternalAssetOwnerTransfer, Long>, JpaSpecificationExecutor<ExternalAssetOwnerTransfer> {
|
||||
|
||||
}
|
||||
+2
-1
@@ -22,5 +22,6 @@
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
|
||||
<include relativeToChangelogFile="true" file="parts/0001_initial_schema.xml" />
|
||||
<include relativeToChangelogFile="true" file="parts/0001_initial_schema.xml"/>
|
||||
<include relativeToChangelogFile="true" file="parts/0002_asset_schemas.xml"/>
|
||||
</databaseChangeLog>
|
||||
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
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.
|
||||
|
||||
-->
|
||||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
|
||||
|
||||
<!-- Create the m_external_asset_owner table -->
|
||||
<changeSet author="fineract" id="1" context="postgresql">
|
||||
<createTable tableName="m_external_asset_owner">
|
||||
<column autoIncrement="true" name="id" type="BIGINT" remarks="Internal ID">
|
||||
<constraints nullable="false" primaryKey="true"/>
|
||||
</column>
|
||||
<column name="external_id" type="varchar(100)" remarks="External id of asset owner">
|
||||
<constraints nullable="false" unique="true"
|
||||
uniqueConstraintName="UQ_external_asset_owner_external_id"/>
|
||||
</column>
|
||||
<column name="created_by" type="bigint" remarks=""/>
|
||||
<column name="created_on_utc" type="TIMESTAMP WITH TIME ZONE" remarks=""/>
|
||||
<column name="last_modified_by" type="bigint" remarks=""/>
|
||||
<column name="last_modified_on_utc" type="TIMESTAMP WITH TIME ZONE" remarks=""/>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="fineract" id="1" context="mysql">
|
||||
<createTable tableName="m_external_asset_owner">
|
||||
<column autoIncrement="true" name="id" type="BIGINT" remarks="Internal ID">
|
||||
<constraints nullable="false" primaryKey="true"/>
|
||||
</column>
|
||||
<column name="external_id" type="varchar(100)" remarks="External id of asset owner">
|
||||
<constraints nullable="false" unique="true"
|
||||
uniqueConstraintName="UQ_external_asset_owner_external_id"/>
|
||||
</column>
|
||||
<column name="created_by" type="bigint" remarks=""/>
|
||||
<column name="created_on_utc" type="DATETIME" remarks=""/>
|
||||
<column name="last_modified_by" type="bigint" remarks=""/>
|
||||
<column name="last_modified_on_utc" type="DATETIME" remarks=""/>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="fineract" id="2">
|
||||
<addForeignKeyConstraint baseColumnNames="created_by" baseTableName="m_external_asset_owner"
|
||||
constraintName="FK_external_asset_owner_created_by" deferrable="false"
|
||||
initiallyDeferred="false"
|
||||
onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
|
||||
referencedTableName="m_appuser" validate="true"/>
|
||||
<addForeignKeyConstraint baseColumnNames="last_modified_by"
|
||||
baseTableName="m_external_asset_owner"
|
||||
constraintName="FK_external_asset_owner_modified_by" deferrable="false"
|
||||
initiallyDeferred="false"
|
||||
onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
|
||||
referencedTableName="m_appuser" validate="true"/>
|
||||
</changeSet>
|
||||
|
||||
<!-- Create m_external_asset_owner_transfer table -->
|
||||
<changeSet author="fineract" id="3" context="mysql">
|
||||
<createTable tableName="m_external_asset_owner_transfer">
|
||||
<column autoIncrement="true" name="id" type="BIGINT" remarks="Internal ID">
|
||||
<constraints nullable="false" primaryKey="true"/>
|
||||
</column>
|
||||
<column name="owner_id" type="BIGINT"/>
|
||||
<column name="external_id" type="VARCHAR(100)"/>
|
||||
<column name="status" type="VARCHAR(50)"/>
|
||||
<column name="purchase_price_ratio" type="NUMERIC(19,6)"/>
|
||||
<column name="settlement_date" type="DATE"/>
|
||||
<column name="effective_date_from" type="DATE"/>
|
||||
<column name="effective_date_to" type="DATe"/>
|
||||
<column name="created_by" type="bigint" remarks=""/>
|
||||
<column name="created_on_utc" type="DATETIME" remarks=""/>
|
||||
<column name="last_modified_by" type="bigint" remarks=""/>
|
||||
<column name="last_modified_on_utc" type="DATETIME" remarks=""/>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="fineract" id="3" context="postgresql">
|
||||
<createTable tableName="m_external_asset_owner_transfer">
|
||||
<column autoIncrement="true" name="id" type="BIGINT" remarks="Internal ID">
|
||||
<constraints nullable="false" primaryKey="true"/>
|
||||
</column>
|
||||
<column name="owner_id" type="BIGINT"/>
|
||||
<column name="external_id" type="VARCHAR(100)"/>
|
||||
<column name="status" type="VARCHAR(50)"/>
|
||||
<column name="purchase_price_ratio" type="NUMERIC(19,6)"/>
|
||||
<column name="settlement_date" type="DATE"/>
|
||||
<column name="effective_date_from" type="DATE"/>
|
||||
<column name="effective_date_to" type="DATe"/>
|
||||
<column name="created_by" type="bigint" remarks=""/>
|
||||
<column name="created_on_utc" type="TIMESTAMP WITH TIME ZONE" remarks=""/>
|
||||
<column name="last_modified_by" type="bigint" remarks=""/>
|
||||
<column name="last_modified_on_utc" type="TIMESTAMP WITH TIME ZONE" remarks=""/>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="fineract" id="4">
|
||||
<createIndex tableName="m_external_asset_owner_transfer"
|
||||
indexName="external_asset_owner_transfer_external_id">
|
||||
<column name="external_id"/>
|
||||
</createIndex>
|
||||
<createIndex tableName="m_external_asset_owner_transfer"
|
||||
indexName="external_asset_owner_transfer_status">
|
||||
<column name="status"/>
|
||||
</createIndex>
|
||||
<createIndex tableName="m_external_asset_owner_transfer"
|
||||
indexName="external_asset_owner_transfer_settlement_date">
|
||||
<column name="settlement_date"/>
|
||||
</createIndex>
|
||||
<createIndex tableName="m_external_asset_owner_transfer"
|
||||
indexName="external_asset_owner_transfer_effective_date_from">
|
||||
<column name="effective_date_from"/>
|
||||
</createIndex>
|
||||
<createIndex tableName="m_external_asset_owner_transfer"
|
||||
indexName="external_asset_owner_transfer_effective_date_to">
|
||||
<column name="effective_date_to"/>
|
||||
</createIndex>
|
||||
|
||||
<addForeignKeyConstraint baseColumnNames="created_by"
|
||||
baseTableName="m_external_asset_owner_transfer"
|
||||
constraintName="FK_external_asset_owner_transfer_created_by" deferrable="false"
|
||||
initiallyDeferred="false"
|
||||
onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
|
||||
referencedTableName="m_appuser" validate="true"/>
|
||||
<addForeignKeyConstraint baseColumnNames="last_modified_by"
|
||||
baseTableName="m_external_asset_owner_transfer"
|
||||
constraintName="FK_external_asset_owner_transfer_modified_by" deferrable="false"
|
||||
initiallyDeferred="false"
|
||||
onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
|
||||
referencedTableName="m_appuser" validate="true"/>
|
||||
|
||||
<addForeignKeyConstraint baseColumnNames="owner_id"
|
||||
baseTableName="m_external_asset_owner_transfer"
|
||||
constraintName="FK_external_asset_owner_transfer_owner_id" deferrable="false"
|
||||
initiallyDeferred="false"
|
||||
onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
|
||||
referencedTableName="m_external_asset_owner" validate="true"/>
|
||||
</changeSet>
|
||||
|
||||
<!-- Create table m_external_asset_owner_transfer_loan_mapping -->
|
||||
|
||||
<changeSet author="fineract" id="5" context="mysql">
|
||||
<createTable tableName="m_external_asset_owner_transfer_loan_mapping">
|
||||
<column autoIncrement="true" name="id" type="BIGINT" remarks="Internal ID">
|
||||
<constraints nullable="false" primaryKey="true"/>
|
||||
</column>
|
||||
<column name="loan_id" type="bigint" remarks="Loan ID">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="owner_transfer_id" type="bigint" remarks="Owner">
|
||||
</column>
|
||||
<column name="created_by" type="bigint" remarks=""/>
|
||||
<column name="created_on_utc" type="DATETIME" remarks=""/>
|
||||
<column name="last_modified_by" type="bigint" remarks=""/>
|
||||
<column name="last_modified_on_utc" type="DATETIME" remarks=""/>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="fineract" id="5" context="postgresql">
|
||||
<createTable tableName="m_external_asset_owner_transfer_loan_mapping">
|
||||
<column autoIncrement="true" name="id" type="BIGINT" remarks="Internal ID">
|
||||
<constraints nullable="false" primaryKey="true"/>
|
||||
</column>
|
||||
<column name="loan_id" type="bigint" remarks="Loan ID">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="owner_transfer_id" type="bigint" remarks="Owner">
|
||||
</column>
|
||||
<column name="created_by" type="bigint" remarks=""/>
|
||||
<column name="created_on_utc" type="TIMESTAMP WITH TIME ZONE" remarks=""/>
|
||||
<column name="last_modified_by" type="bigint" remarks=""/>
|
||||
<column name="last_modified_on_utc" type="TIMESTAMP WITH TIME ZONE" remarks=""/>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="fineract" id="6">
|
||||
<addForeignKeyConstraint baseColumnNames="created_by"
|
||||
baseTableName="m_external_asset_owner_transfer_loan_mapping"
|
||||
constraintName="FK_external_asset_owner_transfer_loan_mapping_created_by" deferrable="false"
|
||||
initiallyDeferred="false"
|
||||
onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
|
||||
referencedTableName="m_appuser" validate="true"/>
|
||||
<addForeignKeyConstraint baseColumnNames="last_modified_by"
|
||||
baseTableName="m_external_asset_owner_transfer_loan_mapping"
|
||||
constraintName="FK_external_asset_owner_transfer_loan_mapping_modified_by" deferrable="false"
|
||||
initiallyDeferred="false"
|
||||
onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
|
||||
referencedTableName="m_appuser" validate="true"/>
|
||||
|
||||
<addForeignKeyConstraint baseColumnNames="loan_id"
|
||||
baseTableName="m_external_asset_owner_transfer_loan_mapping"
|
||||
constraintName="FK_external_asset_owner_transfer_loan_mapping_loan_id" deferrable="false"
|
||||
initiallyDeferred="false"
|
||||
onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
|
||||
referencedTableName="m_loan" validate="true"/>
|
||||
<addForeignKeyConstraint baseColumnNames="owner_transfer_id"
|
||||
baseTableName="m_external_asset_owner_transfer_loan_mapping"
|
||||
constraintName="FK_external_asset_owner_transfer_loan_mapping_owner_transfer_id"
|
||||
deferrable="false" initiallyDeferred="false"
|
||||
onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
|
||||
referencedTableName="m_external_asset_owner_transfer" validate="true"/>
|
||||
</changeSet>
|
||||
|
||||
|
||||
</databaseChangeLog>
|
||||
Reference in New Issue
Block a user