Sales

https://github.com/UnionVMS/UVMS-SalesModule-APP

QA Summary App: https://sonarcloud.io/dashboard?id=eu.europa.ec.fisheries.uvms.sales%3Asales
CI location App: https://jenkins.focus.fish/view/UVMS%20App/job/UVMS-SalesModule-APP/
Project Site reports App: https://jenkins.focus.fish/view/Site-Reports/job/UVMS-SalesModule-APP-Site-Reports/site/
Tattletale report: https://jenkins.focus.fish/view/Site-Reports/job/UVMS-SalesModule-APP-Site-Reports/ws/module/target/site/tattleTaleReport/index.html

Module description

Sales notes are required in respect of first sales of fish and fishery products. For the purposes of these requirements first sale fish is defined as fish being marketed for the first time. Sales notes provide an essential aid in cross checking the quantities of fish recorded in logbooks and on landing declarations as well as providing information about market prices and compliance with the Community's grading and price regulations.

Also, under current EU regulation, where fish is landed but is not offered for sale or is intended for sale at a later date, the owner of the fish or their agent ('the holder') must complete and submit a takeover declaration. This document must contain similar information to the sales note information (except for price) and must also indicate the place where the products are stored.

The sales module has the following components: validation of incoming and outgoing sales notes and take over documents, according to the EU business rules and UN/CEFACT XSD scheme an overview of all sales notes and take over documents a detail of a specific sales note or take over document 

How to install?

Maven dependency

Maven
<dependency>
    <groupId>eu.europa.ec.fisheries.uvms.sales</groupId>
    <artifactId>sales</artifactId>
    <version>LATEST</version>
</dependency>

JMS-Queue dependencies

Name

JNDI name

Description

UVMSSalesEvent

java:/jms/queue/UVMSSalesEvent

Request queue to Sales service module

UVMSSales

java:/jms/queue/UVMSSales

Response queue to Sales module


Queues
<admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/jms/queue/UVMSSalesEvent" use-java-context="true" pool-name="UVMSSalesEvent">
     <config-property name="PhysicalName">
         UVMSSalesEvent
     </config-property>
</admin-object>
<admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/jms/queue/UVMSSales" use-java-context="true" pool-name="UVMSSales">
      <config-property name="PhysicalName">
         UVMSSales
      </config-property>
</admin-object>

Module dependencies

Make sure the following modules have also been deployed.

These are the dependencies of Sales version 1.0.18.

NameRepositoryMinimal version
UserUser2.0.2
AssetAsset4.0.17
Rules

Rules

3.0.41
ECB ProxyECB Proxy1.0.4
ExchangeExchange4.0.27
ConfigConfig4.0.1
ActivityActivity1.0.5
Front-endFront-end3.0.23


Datasources

Name

JNDI name

uvms_sales

java:/jdbc/uvms_sales

Datasources
<datasource jta="true" jndi-name="java:/jdbc/uvms_sales" pool-name="jdbc/uvms_sales" enabled="true" use-ccm="true">
     <connection-url>jdbc:postgresql://dburl/uvms?defaultSchema=sales</connection-url>
     <driver-class>org.postgresql.Driver</driver-class>
     <driver>postgresql</driver>
     <security>
          <user-name>sales</user-name>
          <password>sales</password>
     </security>
</datasource>

The sales application lets you free in choosing the schema name.
On the other side, this also means that the schema name is not included in queries, so make sure that the schema is on the user's search path.

Creating the database and filling it with dummy data

  1. Go to the liquibase folder.
  2. Add a profile in pom.xml, overriding the standard database connection settings with your own settings.
  3. Open your terminal and execute a liquibase command. Check maven_commands.txt for more information. Don't forget to add your own profile.

Necessary config settings

The following settings need to be available in the config module database.

Type of settingKeyExample
global
flux_local_nation_code
BEL
global
currency
EUR
modulesales.flux_data_flowurn:un:unece:uncefact:fisheries:FLUX:SALES:EU:2
modulesales.ebc.proxy.endpointhttp://sdw-wsrest.ecb.europa.eu/service/data/EXR/D..EUR.SP00.A


Related plugins and proxies

Plugins

In order to receive sales messages from FLUX, you can use the flux-sales-plugin (not available at Github yet, at the time of writing).

If you want to receive messages from your own systems, you can create a new plugin.
Check out the wsdl contract of the Exchange module for more information.

Proxies

In the front-end, prices will be shown in the same currency, by default EUR.
If Sales messages are expressed in another currency, a conversion is needed.

In order to retrieve Exchange rates, the SalesModule-ECBProxy is used. If needed, you can replace this proxy with your own implementation.

Missing rules?

The current version of Sales is first workable version. Not all rules, defined by the implementation guide, could fully be implemented at this time.

Rule idStatus
SALE-L00-00-0001Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0010Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0011Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0012Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0014Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0020Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0030Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0095Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0100Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0120Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0130Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0170Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0190Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0191Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0400Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0410Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0430Will not be implemented, is covered by SALE-L00-00-000
SALE-L00-00-0455Will not be implemented, is covered by SALE-L00-00-000
SALE-L01-00-0034TODO
SALE-L01-00-0190Will not be implemented, is covered by SALE-L00-00-000
SALE-L01-00-0192Will not be implemented, is covered by SALE-L00-00-000
SALE-L02-00-0001Will not be implemented, is covered by SALE-L00-00-000
SALE-L02-00-0045Will not be implemented, is covered by SALE-L00-00-000
SALE-L02-00-0090Will not be implemented, is covered by SALE-L00-00-000
SALE-L02-00-0102Will not be implemented, is covered by SALE-L00-00-000
SALE-L02-00-0186Will not be implemented, is covered by SALE-L00-00-000
SALE-L02-00-0402Will not be implemented, is covered by SALE-L00-00-000
SALE-L02-00-0403Will not be implemented, is covered by SALE-L00-00-000
SALE-L03-00-0032TODO
SALE-L03-00-0040TODO
SALE-L03-00-0430TODO



Adapting the code

Implementation guide used for development

FLUX_P1000-5_Sales_domain_EU_Implementation_v2_2_0.pdf

Internal data model

db_model-Java.vsd