export default class UserTransactionsModel
{
    amount = "";
    currency = "";
    tipMessage = "";
    created = "";


    static createFromApiResult(apiResult){
        const userTransactionModel = Object.assign(new UserTransactionsModel(), apiResult)

        const date = new Date(userTransactionModel.created);
        const options = {
            year: 'numeric',
            month: 'long',
            day: 'numeric',
            timeZone: 'America/Montreal'
        };
        userTransactionModel.created = new Intl.DateTimeFormat('fr-CA', options).format(date);

        return userTransactionModel;
    }
}