use of org.estatio.module.asset.dom.role.FixedAssetRoleTypeEnum in project estatio by estatio.
the class CreateInvoiceNumerators method execute.
@Override
protected void execute(ExecutionContext ec) {
final List<FixedAssetRoleTypeEnum> roleTypes = Arrays.asList(FixedAssetRoleTypeEnum.PROPERTY_OWNER, FixedAssetRoleTypeEnum.TENANTS_ASSOCIATION);
for (final Property property : propertyRepository.allProperties()) {
for (final FixedAssetRole fixedAssetRole : fixedAssetRoleRepository.findAllForProperty(property)) {
if (roleTypes.contains(fixedAssetRole.getType())) {
ApplicationTenancy applicationTenancy = estatioApplicationTenancyRepository.findOrCreateTenancyFor(property, fixedAssetRole.getParty());
final Numerator numerator = estatioNumeratorRepository.createInvoiceNumberNumerator(property, PropertyOwnerBuilder.numeratorReferenceFor(property), bi(0), applicationTenancy);
ec.addResult(this, property.getReference(), numerator);
}
}
}
}
Aggregations