rosettapebble

db-schema-transactional

Aug 3rd, 2021
670
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ////plans/////
  2. ///// plan 1 -> 100msgs/ month, 50 hrs/ month, 100 MB data/day for a month -> 100Rs -> all three have same expiry
  3. ////plans/////
  4. {
  5.     id: 1
  6.     price: 100
  7.     balance: 0
  8.     calls: {
  9.         quota: 50hrs//time duration
  10.         dailyLimit: 2hrs// time
  11.     }
  12.     messages: {
  13.         quota: 100 // number of msgs
  14.         dailyLimit: 20 // number   
  15.     }
  16.     data:  {
  17.         quota: 100*28  MB// number of msgs
  18.         dailyLimit: 100 MB // number   
  19.     }
  20.     OTT:  {
  21.         quota: //number of days
  22.     }
  23.     validity: 1 month //timestamp
  24.     rate: {
  25.         calls:
  26.         messages:
  27.         data:
  28.     }
  29. }
  30. ///Assumptions:::
  31. //1. One plan at a time
  32. //2. Multiple services in one plan
  33. ////////////// subscription //////////////
  34. {
  35.     userid: String,
  36.     plan: //plan id
  37.     balance: //
  38.     msg: {
  39.         available: //number of msgs
  40.         consumedMessages:
  41.     },
  42.     call: {
  43.         available: //time duration
  44.         consumedSeconds: 100
  45.     },
  46.     data: {
  47.         available: //data in MB/GB
  48.         consumedData: //in KB
  49.     },
  50.     OTT: {
  51.         available: //
  52.         consumedHours: //
  53.     }
  54.     activatedOn: //timestamp
  55. }
  56. /////// max available calls, msgs and data
  57. //////transactional data////////
  58. {
  59.     userid: 1
  60.     consumed: {
  61.         calls: 2hr
  62.         messages:
  63.         data:
  64.         ott:
  65.     }
  66.     timestamp:
  67. }
RAW Paste Data