Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

we-plugin-ticket

npm version Build Status Coverage Status

We.js tickets plugin, add user tickets from events, courses ...",

Add SDK to process related to generate and valid event tickets

Routes to:

  • Download ticket
  • Edit ticket fullName
  • Find and findOne user ticket with suport to owner permission
  • Ticket QRCode with restricted url to ticket data

URLs

See in: plugin.js

SDK

var ticketAPI = we.plugins['we-plugin-ticket'].api;
// Example data
var data = {
  title: 'NodeConf BR', // required
  typeName: 'Primeiro lote',
  typeIdentifier: 'ev-1-t1', // required, any string to idenfity this ticket
  date: new Date(), // required || event, course, date for the thing how will happend
  // The user how will use it, is printed, owner can change
  fullName: 'Afro Samuray',
  ownerId: 1,
  location: 'Rio de Janeiro, deus me livre, rua X numero 20' // event location
  eventUrl: '', // (optional)
};

// - Create new ticket to user 1
ticketAPI.createTicket(data, function (err, salvedTicket) {
  console.log('createTicket:', err, salvedTicket.id);

  // Valid the ticket
  ticketAPI.validTicket(salvedTicket.id, function (err, record) {
    console.log('validTicket:', err, record.id);

  });

  // check in
  ticketAPI.checkIn(salvedTicket.id, actorId function (err, record) {
    console.log('checkIn:', err, record.id);
  });

  // Set ticket status to used, all done (optional), 
  // use this action to close one ticket after user leaves the event if it cant returns
  ticketAPI.useTicket(salvedTicket.id, actorId,function (err, record) {
    console.log('useTicket:', err, record.id);
  });
});

Links

NPM Info:

NPM

License

Under the MIT license

About

Plugin to add all process related to generate and valid event tickets

Resources

Releases

No releases published

Packages

No packages published