New Docs (#195)
New docs for TPOS and Events, and a fix in Events extension! Co-authored-by: Tiago Vasconcelos <tvasconcelos@gmail.com>
This commit is contained in:
co-authored by
Tiago Vasconcelos
parent
b06e1c8fa9
commit
ebf3dfd076
@@ -1,3 +1,33 @@
|
||||
<h1>Events</h1>
|
||||
<h2>Events: Sell and register event tickets</h2>
|
||||
Events alows you to make a wave of tickets for an event, each ticket is in the form of a unqiue QRcode, which the user presents at registration. Events comes with a shareable ticket scanner, which can be used to register attendees.
|
||||
# Events
|
||||
|
||||
## Sell tickets for events and use the built-in scanner for registering attendants
|
||||
|
||||
Events alows you to make tickets for an event. Each ticket is in the form of a uniqque QR code. After registering, and paying for ticket, the user gets a QR code to present at registration/entrance.
|
||||
|
||||
Events includes a shareable ticket scanner, which can be used to register attendees.
|
||||
|
||||
## Usage
|
||||
|
||||
1. Create an event\
|
||||

|
||||
2. Fill out the event information:
|
||||
|
||||
- event name
|
||||
- wallet (normally there's only one)
|
||||
- event information
|
||||
- closing date for event registration
|
||||
- begin and end date of the event
|
||||
|
||||

|
||||
|
||||
3. Share the event registration link\
|
||||

|
||||
|
||||
- ticket example\
|
||||

|
||||
|
||||
- QR code ticket, presented after invoice paid, to present at registration\
|
||||

|
||||
|
||||
4. Use the built-in ticket scanner to validate registered, and paid, attendees\
|
||||

|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<script>
|
||||
Vue.component(VueQrcode.name, VueQrcode)
|
||||
Vue.use(VueQrcodeReader)
|
||||
var mapEvents = function (obj) {
|
||||
var mapEvents = function(obj) {
|
||||
obj.date = Quasar.utils.date.formatDate(
|
||||
new Date(obj.time * 1000),
|
||||
'YYYY-MM-DD HH:mm'
|
||||
@@ -94,7 +94,7 @@
|
||||
new Vue({
|
||||
el: '#vue',
|
||||
mixins: [windowMixin],
|
||||
data: function () {
|
||||
data: function() {
|
||||
return {
|
||||
tickets: [],
|
||||
ticketsTable: {
|
||||
@@ -119,35 +119,35 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hoverEmail: function (tmp) {
|
||||
hoverEmail: function(tmp) {
|
||||
this.tickets.data.emailtemp = tmp
|
||||
},
|
||||
closeCamera: function () {
|
||||
closeCamera: function() {
|
||||
this.sendCamera.show = false
|
||||
},
|
||||
showCamera: function () {
|
||||
showCamera: function() {
|
||||
this.sendCamera.show = true
|
||||
},
|
||||
decodeQR: function (res) {
|
||||
decodeQR: function(res) {
|
||||
this.sendCamera.show = false
|
||||
var self = this
|
||||
|
||||
LNbits.api
|
||||
.request('GET', '/events/api/v1/register/ticket/' + res)
|
||||
.then(function (response) {
|
||||
.then(function(response) {
|
||||
self.$q.notify({
|
||||
type: 'positive',
|
||||
message: 'Registered!'
|
||||
})
|
||||
setTimeout(function () {
|
||||
setTimeout(function() {
|
||||
window.location.reload()
|
||||
}, 2000)
|
||||
})
|
||||
.catch(function (error) {
|
||||
.catch(function(error) {
|
||||
LNbits.utils.notifyApiError(error)
|
||||
})
|
||||
},
|
||||
getEventTickets: function () {
|
||||
getEventTickets: function() {
|
||||
var self = this
|
||||
console.log('obj')
|
||||
LNbits.api
|
||||
@@ -155,17 +155,17 @@
|
||||
'GET',
|
||||
'/events/api/v1/eventtickets/{{ wallet_id }}/{{ event_id }}'
|
||||
)
|
||||
.then(function (response) {
|
||||
self.tickets = response.data.map(function (obj) {
|
||||
.then(function(response) {
|
||||
self.tickets = response.data.map(function(obj) {
|
||||
return mapEvents(obj)
|
||||
})
|
||||
})
|
||||
.catch(function (error) {
|
||||
.catch(function(error) {
|
||||
LNbits.utils.notifyApiError(error)
|
||||
})
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
created: function() {
|
||||
this.getEventTickets()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -195,6 +195,9 @@ async def api_event_register_ticket(ticket_id):
|
||||
if not ticket:
|
||||
return jsonify({"message": "Ticket does not exist."}), HTTPStatus.FORBIDDEN
|
||||
|
||||
if not ticket.paid:
|
||||
return jsonify({"message": "Ticket not paid for."}), HTTPStatus.FORBIDDEN
|
||||
|
||||
if ticket.registered == True:
|
||||
return jsonify({"message": "Ticket already registered"}), HTTPStatus.FORBIDDEN
|
||||
|
||||
|
||||
Reference in New Issue
Block a user