-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MODDCB-98 Implement GET API for transaction updates with pagination (#77
) * MODDCB-98 Implement GET API for transaction updates with pagination * MODDCB-98 change the datatype of date column to support offsetDateTime * MODDCB-98 change the property name * MODDCB-98 Fetch the record from audit table so that the response of the API is immutable * MODDCB-98 Adding test case * MODDCB-98 Refactoring code
- Loading branch information
1 parent
85d9847
commit 05bc3ce
Showing
18 changed files
with
438 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.folio.dcb.utils; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import lombok.experimental.UtilityClass; | ||
import lombok.extern.log4j.Log4j2; | ||
|
||
@UtilityClass | ||
@Log4j2 | ||
public class JsonUtils { | ||
public static final String DESERIALIZATION_FAILURE = "Failed to deserialize json string"; | ||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); | ||
|
||
public static <T> T jsonToObject(String jsonString, Class<T> classToDeserialize) { | ||
try { | ||
return OBJECT_MAPPER.readValue(jsonString, classToDeserialize); | ||
} catch (JsonProcessingException ex) { | ||
log.info(DESERIALIZATION_FAILURE + ex); | ||
throw new IllegalArgumentException(DESERIALIZATION_FAILURE + ex.getMessage()); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/resources/db/changelog/changes/alter-date-datatype.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.1" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"> | ||
|
||
<changeSet id="alterDateColumnsType" author="vignesh"> | ||
<sql> | ||
<![CDATA[ | ||
ALTER TABLE transactions ALTER COLUMN created_date TYPE timestamp with time zone; | ||
ALTER TABLE transactions ALTER COLUMN updated_date TYPE timestamp with time zone; | ||
ALTER TABLE transactions_audit ALTER COLUMN created_date TYPE timestamp with time zone; | ||
]]> | ||
</sql> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
Oops, something went wrong.