<?php
/**
 * @package    Proxim
 * @author     Davison Pro <davisonpro.coder@gmail.com | https://davisonpro.dev>
 * @copyright  2019 Proxim
 * @version    1.0.0
 * @since      File available since Release 1.0.0
 */

namespace Proxim;

class Payment extends ObjectModel {
    public $reference;
    public $currency_id;
    public $amount;
    public $payment_method;
    public $conversion_rate;
    public $transaction_id;
    public $date_add;

    /**
     * @see ObjectModel::$definition
     */
    public static $definition = array(
        'table' => 'payment',
        'primary' => 'payment_id',
        'fields' => array(
            'reference_type' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 10),
            'reference' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 9),
            'currency_id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
            'amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isNegativePrice', 'required' => true),
            'payment_method' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
            'conversion_rate' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
            'transaction_id' => array('type' => self::TYPE_STRING, 'validate' => 'isAnything', 'size' => 254),
            'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
        ),
    );
}