Search in sources :

Example 1 with Lease

use of org.estatio.dom.lease.Lease in project estatio by estatio.

the class ApiIntegrationTest method t04_putLeaseWorks.

@Test
public void t04_putLeaseWorks() throws Exception {
    api.putLease("APILEASE", "Lease", "APITENANT", "APILANDLORD", "APILEASETYPE", START_DATE, dt(2021, 12, 31), null, null, "APIP");
    Lease lease = leases.findLeaseByReference("APILEASE");
    Assert.assertNotNull(lease);
    Assert.assertThat(lease.getRoles().size(), Is.is(2));
}
Also used : Lease(org.estatio.dom.lease.Lease) Test(org.junit.Test)

Example 2 with Lease

use of org.estatio.dom.lease.Lease in project estatio by estatio.

the class ApiIntegrationTest method t05_putLeaseUnitWorks.

@Test
public void t05_putLeaseUnitWorks() throws Exception {
    api.putOccupancy("APILEASE", "APIUNIT", START_DATE, null, null, null, "APISIZE", "ABIBRAND", "APISECTOR", "APIACTIVITY", "YES", "YES", "YES");
    Lease l = leases.findLeaseByReference("APILEASE");
    Unit u = units.findUnitByReference("APIUNIT");
    Assert.assertNotNull(leaseUnits.findByLeaseAndUnitAndStartDate(l, u, START_DATE));
    Assert.assertNotNull(leaseUnits.findByLeaseAndUnitAndStartDate(l, u, START_DATE));
}
Also used : Lease(org.estatio.dom.lease.Lease) Unit(org.estatio.dom.asset.Unit) Test(org.junit.Test)

Example 3 with Lease

use of org.estatio.dom.lease.Lease in project estatio by estatio.

the class ApiIntegrationTest method t07_putLeaseTermWorks.

@Test
public void t07_putLeaseTermWorks() throws Exception {
    api.putLeaseTermForIndexableRent("APILEASE", "APITENANT", "APIUNIT", BigInteger.valueOf(1), LeaseItemType.RENT.name(), START_DATE, BigInteger.valueOf(1), START_DATE, dt(2012, 12, 31), LeaseTermStatus.NEW.name(), null, null, BigDecimal.valueOf(12345), BigDecimal.valueOf(12345), null, null, null, "APIINDEX", LeaseTermFrequency.YEARLY.name(), null, null, null, null, null, null, null, null, null);
    api.putLeaseTermForIndexableRent("APILEASE", "APITENANT", "APIUNIT", BigInteger.valueOf(1), LeaseItemType.RENT.name(), START_DATE, BigInteger.valueOf(2), dt(2013, 1, 1), dt(2013, 12, 31), LeaseTermStatus.NEW.name(), null, null, BigDecimal.valueOf(12345), BigDecimal.valueOf(12345), null, null, null, "APIINDEX", LeaseTermFrequency.YEARLY.name(), null, null, null, null, null, null, null, null, null);
    Lease lease = leases.findLeaseByReference("APILEASE");
    Assert.assertThat(lease.getItems().first().getTerms().size(), Is.is(2));
}
Also used : Lease(org.estatio.dom.lease.Lease) Test(org.junit.Test)

Example 4 with Lease

use of org.estatio.dom.lease.Lease in project estatio by estatio.

the class ApiIntegrationTest method t05b_putLeasePostalAddress.

@Test
public void t05b_putLeasePostalAddress() throws Exception {
    api.putLeasePostalAddress("APITENANT", LeaseConstants.AgreementRoleType.TENANT.getTitle(), "APILEASE", "Address1", "Address2", null, "PostalCode", "City", "NH", "NLD", BigInteger.valueOf(1));
    final Lease l = leases.findLeaseByReference("APILEASE");
    final AgreementRoleType artTenant = agreementRoleTypes.findByTitle(LeaseConstants.AgreementRoleType.TENANT.getTitle());
    final AgreementRole ar = l.findRoleWithType(artTenant, clockService.now());
    Assert.assertThat(ar.getCommunicationChannels().size(), Is.is(1));
}
Also used : AgreementRole(org.estatio.dom.agreement.AgreementRole) Lease(org.estatio.dom.lease.Lease) AgreementRoleType(org.estatio.dom.agreement.AgreementRoleType) Test(org.junit.Test)

Example 5 with Lease

use of org.estatio.dom.lease.Lease in project estatio by estatio.

the class ApiIntegrationTest method t05b_putLeasePostalAddress_idempotent.

@Test
public void t05b_putLeasePostalAddress_idempotent() throws Exception {
    api.putLeasePostalAddress("APITENANT", LeaseConstants.AgreementRoleType.TENANT.getTitle(), "APILEASE", "Address1", "Address2", null, "PostalCode", "City", "NH", "NLD", BigInteger.valueOf(1));
    final Lease l = leases.findLeaseByReference("APILEASE");
    final AgreementRoleType artTenant = agreementRoleTypes.findByTitle(LeaseConstants.AgreementRoleType.TENANT.getTitle());
    final AgreementRole ar = l.findRoleWithType(artTenant, clockService.now());
    Assert.assertThat(ar.getCommunicationChannels().size(), Is.is(1));
}
Also used : AgreementRole(org.estatio.dom.agreement.AgreementRole) Lease(org.estatio.dom.lease.Lease) AgreementRoleType(org.estatio.dom.agreement.AgreementRoleType) Test(org.junit.Test)

Aggregations

Lease (org.estatio.dom.lease.Lease)5 Test (org.junit.Test)5 AgreementRole (org.estatio.dom.agreement.AgreementRole)2 AgreementRoleType (org.estatio.dom.agreement.AgreementRoleType)2 Unit (org.estatio.dom.asset.Unit)1