Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
info:
name: 05. GET OFFICE DETAILS BY ID
type: http
seq: 5

http:
method: GET
url: http://localhost:8080/fineract-provider/api/v1/self/offices/1/details
headers:
- name: Fineract-Platform-TenantId
value: default
- name: Authorization
value: "{{auth_token}}"
auth: inherit

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
info:
name: 06. GET OFFICE SERVICES
type: http
seq: 6

http:
method: GET
url: http://localhost:8080/fineract-provider/api/v1/self/offices/1/services
headers:
- name: Fineract-Platform-TenantId
value: default
- name: Authorization
value: "{{auth_token}}"
auth: inherit

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
info:
name: 07. GET OFFICE GEOLOCATION
type: http
seq: 7

http:
method: GET
url: http://localhost:8080/fineract-provider/api/v1/self/offices/1/geolocation
headers:
- name: Fineract-Platform-TenantId
value: default
- name: Authorization
value: "{{auth_token}}"
auth: inherit

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
info:
name: 08. GET OFFICE ADDRESS
type: http
seq: 8

http:
method: GET
url: http://localhost:8080/fineract-provider/api/v1/self/offices/1/address
headers:
- name: Fineract-Platform-TenantId
value: default
- name: Authorization
value: "{{auth_token}}"
auth: inherit

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.fineract.selfservice.office.api;

Expand All @@ -23,19 +19,48 @@
import org.apache.fineract.infrastructure.core.config.MapstructMapperConfig;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.organisation.office.data.OfficeData;
import org.apache.fineract.selfservice.office.data.OfficeDetailsData;
import org.apache.fineract.selfservice.office.data.OfficeGeolocationData;
import org.apache.fineract.selfservice.office.data.OfficeServiceData;
import org.apache.fineract.selfservice.office.data.SelfOfficeAddressData;
import org.mapstruct.Mapper;

/** MapStruct mapper for converting office domain objects to Swagger API response models. */
@Mapper(config = MapstructMapperConfig.class, componentModel = "spring")
public interface SelfOfficeSwaggerMapper {

SelfOfficesApiResourceSwagger.PutOfficesOfficeIdResponse toPutOfficesOfficeIdResponse(CommandProcessingResult commandProcessingResult);
/** Maps a {@link CommandProcessingResult} to the PUT office response model. */
SelfOfficesApiResourceSwagger.PutOfficesOfficeIdResponse toPutOfficesOfficeIdResponse(
CommandProcessingResult commandProcessingResult);

default SelfOfficesApiResourceSwagger.PutOfficesOfficeIdResponse.PutOfficesOfficeIdResponseChanges toPutOfficesOfficeIdResponseChanges(
Map<String, Object> changes) {
SelfOfficesApiResourceSwagger.PutOfficesOfficeIdResponse.PutOfficesOfficeIdResponseChanges response = new SelfOfficesApiResourceSwagger.PutOfficesOfficeIdResponse.PutOfficesOfficeIdResponseChanges();
Optional.ofNullable(changes).map(c -> c.get("name")).ifPresent(c -> response.name = String.valueOf(c));
return response;
}
default SelfOfficesApiResourceSwagger.PutOfficesOfficeIdResponse.PutOfficesOfficeIdResponseChanges
toPutOfficesOfficeIdResponseChanges(Map<String, Object> changes) {
SelfOfficesApiResourceSwagger.PutOfficesOfficeIdResponse.PutOfficesOfficeIdResponseChanges
response =
new SelfOfficesApiResourceSwagger.PutOfficesOfficeIdResponse
.PutOfficesOfficeIdResponseChanges();
Optional.ofNullable(changes)
.map(c -> c.get("name"))
.ifPresent(c -> response.name = String.valueOf(c));
return response;
}

SelfOfficesApiResourceSwagger.GetOfficesResponse toGetOfficesResponse(OfficeData officeData);
/** Maps a core {@link OfficeData} to the GET office response model. */
SelfOfficesApiResourceSwagger.GetOfficesResponse toGetOfficesResponse(OfficeData officeData);

/** Maps an {@link OfficeDetailsData} to the GET office details response model. */
SelfOfficesApiResourceSwagger.GetOfficeDetailsResponse toGetOfficeDetailsResponse(
OfficeDetailsData data);

/** Maps an {@link OfficeServiceData} to the GET office services response model. */
SelfOfficesApiResourceSwagger.GetOfficeServicesResponse toGetOfficeServicesResponse(
OfficeServiceData data);

/** Maps an {@link OfficeGeolocationData} to the GET office geolocation response model. */
SelfOfficesApiResourceSwagger.GetOfficeGeolocationResponse toGetOfficeGeolocationResponse(
OfficeGeolocationData data);

/** Maps a {@link SelfOfficeAddressData} to the GET office address response model. */
SelfOfficesApiResourceSwagger.GetOfficeAddressResponse toGetOfficeAddressResponse(
SelfOfficeAddressData data);
}
Loading