Add subtask model and repository, implement webhook notification handling
fix Issue with Scheduler Support NotificationPlatformWebhook
This commit is contained in:
parent
41be361463
commit
8db572f1ec
13 changed files with 337 additions and 38 deletions
|
@ -28,7 +28,8 @@ const (
|
|||
// EventTypeTaskCreated EventType = "task.created"
|
||||
EventTypeTaskReminder EventType = "task.reminder"
|
||||
// EventTypeTaskUpdated EventType = "task.updated"
|
||||
EventTypeTaskCompleted EventType = "task.completed"
|
||||
EventTypeTaskCompleted EventType = "task.completed"
|
||||
EventTypeSubTaskCompleted EventType = "subtask.completed"
|
||||
// EventTypeTaskReassigned EventType = "task.reassigned"
|
||||
EventTypeTaskSkipped EventType = "task.skipped"
|
||||
EventTypeThingChanged EventType = "thing.changed"
|
||||
|
@ -172,3 +173,16 @@ func (p *EventsProducer) ThingsUpdated(ctx context.Context, url string, data int
|
|||
Data: data,
|
||||
})
|
||||
}
|
||||
|
||||
func (p *EventsProducer) SubtaskUpdated(ctx context.Context, url *string, data interface{}) {
|
||||
if url == nil {
|
||||
p.logger.Debug("No subscribers for circle, skipping webhook")
|
||||
return
|
||||
}
|
||||
p.publishEvent(Event{
|
||||
URL: *url,
|
||||
Type: EventTypeSubTaskCompleted,
|
||||
Timestamp: time.Now(),
|
||||
Data: data,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue