Business components

From Arawak
Jump to: navigation, search

The business components are the base microservices of the platform, below each microservice that is part of this component, its technologies and functionalities that it exposes.


Entities and business resources

In order to port to the dynamic platform, a highly flexible low level microservice has been developed that supports the creation of any type of entity, the entity concept being understood as a class that describes a group of resources, for example: the Hotel entity allows describe hotels on the platform, in case of you want to obtain all the hotels this can be done through the name that was given to the entity. It is very important to take into account that this microservice is generic and it is recommended in higher microservices of the architecture to pass these entities to specific types well defined according to the business of the higher microservice.

The technologies of this microservice are Java programming language, Spring Boot development framework and ElasticSearch for the data persistence.

Main functionalities available:

  • Create resources.
  • Get resources.
  • Update a resource.
  • Delete a resource.
  • Enable / Disable available resources.
  • Verify if a resource is available.
  • Search for a resource by name or other criteria using full text search.
  • Get a group of resources once by passing the identifiers of them.
  • Recover a previously deleted resource (deletion operations are logical)

All the available API of this microservice is documented using Swagger and is accessible by selecting /resources from the URL: http://api.opencaribbean.org

Location and georeferencing

The location and georeferencing microservice is in charge of storing all the information of the location data of a resource. It includes physical location data such as, city, country, street, districts, etc; data of geographic type (coordinates) and data for communications such as email, fax and telephone of the resource to which the location is associated.

A nomenclator is included for the homogenization of the information of the countries in the available system in the endpoint /countries and advanced functions are added for working with the maps. It is also used to search places in GooglePlaces API and obtain information about a place using your PlaceId as an identifier.

The technologies of this microservice are Java programming language, Spring Boot development framework and ElasticSearch is used for the data persistence.


Main functionalities available:

Country Management

  • Register a new country.
  • Get the complete list of countries.
  • Get the paged list of countries.
  • Search.
  • Get the information of a country given its countryId.
  • Delete a country given its countryId.

Location Management

  • Register a location.
  • Update a location.
  • Get the locations.
  • Get the paged locations.
  • Get the locations by country.
  • Get the location for one or multiple resources.
  • Check if a location exists given its locationId.
  • Get the number of registered locations.

Work Operations on maps

  • Search by text the places available in Google Places API.
  • Get the available information of a place in Google Maps using its identifier (PlaceId).

All available API of this microservice is documented using Swagger and is accessible by selecting /location from the URL: http://api.opencaribbean.org

Calendar and reservations

In the scope of the platform is available the microservice calendar and reservations. It allows to associate with any system resource (read as any element registered in the microservice described in entities, but not necessarily restricted to it), basically the calendar is associated with the resourceId field.

The two fundamental concepts handled by this microservice:

  1. Bookable: The time that have a resource available and can be reserved, See the following example: Let's suppose that we have a parking of cars (the resource), this parking the owner wishes to rent it on the weekends (Saturdays and Sundays) from 8 to 5pm, when registering this resource so that it can be leased we must add bookable spaces, adding the date ranges in which it is bookable using the API of this microservice.
  2. Booking: The time in which a resource is reserved which was previously declared a bookable space. The booking process requires the start and end dates of the booking and the identifier of the bookable that will be used. The start and end date of the reservation must be framed inside a bookable space.

A reservation has 5 possible states:

  • CREATED: It has been created correctly.
  • CONFIRMATED: Has been confirmed / accepted by the owner.
  • RUNNING: It is running.
  • FINISHED: The reserved period has ended.
  • CANCELED: It has been canceled.

The states are (unless a change is forced by an administrator) handled automatically by the microservice itself.

It is important to keep in mind that when a reservation is made in a bookable space if the reservation does not cover the entire bookable period, new available bookable spaces are generated for the resource, which includes the spaces of available times - not reserved within the bookable period. The following image illustrates how this happens.

Bookable steps


In step 1, the resource is reservable between April 4, 2019 and August 4, 2021. During that bookable period a reservation is made (step 2) between October 2, 2019 and August 4, 2020. Then, the initial bookable is divided into two new bookables, including the initial date at the time the reservation starts and another time from the end of the reservation to the end of the first bookable. It is important to keep in mind that a resource can have multiple bookables, but only one booking at a time in a period of time.

The technologies of this microservice are Java programming language, Spring Boot development framework and MySQL is used for the data persistence.


Main functionalities:

Bookables operations

  • Register a new bookable for a resource.
  • Get a bookable given its identifier.
  • Get all bookables.
  • Update a bookable for a resource.
  • Delete a bookable resource.
  • Verify if a resource has availability to reserve in a period of dates.
  • Check all reserved spaces for a group of resources in a period of dates.

Booking operations

  • Register a reserved reservation in a reserved space.
  • Get the reservations made.
  • Obtain the information of a reservation given its identifier.
  • Check if a reservation exists.
  • Get all reservations made by a user.
  • Change the status (forced) of a reservation.
  • Delete a reservation.


All the available API of the microservice is documented using swagger and is accessible by selecting /booking from the URL: http://api.opencaribbean.org

Claims

The claims microservice has the objective of providing functionalities that allow any user of the system to claim ownership of a resource previously registered in the platform.


The claim process must be performed from a user account previously registered in the system, start by clicking a simple button on the information of the resource that is claimed and from that moment a flow is triggered that includes the following stages:

  1. A client of the system requests the claim of a resource.
  2. An email is sent to the "claimant" indicating that you access a private form in the web system where you must fill in the information related to the application, this form includes that you must show information where you prove the property of the place and other information.
  3. An administrator / moderator of the system evaluates the request and decides whether to accept the ownership of the claimed resource based on the information presented.


The claim process can be internally in one of the following states:

  • CLAIMED: The claim has been made.
  • REPORTED_BY_MAIL: The claimant has been notified by email to access the private form.
  • WIZARD_COMPLETED_BY_CLAIMER: The form has been completed by the claimant.
  • IN_VERIFICATION: The verification process by the administrator or manager of the platform is in progress.
  • ACEPTED: The claim was accepted, a change of ownership over the resource must be made.
  • REJECTED_BY_CLAIMER: The claimant rejects and decides not to proceed with the process.
  • REJECTED_BY_TIME: Too much time has passed and the platform refuses to accept a decision.
  • REJECTED_BY_ADMIN: The claim is not applicable and the resource is maintained by the current owner.
  • STOPPED: The process is paused for some reason.


The technologies of this microservice are Java programming language, Spring Boot development framework and the MySQL is used for the data persistence.

The main functionalities of the claims microservice are:

  • Start / create a claim.
  • Obtain information regarding whether a user has made a claim about a resource.
  • Update the status of a claim.
  • Complete a form about a claim.
  • Update a previously filled form.


All the available API of the microservice is documented using swagger and is accessible by selecting /claims from the URL: http://api.opencaribbean.org

Evaluations and states

The goal of this microservice is that users can issue an assessment about a resource. It allows users to score between 0 and 5 points on a resource and / or express a reaction on resources, for example: Like, Love, etc.

A user can only issue an evaluation or reaction on the same resource, but it can be updated at any time the user wishes to do so.

The technologies of this microservice are Java programming language, Spring Boot development framework and ElasticSearch is used for the data persistence.


Main functionalities:

Evaluation

  • Register / change an evaluation of a user about a resource.
  • Get the evaluation that a user has given about a resource.
  • Get the total average of the evaluations obtained by a resource.
  • Delete an evaluation based on its identifier.

States

  • Register a state or reaction of a user about a resource.
  • Get the reaction given by a user about a resource.
  • Get the amount of reaction given on a resource.
  • Delete a state from its identification.


All the available API of the microservice is documented using swagger and is accessible by selecting /reviews from the URL: http://api.opencaribbean.org

Media management

The media management microservice (media-manager in the graphic) aims to manage all the static content offered by the platform such as images, audio files, email templates and any file that is required, allows uploading the files and exposing it as static content to be consumed by the final client applications.

The technologies of this microservice are Java programming language, Spring Boot development framework and MySQL is used for the data persistence.


Main functionalities:

  • Upload a file and its corresponding metadata.
  • Download a file.
  • Get a group of N .. random images (this functionality is to be used by frontend applications that normally show photos of resources, previously stored).
  • Delete a file based on its identifier.

Each time a file is uploaded using the microservice, an identifier of the file that can be used to recover or delete it is delivered.


All the available API of the microservice is documented using swagger and is accessible by selecting /media from the URL: http://api.opencaribbean.org