import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PaymentPlanVO, PaymentReceiveForm, EduPaymentPlanBoPayload } from './types';

// 查询某合同的缴费计划列表
export function listPaymentPlan(contractId: number | string): AxiosPromise<PaymentPlanVO[]> {
  return request({ url: '/edu/contract/payment-plan/list/' + contractId, method: 'get' });
}

// 修改单期计划(仅待收态)
export function updatePaymentPlan(data: EduPaymentPlanBoPayload) {
  return request({ url: '/edu/contract/payment-plan', method: 'put', data });
}

// 收款确认(联动账本)
export function receivePayment(data: PaymentReceiveForm) {
  return request({ url: '/edu/contract/payment-plan/receive', method: 'put', data });
}
