Skip to content

Commit

Permalink
ref
Browse files Browse the repository at this point in the history
  • Loading branch information
xsalonx committed Apr 30, 2024
1 parent e3d27fc commit 5b1a900
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 58 deletions.
9 changes: 0 additions & 9 deletions lib/database/adapters/QcFlagAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class QcFlagAdapter {
constructor() {
this.toEntity = this.toEntity.bind(this);

this.qcFlagEffectivePeriodAdapter = null;
this.qcFlagTypeAdapter = null;
this.qcFlagVerificationAdapter = null;
this.userAdapter = null;
Expand All @@ -48,19 +47,12 @@ class QcFlagAdapter {
flagTypeId,
flagType,
verifications,
effectivePeriods,
} = databaseObject;

const sumOfEffectivePeriods = effectivePeriods?.reduce((summedPeriodsTime, { from, to }) => summedPeriodsTime + (to - from), 0);
const effectivePart = sumOfEffectivePeriods !== undefined
? sumOfEffectivePeriods / (to - from)
: null;

return {
id,
from: from ? new Date(from).getTime() : null,
to: to ? new Date(to).getTime() : null,
effectivePart,
comment: comment ?? null,
runNumber,
dplDetectorId,
Expand All @@ -71,7 +63,6 @@ class QcFlagAdapter {
createdAt: createdAt ? new Date(createdAt).getTime() : null,
updatedAt: createdAt ? new Date(updatedAt).getTime() : null,
verifications: (verifications ?? []).map(this.qcFlagVerificationAdapter.toEntity),
effectivePeriods: (effectivePeriods ?? []).map(this.qcFlagEffectivePeriodAdapter.toEntity),
};
}
}
Expand Down
45 changes: 0 additions & 45 deletions lib/database/adapters/QcFlagEffectivePeriodAdapter.js

This file was deleted.

4 changes: 0 additions & 4 deletions lib/database/adapters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const LogRunsAdapter = require('./LogRunsAdapter');
const LogTagsAdapter = require('./LogTagsAdapter');
const { QcFlagTypeAdapter } = require('./QcFlagTypeAdapter');
const { QcFlagAdapter } = require('./QcFlagAdapter.js');
const { QcFlagEffectivePeriodAdapter } = require('./QcFlagEffectivePeriodAdapter.js');
const { QcFlagVerificationAdapter } = require('./QcFlagVerificationAdapter.js');
const ReasonTypeAdapter = require('./ReasonTypeAdapter');
const RunTypeAdapter = require('./RunTypeAdapter');
Expand Down Expand Up @@ -67,7 +66,6 @@ const logRunsAdapter = new LogRunsAdapter();
const logTagsAdapter = new LogTagsAdapter();
const qcFlagTypeAdapter = new QcFlagTypeAdapter();
const qcFlagAdapter = new QcFlagAdapter();
const qcFlagEffectivePeriodAdapter = new QcFlagEffectivePeriodAdapter();
const qcFlagVerificationAdapter = new QcFlagVerificationAdapter();
const reasonTypeAdapter = new ReasonTypeAdapter();
const runAdapter = new RunAdapter();
Expand Down Expand Up @@ -117,7 +115,6 @@ logAdapter.userAdapter = userAdapter;

qcFlagAdapter.userAdapter = userAdapter;
qcFlagAdapter.qcFlagTypeAdapter = qcFlagTypeAdapter;
qcFlagAdapter.qcFlagEffectivePeriodAdapter = qcFlagEffectivePeriodAdapter;
qcFlagAdapter.qcFlagVerificationAdapter = qcFlagVerificationAdapter;

qcFlagTypeAdapter.userAdapter = userAdapter;
Expand Down Expand Up @@ -156,7 +153,6 @@ module.exports = {
logAdapter,
logRunsAdapter,
logTagsAdapter,
qcFlagEffectivePeriodAdapter,
qcFlagTypeAdapter,
qcFlagAdapter,
qcFlagVerificationAdapter,
Expand Down

0 comments on commit 5b1a900

Please sign in to comment.