Search in sources :

Example 1 with IAgreementRoleCommunicationChannelType

use of org.estatio.module.agreement.dom.commchantype.IAgreementRoleCommunicationChannelType in project estatio by estatio.

the class LeaseBuilder method createAddress.

private void createAddress(Lease lease, IAgreementRoleCommunicationChannelType addressType) {
    final AgreementRoleType agreementRoleType = agreementRoleTypeRepository.find(LeaseAgreementRoleTypeEnum.TENANT);
    final AgreementRole agreementRole = lease.findRoleWithType(agreementRoleType, ld(2010, 7, 15));
    AgreementRoleCommunicationChannelType agreementRoleCommunicationChannelType = agreementRoleCommunicationChannelTypeRepository.find(addressType);
    final SortedSet<CommunicationChannel> channels = communicationChannelRepository.findByOwnerAndType(lease.getSecondaryParty(), CommunicationChannelType.POSTAL_ADDRESS);
    final CommunicationChannel postalAddress = channels.first();
    agreementRole.addCommunicationChannel(agreementRoleCommunicationChannelType, postalAddress, null);
}
Also used : AgreementRole(org.estatio.module.agreement.dom.AgreementRole) AgreementRoleCommunicationChannelType(org.estatio.module.agreement.dom.AgreementRoleCommunicationChannelType) IAgreementRoleCommunicationChannelType(org.estatio.module.agreement.dom.commchantype.IAgreementRoleCommunicationChannelType) AgreementRoleType(org.estatio.module.agreement.dom.role.AgreementRoleType) CommunicationChannel(org.incode.module.communications.dom.impl.commchannel.CommunicationChannel)

Example 2 with IAgreementRoleCommunicationChannelType

use of org.estatio.module.agreement.dom.commchantype.IAgreementRoleCommunicationChannelType in project estatio by estatio.

the class AgreementRoleCommunicationChannelTypeRepository method findOrCreate.

public AgreementRoleCommunicationChannelType findOrCreate(final IAgreementRoleCommunicationChannelType data, final IAgreementType IAgreementType) {
    final String title = data.getTitle();
    final AgreementType agreementType = agreementTypeRepository.findOrCreate(IAgreementType);
    AgreementRoleCommunicationChannelType arcct = findByAgreementTypeAndTitle(agreementType, title);
    if (arcct == null) {
        arcct = getContainer().newTransientInstance(AgreementRoleCommunicationChannelType.class);
        arcct.setTitle(title);
        arcct.setAppliesTo(agreementType);
        getContainer().persist(arcct);
    }
    return arcct;
}
Also used : AgreementType(org.estatio.module.agreement.dom.type.AgreementType) IAgreementType(org.estatio.module.agreement.dom.type.IAgreementType) IAgreementRoleCommunicationChannelType(org.estatio.module.agreement.dom.commchantype.IAgreementRoleCommunicationChannelType)

Aggregations

IAgreementRoleCommunicationChannelType (org.estatio.module.agreement.dom.commchantype.IAgreementRoleCommunicationChannelType)2 AgreementRole (org.estatio.module.agreement.dom.AgreementRole)1 AgreementRoleCommunicationChannelType (org.estatio.module.agreement.dom.AgreementRoleCommunicationChannelType)1 AgreementRoleType (org.estatio.module.agreement.dom.role.AgreementRoleType)1 AgreementType (org.estatio.module.agreement.dom.type.AgreementType)1 IAgreementType (org.estatio.module.agreement.dom.type.IAgreementType)1 CommunicationChannel (org.incode.module.communications.dom.impl.commchannel.CommunicationChannel)1