var ObjectId = require('mongodb').ObjectId;
var Hashids = require("hashids");
var moment = require("moment");

module.exports = function(moduleId) {


    var salt = new ObjectId().toString();

    var hashids = new Hashids(salt, 8, "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");
    var now = moment();
    var begin = now.clone().startOf("month");
    var diff = now.diff(begin);
    var code = `${hashids.encode(diff)}/${moduleId}/${now.format("MM/YYYY")}`;

    return code;
}
@@ -134,22 +134,20 @@
 ion(
-moduleId
+context
 ) %7B%0A%0A
-%0A
     
@@ -156,16 +156,36 @@
 r salt =
+ context ? context :
  new Obj
@@ -204,17 +204,16 @@
 ring();%0A
-%0A
     var 
@@ -258,17 +258,16 @@
 GHIJKLMN
-O
 PQRSTUVW
@@ -282,9 +282,8 @@
 6789
-0
 %22);%0A
@@ -427,49 +427,11 @@
 ff)%7D
-/$%7BmoduleId%7D/$%7Bnow.format(%22MM/YYYY%22)%7D
 %60;%0A
-%0A
     

update code generator