add push notification subscription model

This commit is contained in:
Ivan Socolsky 2017-02-02 15:17:27 -03:00
parent 7096157bdb
commit 62de18b8ab
No known key found for this signature in database
GPG Key ID: FAECE6A05FAA4F56
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
'use strict';
function PushNotificationSub() {};
PushNotificationSub.create = function(opts) {
opts = opts || {};
var x = new PushNotificationSub();
x.version = '1.0.0';
x.createdOn = Math.floor(Date.now() / 1000);
x.copayerId = opts.copayerId;
x.token = opts.token;
x.packageName = opts.packageName;
x.platform = opts.platform;
return x;
};
PushNotificationSub.fromObj = function(obj) {
var x = new PushNotificationSub();
x.version = obj.version;
x.createdOn = obj.createdOn;
x.copayerId = obj.copayerId;
x.token = obj.token;
x.packageName = obj.packageName;
x.platform = obj.platform;
return x;
};
module.exports = PushNotificationSub;