SOGOMS v1.0.3 - Admin UI, Cron, Config reload
Phase 13 : sogoms-cron
- Jobs planifiés avec schedule cron standard
- Types: query_email, http, service
- Actions: list, trigger, status
Phase 16 : Réorganisation config/apps/{app}/
- Tous les fichiers d'une app dans un seul dossier
- Migration prokov vers nouvelle structure
Phase 17 : sogoms-admin
- Interface web d'administration (Go templates + htmx)
- Auth sessions cookies signées HMAC-SHA256
- Rôles super_admin / app_admin avec permissions
Phase 19 : Création d'app via Admin UI
- Formulaire création app avec config DB/auth
- Bouton "Scanner la base" : introspection + schema.yaml
- Rechargement automatique sogoway via SIGHUP
Infrastructure :
- sogoctl : socket de contrôle /run/sogoctl.sock
- sogoway : reload config sur SIGHUP sans restart
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
143
config/apps/prokov/app.yaml
Normal file
143
config/apps/prokov/app.yaml
Normal file
@@ -0,0 +1,143 @@
|
||||
# Routes API Prokov
|
||||
# Gestion de projets et tâches
|
||||
|
||||
app: prokov
|
||||
version: "1.0"
|
||||
base_path: /api
|
||||
|
||||
# Identification par hostname
|
||||
hosts:
|
||||
- prokov.unikoffice.com
|
||||
- prokov.sogoms.com
|
||||
|
||||
# Base de données
|
||||
database:
|
||||
host: 13.23.33.4
|
||||
port: 3306
|
||||
user: prokov_user
|
||||
password_file: /secrets/prokov_db_pass
|
||||
name: prokov
|
||||
|
||||
# Authentification
|
||||
auth:
|
||||
jwt_secret_file: /secrets/prokov_jwt_secret
|
||||
jwt_expiry: 24h
|
||||
|
||||
# Logs
|
||||
logs:
|
||||
retention_days: 30
|
||||
|
||||
# SMTP
|
||||
smtp:
|
||||
host: barbotte.o2switch.net
|
||||
port: 465
|
||||
user: prokov@unikoffice.com
|
||||
password_file: /secrets/prokov_smtp_pass
|
||||
from: prokov@unikoffice.com
|
||||
from_name: Prokov
|
||||
tls: true # false = STARTTLS (587), true = TLS direct (465)
|
||||
|
||||
# Routes
|
||||
routes:
|
||||
# === AUTH ===
|
||||
- path: /auth/register
|
||||
method: POST
|
||||
scenario: prokov/auth/register
|
||||
auth: false
|
||||
|
||||
- path: /auth/login
|
||||
method: POST
|
||||
scenario: prokov/auth/login
|
||||
auth: false
|
||||
|
||||
- path: /auth/logout
|
||||
method: POST
|
||||
scenario: prokov/auth/logout
|
||||
|
||||
- path: /auth/me
|
||||
method: GET
|
||||
scenario: prokov/auth/me
|
||||
|
||||
# === PROJECTS ===
|
||||
- path: /projects
|
||||
method: GET
|
||||
scenario: prokov/projects/list
|
||||
|
||||
- path: /projects
|
||||
method: POST
|
||||
scenario: prokov/projects/create
|
||||
|
||||
- path: /projects/{id}
|
||||
method: GET
|
||||
scenario: prokov/projects/show
|
||||
|
||||
- path: /projects/{id}
|
||||
method: PUT
|
||||
scenario: prokov/projects/update
|
||||
|
||||
- path: /projects/{id}
|
||||
method: DELETE
|
||||
scenario: prokov/projects/delete
|
||||
|
||||
# === TASKS ===
|
||||
- path: /tasks
|
||||
method: GET
|
||||
scenario: prokov/tasks/list
|
||||
|
||||
- path: /tasks
|
||||
method: POST
|
||||
scenario: prokov/tasks/create
|
||||
|
||||
- path: /tasks/{id}
|
||||
method: GET
|
||||
scenario: prokov/tasks/show
|
||||
|
||||
- path: /tasks/{id}
|
||||
method: PUT
|
||||
scenario: prokov/tasks/update
|
||||
|
||||
- path: /tasks/{id}
|
||||
method: DELETE
|
||||
scenario: prokov/tasks/delete
|
||||
|
||||
# === TAGS ===
|
||||
- path: /tags
|
||||
method: GET
|
||||
scenario: prokov/tags/list
|
||||
|
||||
- path: /tags
|
||||
method: POST
|
||||
scenario: prokov/tags/create
|
||||
|
||||
- path: /tags/{id}
|
||||
method: GET
|
||||
scenario: prokov/tags/show
|
||||
|
||||
- path: /tags/{id}
|
||||
method: PUT
|
||||
scenario: prokov/tags/update
|
||||
|
||||
- path: /tags/{id}
|
||||
method: DELETE
|
||||
scenario: prokov/tags/delete
|
||||
|
||||
# === STATUSES ===
|
||||
- path: /statuses
|
||||
method: GET
|
||||
scenario: prokov/statuses/list
|
||||
|
||||
- path: /statuses
|
||||
method: POST
|
||||
scenario: prokov/statuses/create
|
||||
|
||||
- path: /statuses/{id}
|
||||
method: GET
|
||||
scenario: prokov/statuses/show
|
||||
|
||||
- path: /statuses/{id}
|
||||
method: PUT
|
||||
scenario: prokov/statuses/update
|
||||
|
||||
- path: /statuses/{id}
|
||||
method: DELETE
|
||||
scenario: prokov/statuses/delete
|
||||
44
config/apps/prokov/cron.yaml
Normal file
44
config/apps/prokov/cron.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
# Configuration des tâches planifiées pour Prokov
|
||||
timezone: Europe/Paris
|
||||
|
||||
retry:
|
||||
max_attempts: 3
|
||||
delay: 5m
|
||||
|
||||
history_days: 7
|
||||
|
||||
jobs:
|
||||
# Email quotidien des tâches à faire
|
||||
tasks_today:
|
||||
schedule: "0 8 * * 1-5" # 8h00 du lundi au vendredi
|
||||
type: query_email
|
||||
enabled: true
|
||||
|
||||
# Requête : tâches du jour pour chaque utilisateur
|
||||
# Retourne les tâches dont la date de fin est aujourd'hui ou dépassée
|
||||
# et qui ne sont pas dans un statut "terminé" (code >= 100)
|
||||
query: |
|
||||
SELECT
|
||||
u.id AS user_id,
|
||||
u.email,
|
||||
u.name AS user_name,
|
||||
t.id AS task_id,
|
||||
t.title,
|
||||
t.priority,
|
||||
t.date_end,
|
||||
p.name AS project_name,
|
||||
s.name AS status_name,
|
||||
s.color AS status_color
|
||||
FROM users u
|
||||
INNER JOIN tasks t ON t.user_id = u.id
|
||||
LEFT JOIN projects p ON t.project_id = p.id
|
||||
LEFT JOIN statuses s ON t.status_id = s.id
|
||||
WHERE (t.date_end <= CURDATE() OR t.date_start = CURDATE())
|
||||
AND (s.code IS NULL OR s.code < 100)
|
||||
ORDER BY u.id, t.priority DESC, t.date_end ASC, t.position ASC
|
||||
|
||||
# Grouper par user_id pour envoyer 1 email par utilisateur
|
||||
group_by: user_id
|
||||
|
||||
# Template email à utiliser
|
||||
template: tasks_today
|
||||
41
config/apps/prokov/emails/password_reset.yaml
Normal file
41
config/apps/prokov/emails/password_reset.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
# Template: Réinitialisation de mot de passe
|
||||
subject: "Réinitialisation de votre mot de passe Prokov"
|
||||
|
||||
body: |
|
||||
Bonjour {{.Name}},
|
||||
|
||||
Vous avez demandé la réinitialisation de votre mot de passe.
|
||||
|
||||
Cliquez sur le lien ci-dessous pour créer un nouveau mot de passe :
|
||||
{{.ResetURL}}
|
||||
|
||||
Ce lien expire dans {{.ExpiresIn}}.
|
||||
|
||||
Si vous n'êtes pas à l'origine de cette demande, ignorez cet email.
|
||||
|
||||
Cordialement,
|
||||
L'équipe Prokov
|
||||
|
||||
body_html: |
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
</head>
|
||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||
<div style="max-width: 600px; margin: 0 auto; padding: 20px;">
|
||||
<h1 style="color: #2563eb;">Réinitialisation de mot de passe</h1>
|
||||
<p>Bonjour <strong>{{.Name}}</strong>,</p>
|
||||
<p>Vous avez demandé la réinitialisation de votre mot de passe.</p>
|
||||
<p style="text-align: center; margin: 30px 0;">
|
||||
<a href="{{.ResetURL}}" style="background-color: #2563eb; color: white; padding: 12px 24px; text-decoration: none; border-radius: 6px; display: inline-block;">
|
||||
Réinitialiser mon mot de passe
|
||||
</a>
|
||||
</p>
|
||||
<p style="color: #666; font-size: 14px;">Ce lien expire dans {{.ExpiresIn}}.</p>
|
||||
<p style="color: #666; font-size: 14px;">Si vous n'êtes pas à l'origine de cette demande, ignorez cet email.</p>
|
||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||
<p style="color: #666; font-size: 14px;">Cordialement,<br>L'équipe Prokov</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
45
config/apps/prokov/emails/task_assigned.yaml
Normal file
45
config/apps/prokov/emails/task_assigned.yaml
Normal file
@@ -0,0 +1,45 @@
|
||||
# Template: Notification d'assignation de tâche
|
||||
subject: "Nouvelle tâche : {{.TaskName}}"
|
||||
|
||||
body: |
|
||||
Bonjour {{.Name}},
|
||||
|
||||
Une nouvelle tâche vous a été assignée :
|
||||
|
||||
Projet : {{.ProjectName}}
|
||||
Tâche : {{.TaskName}}
|
||||
{{if .Description}}Description : {{.Description}}{{end}}
|
||||
{{if .DueDate}}Échéance : {{.DueDate}}{{end}}
|
||||
|
||||
Connectez-vous pour voir les détails.
|
||||
|
||||
Cordialement,
|
||||
L'équipe Prokov
|
||||
|
||||
body_html: |
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
</head>
|
||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||
<div style="max-width: 600px; margin: 0 auto; padding: 20px;">
|
||||
<h1 style="color: #2563eb;">Nouvelle tâche assignée</h1>
|
||||
<p>Bonjour <strong>{{.Name}}</strong>,</p>
|
||||
<p>Une nouvelle tâche vous a été assignée :</p>
|
||||
<div style="background-color: #f8fafc; border-left: 4px solid #2563eb; padding: 15px; margin: 20px 0;">
|
||||
<p style="margin: 5px 0;"><strong>Projet :</strong> {{.ProjectName}}</p>
|
||||
<p style="margin: 5px 0;"><strong>Tâche :</strong> {{.TaskName}}</p>
|
||||
{{if .Description}}<p style="margin: 5px 0;"><strong>Description :</strong> {{.Description}}</p>{{end}}
|
||||
{{if .DueDate}}<p style="margin: 5px 0;"><strong>Échéance :</strong> {{.DueDate}}</p>{{end}}
|
||||
</div>
|
||||
<p style="text-align: center; margin: 30px 0;">
|
||||
<a href="{{.TaskURL}}" style="background-color: #2563eb; color: white; padding: 12px 24px; text-decoration: none; border-radius: 6px; display: inline-block;">
|
||||
Voir la tâche
|
||||
</a>
|
||||
</p>
|
||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||
<p style="color: #666; font-size: 14px;">Cordialement,<br>L'équipe Prokov</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
67
config/apps/prokov/emails/tasks_today.yaml
Normal file
67
config/apps/prokov/emails/tasks_today.yaml
Normal file
@@ -0,0 +1,67 @@
|
||||
# Template: Récapitulatif des tâches du jour
|
||||
subject: "Vos tâches du jour - {{.Date}}"
|
||||
|
||||
body: |
|
||||
Bonjour {{.Name}},
|
||||
|
||||
Voici vos tâches prévues pour aujourd'hui ({{.Date}}) :
|
||||
|
||||
{{range .Tasks}}
|
||||
- [{{.Status}}] {{.Name}}{{if .Project}} ({{.Project}}){{end}}{{if .DueTime}} - {{.DueTime}}{{end}}
|
||||
{{end}}
|
||||
|
||||
{{if .TaskCount}}Vous avez {{.TaskCount}} tâche(s) à accomplir.{{end}}
|
||||
|
||||
Bonne journée !
|
||||
|
||||
Cordialement,
|
||||
L'équipe Prokov
|
||||
|
||||
body_html: |
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
</head>
|
||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||
<div style="max-width: 600px; margin: 0 auto; padding: 20px;">
|
||||
<h1 style="color: #2563eb;">Vos tâches du jour</h1>
|
||||
<p>Bonjour <strong>{{.Name}}</strong>,</p>
|
||||
<p>Voici vos tâches prévues pour aujourd'hui ({{.Date}}) :</p>
|
||||
|
||||
<table style="width: 100%; border-collapse: collapse; margin: 20px 0;">
|
||||
<thead>
|
||||
<tr style="background-color: #f8fafc;">
|
||||
<th style="padding: 12px; text-align: left; border-bottom: 2px solid #e2e8f0;">Tâche</th>
|
||||
<th style="padding: 12px; text-align: left; border-bottom: 2px solid #e2e8f0;">Projet</th>
|
||||
<th style="padding: 12px; text-align: left; border-bottom: 2px solid #e2e8f0;">Statut</th>
|
||||
<th style="padding: 12px; text-align: left; border-bottom: 2px solid #e2e8f0;">Heure</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Tasks}}
|
||||
<tr>
|
||||
<td style="padding: 12px; border-bottom: 1px solid #e2e8f0;">{{.Name}}</td>
|
||||
<td style="padding: 12px; border-bottom: 1px solid #e2e8f0;">{{.Project}}</td>
|
||||
<td style="padding: 12px; border-bottom: 1px solid #e2e8f0;">
|
||||
<span style="background-color: {{.StatusColor}}; color: white; padding: 4px 8px; border-radius: 4px; font-size: 12px;">{{.Status}}</span>
|
||||
</td>
|
||||
<td style="padding: 12px; border-bottom: 1px solid #e2e8f0;">{{.DueTime}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{if .TaskCount}}
|
||||
<p style="background-color: #eff6ff; padding: 15px; border-radius: 6px; text-align: center;">
|
||||
<strong>{{.TaskCount}}</strong> tâche(s) à accomplir aujourd'hui
|
||||
</p>
|
||||
{{end}}
|
||||
|
||||
<p>Bonne journée !</p>
|
||||
|
||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||
<p style="color: #666; font-size: 14px;">Cordialement,<br>L'équipe Prokov</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
34
config/apps/prokov/emails/welcome.yaml
Normal file
34
config/apps/prokov/emails/welcome.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
# Template: Email de bienvenue
|
||||
subject: "Bienvenue sur Prokov, {{.Name}} !"
|
||||
|
||||
body: |
|
||||
Bonjour {{.Name}},
|
||||
|
||||
Bienvenue sur Prokov !
|
||||
|
||||
Votre compte a été créé avec succès.
|
||||
Email: {{.Email}}
|
||||
|
||||
Vous pouvez maintenant vous connecter et commencer à gérer vos projets.
|
||||
|
||||
Cordialement,
|
||||
L'équipe Prokov
|
||||
|
||||
body_html: |
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
</head>
|
||||
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
||||
<div style="max-width: 600px; margin: 0 auto; padding: 20px;">
|
||||
<h1 style="color: #2563eb;">Bienvenue sur Prokov !</h1>
|
||||
<p>Bonjour <strong>{{.Name}}</strong>,</p>
|
||||
<p>Votre compte a été créé avec succès.</p>
|
||||
<p><strong>Email :</strong> {{.Email}}</p>
|
||||
<p>Vous pouvez maintenant vous connecter et commencer à gérer vos projets.</p>
|
||||
<hr style="border: none; border-top: 1px solid #eee; margin: 20px 0;">
|
||||
<p style="color: #666; font-size: 14px;">Cordialement,<br>L'équipe Prokov</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
204
config/apps/prokov/prokov.sql
Normal file
204
config/apps/prokov/prokov.sql
Normal file
@@ -0,0 +1,204 @@
|
||||
/*M!999999\- enable the sandbox mode */
|
||||
-- MariaDB dump 10.19-11.8.3-MariaDB, for debian-linux-gnu (x86_64)
|
||||
--
|
||||
-- Host: localhost Database: prokov
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 11.4.8-MariaDB-log
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
|
||||
|
||||
--
|
||||
-- Table structure for table `project_tags`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `project_tags`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `project_tags` (
|
||||
`project_id` int(10) unsigned NOT NULL,
|
||||
`tag_id` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`project_id`,`tag_id`),
|
||||
KEY `tag_id` (`tag_id`),
|
||||
CONSTRAINT `project_tags_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `project_tags_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `projects`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `projects`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `projects` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`parent_id` int(10) unsigned DEFAULT NULL,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`description` text DEFAULT NULL,
|
||||
`position` int(10) unsigned DEFAULT 0,
|
||||
`created_at` timestamp NULL DEFAULT current_timestamp(),
|
||||
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `parent_id` (`parent_id`),
|
||||
KEY `idx_projects_parent` (`user_id`,`parent_id`),
|
||||
CONSTRAINT `projects_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `projects_ibfk_2` FOREIGN KEY (`parent_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `statuses`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `statuses`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `statuses` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`project_id` int(10) unsigned DEFAULT NULL,
|
||||
`code` int(10) unsigned NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`color` varchar(7) DEFAULT '#6B7280',
|
||||
`position` int(10) unsigned DEFAULT 0,
|
||||
`created_at` timestamp NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_statuses_user_project` (`user_id`,`project_id`),
|
||||
CONSTRAINT `statuses_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `tags`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `tags`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `tags` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`color` varchar(7) DEFAULT '#3B82F6',
|
||||
`created_at` timestamp NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `unique_tag_per_user` (`user_id`,`name`),
|
||||
CONSTRAINT `tags_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `task_tags`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `task_tags`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `task_tags` (
|
||||
`task_id` int(10) unsigned NOT NULL,
|
||||
`tag_id` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`task_id`,`tag_id`),
|
||||
KEY `tag_id` (`tag_id`),
|
||||
CONSTRAINT `task_tags_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `task_tags_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `tasks`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `tasks`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `tasks` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`project_id` int(10) unsigned NOT NULL,
|
||||
`status_id` int(10) unsigned NOT NULL,
|
||||
`title` varchar(255) NOT NULL,
|
||||
`description` text DEFAULT NULL,
|
||||
`priority` tinyint(3) unsigned DEFAULT 5,
|
||||
`date_start` date DEFAULT NULL,
|
||||
`date_end` date DEFAULT NULL,
|
||||
`time_estimated` int(10) unsigned DEFAULT 0,
|
||||
`time_spent` int(10) unsigned DEFAULT 0,
|
||||
`billing` decimal(10,2) DEFAULT 0.00,
|
||||
`position` int(10) unsigned DEFAULT 0,
|
||||
`created_at` timestamp NULL DEFAULT current_timestamp(),
|
||||
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `status_id` (`status_id`),
|
||||
KEY `idx_tasks_project_status` (`project_id`,`status_id`),
|
||||
KEY `idx_tasks_user_status` (`user_id`,`status_id`),
|
||||
KEY `idx_tasks_dates` (`date_start`,`date_end`),
|
||||
CONSTRAINT `tasks_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `tasks_ibfk_2` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `tasks_ibfk_3` FOREIGN KEY (`status_id`) REFERENCES `statuses` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `users`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`email` varchar(255) NOT NULL,
|
||||
`password` varchar(255) NOT NULL,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`language` varchar(5) NOT NULL DEFAULT 'fr',
|
||||
`timezone` varchar(50) NOT NULL DEFAULT 'Europe/Paris',
|
||||
`role_id` int(10) unsigned NOT NULL DEFAULT 1,
|
||||
`created_at` timestamp NULL DEFAULT current_timestamp(),
|
||||
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `email` (`email`),
|
||||
KEY `role_id` (`role_id`),
|
||||
CONSTRAINT `users_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `users_roles` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `users_roles`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `users_roles`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8mb4 */;
|
||||
CREATE TABLE `users_roles` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`created_at` timestamp NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping routines for database 'prokov'
|
||||
--
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
|
||||
|
||||
-- Dump completed on 2025-12-18 10:24:52
|
||||
25
config/apps/prokov/queries/auth.yaml
Normal file
25
config/apps/prokov/queries/auth.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
# Requêtes d'authentification
|
||||
|
||||
# Données chargées après login réussi
|
||||
login_data:
|
||||
projects: >
|
||||
SELECT id, parent_id, name, description, position, created_at, updated_at
|
||||
FROM projects WHERE user_id = ? ORDER BY position
|
||||
tasks: >
|
||||
SELECT id, project_id, status_id, title, description, priority,
|
||||
date_start, date_end, time_estimated, time_spent, billing, position,
|
||||
created_at, updated_at
|
||||
FROM tasks WHERE user_id = ? ORDER BY position
|
||||
tags: >
|
||||
SELECT id, name, color, created_at
|
||||
FROM tags WHERE user_id = ?
|
||||
statuses: >
|
||||
SELECT id, project_id, code, name, color, position, created_at
|
||||
FROM statuses WHERE user_id = ? ORDER BY code
|
||||
|
||||
# Requêtes unitaires
|
||||
user_by_email: >
|
||||
SELECT id, email, name, password FROM users WHERE email = ?
|
||||
|
||||
user_by_id: >
|
||||
SELECT id, email, name, created_at FROM users WHERE id = ?
|
||||
44
config/apps/prokov/queries/projects.yaml
Normal file
44
config/apps/prokov/queries/projects.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
# Requêtes CRUD projects
|
||||
|
||||
list:
|
||||
query: >
|
||||
SELECT id, parent_id, name, description, position, created_at, updated_at
|
||||
FROM projects
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
order: "position ASC"
|
||||
|
||||
show:
|
||||
query: >
|
||||
SELECT id, parent_id, name, description, position, created_at, updated_at
|
||||
FROM projects WHERE id = :id
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
|
||||
create:
|
||||
table: projects
|
||||
fields:
|
||||
- user_id
|
||||
- parent_id
|
||||
- name
|
||||
- description
|
||||
- position
|
||||
|
||||
update:
|
||||
table: projects
|
||||
fields:
|
||||
- parent_id
|
||||
- name
|
||||
- description
|
||||
- position
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
|
||||
delete:
|
||||
table: projects
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
55
config/apps/prokov/queries/statuses.yaml
Normal file
55
config/apps/prokov/queries/statuses.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
# Requêtes CRUD statuses
|
||||
|
||||
list:
|
||||
query: >
|
||||
SELECT id, project_id, code, name, color, position, created_at
|
||||
FROM statuses
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
order: "code ASC"
|
||||
|
||||
list_by_project:
|
||||
query: >
|
||||
SELECT id, project_id, code, name, color, position, created_at
|
||||
FROM statuses WHERE (project_id = :project_id OR project_id IS NULL)
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
order: "code ASC"
|
||||
|
||||
show:
|
||||
query: >
|
||||
SELECT id, project_id, code, name, color, position, created_at
|
||||
FROM statuses WHERE id = :id
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
|
||||
create:
|
||||
table: statuses
|
||||
fields:
|
||||
- user_id
|
||||
- project_id
|
||||
- code
|
||||
- name
|
||||
- color
|
||||
- position
|
||||
|
||||
update:
|
||||
table: statuses
|
||||
fields:
|
||||
- project_id
|
||||
- code
|
||||
- name
|
||||
- color
|
||||
- position
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
|
||||
delete:
|
||||
table: statuses
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
39
config/apps/prokov/queries/tags.yaml
Normal file
39
config/apps/prokov/queries/tags.yaml
Normal file
@@ -0,0 +1,39 @@
|
||||
# Requêtes CRUD tags
|
||||
|
||||
list:
|
||||
query: >
|
||||
SELECT id, name, color, created_at
|
||||
FROM tags
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
|
||||
show:
|
||||
query: >
|
||||
SELECT id, name, color, created_at
|
||||
FROM tags WHERE id = :id
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
|
||||
create:
|
||||
table: tags
|
||||
fields:
|
||||
- user_id
|
||||
- name
|
||||
- color
|
||||
|
||||
update:
|
||||
table: tags
|
||||
fields:
|
||||
- name
|
||||
- color
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
|
||||
delete:
|
||||
table: tags
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
73
config/apps/prokov/queries/tasks.yaml
Normal file
73
config/apps/prokov/queries/tasks.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
# Requêtes CRUD tasks
|
||||
|
||||
list:
|
||||
query: >
|
||||
SELECT id, project_id, status_id, title, description, priority,
|
||||
date_start, date_end, time_estimated, time_spent, billing, position,
|
||||
created_at, updated_at
|
||||
FROM tasks
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
order: "position ASC"
|
||||
|
||||
list_by_project:
|
||||
query: >
|
||||
SELECT id, project_id, status_id, title, description, priority,
|
||||
date_start, date_end, time_estimated, time_spent, billing, position,
|
||||
created_at, updated_at
|
||||
FROM tasks WHERE project_id = :project_id
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
order: "position ASC"
|
||||
|
||||
show:
|
||||
query: >
|
||||
SELECT id, project_id, status_id, title, description, priority,
|
||||
date_start, date_end, time_estimated, time_spent, billing, position,
|
||||
created_at, updated_at
|
||||
FROM tasks WHERE id = :id
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
|
||||
create:
|
||||
table: tasks
|
||||
fields:
|
||||
- user_id
|
||||
- project_id
|
||||
- status_id
|
||||
- title
|
||||
- description
|
||||
- priority
|
||||
- date_start
|
||||
- date_end
|
||||
- time_estimated
|
||||
- time_spent
|
||||
- billing
|
||||
- position
|
||||
|
||||
update:
|
||||
table: tasks
|
||||
fields:
|
||||
- project_id
|
||||
- status_id
|
||||
- title
|
||||
- description
|
||||
- priority
|
||||
- date_start
|
||||
- date_end
|
||||
- time_estimated
|
||||
- time_spent
|
||||
- billing
|
||||
- position
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
|
||||
delete:
|
||||
table: tasks
|
||||
filters:
|
||||
default: "user_id = :user_id"
|
||||
admin: ""
|
||||
58
config/apps/prokov/scenarios/auth/login.yaml
Normal file
58
config/apps/prokov/scenarios/auth/login.yaml
Normal file
@@ -0,0 +1,58 @@
|
||||
# Scénario: Connexion utilisateur
|
||||
name: login
|
||||
version: "1.0"
|
||||
description: Authentifie un utilisateur et retourne un JWT
|
||||
|
||||
input:
|
||||
required:
|
||||
- email
|
||||
- password
|
||||
validation:
|
||||
email:
|
||||
type: string
|
||||
format: email
|
||||
password:
|
||||
type: string
|
||||
min_length: 1
|
||||
|
||||
steps:
|
||||
- id: get_user
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT id, email, name, password FROM users WHERE email = ?"
|
||||
args: ["{{input.email}}"]
|
||||
on_error: abort
|
||||
error_message: "Email ou mot de passe incorrect"
|
||||
error_status: 401
|
||||
|
||||
- id: verify_password
|
||||
service: auth
|
||||
action: verify_password
|
||||
params:
|
||||
hash: "{{steps.get_user.result.password}}"
|
||||
password: "{{input.password}}"
|
||||
on_error: abort
|
||||
error_message: "Email ou mot de passe incorrect"
|
||||
error_status: 401
|
||||
|
||||
- id: generate_token
|
||||
service: auth
|
||||
action: generate_jwt
|
||||
params:
|
||||
claims:
|
||||
sub: "{{steps.get_user.result.id}}"
|
||||
email: "{{steps.get_user.result.email}}"
|
||||
name: "{{steps.get_user.result.name}}"
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
message: "Connexion réussie"
|
||||
data:
|
||||
token: "{{steps.generate_token.result.token}}"
|
||||
user:
|
||||
id: "{{steps.get_user.result.id}}"
|
||||
email: "{{steps.get_user.result.email}}"
|
||||
name: "{{steps.get_user.result.name}}"
|
||||
13
config/apps/prokov/scenarios/auth/logout.yaml
Normal file
13
config/apps/prokov/scenarios/auth/logout.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
# Scénario: Déconnexion
|
||||
name: logout
|
||||
version: "1.0"
|
||||
description: Déconnecte l'utilisateur (côté client, invalide le JWT)
|
||||
|
||||
# Avec JWT stateless, le logout est géré côté client
|
||||
# Ce endpoint existe pour la compatibilité API
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
message: "Déconnexion réussie"
|
||||
22
config/apps/prokov/scenarios/auth/me.yaml
Normal file
22
config/apps/prokov/scenarios/auth/me.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
# Scénario: Récupérer l'utilisateur connecté
|
||||
name: me
|
||||
version: "1.0"
|
||||
description: Retourne les informations de l'utilisateur authentifié
|
||||
|
||||
steps:
|
||||
- id: get_user
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT id, email, name, created_at FROM users WHERE id = ?"
|
||||
args: ["{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Utilisateur non trouvé"
|
||||
error_status: 404
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
data:
|
||||
user: "{{steps.get_user.result}}"
|
||||
93
config/apps/prokov/scenarios/auth/register.yaml
Normal file
93
config/apps/prokov/scenarios/auth/register.yaml
Normal file
@@ -0,0 +1,93 @@
|
||||
# Scénario: Inscription utilisateur
|
||||
name: register
|
||||
version: "1.0"
|
||||
description: Crée un nouvel utilisateur
|
||||
|
||||
input:
|
||||
required:
|
||||
- email
|
||||
- password
|
||||
- name
|
||||
validation:
|
||||
email:
|
||||
type: string
|
||||
format: email
|
||||
max_length: 255
|
||||
password:
|
||||
type: string
|
||||
min_length: 6
|
||||
max_length: 255
|
||||
name:
|
||||
type: string
|
||||
min_length: 2
|
||||
max_length: 100
|
||||
|
||||
steps:
|
||||
- id: check_email
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT id FROM users WHERE email = ?"
|
||||
args: ["{{input.email}}"]
|
||||
on_success: abort
|
||||
error_message: "Cet email est déjà utilisé"
|
||||
error_status: 409
|
||||
|
||||
- id: hash_password
|
||||
service: auth
|
||||
action: hash_password
|
||||
params:
|
||||
password: "{{input.password}}"
|
||||
|
||||
- id: create_user
|
||||
service: db
|
||||
action: insert
|
||||
params:
|
||||
table: users
|
||||
data:
|
||||
email: "{{input.email}}"
|
||||
password: "{{steps.hash_password.result.hash}}"
|
||||
name: "{{input.name}}"
|
||||
|
||||
- id: create_default_statuses
|
||||
service: db
|
||||
action: exec
|
||||
params:
|
||||
query: |
|
||||
INSERT INTO statuses (user_id, project_id, code, name, color, position) VALUES
|
||||
(?, NULL, 10, 'Backlog', '#6B7280', 10),
|
||||
(?, NULL, 20, 'À faire', '#3B82F6', 20),
|
||||
(?, NULL, 30, 'En cours', '#F59E0B', 30),
|
||||
(?, NULL, 40, 'À tester', '#8B5CF6', 40),
|
||||
(?, NULL, 50, 'Livré', '#10B981', 50),
|
||||
(?, NULL, 60, 'Terminé', '#059669', 60),
|
||||
(?, NULL, 70, 'Archivé', '#9CA3AF', 70)
|
||||
args:
|
||||
- "{{steps.create_user.insert_id}}"
|
||||
- "{{steps.create_user.insert_id}}"
|
||||
- "{{steps.create_user.insert_id}}"
|
||||
- "{{steps.create_user.insert_id}}"
|
||||
- "{{steps.create_user.insert_id}}"
|
||||
- "{{steps.create_user.insert_id}}"
|
||||
- "{{steps.create_user.insert_id}}"
|
||||
|
||||
- id: generate_token
|
||||
service: auth
|
||||
action: generate_jwt
|
||||
params:
|
||||
claims:
|
||||
sub: "{{steps.create_user.insert_id}}"
|
||||
email: "{{input.email}}"
|
||||
name: "{{input.name}}"
|
||||
|
||||
output:
|
||||
status: 201
|
||||
body:
|
||||
success: true
|
||||
message: "Inscription réussie"
|
||||
data:
|
||||
token: "{{steps.generate_token.result.token}}"
|
||||
user:
|
||||
id: "{{steps.create_user.insert_id}}"
|
||||
email: "{{input.email}}"
|
||||
name: "{{input.name}}"
|
||||
95
config/apps/prokov/scenarios/projects/create.yaml
Normal file
95
config/apps/prokov/scenarios/projects/create.yaml
Normal file
@@ -0,0 +1,95 @@
|
||||
# Scénario: Créer un projet
|
||||
name: projects_create
|
||||
version: "1.0"
|
||||
description: Crée un nouveau projet
|
||||
|
||||
input:
|
||||
required:
|
||||
- name
|
||||
optional:
|
||||
- description
|
||||
- parent_id
|
||||
- position
|
||||
- tags
|
||||
defaults:
|
||||
position: 0
|
||||
validation:
|
||||
name:
|
||||
type: string
|
||||
min_length: 1
|
||||
max_length: 100
|
||||
description:
|
||||
type: string
|
||||
max_length: 65535
|
||||
parent_id:
|
||||
type: int
|
||||
position:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- id: check_parent
|
||||
service: db
|
||||
action: query_one
|
||||
condition: "{{input.parent_id != null}}"
|
||||
params:
|
||||
query: "SELECT id FROM projects WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.parent_id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Projet parent non trouvé"
|
||||
error_status: 422
|
||||
|
||||
- id: insert_project
|
||||
service: db
|
||||
action: insert
|
||||
params:
|
||||
table: projects
|
||||
data:
|
||||
user_id: "{{auth.user_id}}"
|
||||
parent_id: "{{input.parent_id}}"
|
||||
name: "{{input.name}}"
|
||||
description: "{{input.description}}"
|
||||
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 project_tags (project_id, tag_id)
|
||||
SELECT ?, id FROM tags WHERE id = ? AND user_id = ?
|
||||
args: ["{{steps.insert_project.insert_id}}", "{{tag_id}}", "{{auth.user_id}}"]
|
||||
|
||||
- id: get_project
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM projects WHERE id = ?"
|
||||
args: ["{{steps.insert_project.insert_id}}"]
|
||||
|
||||
- id: get_tags
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT t.id, t.name, t.color
|
||||
FROM tags t
|
||||
JOIN project_tags pt ON t.id = pt.tag_id
|
||||
WHERE pt.project_id = ?
|
||||
args: ["{{steps.insert_project.insert_id}}"]
|
||||
|
||||
output:
|
||||
status: 201
|
||||
body:
|
||||
success: true
|
||||
message: "Projet créé"
|
||||
data:
|
||||
id: "{{steps.get_project.result.id}}"
|
||||
name: "{{steps.get_project.result.name}}"
|
||||
description: "{{steps.get_project.result.description}}"
|
||||
parent_id: "{{steps.get_project.result.parent_id}}"
|
||||
position: "{{steps.get_project.result.position}}"
|
||||
created_at: "{{steps.get_project.result.created_at}}"
|
||||
tags: "{{steps.get_tags.result}}"
|
||||
36
config/apps/prokov/scenarios/projects/delete.yaml
Normal file
36
config/apps/prokov/scenarios/projects/delete.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
# Scénario: Supprimer un projet
|
||||
name: projects_delete
|
||||
version: "1.0"
|
||||
description: Supprime un projet (cascade sur sous-projets et tâches)
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- id: check_project
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT id FROM projects WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Projet non trouvé"
|
||||
error_status: 404
|
||||
|
||||
- id: delete_project
|
||||
service: db
|
||||
action: delete
|
||||
params:
|
||||
table: projects
|
||||
where:
|
||||
id: "{{input.id}}"
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
message: "Projet supprimé"
|
||||
27
config/apps/prokov/scenarios/projects/list.yaml
Normal file
27
config/apps/prokov/scenarios/projects/list.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
# Scénario: Liste des projets (arborescence)
|
||||
name: projects_list
|
||||
version: "1.0"
|
||||
description: Retourne tous les projets de l'utilisateur en arborescence
|
||||
|
||||
steps:
|
||||
- id: get_projects
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT p.*,
|
||||
GROUP_CONCAT(t.id) as tag_ids,
|
||||
GROUP_CONCAT(t.name) as tag_names
|
||||
FROM projects p
|
||||
LEFT JOIN project_tags pt ON p.id = pt.project_id
|
||||
LEFT JOIN tags t ON pt.tag_id = t.id
|
||||
WHERE p.user_id = ?
|
||||
GROUP BY p.id
|
||||
ORDER BY p.parent_id ASC, p.position ASC, p.name ASC
|
||||
args: ["{{auth.user_id}}"]
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
data: "{{steps.get_projects.result | tree}}"
|
||||
57
config/apps/prokov/scenarios/projects/show.yaml
Normal file
57
config/apps/prokov/scenarios/projects/show.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
# Scénario: Détail d'un projet
|
||||
name: projects_show
|
||||
version: "1.0"
|
||||
description: Retourne un projet avec ses tags et sous-projets
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- id: get_project
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM projects WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Projet non trouvé"
|
||||
error_status: 404
|
||||
|
||||
- id: get_tags
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT t.id, t.name, t.color
|
||||
FROM tags t
|
||||
JOIN project_tags pt ON t.id = pt.tag_id
|
||||
WHERE pt.project_id = ?
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
- id: get_children
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT * FROM projects
|
||||
WHERE parent_id = ? AND user_id = ?
|
||||
ORDER BY position ASC, name ASC
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
data:
|
||||
id: "{{steps.get_project.result.id}}"
|
||||
name: "{{steps.get_project.result.name}}"
|
||||
description: "{{steps.get_project.result.description}}"
|
||||
parent_id: "{{steps.get_project.result.parent_id}}"
|
||||
position: "{{steps.get_project.result.position}}"
|
||||
created_at: "{{steps.get_project.result.created_at}}"
|
||||
tags: "{{steps.get_tags.result}}"
|
||||
children: "{{steps.get_children.result}}"
|
||||
115
config/apps/prokov/scenarios/projects/update.yaml
Normal file
115
config/apps/prokov/scenarios/projects/update.yaml
Normal file
@@ -0,0 +1,115 @@
|
||||
# Scénario: Modifier un projet
|
||||
name: projects_update
|
||||
version: "1.0"
|
||||
description: Met à jour un projet existant
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
optional:
|
||||
- name
|
||||
- description
|
||||
- parent_id
|
||||
- position
|
||||
- tags
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
name:
|
||||
type: string
|
||||
min_length: 1
|
||||
max_length: 100
|
||||
description:
|
||||
type: string
|
||||
max_length: 65535
|
||||
parent_id:
|
||||
type: int
|
||||
position:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- id: get_project
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM projects WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Projet non trouvé"
|
||||
error_status: 404
|
||||
|
||||
- id: check_parent
|
||||
service: db
|
||||
action: query_one
|
||||
condition: "{{input.parent_id != null && input.parent_id != input.id}}"
|
||||
params:
|
||||
query: "SELECT id FROM projects WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.parent_id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Projet parent invalide"
|
||||
error_status: 422
|
||||
|
||||
- id: update_project
|
||||
service: db
|
||||
action: update
|
||||
params:
|
||||
table: projects
|
||||
where:
|
||||
id: "{{input.id}}"
|
||||
data:
|
||||
name: "{{input.name ?? steps.get_project.result.name}}"
|
||||
description: "{{input.description ?? steps.get_project.result.description}}"
|
||||
parent_id: "{{input.parent_id ?? steps.get_project.result.parent_id}}"
|
||||
position: "{{input.position ?? steps.get_project.result.position}}"
|
||||
|
||||
- id: clear_tags
|
||||
service: db
|
||||
action: delete
|
||||
condition: "{{input.tags != null}}"
|
||||
params:
|
||||
table: project_tags
|
||||
where:
|
||||
project_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 project_tags (project_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 * FROM projects WHERE id = ?"
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
- id: get_tags
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT t.id, t.name, t.color
|
||||
FROM tags t
|
||||
JOIN project_tags pt ON t.id = pt.tag_id
|
||||
WHERE pt.project_id = ?
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
message: "Projet mis à jour"
|
||||
data:
|
||||
id: "{{steps.get_updated.result.id}}"
|
||||
name: "{{steps.get_updated.result.name}}"
|
||||
description: "{{steps.get_updated.result.description}}"
|
||||
parent_id: "{{steps.get_updated.result.parent_id}}"
|
||||
position: "{{steps.get_updated.result.position}}"
|
||||
tags: "{{steps.get_tags.result}}"
|
||||
68
config/apps/prokov/scenarios/statuses/create.yaml
Normal file
68
config/apps/prokov/scenarios/statuses/create.yaml
Normal file
@@ -0,0 +1,68 @@
|
||||
# Scénario: Créer un statut
|
||||
name: statuses_create
|
||||
version: "1.0"
|
||||
description: Crée un nouveau statut
|
||||
|
||||
input:
|
||||
required:
|
||||
- code
|
||||
- name
|
||||
optional:
|
||||
- color
|
||||
- project_id
|
||||
- position
|
||||
defaults:
|
||||
color: "#6B7280"
|
||||
validation:
|
||||
code:
|
||||
type: int
|
||||
name:
|
||||
type: string
|
||||
min_length: 1
|
||||
max_length: 50
|
||||
color:
|
||||
type: string
|
||||
max_length: 7
|
||||
project_id:
|
||||
type: int
|
||||
position:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- 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: insert_status
|
||||
service: db
|
||||
action: insert
|
||||
params:
|
||||
table: statuses
|
||||
data:
|
||||
user_id: "{{auth.user_id}}"
|
||||
project_id: "{{input.project_id}}"
|
||||
code: "{{input.code}}"
|
||||
name: "{{input.name}}"
|
||||
color: "{{input.color}}"
|
||||
position: "{{input.position ?? input.code}}"
|
||||
|
||||
- id: get_status
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM statuses WHERE id = ?"
|
||||
args: ["{{steps.insert_status.insert_id}}"]
|
||||
|
||||
output:
|
||||
status: 201
|
||||
body:
|
||||
success: true
|
||||
message: "Statut créé"
|
||||
data: "{{steps.get_status.result}}"
|
||||
51
config/apps/prokov/scenarios/statuses/delete.yaml
Normal file
51
config/apps/prokov/scenarios/statuses/delete.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
# Scénario: Supprimer un statut
|
||||
name: statuses_delete
|
||||
version: "1.0"
|
||||
description: Supprime un statut (si aucune tâche ne l'utilise)
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- id: check_status
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT id FROM statuses WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Statut non trouvé"
|
||||
error_status: 404
|
||||
|
||||
- id: count_tasks
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT COUNT(*) as count FROM tasks WHERE status_id = ?"
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
- id: check_usage
|
||||
service: system
|
||||
action: assert
|
||||
params:
|
||||
condition: "{{steps.count_tasks.result.count == 0}}"
|
||||
error_message: "Impossible de supprimer : {{steps.count_tasks.result.count}} tâche(s) utilisent ce statut"
|
||||
error_status: 409
|
||||
|
||||
- id: delete_status
|
||||
service: db
|
||||
action: delete
|
||||
params:
|
||||
table: statuses
|
||||
where:
|
||||
id: "{{input.id}}"
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
message: "Statut supprimé"
|
||||
44
config/apps/prokov/scenarios/statuses/list.yaml
Normal file
44
config/apps/prokov/scenarios/statuses/list.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
# Scénario: Liste des statuts
|
||||
name: statuses_list
|
||||
version: "1.0"
|
||||
description: Retourne les statuts avec filtres optionnels
|
||||
|
||||
input:
|
||||
optional:
|
||||
- project_id
|
||||
- global
|
||||
validation:
|
||||
project_id:
|
||||
type: int
|
||||
global:
|
||||
type: bool
|
||||
|
||||
steps:
|
||||
- id: get_statuses
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT s.*,
|
||||
(SELECT COUNT(*) FROM tasks t WHERE t.status_id = s.id) as task_count
|
||||
FROM statuses s
|
||||
WHERE s.user_id = ?
|
||||
AND (
|
||||
(? IS NOT NULL AND (s.project_id = ? OR s.project_id IS NULL))
|
||||
OR (? IS NOT NULL AND s.project_id IS NULL)
|
||||
OR (? IS NULL AND ? IS NULL)
|
||||
)
|
||||
ORDER BY s.position ASC, s.code ASC
|
||||
args:
|
||||
- "{{auth.user_id}}"
|
||||
- "{{input.project_id}}"
|
||||
- "{{input.project_id}}"
|
||||
- "{{input.global}}"
|
||||
- "{{input.project_id}}"
|
||||
- "{{input.global}}"
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
data: "{{steps.get_statuses.result}}"
|
||||
42
config/apps/prokov/scenarios/statuses/show.yaml
Normal file
42
config/apps/prokov/scenarios/statuses/show.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
# Scénario: Détail d'un statut
|
||||
name: statuses_show
|
||||
version: "1.0"
|
||||
description: Retourne un statut avec le nombre de tâches
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- id: get_status
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM statuses WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Statut non trouvé"
|
||||
error_status: 404
|
||||
|
||||
- id: count_tasks
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT COUNT(*) as count FROM tasks WHERE status_id = ?"
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
data:
|
||||
id: "{{steps.get_status.result.id}}"
|
||||
code: "{{steps.get_status.result.code}}"
|
||||
name: "{{steps.get_status.result.name}}"
|
||||
color: "{{steps.get_status.result.color}}"
|
||||
project_id: "{{steps.get_status.result.project_id}}"
|
||||
position: "{{steps.get_status.result.position}}"
|
||||
task_count: "{{steps.count_tasks.result.count}}"
|
||||
65
config/apps/prokov/scenarios/statuses/update.yaml
Normal file
65
config/apps/prokov/scenarios/statuses/update.yaml
Normal file
@@ -0,0 +1,65 @@
|
||||
# Scénario: Modifier un statut
|
||||
name: statuses_update
|
||||
version: "1.0"
|
||||
description: Met à jour un statut existant
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
optional:
|
||||
- code
|
||||
- name
|
||||
- color
|
||||
- position
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
code:
|
||||
type: int
|
||||
name:
|
||||
type: string
|
||||
min_length: 1
|
||||
max_length: 50
|
||||
color:
|
||||
type: string
|
||||
max_length: 7
|
||||
position:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- id: get_status
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM statuses WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Statut non trouvé"
|
||||
error_status: 404
|
||||
|
||||
- id: update_status
|
||||
service: db
|
||||
action: update
|
||||
params:
|
||||
table: statuses
|
||||
where:
|
||||
id: "{{input.id}}"
|
||||
data:
|
||||
code: "{{input.code ?? steps.get_status.result.code}}"
|
||||
name: "{{input.name ?? steps.get_status.result.name}}"
|
||||
color: "{{input.color ?? steps.get_status.result.color}}"
|
||||
position: "{{input.position ?? steps.get_status.result.position}}"
|
||||
|
||||
- id: get_updated
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM statuses WHERE id = ?"
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
message: "Statut mis à jour"
|
||||
data: "{{steps.get_updated.result}}"
|
||||
55
config/apps/prokov/scenarios/tags/create.yaml
Normal file
55
config/apps/prokov/scenarios/tags/create.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
# Scénario: Créer un tag
|
||||
name: tags_create
|
||||
version: "1.0"
|
||||
description: Crée un nouveau tag
|
||||
|
||||
input:
|
||||
required:
|
||||
- name
|
||||
optional:
|
||||
- color
|
||||
defaults:
|
||||
color: "#3B82F6"
|
||||
validation:
|
||||
name:
|
||||
type: string
|
||||
min_length: 1
|
||||
max_length: 50
|
||||
color:
|
||||
type: string
|
||||
max_length: 7
|
||||
|
||||
steps:
|
||||
- id: check_unique
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT id FROM tags WHERE user_id = ? AND name = ?"
|
||||
args: ["{{auth.user_id}}", "{{input.name}}"]
|
||||
on_success: abort
|
||||
error_message: "Ce tag existe déjà"
|
||||
error_status: 409
|
||||
|
||||
- id: insert_tag
|
||||
service: db
|
||||
action: insert
|
||||
params:
|
||||
table: tags
|
||||
data:
|
||||
user_id: "{{auth.user_id}}"
|
||||
name: "{{input.name}}"
|
||||
color: "{{input.color}}"
|
||||
|
||||
- id: get_tag
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM tags WHERE id = ?"
|
||||
args: ["{{steps.insert_tag.insert_id}}"]
|
||||
|
||||
output:
|
||||
status: 201
|
||||
body:
|
||||
success: true
|
||||
message: "Tag créé"
|
||||
data: "{{steps.get_tag.result}}"
|
||||
36
config/apps/prokov/scenarios/tags/delete.yaml
Normal file
36
config/apps/prokov/scenarios/tags/delete.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
# Scénario: Supprimer un tag
|
||||
name: tags_delete
|
||||
version: "1.0"
|
||||
description: Supprime un tag (les associations sont supprimées en cascade)
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- id: check_tag
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT id FROM tags WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Tag non trouvé"
|
||||
error_status: 404
|
||||
|
||||
- id: delete_tag
|
||||
service: db
|
||||
action: delete
|
||||
params:
|
||||
table: tags
|
||||
where:
|
||||
id: "{{input.id}}"
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
message: "Tag supprimé"
|
||||
24
config/apps/prokov/scenarios/tags/list.yaml
Normal file
24
config/apps/prokov/scenarios/tags/list.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
# Scénario: Liste des tags
|
||||
name: tags_list
|
||||
version: "1.0"
|
||||
description: Retourne tous les tags de l'utilisateur avec compteurs
|
||||
|
||||
steps:
|
||||
- id: get_tags
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT t.*,
|
||||
(SELECT COUNT(*) FROM project_tags pt WHERE pt.tag_id = t.id) as project_count,
|
||||
(SELECT COUNT(*) FROM task_tags tt WHERE tt.tag_id = t.id) as task_count
|
||||
FROM tags t
|
||||
WHERE t.user_id = ?
|
||||
ORDER BY t.name ASC
|
||||
args: ["{{auth.user_id}}"]
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
data: "{{steps.get_tags.result}}"
|
||||
58
config/apps/prokov/scenarios/tags/show.yaml
Normal file
58
config/apps/prokov/scenarios/tags/show.yaml
Normal file
@@ -0,0 +1,58 @@
|
||||
# Scénario: Détail d'un tag
|
||||
name: tags_show
|
||||
version: "1.0"
|
||||
description: Retourne un tag avec ses projets et tâches associés
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
|
||||
steps:
|
||||
- id: get_tag
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM tags WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Tag non trouvé"
|
||||
error_status: 404
|
||||
|
||||
- id: get_projects
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT p.id, p.name
|
||||
FROM projects p
|
||||
JOIN project_tags pt ON p.id = pt.project_id
|
||||
WHERE pt.tag_id = ?
|
||||
ORDER BY p.name ASC
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
- id: get_tasks
|
||||
service: db
|
||||
action: query
|
||||
params:
|
||||
query: |
|
||||
SELECT t.id, t.title, t.status_id, s.name as status_name
|
||||
FROM tasks t
|
||||
JOIN task_tags tt ON t.id = tt.task_id
|
||||
LEFT JOIN statuses s ON t.status_id = s.id
|
||||
WHERE tt.tag_id = ?
|
||||
ORDER BY t.created_at DESC
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
data:
|
||||
id: "{{steps.get_tag.result.id}}"
|
||||
name: "{{steps.get_tag.result.name}}"
|
||||
color: "{{steps.get_tag.result.color}}"
|
||||
projects: "{{steps.get_projects.result}}"
|
||||
tasks: "{{steps.get_tasks.result}}"
|
||||
68
config/apps/prokov/scenarios/tags/update.yaml
Normal file
68
config/apps/prokov/scenarios/tags/update.yaml
Normal file
@@ -0,0 +1,68 @@
|
||||
# Scénario: Modifier un tag
|
||||
name: tags_update
|
||||
version: "1.0"
|
||||
description: Met à jour un tag existant
|
||||
|
||||
input:
|
||||
required:
|
||||
- id
|
||||
optional:
|
||||
- name
|
||||
- color
|
||||
validation:
|
||||
id:
|
||||
type: int
|
||||
name:
|
||||
type: string
|
||||
min_length: 1
|
||||
max_length: 50
|
||||
color:
|
||||
type: string
|
||||
max_length: 7
|
||||
|
||||
steps:
|
||||
- id: get_tag
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM tags WHERE id = ? AND user_id = ?"
|
||||
args: ["{{input.id}}", "{{auth.user_id}}"]
|
||||
on_error: abort
|
||||
error_message: "Tag non trouvé"
|
||||
error_status: 404
|
||||
|
||||
- id: check_unique
|
||||
service: db
|
||||
action: query_one
|
||||
condition: "{{input.name != null}}"
|
||||
params:
|
||||
query: "SELECT id FROM tags WHERE user_id = ? AND name = ? AND id != ?"
|
||||
args: ["{{auth.user_id}}", "{{input.name}}", "{{input.id}}"]
|
||||
on_success: abort
|
||||
error_message: "Ce tag existe déjà"
|
||||
error_status: 409
|
||||
|
||||
- id: update_tag
|
||||
service: db
|
||||
action: update
|
||||
params:
|
||||
table: tags
|
||||
where:
|
||||
id: "{{input.id}}"
|
||||
data:
|
||||
name: "{{input.name ?? steps.get_tag.result.name}}"
|
||||
color: "{{input.color ?? steps.get_tag.result.color}}"
|
||||
|
||||
- id: get_updated
|
||||
service: db
|
||||
action: query_one
|
||||
params:
|
||||
query: "SELECT * FROM tags WHERE id = ?"
|
||||
args: ["{{input.id}}"]
|
||||
|
||||
output:
|
||||
status: 200
|
||||
body:
|
||||
success: true
|
||||
message: "Tag mis à jour"
|
||||
data: "{{steps.get_updated.result}}"
|
||||
135
config/apps/prokov/scenarios/tasks/create.yaml
Normal file
135
config/apps/prokov/scenarios/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/apps/prokov/scenarios/tasks/delete.yaml
Normal file
36
config/apps/prokov/scenarios/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/apps/prokov/scenarios/tasks/list.yaml
Normal file
67
config/apps/prokov/scenarios/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/apps/prokov/scenarios/tasks/show.yaml
Normal file
61
config/apps/prokov/scenarios/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/apps/prokov/scenarios/tasks/update.yaml
Normal file
140
config/apps/prokov/scenarios/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}}"
|
||||
255
config/apps/prokov/schema.yaml
Normal file
255
config/apps/prokov/schema.yaml
Normal file
@@ -0,0 +1,255 @@
|
||||
app: prokov
|
||||
tables:
|
||||
project_tags:
|
||||
columns:
|
||||
project_id:
|
||||
foreign: projects.id
|
||||
primary: true
|
||||
required: true
|
||||
type: int
|
||||
tag_id:
|
||||
foreign: tags.id
|
||||
primary: true
|
||||
required: true
|
||||
type: int
|
||||
crud: []
|
||||
primary:
|
||||
- project_id
|
||||
- tag_id
|
||||
projects:
|
||||
columns:
|
||||
created_at:
|
||||
default: current_timestamp()
|
||||
type: datetime
|
||||
description:
|
||||
default: "NULL"
|
||||
length: 65535
|
||||
type: text
|
||||
id:
|
||||
auto: true
|
||||
primary: true
|
||||
required: true
|
||||
type: int
|
||||
name:
|
||||
length: 100
|
||||
required: true
|
||||
type: string
|
||||
parent_id:
|
||||
default: "NULL"
|
||||
foreign: projects.id
|
||||
type: int
|
||||
position:
|
||||
default: "0"
|
||||
type: int
|
||||
updated_at:
|
||||
default: current_timestamp()
|
||||
type: datetime
|
||||
user_id:
|
||||
filter: owner
|
||||
foreign: users.id
|
||||
required: true
|
||||
type: int
|
||||
crud:
|
||||
- list
|
||||
- show
|
||||
- create
|
||||
- update
|
||||
- delete
|
||||
statuses:
|
||||
columns:
|
||||
code:
|
||||
required: true
|
||||
type: int
|
||||
color:
|
||||
default: '''#6B7280'''
|
||||
length: 7
|
||||
type: string
|
||||
created_at:
|
||||
default: current_timestamp()
|
||||
type: datetime
|
||||
id:
|
||||
auto: true
|
||||
primary: true
|
||||
required: true
|
||||
type: int
|
||||
name:
|
||||
length: 50
|
||||
required: true
|
||||
type: string
|
||||
position:
|
||||
default: "0"
|
||||
type: int
|
||||
project_id:
|
||||
default: "NULL"
|
||||
type: int
|
||||
user_id:
|
||||
filter: owner
|
||||
foreign: users.id
|
||||
required: true
|
||||
type: int
|
||||
crud:
|
||||
- list
|
||||
- show
|
||||
- create
|
||||
- update
|
||||
- delete
|
||||
tags:
|
||||
columns:
|
||||
color:
|
||||
default: '''#3B82F6'''
|
||||
length: 7
|
||||
type: string
|
||||
created_at:
|
||||
default: current_timestamp()
|
||||
type: datetime
|
||||
id:
|
||||
auto: true
|
||||
primary: true
|
||||
required: true
|
||||
type: int
|
||||
name:
|
||||
length: 50
|
||||
required: true
|
||||
type: string
|
||||
unique: true
|
||||
user_id:
|
||||
filter: owner
|
||||
foreign: users.id
|
||||
required: true
|
||||
type: int
|
||||
unique: true
|
||||
crud:
|
||||
- list
|
||||
- show
|
||||
- create
|
||||
- update
|
||||
- delete
|
||||
task_tags:
|
||||
columns:
|
||||
tag_id:
|
||||
foreign: tags.id
|
||||
primary: true
|
||||
required: true
|
||||
type: int
|
||||
task_id:
|
||||
foreign: tasks.id
|
||||
primary: true
|
||||
required: true
|
||||
type: int
|
||||
crud: []
|
||||
primary:
|
||||
- task_id
|
||||
- tag_id
|
||||
tasks:
|
||||
columns:
|
||||
billing:
|
||||
default: "0.00"
|
||||
type: float
|
||||
created_at:
|
||||
default: current_timestamp()
|
||||
type: datetime
|
||||
date_end:
|
||||
default: "NULL"
|
||||
type: date
|
||||
date_start:
|
||||
default: "NULL"
|
||||
type: date
|
||||
description:
|
||||
default: "NULL"
|
||||
length: 65535
|
||||
type: text
|
||||
id:
|
||||
auto: true
|
||||
primary: true
|
||||
required: true
|
||||
type: int
|
||||
position:
|
||||
default: "0"
|
||||
type: int
|
||||
priority:
|
||||
default: "5"
|
||||
type: int
|
||||
project_id:
|
||||
foreign: projects.id
|
||||
required: true
|
||||
type: int
|
||||
status_id:
|
||||
foreign: statuses.id
|
||||
required: true
|
||||
type: int
|
||||
time_estimated:
|
||||
default: "0"
|
||||
type: int
|
||||
time_spent:
|
||||
default: "0"
|
||||
type: int
|
||||
title:
|
||||
length: 255
|
||||
required: true
|
||||
type: string
|
||||
updated_at:
|
||||
default: current_timestamp()
|
||||
type: datetime
|
||||
user_id:
|
||||
filter: owner
|
||||
foreign: users.id
|
||||
required: true
|
||||
type: int
|
||||
crud:
|
||||
- list
|
||||
- show
|
||||
- create
|
||||
- update
|
||||
- delete
|
||||
users:
|
||||
columns:
|
||||
created_at:
|
||||
default: current_timestamp()
|
||||
type: datetime
|
||||
email:
|
||||
length: 255
|
||||
required: true
|
||||
type: string
|
||||
unique: true
|
||||
id:
|
||||
auto: true
|
||||
primary: true
|
||||
required: true
|
||||
type: int
|
||||
name:
|
||||
length: 100
|
||||
required: true
|
||||
type: string
|
||||
password:
|
||||
length: 255
|
||||
required: true
|
||||
type: string
|
||||
role_id:
|
||||
default: "1"
|
||||
foreign: users_roles.id
|
||||
required: true
|
||||
type: int
|
||||
updated_at:
|
||||
default: current_timestamp()
|
||||
type: datetime
|
||||
crud:
|
||||
- list
|
||||
- show
|
||||
- create
|
||||
- update
|
||||
- delete
|
||||
users_roles:
|
||||
columns:
|
||||
created_at:
|
||||
default: current_timestamp()
|
||||
type: datetime
|
||||
id:
|
||||
primary: true
|
||||
required: true
|
||||
type: int
|
||||
name:
|
||||
length: 50
|
||||
required: true
|
||||
type: string
|
||||
crud: []
|
||||
version: "1.0"
|
||||
Reference in New Issue
Block a user