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 class Expense {
    id: number;
    timesheet_id: number;
    date: string;    //YYYY-MM-DD
    type: ExpenseType;
    amount: number;
    mileage?: number;
    comment: string;
    supervisor_comment?: string;
    is_approved: boolean;

    constructor(date: string) {
        this.id = -1;
        this.timesheet_id = -1;
        this.date = date;
        this.type = 'EXPENSES';
        this.amount = 0;
        this.comment = '';
        this.is_approved = false;
    };
};