const ZContract = {
    create : function( p )
    {
        Object.assign( this, p.getAll() );
    },

    isValid : function()
    {
        return moment().isBetween( this.valid_from, this.valid_to );
        /*
        let mNow = moment(),
            mFrom = moment( this.valid_from, 'YYYY-MM-DD' ),
            mTo = moment( this.valid_to, 'YYYY-MM-DD' );

        return ( mNow.isAfter( mFrom ) && mNow.isBefore( mTo ) );

         */
    },

    destroy : function()
    {

    }
};

export { ZContract };