filters , order inspections , inventory items , credit notes
This commit is contained in:
@@ -54,6 +54,8 @@ import { ServiceGroupPartsClient } from "./clients/service-group-parts"
|
||||
import { SettingsClient } from "./clients/settings"
|
||||
import { ConfigurationsClient } from "./clients/configurations"
|
||||
import { AutoGenerateClient } from "./clients/auto-generate"
|
||||
import { ExpenseItemsClient } from "./clients/expense-items"
|
||||
import { InventoryCategoriesClient } from "./clients/inventory-categories"
|
||||
|
||||
export function createApi(options?: ApiClientOptions) {
|
||||
return {
|
||||
@@ -112,6 +114,8 @@ export function createApi(options?: ApiClientOptions) {
|
||||
settings: new SettingsClient(undefined, options),
|
||||
configurations: new ConfigurationsClient(undefined, options),
|
||||
autoGenerate: new AutoGenerateClient(undefined, options),
|
||||
expenseItems: new ExpenseItemsClient(undefined, options),
|
||||
inventoryCategories: new InventoryCategoriesClient(undefined, options),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { CrudClient } from "../infra/crud-client"
|
||||
import type { ApiClientOptions } from "../infra/client"
|
||||
import type { ApiPath } from "../infra/types"
|
||||
|
||||
export const EXPENSE_ITEM_ROUTES = {
|
||||
INDEX: "/api/expense-items",
|
||||
BY_ID: "/api/expense-items/{id}",
|
||||
} as const satisfies Record<string, ApiPath>
|
||||
|
||||
export class ExpenseItemsClient extends CrudClient<
|
||||
typeof EXPENSE_ITEM_ROUTES.INDEX,
|
||||
typeof EXPENSE_ITEM_ROUTES.BY_ID
|
||||
> {
|
||||
constructor(baseUrl?: string, defaultOptions?: ApiClientOptions) {
|
||||
super(baseUrl, defaultOptions, EXPENSE_ITEM_ROUTES.INDEX, EXPENSE_ITEM_ROUTES.BY_ID)
|
||||
}
|
||||
}
|
||||
@@ -53,3 +53,5 @@ export { ServiceGroupPartsClient, SERVICE_GROUP_PART_ROUTES } from "./service-gr
|
||||
export { SettingsClient, SETTINGS_ROUTES } from "./settings"
|
||||
export { ConfigurationsClient, CONFIGURATION_ROUTES } from "./configurations"
|
||||
export { AutoGenerateClient, AUTO_GENERATE_ROUTES } from "./auto-generate"
|
||||
export { ExpenseItemsClient, EXPENSE_ITEM_ROUTES } from "./expense-items"
|
||||
export { InventoryCategoriesClient, INVENTORY_CATEGORY_ROUTES } from "./inventory-categories"
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { CrudClient } from "../infra/crud-client"
|
||||
import type { ApiClientOptions } from "../infra/client"
|
||||
import type { ApiPath } from "../infra/types"
|
||||
|
||||
export const INVENTORY_CATEGORY_ROUTES = {
|
||||
INDEX: "/api/inventory-categories",
|
||||
BY_ID: "/api/inventory-categories/{id}",
|
||||
} as const satisfies Record<string, ApiPath>
|
||||
|
||||
export class InventoryCategoriesClient extends CrudClient<
|
||||
typeof INVENTORY_CATEGORY_ROUTES.INDEX,
|
||||
typeof INVENTORY_CATEGORY_ROUTES.BY_ID
|
||||
> {
|
||||
constructor(baseUrl?: string, defaultOptions?: ApiClientOptions) {
|
||||
super(baseUrl, defaultOptions, INVENTORY_CATEGORY_ROUTES.INDEX, INVENTORY_CATEGORY_ROUTES.BY_ID)
|
||||
}
|
||||
}
|
||||
@@ -107,6 +107,10 @@ export type ServiceGroupRateType = (typeof ServiceGroupRateType)[number];
|
||||
// ⚙️ Configurations
|
||||
export const SellRatesTaxInclusive = ['Tax Inclusive', 'Tax Exclusive'] as const;
|
||||
export type SellRatesTaxInclusive = (typeof SellRatesTaxInclusive)[number];
|
||||
// Tables
|
||||
|
||||
export const Tables= ['bills', 'expenses', 'invoices', 'job_cards', 'credit_notes', 'vendor_credits'] as const;
|
||||
export type Tables = (typeof Tables)[number];
|
||||
|
||||
export const GiveDiscounts = ['no', 'line_item_level', 'transaction_level'] as const;
|
||||
export type GiveDiscounts = (typeof GiveDiscounts)[number];
|
||||
@@ -116,3 +120,4 @@ export type PurchaseRatesTaxInclusive = (typeof PurchaseRatesTaxInclusive)[numbe
|
||||
|
||||
export const ReceiveDiscounts = ['no', 'line_item_level', 'transaction_level'] as const;
|
||||
export type ReceiveDiscounts = (typeof ReceiveDiscounts)[number];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user