Skip to content

Commit

Permalink
MODTLR-17 Create service points client
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksandrVidinieiev committed Mar 14, 2024
1 parent 65893ef commit 47b9621
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/org/folio/client/feign/ServicePointsClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.folio.client.feign;

import org.folio.domain.dto.ServicePoint;
import org.folio.spring.config.FeignClientConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "service-points", url = "service-points", configuration = FeignClientConfiguration.class)
public interface ServicePointsClient {

@PostMapping
ServicePoint postServicePoint(@RequestBody ServicePoint servicePoint);

@GetMapping("/{id}")
ServicePoint getServicePoint(@PathVariable String id);
}
2 changes: 2 additions & 0 deletions src/main/resources/swagger.api/ecs-tlr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ components:
$ref: schemas/response/searchInstancesResponse.json
user:
$ref: schemas/user.json
servicePoint:
$ref: schemas/service-point.json
parameters:
requestId:
name: requestId
Expand Down
85 changes: 85 additions & 0 deletions src/main/resources/swagger.api/schemas/service-point.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A service point",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Id of service-point object"
},
"name": {
"type": "string",
"description" : "service-point name, a required field"
},
"code": {
"type": "string",
"description" : "service-point code, a required field"
},
"discoveryDisplayName": {
"type": "string",
"description": "display name, a required field"
},
"description": {
"type": "string",
"description" : "description of the service-point"
},
"shelvingLagTime": {
"type": "integer",
"description": "shelving lag time"
},
"pickupLocation": {
"type": "boolean",
"description": "indicates whether or not the service point is a pickup location"
},
"holdShelfExpiryPeriod" :{
"type": "object",
"$ref": "time-period.json",
"description": "expiration period for items on the hold shelf at the service point"
},
"holdShelfClosedLibraryDateManagement": {
"type": "string",
"description": "enum for closedLibraryDateManagement associated with hold shelf",
"enum":[
"Keep_the_current_due_date",
"Move_to_the_end_of_the_previous_open_day",
"Move_to_the_end_of_the_next_open_day",
"Keep_the_current_due_date_time",
"Move_to_end_of_current_service_point_hours",
"Move_to_beginning_of_next_open_service_point_hours"
],
"default" : "Keep_the_current_due_date"
},
"staffSlips": {
"type": "array",
"description": "List of staff slips for this service point",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"description": "The ID of the staff slip"
},
"printByDefault": {
"type": "boolean",
"description": "Whether or not to print the staff slip by default"
}
},
"required": [
"id",
"printByDefault"
]
}
},
"metadata": {
"type": "object",
"$ref": "metadata.json",
"readonly": true
}
},
"required": [
"name",
"code",
"discoveryDisplayName"
]
}
27 changes: 27 additions & 0 deletions src/main/resources/swagger.api/schemas/time-period.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description" : "schema for time-period, which contains time interval 'duration' and the time unit",
"properties": {
"duration": {
"type": "integer",
"description": "Duration interval"
},
"intervalId": {
"type": "string",
"description": "Unit of time for the duration",
"enum":[
"Minutes",
"Hours",
"Days",
"Weeks",
"Months"
],
"default" : "Days"
}
},
"required": [
"duration",
"intervalId"
]
}

0 comments on commit 47b9621

Please sign in to comment.