export type PaymentTypeCode = "OM" | "FLOOZ" | "MTN" | "WAVE" | "CB";

export interface PaymentType {
	reference: number;
	nom: string;
	description: string;
	code: PaymentTypeCode;
	etat: boolean;
	type_operateur: string;
}

export interface DjangoPaginated<T> {
	count: number;
	next: string | null;
	previous: string | null;
	results: T;
}

export interface Merchant {
	marchand_id: string;
	nom: string;
	code: string;
	adresse: string;
	url_succes: string;
	url_echec: string;
	entreprise: number;
	user: number;
}

export interface IuserInformations {
	username: string;
	email: string;
	first_name: string;
	last_name: string;
	marchand: Merchant;
}

// ORANGE MONEY

export type OmInitializationPayload = {
	type_paiement: number;
	marchand: string;
	service: string;
	montant: number;
	commentaire: string;
	numero: string;
};

export type OmInitializationResponse = {
	status: number;
	message: string;
	pay_token: string;
	payment_url: string;
	notif_token: string;
	order_id: string;
};

export type OmTransactionState = "INITIATED" | "SUCCESS" | "FAILED";
export interface OmTransaction {
	status: OmTransactionState;
	code: number;
	message: {
		status: OmTransactionState;
		order_id: string;
		txnid?: string;
	};
}

// WAVE
export type WaveInitializationPayload = {
	type_paiement: number;
	marchand: string;
	service: string;
	montant: number;
};
export interface WaveTransactionInitilizationResponse {
	id: string;
	amount: string;
	checkout_status: string;
	client_reference: unknown;
	currenfy: string;
	error_url: string;
	last_payment_errror: unknown;
	business_name: string;
	payment_status: string;
	succes_url: string;
	wave_launch_url: string;
	when_completed: unknown;
	when_created: string;
	when_expires: string;
}

export type Transaction = {
	type_paiement: number;
	type_paiement_label: PaymentTypeCode;
	marchand: string;
	marchand_name: string;
	service: string;
	montant: number;
	date: string;
	commentaire: string;
	etat: boolean;
	status: "SUCCESS" | "INITIATED" | "FAILED";
	reference: string;
	transaction_id: number;
	marchand_code: string;
};
