feat(fetch-requests): pdf/xlsx source types + trust_fallback create field
This commit is contained in:
@@ -13,7 +13,7 @@ import { EmptyState } from "../ui/EmptyState";
|
||||
import { formatApiError } from "../features/fetch-requests";
|
||||
import { useToast } from "../ui/Toast";
|
||||
|
||||
const CREATE_FIELDS = ["account", "bank", "pipeline", "start_date", "end_date", "source"];
|
||||
const CREATE_FIELDS = ["account", "bank", "pipeline", "trust_fallback", "start_date", "end_date", "source"];
|
||||
|
||||
function FetchRequestList() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -7,7 +7,10 @@ export type FetchRequestStatus =
|
||||
| "completed"
|
||||
| "failed";
|
||||
|
||||
export type SourceType = "file" | "pdf" | "xlsx" | "email";
|
||||
|
||||
export interface FileSource {
|
||||
type?: SourceType;
|
||||
path: string;
|
||||
bank: string;
|
||||
raw_lines?: string[];
|
||||
@@ -17,7 +20,16 @@ export interface FileSource {
|
||||
txn_dicts_count?: number;
|
||||
}
|
||||
|
||||
export interface PdfSource extends FileSource {
|
||||
type: "pdf";
|
||||
}
|
||||
|
||||
export interface XlsxSource extends FileSource {
|
||||
type: "xlsx";
|
||||
}
|
||||
|
||||
export interface EmailSource {
|
||||
type: "email";
|
||||
bank: string;
|
||||
from_email?: string;
|
||||
subject?: string;
|
||||
@@ -28,10 +40,13 @@ export interface EmailSource {
|
||||
|
||||
export type PipelineType = "heuristic" | "llm" | "llama_parse";
|
||||
|
||||
export type TrustFallback = "amount" | "balance";
|
||||
|
||||
export interface FetchRequestCreate {
|
||||
source: FileSource | EmailSource;
|
||||
source: PdfSource | XlsxSource | FileSource | EmailSource;
|
||||
account_name: string;
|
||||
pipeline?: PipelineType;
|
||||
trust_fallback?: TrustFallback | null;
|
||||
payor_username?: string;
|
||||
start_date?: string;
|
||||
end_date?: string;
|
||||
@@ -113,7 +128,7 @@ export interface SSEEvent {
|
||||
export interface FetchRequestFilters {
|
||||
status?: FetchRequestStatus[];
|
||||
account_name?: string;
|
||||
source_type?: "file" | "email";
|
||||
source_type?: SourceType;
|
||||
}
|
||||
|
||||
export function formatApiError(err: any): string {
|
||||
|
||||
@@ -5,6 +5,9 @@ export type {
|
||||
FetchRequestStatus,
|
||||
FetchRequestFilters,
|
||||
FileSource,
|
||||
PdfSource,
|
||||
XlsxSource,
|
||||
SourceType,
|
||||
EmailSource,
|
||||
UploadResult,
|
||||
PendingAmbiguity,
|
||||
@@ -15,6 +18,7 @@ export type {
|
||||
SSEEventStatus,
|
||||
ProgressMessage,
|
||||
PipelineType,
|
||||
TrustFallback,
|
||||
} from "./fetch-requests.models";
|
||||
export { RETRY_MAX, formatApiError } from "./fetch-requests.models";
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user