
export interface Facture {
    reference?: string
    numero: string
    date: string
    date_livraison?: string
    date_expedition?: string
    client_code: string
    client_intitule: string
    client_adresse: string
    client_code_postal: string
    client_ville: string
    client_email: string
    client_telephone: string
    valide: number
    total_ht: number
    total_ttc: number
    total_ht_net: number
    statut: number
    total_taxes_calcule: number
    total_ht_calcule:number
    total_ttc_calcule: number
    valeur_frais: number
    taxes1?: number
    lignes?: LigneFacture[]
}



export interface LigneFacture {
    article_code: string
    designation?: string
    quantite: number
    prix_unitaire_ht?: number
    remise_pourcentage?: number
    remise_valeur1?: number
    montant_ligne_ht?: number
    taux_taxe1?: number
    montant_taxe1?: number
    taux_taxe2?: number
    montant_taxe2?: number
    taux_taxe3?: number
    montant_taxe3?: number
    total_taxes?: number
    famille_article?: string
    code_barre?: string
    poids_brut?: number
    poids_net?: number
}


export interface FactureRequest {
    client_id: string
    date_livraison?: string
    reference?: string
    date_facture?: string
    lignes: LigneFactureRequest[]
}



export interface FactureUpdateRequest {
    date_facture?: string
    date_livraison?: string
    reference?: string
    lignes: LigneFactureRequest[]
}



export interface LigneFactureRequest {
    article_code: string
    quantite: number
    prix_unitaire?: number
    designation?: string
    montant_ht?: number
}



export interface FactureResponse {
    success: boolean
    data: {
        numero_facture: string,
        client_id: string
    }
    message: string
}


export interface FactureValideResponse {
    success: boolean
    data: {
        numero_facture: string,
        client_id: string
    }
    message: string
}


export interface RelanceResponse {
    success: boolean
    devis_id?: string
    facture_id?: string
    email_log_id?: string
    destinataire: string
    message: string
}



export interface RelanceRequest {
    factureId: string
    messagePersonnalise?: string
}


export type FactureAction = "send" | "download" | "remind" | "paid";
