Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-05-07 13:32:35 +03:00
co-authored by Copilot
parent 4faafe6667
commit c7eb23dd3f
17 changed files with 668 additions and 120 deletions
+217 -3
View File
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "559bc27f-b656-4554-a080-73c56d317ce5",
"_postman_id": "097332d0-ce5c-4074-bad0-df5482013438",
"name": "Reparee Collection",
"description": "Auto-generated from OpenAPI spec. Import storage/app/openapi-default.json for the full schema.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
@@ -43463,13 +43463,120 @@
}
],
"url": {
"raw": "{{base_url}}/api/home",
"raw": "{{base_url}}/api/home?period=this_month&start_date=&end_date=&financial_period=this_month&financial_start_date=&financial_end_date=&work_order_period=this_month&work_order_start_date=&work_order_end_date=&appointment_period=this_month&appointment_start_date=&appointment_end_date=&sales_period=this_month&sales_start_date=&sales_end_date=&purchase_period=this_month&purchase_start_date=&purchase_end_date=&upcoming_filter=today&upcoming_per_page=10&upcoming_page=1",
"host": [
"{{base_url}}"
],
"path": [
"api",
"home"
],
"query": [
{
"key": "period",
"value": "this_month",
"description": "Optional. Main dashboard period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "start_date",
"value": "",
"description": "Optional. Main dashboard custom start date (YYYY-MM-DD). Use when period=custom."
},
{
"key": "end_date",
"value": "",
"description": "Optional. Main dashboard custom end date (YYYY-MM-DD). Use when period=custom."
},
{
"key": "financial_period",
"value": "this_month",
"description": "Optional. Financial section period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "financial_start_date",
"value": "",
"description": "Optional. Financial custom start date (YYYY-MM-DD). Use when financial_period=custom."
},
{
"key": "financial_end_date",
"value": "",
"description": "Optional. Financial custom end date (YYYY-MM-DD). Use when financial_period=custom."
},
{
"key": "work_order_period",
"value": "this_month",
"description": "Optional. Work orders section period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "work_order_start_date",
"value": "",
"description": "Optional. Work orders custom start date (YYYY-MM-DD). Use when work_order_period=custom."
},
{
"key": "work_order_end_date",
"value": "",
"description": "Optional. Work orders custom end date (YYYY-MM-DD). Use when work_order_period=custom."
},
{
"key": "appointment_period",
"value": "this_month",
"description": "Optional. Appointments section period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "appointment_start_date",
"value": "",
"description": "Optional. Appointments custom start date (YYYY-MM-DD). Use when appointment_period=custom."
},
{
"key": "appointment_end_date",
"value": "",
"description": "Optional. Appointments custom end date (YYYY-MM-DD). Use when appointment_period=custom."
},
{
"key": "sales_period",
"value": "this_month",
"description": "Optional. Sales section period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "sales_start_date",
"value": "",
"description": "Optional. Sales custom start date (YYYY-MM-DD). Use when sales_period=custom."
},
{
"key": "sales_end_date",
"value": "",
"description": "Optional. Sales custom end date (YYYY-MM-DD). Use when sales_period=custom."
},
{
"key": "purchase_period",
"value": "this_month",
"description": "Optional. Purchases section period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "purchase_start_date",
"value": "",
"description": "Optional. Purchases custom start date (YYYY-MM-DD). Use when purchase_period=custom."
},
{
"key": "purchase_end_date",
"value": "",
"description": "Optional. Purchases custom end date (YYYY-MM-DD). Use when purchase_period=custom."
},
{
"key": "upcoming_filter",
"value": "today",
"description": "Optional. Upcoming appointments filter. Allowed: today, tomorrow, this_week, next_week. Default: today."
},
{
"key": "upcoming_per_page",
"value": "10",
"description": "Optional. Upcoming appointments page size. Integer 1-100. Default: 10."
},
{
"key": "upcoming_page",
"value": "1",
"description": "Optional. Upcoming appointments page number. Default: 1."
}
]
}
},
@@ -43499,13 +43606,120 @@
}
],
"url": {
"raw": "{{base_url}}/api/home",
"raw": "{{base_url}}/api/home?period=this_month&start_date=&end_date=&financial_period=this_month&financial_start_date=&financial_end_date=&work_order_period=this_month&work_order_start_date=&work_order_end_date=&appointment_period=this_month&appointment_start_date=&appointment_end_date=&sales_period=this_month&sales_start_date=&sales_end_date=&purchase_period=this_month&purchase_start_date=&purchase_end_date=&upcoming_filter=today&upcoming_per_page=10&upcoming_page=1",
"host": [
"{{base_url}}"
],
"path": [
"api",
"home"
],
"query": [
{
"key": "period",
"value": "this_month",
"description": "Optional. Main dashboard period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "start_date",
"value": "",
"description": "Optional. Main dashboard custom start date (YYYY-MM-DD). Use when period=custom."
},
{
"key": "end_date",
"value": "",
"description": "Optional. Main dashboard custom end date (YYYY-MM-DD). Use when period=custom."
},
{
"key": "financial_period",
"value": "this_month",
"description": "Optional. Financial section period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "financial_start_date",
"value": "",
"description": "Optional. Financial custom start date (YYYY-MM-DD). Use when financial_period=custom."
},
{
"key": "financial_end_date",
"value": "",
"description": "Optional. Financial custom end date (YYYY-MM-DD). Use when financial_period=custom."
},
{
"key": "work_order_period",
"value": "this_month",
"description": "Optional. Work orders section period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "work_order_start_date",
"value": "",
"description": "Optional. Work orders custom start date (YYYY-MM-DD). Use when work_order_period=custom."
},
{
"key": "work_order_end_date",
"value": "",
"description": "Optional. Work orders custom end date (YYYY-MM-DD). Use when work_order_period=custom."
},
{
"key": "appointment_period",
"value": "this_month",
"description": "Optional. Appointments section period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "appointment_start_date",
"value": "",
"description": "Optional. Appointments custom start date (YYYY-MM-DD). Use when appointment_period=custom."
},
{
"key": "appointment_end_date",
"value": "",
"description": "Optional. Appointments custom end date (YYYY-MM-DD). Use when appointment_period=custom."
},
{
"key": "sales_period",
"value": "this_month",
"description": "Optional. Sales section period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "sales_start_date",
"value": "",
"description": "Optional. Sales custom start date (YYYY-MM-DD). Use when sales_period=custom."
},
{
"key": "sales_end_date",
"value": "",
"description": "Optional. Sales custom end date (YYYY-MM-DD). Use when sales_period=custom."
},
{
"key": "purchase_period",
"value": "this_month",
"description": "Optional. Purchases section period. Allowed: today, yesterday, this_week, this_month, last_month, last_3_months, last_6_months, last_year, year_to_date, all_time, custom."
},
{
"key": "purchase_start_date",
"value": "",
"description": "Optional. Purchases custom start date (YYYY-MM-DD). Use when purchase_period=custom."
},
{
"key": "purchase_end_date",
"value": "",
"description": "Optional. Purchases custom end date (YYYY-MM-DD). Use when purchase_period=custom."
},
{
"key": "upcoming_filter",
"value": "today",
"description": "Optional. Upcoming appointments filter. Allowed: today, tomorrow, this_week, next_week. Default: today."
},
{
"key": "upcoming_per_page",
"value": "10",
"description": "Optional. Upcoming appointments page size. Integer 1-100. Default: 10."
},
{
"key": "upcoming_page",
"value": "1",
"description": "Optional. Upcoming appointments page number. Default: 1."
}
]
}
},
+49 -2
View File
@@ -5,6 +5,46 @@ export const HOME_ROUTES = {
DASHBOARD: "/api/home",
} as const satisfies Record<string, ApiPath>
export const DashboardPeriods = [
"today",
"yesterday",
"this_week",
"this_month",
"last_month",
"last_3_months",
"last_6_months",
"last_year",
"year_to_date",
"all_time",
"custom",
] as const
export type DashboardPeriod = (typeof DashboardPeriods)[number]
export type HomeDashboardQuery = {
period?: DashboardPeriod
start_date?: string
end_date?: string
financial_period?: DashboardPeriod
financial_start_date?: string
financial_end_date?: string
work_order_period?: DashboardPeriod
work_order_start_date?: string
work_order_end_date?: string
appointment_period?: DashboardPeriod
appointment_start_date?: string
appointment_end_date?: string
sales_period?: DashboardPeriod
sales_start_date?: string
sales_end_date?: string
purchase_period?: DashboardPeriod
purchase_start_date?: string
purchase_end_date?: string
upcoming_filter?: "today" | "tomorrow" | "this_week" | "next_week"
upcoming_per_page?: number
upcoming_page?: number
}
export type HomeDashboardResponse = ApiResponse<typeof HOME_ROUTES.DASHBOARD, "get">
export class HomeClient extends ApiClient {
@@ -12,7 +52,14 @@ export class HomeClient extends ApiClient {
super(baseUrl, defaultOptions)
}
async dashboard() {
return this.get(HOME_ROUTES.DASHBOARD)
async dashboard(query?: HomeDashboardQuery) {
return this.get(
HOME_ROUTES.DASHBOARD,
query
? ({
query,
} as never)
: undefined,
)
}
}
+8 -1
View File
@@ -35,7 +35,14 @@ export { ShopCalendarsClient, SHOP_CALENDAR_ROUTES } from "./shop-calendars"
export { HolidayYearsClient, HOLIDAY_YEAR_ROUTES } from "./holiday-years"
export { TaxesClient, TAX_ROUTES } from "./taxes"
export { InvoicesClient, INVOICE_ROUTES, type InvoiceShowData } from "./invoices"
export { HomeClient, HOME_ROUTES, type HomeDashboardResponse } from "./home"
export {
HomeClient,
HOME_ROUTES,
DashboardPeriods,
type DashboardPeriod,
type HomeDashboardQuery,
type HomeDashboardResponse,
} from "./home"
export { BillsClient, BILL_ROUTES } from "./bills"
export { ReasonsClient, REASON_ROUTES } from "./reasons"
export { DocumentPrintClient, DOCUMENT_PRINT_ROUTES, type DocumentPrintType, type DocumentPrintMode } from "./document-print"