From dc97ff85b3fba5f077a52cd62744243515895278 Mon Sep 17 00:00:00 2001 From: Mark Slowey Date: Wed, 10 Jun 2026 11:30:54 +0100 Subject: [PATCH 1/5] update pageCount constraint with duplex and sides --- .../__tests__/supplier-config.test.ts | 165 +++++++++++++++++- .../src/services/supplier-config.ts | 92 +++++++--- 2 files changed, 231 insertions(+), 26 deletions(-) diff --git a/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts b/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts index 6663d120f..5109ba935 100644 --- a/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts +++ b/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts @@ -483,7 +483,8 @@ describe("supplier-config service", () => { expect(result).toEqual(["spec1"]); }); - it("throws when no eligible packs found for letter", async () => { + + it("throws when no eligible packs found for letter based on sheets", async () => { const deps = makeDeps(); deps.supplierConfigRepo.getPackSpecification = jest .fn() @@ -505,11 +506,15 @@ describe("supplier-config service", () => { "No eligible pack specifications found for letter variant id undefined and pack specification ids spec1", ); expect(deps.logger.info).toHaveBeenCalledWith({ - description: "Pack specification filtered out based on constraints", + description: "Pack specification spec1 filtered out based on pageCount constraints", packSpecId: "spec1", pageCount: 3, - constraintValue: 2, - constraintOperator: "LESS_THAN", + violatedConstraints: expect.arrayContaining([expect.objectContaining({ + actualValue: 3, + constraint: "sheets", + constraintValue: 2, + operator: "LESS_THAN", + })]), }); expect(deps.logger.error).toHaveBeenCalledWith( expect.objectContaining({ @@ -519,6 +524,158 @@ describe("supplier-config service", () => { }), ); }); + + it("does not filter pack specification when duplex reduces sheets and constraint is LESS_THAN_OR_EQUAL", async () => { + const deps = makeDeps(); + deps.supplierConfigRepo.getPackSpecification = jest + .fn() + .mockResolvedValue({ + id: "spec1", + assembly: { duplex: true }, + constraints: { + sheets: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, + }, + } as any); + + const letterEvent = { + data: { + pageCount: 3, + letterVariantId: "variant-1", + }, + } as any; + + const result = await filterPacksForLetter(letterEvent, ["spec1"], deps); + + expect(result).toEqual(["spec1"]); + expect(deps.logger.info).not.toHaveBeenCalled(); + }); + + it("filters pack specification when sides fail LESS_THAN_OR_EQUAL", async () => { + const deps = makeDeps(); + deps.supplierConfigRepo.getPackSpecification = jest.fn().mockResolvedValue({ + id: "spec1", + constraints: { + sides: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, + }, + } as any); + + const letterEvent = { + data: { + pageCount: 3, + letterVariantId: "variant-1", + }, + } as any; + + await expect( + filterPacksForLetter(letterEvent, ["spec1"], deps), + ).rejects.toThrow(/No eligible pack specifications found/); + + expect(deps.logger.info).toHaveBeenCalledWith({ + description: + "Pack specification spec1 filtered out based on pageCount constraints", + packSpecId: "spec1", + pageCount: 3, + violatedConstraints: expect.arrayContaining([ + expect.objectContaining({ + constraint: "sides", + actualValue: 3, + constraintValue: 2, + operator: "LESS_THAN_OR_EQUAL", + }), + ]), + }); + }); + + it("filters by sides using page count even when duplex is enabled", async () => { + const deps = makeDeps(); + deps.supplierConfigRepo.getPackSpecification = jest.fn().mockResolvedValue({ + id: "spec1", + assembly: { duplex: true }, + constraints: { + sheets: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, + sides: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, + }, + } as any); + + const letterEvent = { + data: { + pageCount: 3, + letterVariantId: "variant-1", + }, + } as any; + + await expect( + filterPacksForLetter(letterEvent, ["spec1"], deps), + ).rejects.toThrow(/No eligible pack specifications found/); + + expect(deps.logger.info).toHaveBeenCalledWith({ + description: + "Pack specification spec1 filtered out based on pageCount constraints", + packSpecId: "spec1", + pageCount: 3, + violatedConstraints: expect.arrayContaining([ + expect.objectContaining({ + constraint: "sides", + actualValue: 3, + constraintValue: 2, + operator: "LESS_THAN_OR_EQUAL", + }), + ]), + }); + }); + + it("does not filter pack specification when sides is valid", async () => { + const deps = makeDeps(); + deps.supplierConfigRepo.getPackSpecification = jest + .fn() + .mockResolvedValue({ + id: "spec1", + assembly: { duplex: true }, + constraints: { + sheets: { operator: "LESS_THAN_OR_EQUAL", value: 4 }, + }, + } as any); + + const letterEvent = { + data: { + pageCount: 3, + letterVariantId: "variant-1", + }, + } as any; + + const result = await filterPacksForLetter(letterEvent, ["spec1"], deps); + + expect(result).toEqual(["spec1"]); + expect(deps.logger.info).not.toHaveBeenCalled(); + }); + + it("keeps pack specification when sides constraint passes", async () => { + const deps = makeDeps(); + deps.supplierConfigRepo.getPackSpecification = jest + .fn() + .mockResolvedValue({ + id: "spec1", + constraints: { + sides: { operator: "LESS_THAN_OR_EQUAL", value: 3 }, + }, + } as any); + + const letterEvent = { + data: { + pageCount: 3, + letterVariantId: "variant-1", + }, + } as any; + + const result = await filterPacksForLetter(letterEvent, ["spec1"], deps); + + expect(result).toEqual(["spec1"]); + expect(deps.logger.info).not.toHaveBeenCalled(); + expect(deps.logger.error).not.toHaveBeenCalled(); + }); + + + it("returns eligible packs for all constraint types", async () => { const deps = makeDeps(); const constraints: { operator: string; value: number }[] = [ diff --git a/lambdas/supplier-allocator/src/services/supplier-config.ts b/lambdas/supplier-allocator/src/services/supplier-config.ts index d5a3774cd..b0788e5b6 100644 --- a/lambdas/supplier-allocator/src/services/supplier-config.ts +++ b/lambdas/supplier-allocator/src/services/supplier-config.ts @@ -218,35 +218,83 @@ export async function filterPacksForLetter( deps: Deps, ): Promise { const filteredPackIds: string[] = []; + for (const packSpecId of packSpecificationIds) { + let isValid = true; + const violatedConstraints: Array<{ + constraint: "sheets" | "sides"; + actualValue: number; + constraintValue: number; + operator: string; + }> = []; + const packSpec = await deps.supplierConfigRepo.getPackSpecification(packSpecId); - if ( - !packSpec.constraints || - !packSpec.constraints.sheets || - !packSpec.constraints.sheets.value || - !packSpec.constraints.sheets.operator - ) { + + if (packSpec.constraints) { + // Evaluate sheets constraint if present + if ( + packSpec.constraints.sheets && + packSpec.constraints.sheets.value !== undefined && + packSpec.constraints.sheets.operator + ) { + const sheetCount = packSpec?.assembly?.duplex + ? Math.ceil(letterEvent.data.pageCount / 2) + : letterEvent.data.pageCount; + + const passesSheetsConstraint = evaluateContraint( + sheetCount, + packSpec.constraints.sheets.value, + packSpec.constraints.sheets.operator, + ); + + if (!passesSheetsConstraint) { + isValid = false; + violatedConstraints.push({ + constraint: "sheets", + actualValue: sheetCount, + constraintValue: packSpec.constraints.sheets.value, + operator: packSpec.constraints.sheets.operator, + }); + } + } + + // Evaluate sides constraint if present + if ( + packSpec.constraints.sides && + packSpec.constraints.sides.value !== undefined && + packSpec.constraints.sides.operator + ) { + const passesSidesConstraint = evaluateContraint( + letterEvent.data.pageCount, + packSpec.constraints.sides.value, + packSpec.constraints.sides.operator, + ); + + if (!passesSidesConstraint) { + isValid = false; + violatedConstraints.push({ + constraint: "sides", + actualValue: letterEvent.data.pageCount, + constraintValue: packSpec.constraints.sides.value, + operator: packSpec.constraints.sides.operator, + }); + } + } + } + + if (isValid) { filteredPackIds.push(packSpecId); } else { - const isValid = evaluateContraint( - letterEvent.data.pageCount, - packSpec.constraints.sheets.value, - packSpec.constraints.sheets.operator, - ); - if (isValid) { - filteredPackIds.push(packSpecId); - } else { - deps.logger.info({ - description: "Pack specification filtered out based on constraints", - packSpecId, - pageCount: letterEvent.data.pageCount, - constraintValue: packSpec.constraints.sheets.value, - constraintOperator: packSpec.constraints.sheets.operator, - }); - } + deps.logger.info({ + description: `Pack specification ${packSpecId} filtered out based on pageCount constraints`, + packSpecId, + pageCount: letterEvent.data.pageCount, + violatedConstraints, + }); } } + if (filteredPackIds.length === 0) { deps.logger.error({ description: "No eligible pack specifications found for letter", From ae53e1ef779b2ff45b70e909509e830efeeb5528 Mon Sep 17 00:00:00 2001 From: Mark Slowey Date: Wed, 10 Jun 2026 11:55:33 +0100 Subject: [PATCH 2/5] tests and linting --- .../__tests__/supplier-config.test.ts | 99 ++++++----- .../src/services/supplier-config.ts | 167 ++++++++++-------- 2 files changed, 146 insertions(+), 120 deletions(-) diff --git a/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts b/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts index 5109ba935..52cc91a46 100644 --- a/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts +++ b/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts @@ -506,15 +506,18 @@ describe("supplier-config service", () => { "No eligible pack specifications found for letter variant id undefined and pack specification ids spec1", ); expect(deps.logger.info).toHaveBeenCalledWith({ - description: "Pack specification spec1 filtered out based on pageCount constraints", + description: + "Pack specification spec1 filtered out based on pageCount constraints", packSpecId: "spec1", pageCount: 3, - violatedConstraints: expect.arrayContaining([expect.objectContaining({ - actualValue: 3, - constraint: "sheets", - constraintValue: 2, - operator: "LESS_THAN", - })]), + violatedConstraints: expect.arrayContaining([ + expect.objectContaining({ + actualValue: 3, + constraint: "sheets", + constraintValue: 2, + operator: "LESS_THAN", + }), + ]), }); expect(deps.logger.error).toHaveBeenCalledWith( expect.objectContaining({ @@ -528,20 +531,20 @@ describe("supplier-config service", () => { it("does not filter pack specification when duplex reduces sheets and constraint is LESS_THAN_OR_EQUAL", async () => { const deps = makeDeps(); deps.supplierConfigRepo.getPackSpecification = jest - .fn() - .mockResolvedValue({ - id: "spec1", - assembly: { duplex: true }, - constraints: { - sheets: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, - }, - } as any); + .fn() + .mockResolvedValue({ + id: "spec1", + assembly: { duplex: true }, + constraints: { + sheets: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, + }, + } as any); const letterEvent = { - data: { - pageCount: 3, - letterVariantId: "variant-1", - }, + data: { + pageCount: 3, + letterVariantId: "variant-1", + }, } as any; const result = await filterPacksForLetter(letterEvent, ["spec1"], deps); @@ -552,12 +555,14 @@ describe("supplier-config service", () => { it("filters pack specification when sides fail LESS_THAN_OR_EQUAL", async () => { const deps = makeDeps(); - deps.supplierConfigRepo.getPackSpecification = jest.fn().mockResolvedValue({ - id: "spec1", - constraints: { - sides: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, - }, - } as any); + deps.supplierConfigRepo.getPackSpecification = jest + .fn() + .mockResolvedValue({ + id: "spec1", + constraints: { + sides: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, + }, + } as any); const letterEvent = { data: { @@ -588,14 +593,16 @@ describe("supplier-config service", () => { it("filters by sides using page count even when duplex is enabled", async () => { const deps = makeDeps(); - deps.supplierConfigRepo.getPackSpecification = jest.fn().mockResolvedValue({ - id: "spec1", - assembly: { duplex: true }, - constraints: { - sheets: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, - sides: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, - }, - } as any); + deps.supplierConfigRepo.getPackSpecification = jest + .fn() + .mockResolvedValue({ + id: "spec1", + assembly: { duplex: true }, + constraints: { + sheets: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, + sides: { operator: "LESS_THAN_OR_EQUAL", value: 2 }, + }, + } as any); const letterEvent = { data: { @@ -627,20 +634,20 @@ describe("supplier-config service", () => { it("does not filter pack specification when sides is valid", async () => { const deps = makeDeps(); deps.supplierConfigRepo.getPackSpecification = jest - .fn() - .mockResolvedValue({ - id: "spec1", - assembly: { duplex: true }, - constraints: { - sheets: { operator: "LESS_THAN_OR_EQUAL", value: 4 }, - }, - } as any); + .fn() + .mockResolvedValue({ + id: "spec1", + assembly: { duplex: true }, + constraints: { + sheets: { operator: "LESS_THAN_OR_EQUAL", value: 4 }, + }, + } as any); const letterEvent = { - data: { - pageCount: 3, - letterVariantId: "variant-1", - }, + data: { + pageCount: 3, + letterVariantId: "variant-1", + }, } as any; const result = await filterPacksForLetter(letterEvent, ["spec1"], deps); @@ -674,8 +681,6 @@ describe("supplier-config service", () => { expect(deps.logger.error).not.toHaveBeenCalled(); }); - - it("returns eligible packs for all constraint types", async () => { const deps = makeDeps(); const constraints: { operator: string; value: number }[] = [ diff --git a/lambdas/supplier-allocator/src/services/supplier-config.ts b/lambdas/supplier-allocator/src/services/supplier-config.ts index b0788e5b6..91118daec 100644 --- a/lambdas/supplier-allocator/src/services/supplier-config.ts +++ b/lambdas/supplier-allocator/src/services/supplier-config.ts @@ -212,88 +212,108 @@ function evaluateContraint( // This function is used to filter the pack specifications for a letter based on the letter data pages and pack specification constraints sheets +type ConstraintName = "sheets" | "sides"; + +type ViolatedConstraint = { + constraint: ConstraintName; + actualValue: number; + constraintValue: number; + operator: string; +}; + +function hasConstraint(constraint?: { + value?: number; + operator?: string; +}): constraint is { value: number; operator: string } { + return constraint?.value !== undefined && constraint.operator !== undefined; +} + +function getViolatedConstraints( + pageCount: number, + duplex: boolean | undefined, + constraints?: { + sheets?: { value?: number; operator?: string }; + sides?: { value?: number; operator?: string }; + }, +): ViolatedConstraint[] { + if (!constraints) { + return []; + } + + const violations: ViolatedConstraint[] = []; + + if (hasConstraint(constraints.sheets)) { + const sheetCount = duplex ? Math.ceil(pageCount / 2) : pageCount; + const passes = evaluateContraint( + sheetCount, + constraints.sheets.value, + constraints.sheets.operator, + ); + + if (!passes) { + violations.push({ + constraint: "sheets", + actualValue: sheetCount, + constraintValue: constraints.sheets.value, + operator: constraints.sheets.operator, + }); + } + } + + if (hasConstraint(constraints.sides)) { + const passes = evaluateContraint( + pageCount, + constraints.sides.value, + constraints.sides.operator, + ); + + if (!passes) { + violations.push({ + constraint: "sides", + actualValue: pageCount, + constraintValue: constraints.sides.value, + operator: constraints.sides.operator, + }); + } + } + + return violations; +} + export async function filterPacksForLetter( letterEvent: PreparedEvents, packSpecificationIds: string[], deps: Deps, ): Promise { - const filteredPackIds: string[] = []; + const { pageCount } = letterEvent.data; - for (const packSpecId of packSpecificationIds) { - let isValid = true; - const violatedConstraints: Array<{ - constraint: "sheets" | "sides"; - actualValue: number; - constraintValue: number; - operator: string; - }> = []; - - const packSpec = - await deps.supplierConfigRepo.getPackSpecification(packSpecId); - - if (packSpec.constraints) { - // Evaluate sheets constraint if present - if ( - packSpec.constraints.sheets && - packSpec.constraints.sheets.value !== undefined && - packSpec.constraints.sheets.operator - ) { - const sheetCount = packSpec?.assembly?.duplex - ? Math.ceil(letterEvent.data.pageCount / 2) - : letterEvent.data.pageCount; - - const passesSheetsConstraint = evaluateContraint( - sheetCount, - packSpec.constraints.sheets.value, - packSpec.constraints.sheets.operator, - ); - - if (!passesSheetsConstraint) { - isValid = false; - violatedConstraints.push({ - constraint: "sheets", - actualValue: sheetCount, - constraintValue: packSpec.constraints.sheets.value, - operator: packSpec.constraints.sheets.operator, - }); - } - } + const evaluationResults = await Promise.all( + packSpecificationIds.map(async (packSpecId) => { + const packSpec = + await deps.supplierConfigRepo.getPackSpecification(packSpecId); + + const violatedConstraints = getViolatedConstraints( + pageCount, + packSpec?.assembly?.duplex, + packSpec.constraints, + ); - // Evaluate sides constraint if present - if ( - packSpec.constraints.sides && - packSpec.constraints.sides.value !== undefined && - packSpec.constraints.sides.operator - ) { - const passesSidesConstraint = evaluateContraint( - letterEvent.data.pageCount, - packSpec.constraints.sides.value, - packSpec.constraints.sides.operator, - ); - - if (!passesSidesConstraint) { - isValid = false; - violatedConstraints.push({ - constraint: "sides", - actualValue: letterEvent.data.pageCount, - constraintValue: packSpec.constraints.sides.value, - operator: packSpec.constraints.sides.operator, - }); - } + if (violatedConstraints.length > 0) { + deps.logger.info({ + description: `Pack specification ${packSpecId} filtered out based on pageCount constraints`, + packSpecId, + pageCount, + violatedConstraints, + }); } - } - if (isValid) { - filteredPackIds.push(packSpecId); - } else { - deps.logger.info({ - description: `Pack specification ${packSpecId} filtered out based on pageCount constraints`, - packSpecId, - pageCount: letterEvent.data.pageCount, - violatedConstraints, - }); - } - } + return { packSpecId, isValid: violatedConstraints.length === 0 }; + }), + ); + + const filteredPackIds = evaluationResults + .filter((result) => result.isValid) + .map((result) => result.packSpecId); if (filteredPackIds.length === 0) { deps.logger.error({ @@ -305,5 +325,6 @@ export async function filterPacksForLetter( `No eligible pack specifications found for letter variant id ${letterEvent.data.letterVariantId} and pack specification ids ${packSpecificationIds.join(", ")}`, ); } + return filteredPackIds; } From adf4de64240e09731a35dccf0cc6d2f1b7687ab8 Mon Sep 17 00:00:00 2001 From: Mark Slowey Date: Wed, 10 Jun 2026 14:05:01 +0100 Subject: [PATCH 3/5] resync log message across acceptance tests --- lambdas/supplier-allocator/src/services/supplier-config.ts | 2 +- .../allocation-tests/letter-allocation-capacity.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lambdas/supplier-allocator/src/services/supplier-config.ts b/lambdas/supplier-allocator/src/services/supplier-config.ts index 91118daec..52ac1c434 100644 --- a/lambdas/supplier-allocator/src/services/supplier-config.ts +++ b/lambdas/supplier-allocator/src/services/supplier-config.ts @@ -300,7 +300,7 @@ export async function filterPacksForLetter( if (violatedConstraints.length > 0) { deps.logger.info({ - description: `Pack specification ${packSpecId} filtered out based on pageCount constraints`, + description: `Pack specification filtered out based on pageCount constraints`, packSpecId, pageCount, violatedConstraints, diff --git a/tests/component-tests/allocation-tests/letter-allocation-capacity.spec.ts b/tests/component-tests/allocation-tests/letter-allocation-capacity.spec.ts index e2353c3d8..c8264fc61 100644 --- a/tests/component-tests/allocation-tests/letter-allocation-capacity.spec.ts +++ b/tests/component-tests/allocation-tests/letter-allocation-capacity.spec.ts @@ -65,7 +65,7 @@ test.describe("Allocator Lambda Tests", () => { expect(response.MessageId).toBeTruthy(); const supplierAllocatorLog = await getAllocationLog( - "Pack specification filtered out based on constraints", + "Pack specification filtered out based on pageCount constraints", ); const filteredPackSpecId = supplierAllocatorLog.packSpecId; logger.info(`Pack spec filtered out ${filteredPackSpecId}`); From 172c2e56c06f4de17dbeccb1689ebc73ff9aedb4 Mon Sep 17 00:00:00 2001 From: Mark Slowey Date: Wed, 10 Jun 2026 14:13:11 +0100 Subject: [PATCH 4/5] fix the config unit test log msg --- .../src/services/__tests__/supplier-config.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts b/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts index 52cc91a46..1f6807dba 100644 --- a/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts +++ b/lambdas/supplier-allocator/src/services/__tests__/supplier-config.test.ts @@ -507,7 +507,7 @@ describe("supplier-config service", () => { ); expect(deps.logger.info).toHaveBeenCalledWith({ description: - "Pack specification spec1 filtered out based on pageCount constraints", + "Pack specification filtered out based on pageCount constraints", packSpecId: "spec1", pageCount: 3, violatedConstraints: expect.arrayContaining([ @@ -577,7 +577,7 @@ describe("supplier-config service", () => { expect(deps.logger.info).toHaveBeenCalledWith({ description: - "Pack specification spec1 filtered out based on pageCount constraints", + "Pack specification filtered out based on pageCount constraints", packSpecId: "spec1", pageCount: 3, violatedConstraints: expect.arrayContaining([ @@ -617,7 +617,7 @@ describe("supplier-config service", () => { expect(deps.logger.info).toHaveBeenCalledWith({ description: - "Pack specification spec1 filtered out based on pageCount constraints", + "Pack specification filtered out based on pageCount constraints", packSpecId: "spec1", pageCount: 3, violatedConstraints: expect.arrayContaining([ From a9ada15bcd183d1aa256b8c8b7a13b8a5b4c2719 Mon Sep 17 00:00:00 2001 From: Mark Slowey Date: Wed, 10 Jun 2026 14:41:25 +0100 Subject: [PATCH 5/5] fix test pack eligibility --- .../allocation-tests/letter-allocation-capacity.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/component-tests/allocation-tests/letter-allocation-capacity.spec.ts b/tests/component-tests/allocation-tests/letter-allocation-capacity.spec.ts index c8264fc61..7a172a4a8 100644 --- a/tests/component-tests/allocation-tests/letter-allocation-capacity.spec.ts +++ b/tests/component-tests/allocation-tests/letter-allocation-capacity.spec.ts @@ -58,7 +58,7 @@ test.describe("Allocator Lambda Tests", () => { const preparedEvent = createPreparedV1Event({ domainId, letterVariantId: letterVariant, - pageCount: 6, // pagecount that makes notify-c5 ineligible and notify-c4 eligible based on their pack configs + pageCount: 11, // pagecount that makes notify-c5 ineligible and notify-c4 eligible based on their pack configs (note packs are duplex) }); const response = await sendSnsEvent(preparedEvent);