Profile complete flow

Users are created with the (Incomplete) status (profileCompleted == false) by default.

An incomplete profile is a profile in which the fields are not filled in that are inserted and selected in the Business Settings: (Business -> select business -> Edit -> Profile settings) (Full profile settings - check the fields you need to fill in to mark the profile as Completed), to which this user is attached.

After editing or creating a user, the onUserProfileUpdateEvent or onUserProfileCreateEvent events are thrown, respectively, in which the fields are checked and the UserManager :: checkProfile method is called, where it is actually checked whether the profile is filled in accordance with the Business Settings.


If missed_fields or missed_custom_fields exist

The check is performed in comparison with the fields entered by the user during registration or editing and with the fields from the master_profile_incomplete_settings tables (variable $missed_fields) and master_custom_fields_per_user table (variable $missed_custom_fields), which are set in the Business Settings.

There is also a check for the presence of UserNote (from the master_user_notes tables) with the incomplete status for this user. This field displays messages on the POS with various information (such as list of empty field).

If there are empty fields, a record is created in UserNote (in the master_user_notes table) with a list of those fields that are necessary for the complete filling of the profile - so that the profile becomes Completed. Also, if there is any UserNote, then the check returns null (aborted).

An entry is also created in the actions_log table with a description of this event.

After the event is called, the UserProfileIncompleteEvent is created in the CampaignManager class, that set AnalyticEvents::PROFILE_STATUS (32)

 


If all fields are filled

If all the fields are normal and there are no empty fields, in accordance with the Business Settings, then bonuses (Reward_points_model->add_points_to_user) for the completed profile will be credited. The number of bonuses is taken from the business_analytics_events table, which are set in the Business Settings.

After that, the status is set to Completed and the status for UserNote changes to completed.

After the event is called, the UserProfileCompleteEvent is created in the CampaignManager class, that set AnalyticEvents::PROFILE_STATUS (32)


But this process takes place only once - if the profile has already received the Completed status, then there will be no checks on the next round, even if information from some required field from the Business Settings is removed from the profile (during editing)