Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add internal hook points support with scripting capabilities #349

Closed
syjer opened this issue Oct 4, 2017 · 4 comments
Closed

add internal hook points support with scripting capabilities #349

syjer opened this issue Oct 4, 2017 · 4 comments
Assignees
Milestone

Comments

@syjer
Copy link
Member

syjer commented Oct 4, 2017

for example:

  • when a ticket is bought, execute a script (javascript) that will do a http post to remote interface.
  • expose a generic web hook end point for handling incoming requests with a user defined script -> will be done in another task
@syjer syjer self-assigned this Oct 4, 2017
syjer added a commit that referenced this issue Dec 28, 2017
@syjer
Copy link
Member Author

syjer commented Jan 2, 2018

TODO:

  • wire up the events + script execution for async and sync use case (+ provide logging and rest template)
  • add fk&pk&unique constraints
  • add schema for mysql and pgsql
  • edit script: handle rename and path change, currently it will create a new script :D
  • add samples scripts (e.g. making a http call to a rest end point for fetching the invoice number)
  • add and wire up the following events: RESERVATION_CANCELLED, RESERVATION_EXPIRED: see who call ticketReservationRepository.remove
  • add EVENT_CREATED hook point :)
  • display error when trying to save invalid scripts
  • refine the admin ui
  • log errors somewhere -> check log table for plugins: -> show log in ui, add possibility to clean up?
  • add parameters like the plugin system (see plugin_configuration table + MailChimpPlugin.getConfigOptions
  • add mailchimp js script, add migration script
  • remove all the previous plugin infrastructure

syjer added a commit that referenced this issue Jan 3, 2018
syjer added a commit that referenced this issue Jan 3, 2018
syjer added a commit that referenced this issue Jan 3, 2018
syjer added a commit that referenced this issue Jan 3, 2018
syjer added a commit that referenced this issue Jan 3, 2018
syjer added a commit that referenced this issue Jan 4, 2018
syjer added a commit that referenced this issue Jan 4, 2018
@syjer
Copy link
Member Author

syjer commented Jan 4, 2018

sample scripts

function getScriptMetadata() {
  return {async:true, events: ['RESERVATION_CONFIRMATION']};
}

function executeScript(scriptEvent) {
    log.warn('hello from script with event: ' + scriptEvent);
}
function getScriptMetadata() {
    return {async:false, events: ['INVOICE_GENERATION']};
}

function executeScript(scriptEvent) {
    return {invoiceNumber: '42'};
}
function getScriptMetadata() {
    return {async:false, events: ['INVOICE_GENERATION']};
}

function executeScript(scriptEvent) {
    var symbol = restTemplate.getForObject('https://api.coinmarketcap.com/v1/ticker/bitcoin/', Java.type('java.util.ArrayList').class)[0].symbol;
    return {invoiceNumber: symbol};
}

syjer added a commit that referenced this issue Jan 4, 2018
cbellone added a commit that referenced this issue Jan 4, 2018
syjer added a commit that referenced this issue Jan 5, 2018
syjer added a commit that referenced this issue Jan 5, 2018
syjer added a commit that referenced this issue Jan 5, 2018
cbellone added a commit that referenced this issue Jan 5, 2018
cbellone added a commit that referenced this issue Jan 5, 2018
cbellone added a commit that referenced this issue Jan 5, 2018
cbellone added a commit that referenced this issue Jan 5, 2018
syjer added a commit that referenced this issue Jan 5, 2018
cbellone added a commit that referenced this issue Jan 6, 2018
cbellone added a commit that referenced this issue Mar 18, 2018
cbellone added a commit that referenced this issue Mar 18, 2018
(cherry picked from commit e257227)
cbellone added a commit that referenced this issue Mar 18, 2018
syjer added a commit that referenced this issue Mar 20, 2018
syjer added a commit that referenced this issue Mar 22, 2018
cbellone added a commit that referenced this issue Mar 25, 2018
cbellone pushed a commit that referenced this issue Mar 26, 2018
cbellone pushed a commit that referenced this issue Mar 26, 2018
cbellone pushed a commit that referenced this issue Mar 26, 2018
cbellone pushed a commit that referenced this issue Mar 26, 2018
(cherry picked from commit 69ea346)
cbellone pushed a commit that referenced this issue Mar 26, 2018
(cherry picked from commit 3cfe7ee)
cbellone pushed a commit that referenced this issue Mar 26, 2018
cbellone pushed a commit that referenced this issue Mar 26, 2018
cbellone added a commit that referenced this issue Mar 26, 2018
(cherry picked from commit c1afac5)
@syjer syjer changed the title add webhook + internal hook points support with scripting capabilities add internal hook points support with scripting capabilities Mar 26, 2018
syjer added a commit that referenced this issue Mar 26, 2018
syjer added a commit that referenced this issue Mar 26, 2018
@syjer
Copy link
Member Author

syjer commented Mar 26, 2018

can be finally considered done...

@syjer syjer closed this as completed Mar 26, 2018
syjer added a commit that referenced this issue Mar 26, 2018
syjer added a commit that referenced this issue Mar 26, 2018
syjer added a commit that referenced this issue Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants