Skip to content

Commit

Permalink
Merge pull request #131 from openimis/develop
Browse files Browse the repository at this point in the history
MERGING develop into release/24.04
  • Loading branch information
delcroip authored Mar 28, 2024
2 parents 8db5af3 + 98be174 commit cec402f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/components/InsureeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,35 @@ const INSUREE_INSUREE_FORM_CONTRIBUTION_KEY = "insuree.InsureeForm";
class InsureeForm extends Component {
constructor(props) {
super(props);
this.isWorker = props.modulesManager.getConf("fe-core", "isWorker", DEFAULT.IS_WORKER);
this.state = {
lockNew: false,
reset: 0,
insuree: this._newInsuree(),
newInsuree: true,
isSaved: false,
};
this.isWorker = props.modulesManager.getConf("fe-core", "isWorker", DEFAULT.IS_WORKER);
}

_newInsuree() {
let insuree = {};

// NOTE: This is a placeholder data for the worker entity,
// as the worker itself does not have the same fields as the insuree.
if (this.isWorker) {
const dateOfBirthPlaceholder = "2000-01-01";
const genderCodePlaceholder = "O";

const insureeWithPlaceholderData = {
dob: dateOfBirthPlaceholder,
gender: {
code: genderCodePlaceholder,
},
};

insuree = { ...insuree, ...insureeWithPlaceholderData };
}

insuree.jsonExt = {};
insuree.status = INSUREE_ACTIVE_STRING;
insuree.statusReason = null;
Expand Down

0 comments on commit cec402f

Please sign in to comment.