PostalAddress.js 1.13 KB
/* global console */
define(
    [
        'ofbiz/model/Base',
        'ofbiz/model/ContactMech',
    ],
    function(
        Base,
        ContactMech
    ) {
        'use strict';
        console.log('ofbiz/model/PostalAddress: loaded');
        return ContactMech.extend({
            defaults: {
                address1: null,
                city: null,
                postalCode: null,
            },
            validation: {
                address1: [
                    {
                        required: Base.createRequiredValidator('ofbiz/model/PostalAddress.address1'),
                        maxLength: 255
                    }
                ],
                city: [
                    {
                        required: Base.createRequiredValidator('ofbiz/model/PostalAddress.city'),
                        maxLength: 100
                    }
                ],
                postalCode: [
                    {
                        required: Base.createRequiredValidator('ofbiz/model/PostalAddress.postalCode'),
                        maxLength: 5
                    }
                ],
            }
        });
    }
);