targo-frontend/src/modules/timesheets/models/expense.models.ts

40 lines
1.1 KiB
TypeScript

export type ExpenseType = 'PER_DIEM' | 'MILEAGE' | 'EXPENSES' | 'ON_CALL' | undefined;
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 class Expense {
id: number;
timesheet_id: number;
date: string; //YYYY-MM-DD
type: ExpenseType;
amount?: number | null;
mileage?: number | null;
attachment_name?: string;
attachment_key?: string;
comment: string;
supervisor_comment?: string;
is_approved: boolean;
constructor(date: string) {
this.id = -1;
this.timesheet_id = -1;
this.date = date;
this.type = undefined;
this.amount = 0;
this.comment = '';
this.is_approved = false;
};
};
export interface ExpenseOption {
label: string;
value: ExpenseType;
icon: string;
}
export interface AttachmentPresignedURLResponse {
url: string;
key: string;
}