Initial commit - SOGOMS v1.0.0
- sogoctl: supervisor avec health checks et restart auto - sogoway: gateway HTTP, auth JWT, routing par hostname - sogoms-db: microservice MariaDB avec pool par application - Protocol IPC Unix socket JSON length-prefixed - Config YAML multi-application (prokov) - Deploy script pour container Alpine gw3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
135
config/scenarios/prokov/tasks/create.yaml
Normal file
135
config/scenarios/prokov/tasks/create.yaml
Normal file
@@ -0,0 +1,135 @@
|
||||
# Scénario: Créer une tâche
|
||||
name: tasks_create
|
||||
version: "1.0"
|
||||
description: Crée une nouvelle tâche
|
||||
|
||||
input:
|
||||
required:
|
||||
- project_id
|
||||
- status_id
|
||||
- title
|
||||
optional:
|
||||
- description
|
||||
- priority
|
||||
- date_start
|
||||
- date_end
|
||||
- time_estimated
|
||||
- time_spent
|
||||
- billing
|
||||
- position
|
||||
- tags
|
||||
defaults:
|
||||
priority: 5
|
||||
time_estimated: 0
|
||||
time_spent: 0
|
||||
billing: 0
|
||||
position: 0
|
||||
validation:
|
||||
project_id:
|
||||
type: int
|
||||
status_id:
|
||||
type: int
|
||||
title:
|
||||
type: string
|
||||
min_length: 1
|
||||
max_length: 255
|
||||
description:
|
||||
type: string
|
||||
max_length: 65535
|
||||
priority:
|
||||
type: int
|
||||
date_start:
|
||||
type: string
|
||||
format: date
|
||||
date_end:
|
||||
type: string
|
||||
format: date
|
||||
|
||||
steps:
|
||||
- id: check_project
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT id FROM projects WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.project_id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Projet invalide"
|
||||
error_status: 422
|
||||
|
||||
- id: check_status
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT id FROM statuses WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.status_id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Statut invalide"
|
||||
error_status: 422
|
||||
|
||||
- id: insert_task
|
||||
service: db
|
||||
action: insert
|
||||
params:
|
||||
table: tasks
|
||||
data:
|
||||
user_id: "{{auth.user_id}}"
|
||||
project_id: "{{input.project_id}}"
|
||||
status_id: "{{input.status_id}}"
|
||||
title: "{{input.title}}"
|
||||
description: "{{input.description}}"
|
||||
priority: "{{input.priority}}"
|
||||
date_start: "{{input.date_start}}"
|
||||
date_end: "{{input.date_end}}"
|
||||
time_estimated: "{{input.time_estimated}}"
|
||||
time_spent: "{{input.time_spent}}"
|
||||
billing: "{{input.billing}}"
|
||||
position: "{{input.position}}"
|
||||
|
||||
- id: sync_tags
|
||||
service: db
|
||||
action: exec
|
||||
condition: "{{input.tags != null && input.tags | length > 0}}"
|
||||
foreach: "{{input.tags}}"
|
||||
foreach_as: tag_id
|
||||
params:
|
||||
query: |
|
||||
INSERT INTO task_tags (task_id, tag_id)
|
||||
SELECT ?, id FROM tags WHERE id = ? AND user_id = ?
|
||||
args: ["{{steps.insert_task.insert_id}}", "{{tag_id}}", "{{auth.user_id}}"]
|
||||
|
||||
- id: get_task
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: |
|
||||
SELECT t.*, p.name as project_name, s.name as status_name, s.color as status_color
|
||||
FROM tasks t
|
||||
LEFT JOIN projects p ON t.project_id = p.id
|
||||
LEFT JOIN statuses s ON t.status_id = s.id
|
||||
WHERE t.id = ?
|
||||
args: ["{{steps.insert_task.insert_id}}"]
|
||||
|
||||
- id: get_tags
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT t.id, t.name, t.color
|
||||
FROM tags t
|
||||
JOIN task_tags tt ON t.id = tt.tag_id
|
||||
WHERE tt.task_id = ?
|
||||
args: ["{{steps.insert_task.insert_id}}"]
|
||||
|
||||
output:
|
||||
status: 201
|
||||
body:
|
||||
success: true
|
||||
message: "Tâche créée"
|
||||
data:
|
||||
id: "{{steps.get_task.result.id}}"
|
||||
project_id: "{{steps.get_task.result.project_id}}"
|
||||
project_name: "{{steps.get_task.result.project_name}}"
|
||||
status_id: "{{steps.get_task.result.status_id}}"
|
||||
status_name: "{{steps.get_task.result.status_name}}"
|
||||
title: "{{steps.get_task.result.title}}"
|
||||
tags: "{{steps.get_tags.result}}"
|
||||
36
config/scenarios/prokov/tasks/delete.yaml
Normal file
36
config/scenarios/prokov/tasks/delete.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
# Scénario: Supprimer une tâche
|
||||
name: tasks_delete
|
||||
version: "1.0"
|
||||
description: Supprime une tâche
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- id: check_task
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT id FROM tasks WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Tâche non trouvée"
|
||||
error_status: 404
|
||||
|
||||
- id: delete_task
|
||||
service: db
|
||||
action: delete
|
||||
params:
|
||||
table: tasks
|
||||
where:
|
||||
id: "{{input.id}}"
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
message: "Tâche supprimée"
|
||||
67
config/scenarios/prokov/tasks/list.yaml
Normal file
67
config/scenarios/prokov/tasks/list.yaml
Normal file
@@ -0,0 +1,67 @@
|
||||
# Scénario: Liste des tâches
|
||||
name: tasks_list
|
||||
version: "1.0"
|
||||
description: Retourne les tâches avec filtres optionnels
|
||||
|
||||
input:
|
||||
optional:
|
||||
- project_id
|
||||
- status_id
|
||||
- tag_id
|
||||
- date_start
|
||||
- date_end
|
||||
validation:
|
||||
project_id:
|
||||
type: int
|
||||
status_id:
|
||||
type: int
|
||||
tag_id:
|
||||
type: int
|
||||
date_start:
|
||||
type: string
|
||||
format: date
|
||||
date_end:
|
||||
type: string
|
||||
format: date
|
||||
|
||||
steps:
|
||||
- id: get_tasks
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT t.*,
|
||||
p.name as project_name,
|
||||
s.name as status_name,
|
||||
s.color as status_color,
|
||||
GROUP_CONCAT(tg.id) as tag_ids,
|
||||
GROUP_CONCAT(tg.name) as tag_names,
|
||||
GROUP_CONCAT(tg.color) as tag_colors
|
||||
FROM tasks t
|
||||
LEFT JOIN projects p ON t.project_id = p.id
|
||||
LEFT JOIN statuses s ON t.status_id = s.id
|
||||
LEFT JOIN task_tags tt ON t.id = tt.task_id
|
||||
LEFT JOIN tags tg ON tt.tag_id = tg.id
|
||||
WHERE t.user_id = ?
|
||||
AND (? IS NULL OR t.project_id = ?)
|
||||
AND (? IS NULL OR t.status_id = ?)
|
||||
AND (? IS NULL OR t.date_start >= ?)
|
||||
AND (? IS NULL OR t.date_end <= ?)
|
||||
GROUP BY t.id
|
||||
ORDER BY t.position ASC, t.priority DESC, t.created_at DESC
|
||||
args:
|
||||
- "{{auth.user_id}}"
|
||||
- "{{input.project_id}}"
|
||||
- "{{input.project_id}}"
|
||||
- "{{input.status_id}}"
|
||||
- "{{input.status_id}}"
|
||||
- "{{input.date_start}}"
|
||||
- "{{input.date_start}}"
|
||||
- "{{input.date_end}}"
|
||||
- "{{input.date_end}}"
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
data: "{{steps.get_tasks.result | parse_tags}}"
|
||||
61
config/scenarios/prokov/tasks/show.yaml
Normal file
61
config/scenarios/prokov/tasks/show.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
# Scénario: Détail d'une tâche
|
||||
name: tasks_show
|
||||
version: "1.0"
|
||||
description: Retourne une tâche avec ses tags
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- id: get_task
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: |
|
||||
SELECT t.*, p.name as project_name, s.name as status_name, s.color as status_color
|
||||
FROM tasks t
|
||||
LEFT JOIN projects p ON t.project_id = p.id
|
||||
LEFT JOIN statuses s ON t.status_id = s.id
|
||||
WHERE t.id = ? AND t.user_id = ?
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Tâche non trouvée"
|
||||
error_status: 404
|
||||
|
||||
- id: get_tags
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT t.id, t.name, t.color
|
||||
FROM tags t
|
||||
JOIN task_tags tt ON t.id = tt.tag_id
|
||||
WHERE tt.task_id = ?
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
data:
|
||||
id: "{{steps.get_task.result.id}}"
|
||||
project_id: "{{steps.get_task.result.project_id}}"
|
||||
project_name: "{{steps.get_task.result.project_name}}"
|
||||
status_id: "{{steps.get_task.result.status_id}}"
|
||||
status_name: "{{steps.get_task.result.status_name}}"
|
||||
status_color: "{{steps.get_task.result.status_color}}"
|
||||
title: "{{steps.get_task.result.title}}"
|
||||
description: "{{steps.get_task.result.description}}"
|
||||
priority: "{{steps.get_task.result.priority}}"
|
||||
date_start: "{{steps.get_task.result.date_start}}"
|
||||
date_end: "{{steps.get_task.result.date_end}}"
|
||||
time_estimated: "{{steps.get_task.result.time_estimated}}"
|
||||
time_spent: "{{steps.get_task.result.time_spent}}"
|
||||
billing: "{{steps.get_task.result.billing}}"
|
||||
position: "{{steps.get_task.result.position}}"
|
||||
created_at: "{{steps.get_task.result.created_at}}"
|
||||
tags: "{{steps.get_tags.result}}"
|
||||
140
config/scenarios/prokov/tasks/update.yaml
Normal file
140
config/scenarios/prokov/tasks/update.yaml
Normal file
@@ -0,0 +1,140 @@
|
||||
# Scénario: Modifier une tâche
|
||||
name: tasks_update
|
||||
version: "1.0"
|
||||
description: Met à jour une tâche existante
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
optional:
|
||||
- project_id
|
||||
- status_id
|
||||
- title
|
||||
- description
|
||||
- priority
|
||||
- date_start
|
||||
- date_end
|
||||
- time_estimated
|
||||
- time_spent
|
||||
- billing
|
||||
- position
|
||||
- tags
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
project_id:
|
||||
type: int
|
||||
status_id:
|
||||
type: int
|
||||
title:
|
||||
type: string
|
||||
min_length: 1
|
||||
max_length: 255
|
||||
|
||||
steps:
|
||||
- id: get_task
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM tasks WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Tâche non trouvée"
|
||||
error_status: 404
|
||||
|
||||
- id: check_project
|
||||
service: db
|
||||
action: query_one
|
||||
condition: "{{input.project_id != null}}"
|
||||
params:
|
||||
query: "SELECT id FROM projects WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.project_id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Projet invalide"
|
||||
error_status: 422
|
||||
|
||||
- id: check_status
|
||||
service: db
|
||||
action: query_one
|
||||
condition: "{{input.status_id != null}}"
|
||||
params:
|
||||
query: "SELECT id FROM statuses WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.status_id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Statut invalide"
|
||||
error_status: 422
|
||||
|
||||
- id: update_task
|
||||
service: db
|
||||
action: update
|
||||
params:
|
||||
table: tasks
|
||||
where:
|
||||
id: "{{input.id}}"
|
||||
data:
|
||||
project_id: "{{input.project_id ?? steps.get_task.result.project_id}}"
|
||||
status_id: "{{input.status_id ?? steps.get_task.result.status_id}}"
|
||||
title: "{{input.title ?? steps.get_task.result.title}}"
|
||||
description: "{{input.description ?? steps.get_task.result.description}}"
|
||||
priority: "{{input.priority ?? steps.get_task.result.priority}}"
|
||||
date_start: "{{input.date_start ?? steps.get_task.result.date_start}}"
|
||||
date_end: "{{input.date_end ?? steps.get_task.result.date_end}}"
|
||||
time_estimated: "{{input.time_estimated ?? steps.get_task.result.time_estimated}}"
|
||||
time_spent: "{{input.time_spent ?? steps.get_task.result.time_spent}}"
|
||||
billing: "{{input.billing ?? steps.get_task.result.billing}}"
|
||||
position: "{{input.position ?? steps.get_task.result.position}}"
|
||||
|
||||
- id: clear_tags
|
||||
service: db
|
||||
action: delete
|
||||
condition: "{{input.tags != null}}"
|
||||
params:
|
||||
table: task_tags
|
||||
where:
|
||||
task_id: "{{input.id}}"
|
||||
|
||||
- id: sync_tags
|
||||
service: db
|
||||
action: exec
|
||||
condition: "{{input.tags != null && input.tags | length > 0}}"
|
||||
foreach: "{{input.tags}}"
|
||||
foreach_as: tag_id
|
||||
params:
|
||||
query: |
|
||||
INSERT INTO task_tags (task_id, tag_id)
|
||||
SELECT ?, id FROM tags WHERE id = ? AND user_id = ?
|
||||
args: ["{{input.id}}", "{{tag_id}}", "{{auth.user_id}}"]
|
||||
|
||||
- id: get_updated
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: |
|
||||
SELECT t.*, p.name as project_name, s.name as status_name, s.color as status_color
|
||||
FROM tasks t
|
||||
LEFT JOIN projects p ON t.project_id = p.id
|
||||
LEFT JOIN statuses s ON t.status_id = s.id
|
||||
WHERE t.id = ?
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
- id: get_tags
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT t.id, t.name, t.color
|
||||
FROM tags t
|
||||
JOIN task_tags tt ON t.id = tt.tag_id
|
||||
WHERE tt.task_id = ?
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
message: "Tâche mise à jour"
|
||||
data:
|
||||
id: "{{steps.get_updated.result.id}}"
|
||||
title: "{{steps.get_updated.result.title}}"
|
||||
status_name: "{{steps.get_updated.result.status_name}}"
|
||||
tags: "{{steps.get_tags.result}}"
|
||||
Reference in New Issue
Block a user