diff --git a/client/src/components/TransactionForm.tsx b/client/src/components/TransactionForm.tsx index 2451bdf..948f5aa 100644 --- a/client/src/components/TransactionForm.tsx +++ b/client/src/components/TransactionForm.tsx @@ -1,6 +1,7 @@ import React, { useState } from 'react'; import { checkDispensingEligibility, type LocalSettings, type GuardResult } from '../utils/dispensingGuard'; import { type PatientDocType } from '../db/schema'; +import { TRANSACTION_TYPES, type TransactionType } from '../constants'; // Mock Patient Data (Since we don't have a patient picker UI yet) const MOCK_PATIENTS: (PatientDocType & { last_sync_date: string })[] = [ @@ -15,7 +16,7 @@ const LOCAL_SETTINGS: LocalSettings = { }; interface TransactionFormProps { - onAdd: (type: 'DISPENSE' | 'RECEIVE' | 'ADJUST', qty: number, batchId: string) => void; + onAdd: (type: TransactionType, qty: number, batchId: string) => void; sku: string; } @@ -34,7 +35,7 @@ export const TransactionForm: React.FC = ({ onAdd, sku }) setGuardResult(result); if (result.allowed) { - onAdd('DISPENSE', qty, batchId); + onAdd(TRANSACTION_TYPES.DISPENSE, qty, batchId); setQty(0); } }; @@ -103,13 +104,13 @@ export const TransactionForm: React.FC = ({ onAdd, sku }) Dispense ( - )