use of org.estatio.module.party.dom.Party in project estatio by estatio.
the class Invoice_DocumentManagement_IntegTest method findInvoice.
Invoice findInvoice(final InvoiceStatus invoiceStatus) {
// clears out queryResultsCache
transactionService.nextTransaction();
final Party seller = InvoiceForLease_enum.OxfPoison003Gb.getSeller_d().findUsing(serviceRegistry);
final Party buyer = InvoiceForLease_enum.OxfPoison003Gb.getBuyer_d().findUsing(serviceRegistry);
final Lease lease = InvoiceForLease_enum.OxfPoison003Gb.getLease_d().findUsing(serviceRegistry);
final LocalDate invoiceStartDate = InvoiceForLease_enum.OxfPoison003Gb.getLease_d().getStartDate().plusYears(1);
List<InvoiceForLease> matchingInvoices = findMatchingInvoices(seller, buyer, lease, invoiceStartDate, invoiceStatus);
assertThat(matchingInvoices.size()).isLessThanOrEqualTo(1);
return matchingInvoices.isEmpty() ? null : matchingInvoices.get(0);
}
use of org.estatio.module.party.dom.Party in project estatio by estatio.
the class Lease method newMandate.
// //////////////////////////////////////
public Lease newMandate(final BankAccount bankAccount, @Parameter(regexPattern = org.incode.module.base.dom.types.ReferenceType.Meta.REGEX, regexPatternReplacement = org.incode.module.base.dom.types.ReferenceType.Meta.REGEX_DESCRIPTION) final String reference, final LocalDate startDate, @Parameter(optionality = Optionality.OPTIONAL) final LocalDate endDate, final SequenceType sequenceType, final Scheme scheme, final LocalDate signatureDate) {
final Party creditor = getPrimaryParty();
final Party debtor = getSecondaryParty();
final BankMandate bankMandate = bankMandateRepository.newBankMandate(reference, reference, startDate, endDate, debtor, creditor, bankAccount, sequenceType, scheme, signatureDate);
paidBy(bankMandate);
return this;
}
use of org.estatio.module.party.dom.Party in project estatio by estatio.
the class PartyRole method remove.
@Action(semantics = SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE)
public Party remove() {
Party party = getParty();
remove(this);
return party;
}
use of org.estatio.module.party.dom.Party in project estatio by estatio.
the class PartyDtoFactory_Test method happy_case.
@Test
public void happy_case() throws Exception {
// given
final Party p = new Organisation();
p.setReference("12345678");
p.setName("New Company");
// expecting
final OidDto partyOidDto = new OidDto();
context.checking(new Expectations() {
{
oneOf(mockDtoMappingHelper).oidDtoFor(p);
will(returnValue(partyOidDto));
oneOf(mockCommunicationChannelRepository).findByOwnerAndType(p, CommunicationChannelType.POSTAL_ADDRESS);
will(returnValue(Collections.emptySortedSet()));
}
});
// when
PartyDto partyDto = partyDtoFactory.newDto(p);
// and when roundtrip
String xml = jaxbService.toXml(partyDto);
PartyDto partyDtoAfter = jaxbService.fromXml(PartyDto.class, xml);
// then
assertThat(partyDtoAfter.getName()).isEqualTo(p.getName());
assertThat(partyDtoAfter.getReference()).isEqualTo(p.getReference());
}
use of org.estatio.module.party.dom.Party in project estatio by estatio.
the class PropertyImport method importData.
@Programmatic
@Override
public List<Object> importData(final Object previousRow) {
final Party owner = partyRepository.findPartyByReference(ownerReference);
final Country country = countryRepository.findCountry(countryCode);
final ApplicationTenancy appTenancy = applicationTenancyRepository.findByPath(atPath);
Property property = propertyRepository.findPropertyByReference(reference);
if (property == null) {
property = propertyRepository.newProperty(reference, name, PropertyType.valueOf(type), city, country, acquireDate);
}
property.setName(name);
property.setFullName(fullName);
property.setCountry(country);
property.setCity(city);
property.setType(PropertyType.valueOf(type));
property.setAcquireDate(acquireDate);
property.setDisposalDate(disposalDate);
property.setOpeningDate(openingDate);
property.setExternalReference(externalReference);
property.addRoleIfDoesNotExist(owner, FixedAssetRoleTypeEnum.PROPERTY_OWNER, null, null);
property.setParkingSpaces(parkingSpaces);
property.setArea(grossLettableArea);
property.setDisplayOrder(displayOrder);
return Lists.newArrayList(property);
}
Aggregations