Examples of update()


Examples of org.mifosplatform.infrastructure.sms.domain.SmsMessage.update()

        try {
            this.validator.validateForUpdate(command.json());

            final SmsMessage message = this.assembler.assembleFromResourceId(resourceId);
            final Map<String, Object> changes = message.update(command);
            if (!changes.isEmpty()) {
                this.repository.save(message);
            }

            return new CommandProcessingResultBuilder() //
View Full Code Here

Examples of org.mifosplatform.infrastructure.survey.domain.Likelihood.update()

            this.likelihoodDataValidator.validateForUpdate(command);

            final Likelihood likelihood = this.repository.findOne(likelihoodId);

            if (!likelihood.update(command).isEmpty()) {
                this.repository.save(likelihood);

                if (likelihood.isActivateCommand(command)) {
                    List<Likelihood> likelihoods = this.repository
                            .findByPpiNameAndLikeliHoodId(likelihood.getPpiName(), likelihood.getId());
View Full Code Here

Examples of org.mifosplatform.mix.domain.MixTaxonomyMapping.update()

        try {
            MixTaxonomyMapping mapping = this.mappingRepository.findOne(mappingId);
            if (mapping == null) {
                mapping = MixTaxonomyMapping.fromJson(command);
            } else {
                mapping.update(command);
            }

            this.mappingRepository.saveAndFlush(mapping);

            return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(mapping.getId()).build();
View Full Code Here

Examples of org.mifosplatform.organisation.holiday.domain.Holiday.update()

        try {
            this.context.authenticatedUser();
            this.fromApiJsonDeserializer.validateForUpdate(command.json());

            final Holiday holiday = this.holidayRepository.findOneWithNotFoundDetection(command.entityId());
            Map<String, Object> changes = holiday.update(command);

            validateInputDates(holiday.getFromDateLocalDate(), holiday.getToDateLocalDate(), holiday.getRepaymentsRescheduledToLocalDate());

            if (changes.containsKey(officesParamName)) {
                final Set<Office> offices = getSelectedOffices(command);
View Full Code Here

Examples of org.mifosplatform.organisation.office.domain.Office.update()

                parentId = command.longValueOfParameterNamed("parentId");
            }

            final Office office = validateUserPriviledgeOnOfficeAndRetrieve(currentUser, officeId);

            final Map<String, Object> changes = office.update(command);

            if (changes.containsKey("parentId")) {
                final Office parent = validateUserPriviledgeOnOfficeAndRetrieve(currentUser, parentId);
                office.update(parent);
            }
View Full Code Here

Examples of org.mifosplatform.organisation.staff.domain.Staff.update()

            this.fromApiJsonDeserializer.validateForUpdate(command.json());

            final Staff staffForUpdate = this.staffRepository.findOne(staffId);
            if (staffForUpdate == null) { throw new StaffNotFoundException(staffId); }

            final Map<String, Object> changesOnly = staffForUpdate.update(command);

            if (changesOnly.containsKey("officeId")) {
                final Long officeId = (Long) changesOnly.get("officeId");
                final Office newOffice = this.officeRepository.findOne(officeId);
                if (newOffice == null) { throw new OfficeNotFoundException(officeId); }
View Full Code Here

Examples of org.mifosplatform.portfolio.account.domain.AccountTransferStandingInstruction.update()

    @Override
    public CommandProcessingResult update(final Long id, final JsonCommand command) {
        this.standingInstructionDataValidator.validateForUpdate(command);
        AccountTransferStandingInstruction standingInstructionsForUpdate = this.standingInstructionRepository.findOne(id);
        if (standingInstructionsForUpdate == null) { throw new StandingInstructionNotFoundException(id); }
        final Map<String, Object> actualChanges = standingInstructionsForUpdate.update(command);
        return new CommandProcessingResultBuilder() //
                .withCommandId(command.commandId()) //
                .withEntityId(id) //
                .with(actualChanges) //
                .build();
View Full Code Here

Examples of org.mifosplatform.portfolio.calendar.domain.Calendar.update()

        if (calendarForUpdate == null) { throw new CalendarNotFoundException(calendarId); }
        final Date oldStartDate = calendarForUpdate.getStartDate();
        final LocalDate currentDate = DateUtils.getLocalDateOfTenant();
        // create calendar history before updating calendar
        final CalendarHistory calendarHistory = new CalendarHistory(calendarForUpdate, oldStartDate);
        final Map<String, Object> changes = calendarForUpdate.update(command);

        if (!changes.isEmpty()) {
            // update calendar history table only if there is a change in
            // calendar start date.
            if (currentDate.isAfter(new LocalDate(oldStartDate))) {
View Full Code Here

Examples of org.mifosplatform.portfolio.charge.domain.Charge.update()

            this.fromApiJsonDeserializer.validateForUpdate(command.json());

            final Charge chargeForUpdate = this.chargeRepository.findOne(chargeId);
            if (chargeForUpdate == null) { throw new ChargeNotFoundException(chargeId); }

            final Map<String, Object> changes = chargeForUpdate.update(command);

            // MIFOSX-900: Check if the Charge has been active before and now is
            // deactivated:
            if (changes.containsKey("active")) {
                // IF the key exists then it has changed (otherwise it would
View Full Code Here

Examples of org.mifosplatform.portfolio.client.domain.Client.update()

            final Client clientForUpdate = this.clientRepository.findOneWithNotFoundDetection(clientId);
            final String clientHierarchy = clientForUpdate.getOffice().getHierarchy();

            this.context.validateAccessRights(clientHierarchy);

            final Map<String, Object> changes = clientForUpdate.update(command);

            if (changes.containsKey(ClientApiConstants.staffIdParamName)) {

                final Long newValue = command.longValueOfParameterNamed(ClientApiConstants.staffIdParamName);
                Staff newStaff = null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.