Change timesheet UI to better fit current app model and avoid adding extra clicks and interactions to add new shifts and expenses. Also refactoring calls to backend to be more efficient and use recently-finalized OIDC implementation and integration.
48 lines
1.1 KiB
TypeScript
48 lines
1.1 KiB
TypeScript
export type ExpenseType = 'PER_DIEM' | 'MILEAGE' | 'EXPENSES' | 'ON_CALL';
|
|
|
|
export const EXPENSE_TYPE: ExpenseType[] = ['PER_DIEM', 'MILEAGE', 'EXPENSES', 'ON_CALL',];
|
|
export const TYPES_WITH_MILEAGE_ONLY: Readonly<ExpenseType[]> = ['MILEAGE'];
|
|
export const TYPES_WITH_AMOUNT_ONLY: Readonly<ExpenseType[]> = ['PER_DIEM', 'EXPENSES', 'ON_CALL',];
|
|
|
|
export interface Expense {
|
|
id: number;
|
|
date: string; //YYYY-MM-DD
|
|
type: ExpenseType;
|
|
amount: number;
|
|
mileage?: number;
|
|
comment: string;
|
|
supervisor_comment?: string;
|
|
is_approved: boolean;
|
|
};
|
|
|
|
export const empty_expense: Expense = {
|
|
id: -1,
|
|
date: '',
|
|
type: 'EXPENSES',
|
|
amount: 0,
|
|
comment: '',
|
|
is_approved: false,
|
|
};
|
|
|
|
export const test_expenses: Expense[] = [
|
|
{
|
|
id: 201,
|
|
date: '2025-01-06',
|
|
type: 'EXPENSES',
|
|
amount: 15.5,
|
|
comment: 'Lunch receipt',
|
|
is_approved: false,
|
|
},
|
|
{
|
|
id: 202,
|
|
date: '2025-01-07',
|
|
type: 'MILEAGE',
|
|
amount: 0,
|
|
mileage: 32.4,
|
|
comment: 'Travel to client site',
|
|
is_approved: true,
|
|
},
|
|
];
|
|
|
|
|