feat(lexware): add integration foundation

This commit is contained in:
Schubert Ferenc 2026-07-05 13:10:27 +02:00
parent 8d37eb29b3
commit ffffb68898
28 changed files with 1150 additions and 11 deletions

View file

@ -0,0 +1,56 @@
import type { SettingsSource } from "@/types/system-settings";
export interface LexwareSettings {
enabled: boolean;
api_base_url: string;
api_key_is_set: boolean;
organization_name: string;
default_tax_rate: string;
default_payment_terms_days: number;
source: SettingsSource;
}
export interface LexwareSettingsPayload {
enabled: boolean;
api_base_url: string;
api_key?: string;
organization_name: string;
default_tax_rate: string;
default_payment_terms_days: number;
}
export interface LexwareTestConnectionResponse {
success: boolean;
message: string;
source: SettingsSource;
api_base_url: string;
organization_name: string;
}
export interface LexwareCustomerMapping {
name: string;
email: string;
phone: string;
search_strategy: string;
create_payload: Record<string, unknown>;
}
export interface LexwareLineItemMapping {
title: string;
description: string | null;
quantity: string;
unit: string;
unit_price: string;
tax_rate: string;
total: string;
}
export interface LexwareInvoicePreparation {
ready_for_export: boolean;
payload_summary: Record<string, unknown>;
customer_mapping: LexwareCustomerMapping;
line_item_mapping: LexwareLineItemMapping[];
tax_mapping: Record<string, unknown>;
warnings: string[];
sync_record_id: number;
}

View file

@ -216,6 +216,10 @@ export interface RepairEstimate {
approved_at: string | null;
declined_at: string | null;
customer_response_message: string | null;
lexware_invoice_id: string | null;
lexware_invoice_number: string | null;
lexware_invoice_status: string | null;
lexware_synced_at: string | null;
created_by_user_id: number | null;
created_at: string;
updated_at: string;