add hasStructuredID property isntead of throwing exception and filter it

This commit is contained in:
2025-10-08 00:19:28 +02:00
parent 4fad41bd0b
commit 7d85d59ace
2 changed files with 20 additions and 22 deletions

View File

@@ -180,8 +180,9 @@ Namespace Jobs.FinalizeDocument
Public ReadOnly Property AnnotationsByReceiver As IEnumerable(Of List(Of Annotation)) Public ReadOnly Property AnnotationsByReceiver As IEnumerable(Of List(Of Annotation))
Get Get
Return annotations _ Return annotations _
.GroupBy(Function(a) a.receiverId) _ .Where(Function(annot) annot.hasStructuredID).ToList() _
.Select(Function(g) g.ToList()) .GroupBy(Function(a) a.receiverId) _
.Select(Function(g) g.ToList())
End Get End Get
End Property End Property
@@ -191,15 +192,17 @@ Namespace Jobs.FinalizeDocument
Friend Class Annotation Friend Class Annotation
Private _id As String Private _id As String = Nothing
Public envelopeId As Integer Public envelopeId As Integer = Nothing
Public receiverId As Integer Public receiverId As Integer = Nothing
Public index As Integer Public index As Integer = Nothing
Public internalType As String Public internalType As String = Nothing
Public hasStructuredID As Boolean = True
Public Property id As String Public Property id As String
Get Get
@@ -215,7 +218,9 @@ Namespace Jobs.FinalizeDocument
Dim parts As String() = value.Split("#"c) Dim parts As String() = value.Split("#"c)
If (parts.Length <> 4) Then If (parts.Length <> 4) Then
Throw New BurnAnnotationException($"The identifier of annotation has more or less than 4 sub-part. Id: {_id}") hasStructuredID = False
Return
'Throw New BurnAnnotationException($"The identifier of annotation has more or less than 4 sub-part. Id: {_id}")
End If End If
If Not Integer.TryParse(parts(0), envelopeId) Then If Not Integer.TryParse(parts(0), envelopeId) Then

View File

@@ -17,9 +17,8 @@
const page = element.page - 1 const page = element.page - 1
//#region signatures //#region signatures
const id = generateId('signature');
const annotation = new PSPDFKit.Annotations.WidgetAnnotation({ const annotation = new PSPDFKit.Annotations.WidgetAnnotation({
id: id, id: generateId('signature'),
pageIndex: page, pageIndex: page,
formFieldName: id, formFieldName: id,
backgroundColor: PSPDFKit.Color.LIGHT_YELLOW, backgroundColor: PSPDFKit.Color.LIGHT_YELLOW,
@@ -34,9 +33,8 @@
//#endregion //#endregion
//#region position //#region position
const id_position = generateId('position');
const annotation_position = new PSPDFKit.Annotations.WidgetAnnotation({ const annotation_position = new PSPDFKit.Annotations.WidgetAnnotation({
id: id_position, id: generateId('position'),
pageIndex: page, pageIndex: page,
formFieldName: id_position, formFieldName: id_position,
backgroundColor: PSPDFKit.Color.DarkBlue, backgroundColor: PSPDFKit.Color.DarkBlue,
@@ -54,9 +52,8 @@
//#endregion //#endregion
//#region city //#region city
const id_city = generateId('city');
const annotation_city = new PSPDFKit.Annotations.WidgetAnnotation({ const annotation_city = new PSPDFKit.Annotations.WidgetAnnotation({
id: id_city, id: generateId('city'),
pageIndex: page, pageIndex: page,
formFieldName: id_city, formFieldName: id_city,
backgroundColor: PSPDFKit.Color.DarkBlue, backgroundColor: PSPDFKit.Color.DarkBlue,
@@ -74,9 +71,8 @@
//#endregion //#endregion
//#region date //#region date
const id_date = generateId('date');
const annotation_date = new PSPDFKit.Annotations.WidgetAnnotation({ const annotation_date = new PSPDFKit.Annotations.WidgetAnnotation({
id: id_date, id: generateId('date'),
pageIndex: page, pageIndex: page,
formFieldName: id_date, formFieldName: id_date,
backgroundColor: PSPDFKit.Color.DarkBlue, backgroundColor: PSPDFKit.Color.DarkBlue,
@@ -102,9 +98,8 @@
this.markFieldAsCity(formFieldCity); this.markFieldAsCity(formFieldCity);
//#region date label //#region date label
const id_date_label = generateId('date_label');
const annotation_date_label = new PSPDFKit.Annotations.WidgetAnnotation({ const annotation_date_label = new PSPDFKit.Annotations.WidgetAnnotation({
id: id_date_label, id: generateId('date_label'),
pageIndex: page, pageIndex: page,
formFieldName: id_date_label, formFieldName: id_date_label,
blendMode: 'normal', blendMode: 'normal',
@@ -125,9 +120,8 @@
//#endregion //#endregion
//#region city label //#region city label
const id_city_label = generateId('city_label');
const annotation_city_label = new PSPDFKit.Annotations.WidgetAnnotation({ const annotation_city_label = new PSPDFKit.Annotations.WidgetAnnotation({
id: id_city_label, id: generateId('city_label'),
pageIndex: page, pageIndex: page,
formFieldName: id_city_label, formFieldName: id_city_label,
blendMode: 'normal', blendMode: 'normal',
@@ -148,9 +142,8 @@
//#endregion //#endregion
//#region position label //#region position label
const id_position_label = generateId('position_label');
const annotation_position_label = new PSPDFKit.Annotations.WidgetAnnotation({ const annotation_position_label = new PSPDFKit.Annotations.WidgetAnnotation({
id: id_position_label, id: generateId('position_label'),
pageIndex: page, pageIndex: page,
formFieldName: id_position_label, formFieldName: id_position_label,
blendMode: 'normal', blendMode: 'normal',