Skip to content

Commit

Permalink
Merge pull request #68 from JanardhanBS-SyncByte/release-1.3.x
Browse files Browse the repository at this point in the history
[MOSIP-37358] Readme
  • Loading branch information
ckm007 authored Nov 12, 2024
2 parents caaaefd + c4e227f commit 4ba9fba
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 19 deletions.
36 changes: 18 additions & 18 deletions kernel-bio-converter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ Method: POST

| Property | Description |
| ----------------------| ------------ |
| values | key-value pairs, with base64 url encoded data |
| sourceFormat | Http mime types, ISO formats [ISO19794_4_2011, ISO19794_5_2011, ISO19794_6_2011] |
| sourceParameters | key-value pairs [IMAGE/JPEG, IMAGE/PNG] |
| targetFormat | Http mime types, ISO formats |
Expand All @@ -132,26 +131,27 @@ Method: POST
}
```

| Property | Description |
| -------- | ------------|
| response | key-value pairs, with base64 url encoded converted data |
| **Property** | **Description** |
| :----------- | :--------------------------------------------------------- |
| response | key-value pairs, with base64 url encoded converted data |


## Error-codes:

| Code | Description |
| ------------| --------------------------------------------------------------------------------------------|
| MOS-CNV-001 | Input Source Request may be null or Source Format may be null or Target Format may be null |
| MOS-CNV-002 | Invalid Request Value |
| MOS-CNV-003 | Invalid Source Value or Source Format not supported |
| MOS-CNV-004 | Invalid Target Value or Target Format not supported |
| MOS-CNV-005 | Source value can not be empty or null |
| MOS-CNV-006 | Source not valid base64urlencoded |
| MOS-CNV-007 | Could not read Source ISO Image Data |
| MOS-CNV-008 | Source not valid ISO ISO19794_4_2011 |
| MOS-CNV-009 | Source not valid ISO ISO19794_5_2011 |
| MOS-CNV-010 | Source not valid ISO ISO19794_6_2011 |
| MOS-CNV-011 | Target format not valid |
| MOS-CNV-500 | Technical Error |
| **Code** | **Description** |
|----|----|
| MOS-CNV-001 | Input Source Request may be null or Source Format may be null or Target Format may be null |
| MOS-CNV-002 | Invalid Request Value |
| MOS-CNV-003 | Invalid Source Value or Source Format not supported |
| MOS-CNV-004 | Invalid Target Value or Target Format not supported |
| MOS-CNV-005 | Source value cannot be empty or null |
| MOS-CNV-006 | Source not valid base64urlencoded |
| MOS-CNV-007 | Could not read Source ISO Image Data |
| MOS-CNV-008 | Source not valid ISO ISO19794_4_2011 |
| MOS-CNV-009 | Source not valid ISO ISO19794_5_2011 |
| MOS-CNV-010 | Source not valid ISO ISO19794_6_2011 |
| MOS-CNV-011 | Target format not valid |
| MOS-CNV-500 | Technical Error |


## Configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package io.mosip.kernel.bio.converter.dto;

import java.util.Map;
import java.util.Objects;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import lombok.Data;
import lombok.ToString;

/**
* Data Transfer Object for conversion requests in the bio converter service.
Expand Down Expand Up @@ -35,6 +37,7 @@
*/

@Data
@ToString
public class ConvertRequestDto {
/**
* A map of values required for the conversion. The map must contain at least
Expand Down Expand Up @@ -73,4 +76,43 @@ public class ConvertRequestDto {
*/
@SuppressWarnings({ "java:S1104" })
public Map<String, String> targetParameters;
}

public ConvertRequestDto() {
super();
}

public ConvertRequestDto(
@NotNull(message = "Values code can not be null") @Size(min = 1, message = "Minimum one entry required") Map<String, String> values,
@NotNull(message = "SourceFormat code can not be null") @NotBlank(message = "SourceFormat code can not be blank") @NotEmpty(message = "SourceFormat code can not be empty") String sourceFormat,
@NotNull(message = "TargetFormat code can not be null") @NotBlank(message = "TargetFormat code can not be blank") @NotEmpty(message = "TargetFormat code can not be empty") String targetFormat,
Map<String, String> sourceParameters, Map<String, String> targetParameters) {
super();
this.values = values;
this.sourceFormat = sourceFormat;
this.targetFormat = targetFormat;
this.sourceParameters = sourceParameters;
this.targetParameters = targetParameters;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ConvertRequestDto that = (ConvertRequestDto) o;
return Objects.equals(values, that.values) && Objects.equals(sourceFormat, that.sourceFormat)
&& Objects.equals(targetFormat, that.targetFormat)
&& Objects.equals(sourceParameters, that.sourceParameters)
&& Objects.equals(targetParameters, that.targetParameters);
}

@Override
public int hashCode() {
return Objects.hash(values, sourceFormat, targetFormat, sourceParameters, targetParameters);
}

public boolean canEqual(Object other) {
return other instanceof ConvertRequestDto;
}
}

0 comments on commit 4ba9fba

Please sign in to comment.