mangopay4-nodejs-sdk
Version:
Mangopay Node.js SDK
58 lines (50 loc) • 1.75 kB
JavaScript
const _ = require('underscore');
const PersonType = require('./PersonType');
const User = require('./User');
const Address = require('./Address');
const PendingUserAction = require('./PendingUserAction');
const LegalRepresentative = require('./LegalRepresentative');
const UserLegalSca = User.extend({
defaults: _.extend({}, User.prototype.defaults, {
Name: null,
LegalPersonType: null,
LegalRepresentative: null,
ProofOfRegistration: null,
ShareholderDeclaration: null,
Statute: null,
CompanyNumber: null,
PendingUserAction: null,
HeadquartersAddress: null,
LegalRepresentativeAddress: null,
ScaContext: null,
ProfilingAttemptReference: null
}),
initialize: function() {
User.prototype.initialize.apply(this, arguments);
this.setPersonType(PersonType.Legal);
},
/**
* Get object with key as object type and value the object class
* @return {Object} Mapping of sub-objects
*/
getSubObjects: function() {
const subObjects = User.prototype.getSubObjects();
return _.extend({}, subObjects, {
Address: Address,
HeadquarterAddress: Address,
LegalRepresentativeAddress: Address,
PendingUserAction: PendingUserAction,
LegalRepresentative: LegalRepresentative
});
},
/**
* Get array with read-only properties
* @return {Array}
*/
getReadOnlyProperties: function() {
const properties = User.prototype.getReadOnlyProperties();
properties.push('Statute', 'ProofOfRegistration', 'ShareholderDeclaration');
return properties;
}
});
module.exports = UserLegalSca;