openMF/mifosx — pull request #299 by lrozanski (2013-05-17 15:08:50+00:00)
Title: MIFOSX-40: Tenant Subscription

Added the ability to create new tenants by passing correct arguments to /tenants. After adding a new entry to `mifosplatform-tenants`.`tenants`, a new database is initialized and `flyway.migrate()` is called.

A new permission (`Tenant`) under the Authorisation tab has been added.

Example API call:

var tenantObject = new Object();
tenantObject.identifier = "new";
tenantObject.name = "New Tenant";
tenantObject.schemaName = "mifostenant-new";
tenantObject.timezoneId = "Asia/Kolkata";
tenantObject.countryId = null;
tenantObject.joinedDate = null;
tenantObject.createdDate = null;
tenantObject.lastmodifiedDate = null;
tenantObject.schemaServer = "localhost";
tenantObject.schemaServerPort = "3306";
tenantObject.schemaUsername = "root";
tenantObject.schemaPassword = "mysql";
tenantObject.autoUpdate = 1;

var tenantObjectStr = JSON.stringify(tenantObject);

executeAjaxRequest("tenants", "POST", tenantObjectStr, successFunction, failureFunction);