Skip to content
Snippets Groups Projects
new.js 853 B
Newer Older
wactbprot's avatar
wactbprot committed
function (doc, req) {
    // example url:
    // http://localhost:5984/vaclab_db/_design/e-share/_show/new
    // 
    
    var share = require("lib/share"),
    nd        = new Date(),
    ndoc = {
        Calibration:{
            Sign: req.query.sign || "99999_0001",
            Type: req.query.type || "NN",
            Year: "" + nd.getFullYear(),
            Standard: req.query.standard || "",
            Presettings:{
		Maintainer:req.query.maintainer || "",
		Date: [
		    {Value: share.vlDateString(nd),
		     Type: "generated"
		    }
		]
            },
            Measurement:{
                CalibrationObject:[{
		                       Type: "",
				       Sign: "",
				       Name: ""
				   }]
            }
        }
    };
    
    return  {
	"headers" : {"Content-Type" : "application/json"},
	"body" : toJSON(ndoc)
    };
};