diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm index 6526774d7..88cd3b089 100644 --- a/api-docs/apiLive.htm +++ b/api-docs/apiLive.htm @@ -11765,14 +11765,77 @@ Request Body:

Allows you to model staff members. At present the key role of significance is whether this staff member is a loan officer or not.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Field Descriptions
firstname
First Name of the new Employee.
lastname
Last Name of the new Employee. +
externalId
ID to put an external reference for an Employee.
mobileNo
Mobile number of an Employee. +
isLoanOfficer
Indicates whether the employee account is to be created as Loan Officer. If isLoanOfficer=true, then the employee is Loan Officer. If isLoanOfficer=false, then the employee is + not Loan Officer. +
isActive
Indicates whether the employee account is to be created as Active. If isActive=true, then employee is active. If isActive=false, then employee is inactive.
+  

Create a staff member

Creates a staff member.

+ + + + + + + +
Mandatory Fields
officeId, firstname, lastname
+
+ + + + + + + +
Optional Fields
isLoanOfficer, isActive
@@ -11788,7 +11851,8 @@ Request Body: "lastname": "Doe", "isLoanOfficer": "true", "externalId": "17H", - "mobileNo": "+353851239876" + "mobileNo": "+353851239876", + "isActive": "true" } diff --git a/mifosng-db/migrations/core_db/V137__added_is_active_column_in_m_staff.sql b/mifosng-db/migrations/core_db/V137__added_is_active_column_in_m_staff.sql new file mode 100644 index 000000000..2726e0874 --- /dev/null +++ b/mifosng-db/migrations/core_db/V137__added_is_active_column_in_m_staff.sql @@ -0,0 +1 @@ +ALTER TABLE `m_staff` ADD COLUMN `is_active` TINYINT(1) DEFAULT '0' AFTER `organisational_role_parent_staff_id`; \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/organisation/staff/domain/Staff.java b/mifosng-provider/src/main/java/org/mifosplatform/organisation/staff/domain/Staff.java index 85d1702e2..9085df388 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/organisation/staff/domain/Staff.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/organisation/staff/domain/Staff.java @@ -87,14 +87,14 @@ public class Staff extends AbstractPersistable { } private Staff(final Office staffOffice, final String firstname, final String lastname, final String externalId, final String mobileNo, - final boolean isLoanOfficer, final boolean isActive) { + final boolean isLoanOfficer, final Boolean isActive) { this.office = staffOffice; this.firstname = StringUtils.defaultIfEmpty(firstname, null); this.lastname = StringUtils.defaultIfEmpty(lastname, null); this.externalId = StringUtils.defaultIfEmpty(externalId, null); this.mobileNo = StringUtils.defaultIfEmpty(mobileNo, null); this.loanOfficer = isLoanOfficer; - this.active = isActive; + this.active = (isActive == null) ? false : isActive; deriveDisplayName(firstname); }