# ticket-boy

> A booking system that expires subscriptions with in a given time.

Latest version **0.0.123** (published 2017-04-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install ticket-boy
pnpm add ticket-boy
yarn add ticket-boy
bun add ticket-boy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.123 |
| Published | 2017-04-01 |
| First published | 2017-03-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Ramachandra jr |
| Maintainers | ramachandrajr |

## Links

- npm: https://www.npmjs.com/package/ticket-boy
- Repository: https://github.com/ramachandrajr/ticket-boy
- Homepage: https://github.com/ramachandrajr/ticket-boy#readme
- Issues: https://github.com/ramachandrajr/ticket-boy/issues
- npm.io page: https://npm.io/package/ticket-boy

## Dependencies (1)

- [mongoose](https://npm.io/package/mongoose.md) ^4.9.1

## Recent versions

- 0.0.123 (latest) — 2017-04-01
- 0.0.122 — 2017-04-01
- 0.0.121 — 2017-03-30
- 0.0.12 — 2017-03-30
- 0.0.11 — 2017-03-28
- 0.0.1 — 2017-03-27

## README

# 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:

``` javascript
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

---
_Source: https://npm.io/package/ticket-boy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
