KuyoDynamics / SILCServer

API for SILC/Village Banking Applications written in nodejs
MIT License
2 stars 1 forks source link

Add Membership Schema to the SILC Group Model #12

Closed chaiwa-berian closed 5 years ago

chaiwa-berian commented 5 years ago

This will allow members to belong to more than one group and at the same time be able to opt-in or out of the groups. When a member leaves the group, their status can be set to left, dead, deactivated due to subscription credits expiring. Below is an example of a membership schema which can be embedded as a collection of objects within the SILC Group Schema:

{
   _id: ObjectId,
   date_joined_group: String,
   status: { 
                type: String,
                enum: ['active', 'left', 'deactivated']
             },
  date_of_leaving: String,
  reason_for_leaving: {type: String, enum:['end_of_cycle','subscription_expired','group_misconduct','voluntary','died'],
  silc_group_member: {type: ObjectId, ref: 'SILCGroupMember'}
}
chaiwa-berian commented 5 years ago

I am working on this issue this weekend.