Real-Dev-Squad / notification-service

MIT License
0 stars 1 forks source link

Create Data model #11

Open vikhyat187 opened 1 year ago

prakashchoudhary07 commented 1 year ago

DATA MODEL

NOTIFICATION MODEL

{
    id: string,
    type: ['EMAIL', 'SMS', 'WHATSAPP', 'PUSH', 'MOBILE'],
    userId: string,
    message: string,
    createAt: timestamp,
    prority: ['HIGH', 'MEDIUM', 'LOW'],
    ownerId: string,
    sendingService: string, // Service which will call this, not sure if it's required
}

NOTIFICATION SCHEDULE

{
    notificationID: string,
    sendAt: timeStamp,
}

NOTIFICATION STATUS

{
    notificationID: string,
    status: ['SENT', 'PENDING', 'FAILED'],
    createdAt: timeStamp,
    error: {} //'reason if failed'
}

// FOR LATER

TEMPLATE MODEL

{
    id: string,
    name: string,
    message: 'HELLO ${name}, '
    params: [{
      name: 'Username',
      placeHolder: 'name'
    },],
}
vikhyat187 commented 1 year ago

Looks nice, thanks @prakashchoudhary07