first commit
This commit is contained in:
20
resources/js/types/auth.ts
Normal file
20
resources/js/types/auth.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export type User = {
|
||||
id: number;
|
||||
name: string;
|
||||
email: string;
|
||||
avatar?: string;
|
||||
email_verified_at: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export type Auth = {
|
||||
user: User;
|
||||
};
|
||||
|
||||
export type TwoFactorConfigContent = {
|
||||
title: string;
|
||||
description: string;
|
||||
buttonText: string;
|
||||
};
|
||||
15
resources/js/types/departments.ts
Normal file
15
resources/js/types/departments.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export type DepartmentProfile = {
|
||||
id: number;
|
||||
name: string;
|
||||
departmentsCount: number;
|
||||
};
|
||||
|
||||
export type Department = {
|
||||
id: number;
|
||||
name: string;
|
||||
isActive: boolean;
|
||||
departmentProfile: {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
36
resources/js/types/global.d.ts
vendored
Normal file
36
resources/js/types/global.d.ts
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import type { Auth } from '@/types/auth';
|
||||
import type { Team } from '@/types/teams';
|
||||
|
||||
// Extend ImportMeta interface for Vite...
|
||||
declare module 'vite/client' {
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_APP_NAME: string;
|
||||
[key: string]: string | boolean | undefined;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
readonly glob: <T>(pattern: string) => Record<string, () => Promise<T>>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@inertiajs/core' {
|
||||
export interface InertiaConfig {
|
||||
sharedPageProps: {
|
||||
name: string;
|
||||
auth: Auth;
|
||||
sidebarOpen: boolean;
|
||||
currentTeam: Team | null;
|
||||
teams: Team[];
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
$inertia: typeof Router;
|
||||
$page: Page;
|
||||
$headManager: ReturnType<typeof createHeadManager>;
|
||||
}
|
||||
}
|
||||
6
resources/js/types/index.ts
Normal file
6
resources/js/types/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export * from './departments';
|
||||
export * from './auth';
|
||||
export * from './navigation';
|
||||
export * from './reports';
|
||||
export * from './teams';
|
||||
export * from './ui';
|
||||
15
resources/js/types/navigation.ts
Normal file
15
resources/js/types/navigation.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { InertiaLinkProps } from '@inertiajs/vue3';
|
||||
import type { LucideIcon } from 'lucide-vue-next';
|
||||
|
||||
export type BreadcrumbItem = {
|
||||
title: string;
|
||||
href: NonNullable<InertiaLinkProps['href']>;
|
||||
};
|
||||
|
||||
export type NavItem = {
|
||||
title: string;
|
||||
href: NonNullable<InertiaLinkProps['href']>;
|
||||
icon?: LucideIcon;
|
||||
isActive?: boolean;
|
||||
items?: NavItem[];
|
||||
};
|
||||
89
resources/js/types/reports.ts
Normal file
89
resources/js/types/reports.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
export type ReportPeriodSummary = {
|
||||
id: number;
|
||||
year: number;
|
||||
month?: number;
|
||||
label: string;
|
||||
status: string;
|
||||
statusLabel: string;
|
||||
isEditable?: boolean;
|
||||
updatedAt?: string | null;
|
||||
};
|
||||
|
||||
export type ServiceCatalogItem = {
|
||||
id: number;
|
||||
code: string;
|
||||
name: string;
|
||||
unit?: string | null;
|
||||
defaultPrice: number;
|
||||
sortOrder: number;
|
||||
isActive: boolean;
|
||||
};
|
||||
|
||||
export type ServiceEntryRow = {
|
||||
quantity: number;
|
||||
unitPrice: number;
|
||||
totalAmount: number;
|
||||
};
|
||||
|
||||
export type ServiceEntryMap = Record<number, ServiceEntryRow>;
|
||||
|
||||
export type FundingSourceOption = {
|
||||
value: string;
|
||||
label: string;
|
||||
};
|
||||
|
||||
export type ExpenseCategoryOption = {
|
||||
value: string;
|
||||
label: string;
|
||||
};
|
||||
|
||||
export type MedicationExpenseValueMap = Record<string, Record<string, number>>;
|
||||
|
||||
export type MedicationExpenseTotals = {
|
||||
byFundingSource: Record<
|
||||
string,
|
||||
{
|
||||
label: string;
|
||||
without_dressing: number;
|
||||
dressing: number;
|
||||
total: number;
|
||||
}
|
||||
>;
|
||||
total_without_dressing: number;
|
||||
total_dressing: number;
|
||||
total_expense: number;
|
||||
without_budget_no_dressing: number;
|
||||
without_budget_dressing: number;
|
||||
without_budget_total: number;
|
||||
};
|
||||
|
||||
export type AnalysisColumn = {
|
||||
key: string;
|
||||
label: string;
|
||||
unit: string;
|
||||
};
|
||||
|
||||
export type AnalysisRow = {
|
||||
department: {
|
||||
id: number;
|
||||
name: string;
|
||||
profileName: string;
|
||||
};
|
||||
services: Record<
|
||||
string,
|
||||
{
|
||||
quantity: number;
|
||||
amount: number;
|
||||
}
|
||||
>;
|
||||
serviceTotals: {
|
||||
total_quantity: number;
|
||||
total_amount: number;
|
||||
};
|
||||
expense: {
|
||||
total_without_dressing: number;
|
||||
total_dressing: number;
|
||||
total_expense: number;
|
||||
without_budget_total: number;
|
||||
};
|
||||
};
|
||||
43
resources/js/types/teams.ts
Normal file
43
resources/js/types/teams.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
export type TeamRole = 'owner' | 'admin' | 'member';
|
||||
|
||||
export type Team = {
|
||||
id: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
isPersonal: boolean;
|
||||
role?: TeamRole;
|
||||
roleLabel?: string;
|
||||
isCurrent?: boolean;
|
||||
};
|
||||
|
||||
export type TeamMember = {
|
||||
id: number;
|
||||
name: string;
|
||||
email: string;
|
||||
avatar?: string | null;
|
||||
role: TeamRole;
|
||||
role_label: string;
|
||||
};
|
||||
|
||||
export type TeamInvitation = {
|
||||
code: string;
|
||||
email: string;
|
||||
role: TeamRole;
|
||||
role_label: string;
|
||||
created_at: string;
|
||||
};
|
||||
|
||||
export type TeamPermissions = {
|
||||
canUpdateTeam: boolean;
|
||||
canDeleteTeam: boolean;
|
||||
canAddMember: boolean;
|
||||
canUpdateMember: boolean;
|
||||
canRemoveMember: boolean;
|
||||
canCreateInvitation: boolean;
|
||||
canCancelInvitation: boolean;
|
||||
};
|
||||
|
||||
export type RoleOption = {
|
||||
value: TeamRole;
|
||||
label: string;
|
||||
};
|
||||
4
resources/js/types/ui.ts
Normal file
4
resources/js/types/ui.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export type Appearance = 'light' | 'dark' | 'system';
|
||||
export type ResolvedAppearance = 'light' | 'dark';
|
||||
|
||||
export type AppVariant = 'header' | 'sidebar';
|
||||
5
resources/js/types/vue-shims.d.ts
vendored
Normal file
5
resources/js/types/vue-shims.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue';
|
||||
const component: DefineComponent;
|
||||
export default component;
|
||||
}
|
||||
Reference in New Issue
Block a user