import { HitDatabaseEntry } from '../types';

export const conflictsPreserveBonus = (
  oldEntry: HitDatabaseEntry,
  newEntry: HitDatabaseEntry
): HitDatabaseEntry => {
  return {
    ...newEntry,
    bonus: oldEntry.bonus
  };
};

export const keepPaidOrApproved = (el: HitDatabaseEntry) =>
  el.status === 'Paid' || el.status === 'Pending Payment';

export const keepPending = (el: HitDatabaseEntry) => el.status === 'Pending';

export const calculateAcceptanceRate = (
  total: number,
  rejected: number
): number => {
  return (total - rejected) / total * 100;
};

import { HitDatabaseEntry } from '../types';

export const conflictsPreserveBonus = (
  oldEntry: HitDatabaseEntry,
  newEntry: HitDatabaseEntry
): HitDatabaseEntry => {
  return {
    ...newEntry,
    bonus: oldEntry.bonus
  };
};

export const keepPaidOrApproved = (el: HitDatabaseEntry) =>
  el.status === 'Paid' || el.status === 'Pending Payment';

export const keepPending = (el: HitDatabaseEntry) => el.status === 'Pending';

--- 
+++ 
@@ -14,3 +14,10 @@
   el.status === 'Paid' || el.status === 'Pending Payment';
 
 export const keepPending = (el: HitDatabaseEntry) => el.status === 'Pending';
+
+export const calculateAcceptanceRate = (
+  total: number,
+  rejected: number
+): number => {
+  return (total - rejected) / total * 100;
+};
Add utility function to calculate acceptance rate.
