Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #76 from regulaforensics/stable
Browse files Browse the repository at this point in the history
Extended AuthenticityFibersCheck
  • Loading branch information
aliaksandr-drozd authored Jul 16, 2024
2 parents 13371e8 + 73ca1a8 commit b1ac7a1
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.0.74",
"version": "0.0.75",
"author": "Regula Forensics, Inc.",
"name": "@regulaforensics/document-reader-recipes",
"description": "Document Reader Recipes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export const getAuthenticityCheckList = (input: ProcessResponse): RAuthenticityC
}

current.groups[groupIndex].checks.push(RAuthenticityFibersCheck.fromPlain({
colorValues: subItem.ColorValues,
rectCount: subItem.RectCount,
expectedCount: subItem.ExpectedCount,
checkType: subItem.Type,
location: {
light: undefined,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsDefined, IsEnum, IsIn, IsOptional, ValidateNested } from 'class-validator'
import { IsDefined, IsEnum, IsIn, IsInt, IsOptional, ValidateNested } from 'class-validator'
import {
AuthenticityFibersTypeCheckResultTypes,
eCheckDiagnose,
Expand All @@ -7,6 +7,7 @@ import {
} from '@regulaforensics/document-reader-typings'
import { plainToInstance, Type } from 'class-transformer'

import { Default } from '@/decorators'
import { aAuthenticityCheck } from '../authenticity-check.abstract'
import { iRLocation, RLocation } from './children'

Expand Down Expand Up @@ -35,6 +36,24 @@ export interface iRAuthenticityFibersCheck extends aAuthenticityCheck {
* @type {eCheckResult}
*/
checkResult: eCheckResult

/**
* Fibers’ color (B, G, R)
* @type {number[]}
*/
colorValues: number[]

/**
* Number of RectArray, Width, Length, Area items
* @type {number}
*/
rectCount: number

/**
* Expected fibers number
* @type {number}
*/
expectedCount: number
}

export class RAuthenticityFibersCheck extends aAuthenticityCheck implements iRAuthenticityFibersCheck {
Expand Down Expand Up @@ -71,6 +90,33 @@ export class RAuthenticityFibersCheck extends aAuthenticityCheck implements iRAu
@IsEnum(eCheckResult)
checkResult: eCheckResult

/**
* Fibers’ color (B, G, R)
* @type {number[]}
*/
@IsDefined()
@Default([0,0,0])
@IsInt({ each: true })
colorValues: number[]

/**
* Number of RectArray, Width, Length, Area items
* @type {number}
*/
@IsDefined()
@Default(0)
@IsInt()
rectCount: number

/**
* Expected fibers number
* @type {number}
*/
@IsDefined()
@Default(0)
@IsInt()
expectedCount: number

/**
* Create instance of RAuthenticityImageCheckListItem from plain object
* @param {iRAuthenticityFibersCheck} input - plain object
Expand Down

0 comments on commit b1ac7a1

Please sign in to comment.