0.0.123 • Published 7 years ago

ticket-boy v0.0.123

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

Ticket-Boy(ticket-boy)

A package I use for creating time based tickets and subscriptions. Now you no longer need to kill time for creating code based on time based ticketing. I built this to use for a hotel management systems, which has a lot of checkin's and checkouts different dates, days years and stuff and we need to check if a user's time is expired(prepaid style hotels) for what he paid for.

Usage

To get started start with the following code:

var ticketBoy = require("ticket-boy").TicketBoy();
var testObj = {};

// This is an absolute requirement. 
// You can skip mongoose.connect incase you do this.
ticketBoy.config({
    mongoUrl: "mongodb://localhost/shopDB"
});

var someTimeAgo = new Date();
someTimeAgo.setFullYear(2013);

var someTimeLater = new Date();
someTimeLater.setFullYear(2019);

// ticketBoy.createTicket([tag], start, end, [object])
ticketBoy.createTicket(null, someTimeAgo, someTimeLater)
.then((obj) => {
 	testObj = obj;
	console.log(JSON.stringify(obj));
	
 	// ticketBoy.findAll(tag)
 	ticketBoy.findAll(testObj.__tag__)
 	.then((obj) => {
 		obj.forEach((o) => {
 		    console.log("Found Object: " + o.id);
 		});
 	})
 	.catch(err => {
 	    console.log(err)
 	});

})
.catch(err => {
    console.log(err);
});

Functions

TicketBoy.prototype.config

0.0.123

7 years ago

0.0.122

7 years ago

0.0.121

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.1

7 years ago