import { cloudService } from './index' import { IBillBook, IBillCategory, IBillPay, IBillQuery, IBillRecord, IBillSearch } from '@/types/bill' import { IStatsChart } from 'vue3-common/dist/types' export const addBillRecordApi = (billRecord: IBillRecord): Promise => cloudService({ url: '/home-api/bill', method: 'post', data: billRecord }) export const updateBillRecordApi = (id: number, billRecord: IBillRecord): Promise => cloudService({ url: `/home-api/bill/${id}`, method: 'put', data: billRecord }) export const deleteBillRecordApi = (id: number): Promise => cloudService({ url: `/home-api/bill/${id}`, method: 'DELETE' }) export const queryBillRecordApi = (id: number): Promise => cloudService({ url: `/home-api/bill/${id}`, method: 'get' }) export const queryBillSummaryApi = (query: IBillQuery): Promise => cloudService({ url: '/home-api/bill/summary', method: 'get', params: query }) export const searchBillSummaryApi = (search: IBillSearch): Promise => cloudService({ url: '/home-api/bill/search', method: 'get', params: search }) export const queryBillStatsApi = (type: string, query: IBillQuery): Promise => cloudService({ url: `/home-api/bill/stats/${type}`, method: 'get', params: query }) export const queryBillPayApi = (): Promise => cloudService({ url: '/home-api/bill/pay', method: 'get' }) export const queryBillBookApi = (): Promise => cloudService({ url: '/home-api/bill/book', method: 'get' }) export const queryBillCategoryApi = (): Promise => cloudService({ url: '/home-api/bill/category', method: 'get' }) export const addBillPayApi = (billPay: IBillPay): Promise => cloudService({ url: '/home-api/bill-manage/pay', method: 'post', data: billPay }) export const updateBillPayApi = (id: number, billPay: IBillPay): Promise => cloudService({ url: `/home-api/bill-manage/pay/${id}`, method: 'put', data: billPay }) export const addBillBookApi = (billBook: IBillBook): Promise => cloudService({ url: '/home-api/bill-manage/book', method: 'post', data: billBook }) export const updateBillBookApi = (id: number, billBook: IBillBook): Promise => cloudService({ url: `/home-api/bill-manage/book/${id}`, method: 'put', data: billBook }) export const addBillCategoryApi = (billCategory: IBillCategory): Promise => cloudService({ url: '/home-api/bill-manage/category', method: 'post', data: billCategory }) export const updateBillCategoryApi = (id: number, billCategory: IBillCategory): Promise => cloudService({ url: `/home-api/bill-manage/category/${id}`, method: 'put', data: billCategory })