// Questo file fa parte di MyTown.
// MyTown è software libero: puoi ridistribuirlo e/o modificarlo secondo
// i termini della GNU Affero General Public License come pubblicata dalla
// Free Software Foundation, versione 3.
// Distribuito senza ALCUNA GARANZIA; vedi la GNU AGPL v3 per i dettagli.
// Copyright (C) Kondor Consulting & Services S.r.l.
// SPDX-License-Identifier: AGPL-3.0-or-later

export interface PayType {
	pt_id: number;
	pt_code: string;  // "NEXI" | "PAYPAL" | "CASH"
	pt_name: string;
	pt_icon: string;
}

export interface PaymentRequest {
	// Per /pay/config
	type_code?: string;
	amount?: number;
	module?: string;      // "BOOKING" | "ECOMMERCE"
	entity_id?: number;
	entity_ref?: string;
	currency?: string;
	pcc_id?: number;      // ID config di pagamento dell'azienda (pay_company_config). Obbligatorio per NEXI/PAYPAL.
	// Per /pay/save
	uid_transaction?: string;
	state?: string;       // "COMPLETED" | "FAILED" | "CANCELLED"
	response_json?: string;
}

/** Riga ritornata da /company-config/active-by-company/{cmp_id} (no credenziali) */
export interface ActivePaymentConfig {
	pcc_id: number;
	pcc_cmp_id: number;
	pcc_provider: string;     // 'NEXI' | 'PAYPAL'
	pcc_alias: string;
	pcc_environment: string;  // 'SANDBOX' | 'PRODUCTION'
}

export interface PayTransaction {
	pt_uid: string;
	pt_type_id: number;
	pt_type_code: string;
	pt_type_name: string;
	pt_amount: number;
	pt_currency: string;
	pt_state: string;
	pt_module: string;
	pt_entity_id: number;
	pt_date_ins: string;
	pt_date_response: string;
}
