GGCE Server issueshttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues2021-10-01T09:24:08+02:00https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/228Assign barcode to inventory2021-10-01T09:24:08+02:00Matija ObrezaAssign barcode to inventoryAdd a service method to generate `barcode` for `Inventory` based on a template in `AppSettings`:
```java
public static final String CATEGORY_BARCODE = "BARCODE";
public static final AppSettingDef BARCODE_INVENTORY = new AppSettingDef(CA...Add a service method to generate `barcode` for `Inventory` based on a template in `AppSettings`:
```java
public static final String CATEGORY_BARCODE = "BARCODE";
public static final AppSettingDef BARCODE_INVENTORY = new AppSettingDef(CATEGORY_BARCODE, "inventoryBarcode", "I:{{ inventory.id }}");
```
Add an API endpoint *POST /i/{id}/barcode* to generate and assign the `barcode` for an inventory if `inventory.barcode == null`. The API call returns `inventory.barcode`.2021.12Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/227AbstractAction with notBeforeDate2021-09-01T15:37:26+02:00Matija ObrezaAbstractAction with notBeforeDateGG-CE recognizes the following action states:
- **in progress**: Action has a `startDate` but no `completedDate`
- **completed**: Action has a `completedDate` and a `startDate`
- **pending**: Action does **not** have `startDate`
The `s...GG-CE recognizes the following action states:
- **in progress**: Action has a `startDate` but no `completedDate`
- **completed**: Action has a `completedDate` and a `startDate`
- **pending**: Action does **not** have `startDate`
The `startDate` documents the date and time when the action actually began and is in progress. One could set the `startDate = tomorrow` and that means that the action will definitely be started (tomorrow). When we look at the action records tomorrow, this action will be marked as **in progress**.
The current data model allows us to capture actions that we do, but it does not allow for **effective planning** of activities. When we add 1000 pending actions for viability testing, then we have 1000 pending actions with no mechanism to prioritize or delay the actions.
## `notBeforeDate`
The new field `notBeforeDate` in `AbstractAction` allows the user to register an action that does not need to be considered before the specified date. This effectively introduces a change in states of action records:
- **pending**: Action does not have a `startDate` **and** `notBeforeDate` is not defined or is before today (`notBeforeDate is null OR notBeforeDate <= today`)
- **scheduled**: Action does not have a `startDate` and has a `notBeforeDate > today`
## Code changes
Add to `AbstractAction`:
```java
@Basic
@Column(name = "not_before_date")
protected Date notBeforeDate;
@Basic
@Column(name = "not_before_date_code", length = 20)
@CodeValueField(CommunityCodeValues.DATE_FORMAT)
protected String notBeforeDateCode;
```
Update `ActionFilter` with `public DateFilter notBeforeDate`.
The current controllers and services seem to be OK even with this addition.2021.12Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/226Inventory hundredSeedWeight not 02021-09-01T13:55:54+02:00Matija ObrezaInventory hundredSeedWeight not 0Please add a validation that hundredSeedWeight is positive and not equal to 0 (`> 0`) if not null.Please add a validation that hundredSeedWeight is positive and not equal to 0 (`> 0`) if not null.2021.12Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/225OrderRequest with last completed action2021-08-31T09:37:48+02:00Matija ObrezaOrderRequest with last completed actionProviding the last completed `OrderRequestAction` allows the user to make some more sense of the order when exploring the list of order requests.
Include the `lastCompletedAction` code value with each `OrderRequest`.Providing the last completed `OrderRequestAction` allows the user to make some more sense of the order when exploring the list of order requests.
Include the `lastCompletedAction` code value with each `OrderRequest`.2021.12Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/224JSON: Inventory update2021-09-07T19:16:02+02:00Matija ObrezaJSON: Inventory update@jarias reports in grin-global/support#107 that when calling **PUT** `/api/v1/i` to update the `inventory`, the returned `Inventory` has `"inventoryMaintenancePolicy": null`.
I think it should be added to `Inventory#lazyLoad()` -- basic...@jarias reports in grin-global/support#107 that when calling **PUT** `/api/v1/i` to update the `inventory`, the returned `Inventory` has `"inventoryMaintenancePolicy": null`.
I think it should be added to `Inventory#lazyLoad()` -- basically anything that can be updated with this service call should also be included in the response.2021.11Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/223MCPD: Add ACCEURL support2021-08-27T08:38:19+02:00Matija ObrezaMCPD: Add ACCEURL support**Accession URL** (`ACCEURL`) is a commonly used extension to MCPD. The field should contain a direct link to the provider’s online portal where additional data about the accession may be available.
The URL is unique for each accession,...**Accession URL** (`ACCEURL`) is a commonly used extension to MCPD. The field should contain a direct link to the provider’s online portal where additional data about the accession may be available.
The URL is unique for each accession, but there is usually a URL template that can be used. Some examples are:
```
https://npgsweb.ars-grin/gringlobal/accessiondetail?id={{ accession.id }}
http://my.iita/accession/{{ accession.accessionNumber }}
```
Extend `AccessionMCPD` with `String acceUrl` and update `AccessionMCPDConverter` to use the value of `AppSetting` in group `MCPD` named `ACCEURL` as a mustache template to generate the values.
![image](/uploads/0ecd65fd953f58fa569fcacfefada533/image.png)2021.11Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/222Initial CT problems2021-08-25T09:15:44+02:00Matija ObrezaInitial CT problemsFiring up GG-CE and trying to use the CT results in a few issues:
1. `managementTypeCode` is missing in *get_inventory_maint_policy*
1. `site_id` incorrect in *get_site* dataview query?
1. CT check the dropdown orderFiring up GG-CE and trying to use the CT results in a few issues:
1. `managementTypeCode` is missing in *get_inventory_maint_policy*
1. `site_id` incorrect in *get_site* dataview query?
1. CT check the dropdown order2021.11Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/221Cooperator: new API endpoints2021-08-27T18:16:15+02:00Maxym BorodenkoCooperator: new API endpointsDetails in https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/313Details in https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/3132021.11Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/220Taxonomy and Geography updaters2021-09-29T13:46:49+02:00Matija ObrezaTaxonomy and Geography updatersThe Taxonomy and Geography updaters are not updated for the `@Versioned modifiedDate`.
Please implement a new version of the updaters that are aware of `modifiedDate`.The Taxonomy and Geography updaters are not updated for the `@Versioned modifiedDate`.
Please implement a new version of the updaters that are aware of `modifiedDate`.2021.13Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/219modifiedDate not null2021-08-27T18:16:15+02:00Matija ObrezamodifiedDate not nullWith `@Version` on `Date modifiedDate` GG-CE expects that all new entities stored to the database will have this field populated.
Originally, `modified_field` allows `NULL`. When loading an "old" record, the `modifiedDate` may not be po...With `@Version` on `Date modifiedDate` GG-CE expects that all new entities stored to the database will have this field populated.
Originally, `modified_field` allows `NULL`. When loading an "old" record, the `modifiedDate` may not be populated.
As part of the upgrade path to GG-CE liquibase should ensure that all `modified_date` are populated in all tables. Please add liquibase changelog that will:
1. `update <table> set modified_date = owned_date where modified_date is null` for all tables.
1. Update `modified_date` to **`NOT NULL`**2021.11Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/218liquibase: mls_status2021-08-12T14:40:20+02:00Matija Obrezaliquibase: mls_statusWhen using `addColumn` the change must test if the column already exists.
```yml
- changeSet:
id: 1624977790584-1
author: mborodenko
changes:
- addColumn:
columns:
- column:
n...When using `addColumn` the change must test if the column already exists.
```yml
- changeSet:
id: 1624977790584-1
author: mborodenko
changes:
- addColumn:
columns:
- column:
name: mls_status
type: varchar(50)
tableName: accession
```
needs to include a precondition:
```yml
preConditions:
- onFail: MARK_RAN
- not:
- columnExists:
columnName: mls_status
tableName: accession
```
And the id needs to be changed from `id: 1624977790584-1` to `id: 1624977790584-1x`.2021.11Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/217Genesys integration: Uploading passport data2021-08-26T10:46:28+02:00Matija ObrezaGenesys integration: Uploading passport dataGG-CE already implements a "MCPD" view of passport data and implements a `GenesysClient`.
In this ticket, we add support to upload the passport data of accessions selected with `AccessionFilter` and `upsert` them in Genesys.
On the UI ...GG-CE already implements a "MCPD" view of passport data and implements a `GenesysClient`.
In this ticket, we add support to upload the passport data of accessions selected with `AccessionFilter` and `upsert` them in Genesys.
On the UI side, the *MCPD* page will get an "Upload to Genesys" button that triggers this new API call. The uploading should be done on the API server and not by the UI client.2021.11Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/216Drop SiteLocation2021-08-12T09:09:29+02:00Maxym BorodenkoDrop SiteLocationDetails in https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/305#note_56721Details in https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/305#note_567212021.10Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/213Preferred names2021-07-23T13:29:11+02:00Matija ObrezaPreferred namesAs @jalarcon describes in grin-global/grin-global-ui#291, the UI should also display the "preferred name" of `Accession` or `Inventory` records.
The preferred name of an `Inventory` is the first `String AccessionInvName.plantName` of `i...As @jalarcon describes in grin-global/grin-global-ui#291, the UI should also display the "preferred name" of `Accession` or `Inventory` records.
The preferred name of an `Inventory` is the first `String AccessionInvName.plantName` of `inventory.names` ordered by `plantNameRank ASC` (the one with the lowest rank). For `Accession` we use the preferred name of accession's *SYSTEM* inventory.
Ideally, the preferred name would be calculated by the database using `@Formula` so that it can also be used in filters and in sorting.2021.10Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/215Curator-Tool. Bug in dataview Get Site2021-07-27T14:15:26+02:00Ghost UserCurator-Tool. Bug in dataview Get SiteI can not open the `Site dataview`, the Curator-Tool sends this error:
![image](/uploads/94dd3e136a0e49c889acf2b305fcd381/image.png)
**Here is the full text of the error.**
```
here was an unexpected error retrieving data for get_sit...I can not open the `Site dataview`, the Curator-Tool sends this error:
![image](/uploads/94dd3e136a0e49c889acf2b305fcd381/image.png)
**Here is the full text of the error.**
```
here was an unexpected error retrieving data for get_site.\
\
Full error message:\
PreparedStatementCallback; bad SQL grammar [SELECT
s.site_id,
s.site_short_name,
s.site_long_name,
s.provider_identifier,
s.organization_abbrev,
s.is_internal,
s.is_distribution_site,
s.type_code,
s.fao_institute_number,
s.note,
s.created_date,
s.created_by,
s.modified_date,
s.modified_by,
s.owned_date,
s.owned_by
FROM
site AS s
INNER JOIN (
SELECT site_id FROM site
WHERE site_id IN (?)
OR ('' = '-1' AND '' = '-1' AND '' = '-1' AND '' = '-1')
UNION SELECT site_id FROM cooperator
WHERE cooperator_id IN (?)
UNION SELECT site_id FROM cooperator c
JOIN accession a ON a.owned_by = c.cooperator_id
WHERE a.accession_id IN (?)
UNION SELECT site_id FROM cooperator c
JOIN inventory i ON i.owned_by = c.cooperator_id
WHERE i.inventory_id IN (?)
) list ON list.site_id = s.site_id
]; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Ambiguous column name 'site_id'.
```2021.10Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/214Curator-Tool. Bug in adding Accessions.2021-08-12T09:09:29+02:00Ghost UserCurator-Tool. Bug in adding Accessions.When I click on the button `Save data`, the CT sends this error:
![image](/uploads/1108e89aad049b54b0664df99003d752/image.png)When I click on the button `Save data`, the CT sends this error:
![image](/uploads/1108e89aad049b54b0664df99003d752/image.png)2021.10https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/212GG-CE API client2023-09-05T06:47:28+02:00Maxym BorodenkoGG-CE API clientIn https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/197 old project layout was converted to a modular Maven project. In this ticket, we will introduce a **client** module. It's a Java client library for GG-CE API.
We...In https://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/197 old project layout was converted to a modular Maven project. In this ticket, we will introduce a **client** module. It's a Java client library for GG-CE API.
We use `springdoc-openapi` library to automating the generation of API documentation. So, explore if we can generate a Java client from that documentation.Matija ObrezaMatija Obrezahttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/211Cooperator: similarity search functionality2021-08-12T09:09:29+02:00Maxym BorodenkoCooperator: similarity search functionalityhttps://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/276 requires similarity search functionality.
Bring the abstract `DuplicateFinder` from Genesys and implement it to search for similar cooperators.https://gitlab.croptrust.org/grin-global/grin-global-ui/-/issues/276 requires similarity search functionality.
Bring the abstract `DuplicateFinder` from Genesys and implement it to search for similar cooperators.2021.10Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/210Scheduled KPI runs and cleanup2021-07-05T10:38:41+02:00Matija ObrezaScheduled KPI runs and cleanupPlease ensure that KPI executions are started nightly and that the runs cleanup (removing runs, but keeping one per month) is enabled.
Our demo.api instance is restarted daily, does that affect the `@Scheduled` annotations?Please ensure that KPI executions are started nightly and that the runs cleanup (removing runs, but keeping one per month) is enabled.
Our demo.api instance is restarted daily, does that affect the `@Scheduled` annotations?2021.10Maxym BorodenkoMaxym Borodenkohttps://gitlab.croptrust.org/grin-global/grin-global-server/-/issues/209Taxonomy updated2021-09-20T19:55:27+02:00Matija ObrezaTaxonomy updatedI'm getting a warning during updating of GRIN Taxonomy data:
```
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert duplicate key row in object 'dbo.taxonomy_species' with unique index 'ndx_uniq_ts'. The duplicate...I'm getting a warning during updating of GRIN Taxonomy data:
```
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert duplicate key row in object 'dbo.taxonomy_species' with unique index 'ndx_uniq_ts'. The duplicate key value is (Sciadophyllum ellipticum, Blume).
```
This seems to also result in the final exception:
```
Unable to find org.gringlobal.model.TaxonomySpecies with id 472546
```
Please test if updating of taxonomy and geographies still works.2021.12Maxym BorodenkoMaxym Borodenko