mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-15 09:14:08 +00:00
build passes Create all missing components (modals, dropdowns, icons, tabs, mail drivers, customer partials), fix all @/scripts/ imports to @v2/, wire up vite entry point and blade template. 382 files, 48883 lines. - 27 settings components: modals (tax, payment, custom field, note, category, role, exchange rate, unit, mail test), dropdowns (6), customization tabs (4), mail driver forms (4) - 22 icon components: 5 utility icons, 4 dashboard icons, 13 editor toolbar icons with typed barrel export - 3 customer components: info, chart placeholder, custom fields single - Fixed usePopper composable, client/format-money import patterns - Zero remaining @/scripts/ imports in scripts-v2/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
71 lines
1.9 KiB
TypeScript
71 lines
1.9 KiB
TypeScript
import { client } from '../client'
|
|
import { API } from '../endpoints'
|
|
import type { RecurringInvoice, CreateRecurringInvoicePayload } from '@v2/types/domain/recurring-invoice'
|
|
import type {
|
|
ApiResponse,
|
|
ListParams,
|
|
DeletePayload,
|
|
} from '@v2/types/api'
|
|
|
|
export interface RecurringInvoiceListParams extends ListParams {
|
|
status?: string
|
|
customer_id?: number
|
|
}
|
|
|
|
export interface RecurringInvoiceListMeta {
|
|
current_page: number
|
|
last_page: number
|
|
per_page: number
|
|
total: number
|
|
recurring_invoice_total_count: number
|
|
}
|
|
|
|
export interface RecurringInvoiceListResponse {
|
|
data: RecurringInvoice[]
|
|
meta: RecurringInvoiceListMeta
|
|
}
|
|
|
|
export interface FrequencyDateParams {
|
|
frequency: string
|
|
starts_at?: string
|
|
}
|
|
|
|
export interface FrequencyDateResponse {
|
|
next_invoice_at: string
|
|
}
|
|
|
|
export const recurringInvoiceService = {
|
|
async list(params?: RecurringInvoiceListParams): Promise<RecurringInvoiceListResponse> {
|
|
const { data } = await client.get(API.RECURRING_INVOICES, { params })
|
|
return data
|
|
},
|
|
|
|
async get(id: number): Promise<ApiResponse<RecurringInvoice>> {
|
|
const { data } = await client.get(`${API.RECURRING_INVOICES}/${id}`)
|
|
return data
|
|
},
|
|
|
|
async create(payload: CreateRecurringInvoicePayload): Promise<ApiResponse<RecurringInvoice>> {
|
|
const { data } = await client.post(API.RECURRING_INVOICES, payload)
|
|
return data
|
|
},
|
|
|
|
async update(
|
|
id: number,
|
|
payload: Partial<CreateRecurringInvoicePayload>,
|
|
): Promise<ApiResponse<RecurringInvoice>> {
|
|
const { data } = await client.put(`${API.RECURRING_INVOICES}/${id}`, payload)
|
|
return data
|
|
},
|
|
|
|
async delete(payload: DeletePayload): Promise<{ success: boolean }> {
|
|
const { data } = await client.post(API.RECURRING_INVOICES_DELETE, payload)
|
|
return data
|
|
},
|
|
|
|
async getFrequencyDate(params: FrequencyDateParams): Promise<FrequencyDateResponse> {
|
|
const { data } = await client.get(API.RECURRING_INVOICE_FREQUENCY, { params })
|
|
return data
|
|
},
|
|
}
|