import ApiService from "./ApiService";
import { type PartyType } from "./projectPartyService";

// Party Payment interfaces
export interface PartyPaymentData {
  party_type: PartyType;
  payment_type: "FIXED" | "MONTHLY";
  amount: number;
  start_date?: string;
  end_date?: string;
  paid_date?: string;
  notes?: string;
  company_id: string;
  project_id: string;
}

export interface PartyPaymentResponse {
  success: boolean;
  message?: string;
  data?: any;
}

// Create Party Payment
export async function createPartyPayment(partyId: string, data: PartyPaymentData) {
  return ApiService.request<PartyPaymentResponse>({
    url: `/party-types/party-payments/${partyId}`,
    method: "post",
    data,
  });
}