From 3866a57ff6a77b535e8b1fedb8928a3bd5d9f65e Mon Sep 17 00:00:00 2001 From: Delgee Date: Wed, 14 Feb 2024 15:44:08 +0800 Subject: [PATCH] Change externalReference model To match against data inside database changing importInformation model --- src/db/models/externalReference.ts | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/db/models/externalReference.ts b/src/db/models/externalReference.ts index dd2c2e09..9f8ff6ed 100644 --- a/src/db/models/externalReference.ts +++ b/src/db/models/externalReference.ts @@ -17,23 +17,29 @@ export const EXTERNAL_REFERENCE_ID = brandedType( t.number ); -export const EXTERNAL_REFERENCE_IMPORT_INFORMATION = t.intersection([ - t.type({ - inferred: t.array( +export const EXTERNAL_REFERENCE_IMPORT_INFORMATION = t.partial({ + inferred: t.array( + t.intersection([ t.type({ key: t.string, reason: t.string, - }) - ), - }), - t.partial({ - transferred: t.array( + }), + t.partial({ + valueId: t.any, + }), + ]) + ), + transferred: t.array( + t.intersection([ t.type({ key: t.string, - }) - ), - }), -]); + }), + t.partial({ + valueId: t.any, + }), + ]) + ), +}); export default defineIDModel({ tableName: 'externalReference',