Some checks are pending
CI / Lint bridge (Biome) (push) Waiting to run
CI / Type-check bridge (push) Blocked by required conditions
CI / Tests unit bridge (push) Blocked by required conditions
CI / Tests integration bridge (push) Blocked by required conditions
CI / Security scan (push) Waiting to run
CI / Docker build + healthcheck (push) Blocked by required conditions
- schema.json : 17 formulas (rollups + heures_restantes) ajoutees + related_field_name explicite sur les 10 liens - seed.py : 3 nouveaux methodes (create_formula_field, rename_field, create_link_field returns dict) - seed.py : pass 5/6 renomme automatiquement les related fields apres link creation - seed.py : pass 6/6 cree les formulas (idempotent) - README.md : section formulas updated Iteration 2 du plan Fast-App couverte. Apres seed, les rollups (formation_heures_attribuees, personne_heures_restantes_total, etc.) sont automatiques.
220 lines
12 KiB
JSON
220 lines
12 KiB
JSON
{
|
|
"$schema": "Baserow schema declaratif — formation-hub Phase 1",
|
|
"version": "1.0.0",
|
|
"workspace_name": "Acadenice",
|
|
"database_name": "formation-hub",
|
|
"tables": [
|
|
{
|
|
"name": "personne",
|
|
"primary_field": "personne_nom",
|
|
"fields": [
|
|
{"name": "personne_nom", "type": "text", "primary": true},
|
|
{"name": "personne_prenom", "type": "text"},
|
|
{"name": "personne_email", "type": "email"},
|
|
{"name": "personne_telephone", "type": "phone_number"},
|
|
{"name": "personne_capacite_annuelle", "type": "number", "number_decimal_places": 2},
|
|
{"name": "personne_split_formation_pct", "type": "number", "number_decimal_places": 1, "number_default": 50.0},
|
|
{"name": "personne_split_agence_pct", "type": "number", "number_decimal_places": 1, "number_default": 50.0},
|
|
{"name": "personne_roles", "type": "multiple_select", "select_options": [
|
|
{"value": "formateur", "color": "blue"},
|
|
{"value": "developpeur", "color": "green"},
|
|
{"value": "admin", "color": "red"},
|
|
{"value": "direction", "color": "purple"},
|
|
{"value": "support", "color": "gray"}
|
|
]},
|
|
{"name": "personne_statut", "type": "single_select", "select_options": [
|
|
{"value": "actif", "color": "green"},
|
|
{"value": "inactif", "color": "gray"}
|
|
]}
|
|
]
|
|
},
|
|
{
|
|
"name": "formation",
|
|
"primary_field": "formation_nom",
|
|
"fields": [
|
|
{"name": "formation_nom", "type": "text", "primary": true},
|
|
{"name": "formation_description", "type": "long_text"},
|
|
{"name": "formation_filiere", "type": "single_select", "select_options": [
|
|
{"value": "dev", "color": "blue"},
|
|
{"value": "graphisme", "color": "pink"},
|
|
{"value": "marketing", "color": "yellow"},
|
|
{"value": "iot", "color": "orange"},
|
|
{"value": "cybersec", "color": "red"}
|
|
]},
|
|
{"name": "formation_heures_totales", "type": "number", "number_decimal_places": 2},
|
|
{"name": "formation_statut", "type": "single_select", "select_options": [
|
|
{"value": "draft", "color": "gray"},
|
|
{"value": "actif", "color": "green"},
|
|
{"value": "termine", "color": "blue"},
|
|
{"value": "archive", "color": "dark-gray"}
|
|
]},
|
|
{"name": "formation_date_debut", "type": "date"},
|
|
{"name": "formation_date_fin", "type": "date"},
|
|
{"name": "formation_created_at", "type": "created_on"},
|
|
{"name": "formation_updated_at", "type": "last_modified"}
|
|
]
|
|
},
|
|
{
|
|
"name": "bloc",
|
|
"primary_field": "bloc_nom",
|
|
"fields": [
|
|
{"name": "bloc_nom", "type": "text", "primary": true},
|
|
{"name": "bloc_description", "type": "long_text"},
|
|
{"name": "bloc_heures_prevues", "type": "number", "number_decimal_places": 2},
|
|
{"name": "bloc_ordre", "type": "number", "number_decimal_places": 0}
|
|
]
|
|
},
|
|
{
|
|
"name": "module",
|
|
"primary_field": "module_nom",
|
|
"fields": [
|
|
{"name": "module_nom", "type": "text", "primary": true},
|
|
{"name": "module_description", "type": "long_text"},
|
|
{"name": "module_heures_prevues", "type": "number", "number_decimal_places": 2},
|
|
{"name": "module_statut", "type": "single_select", "select_options": [
|
|
{"value": "a_attribuer", "color": "gray"},
|
|
{"value": "attribue", "color": "blue"},
|
|
{"value": "en_cours", "color": "yellow"},
|
|
{"value": "realise", "color": "green"},
|
|
{"value": "annule", "color": "red"}
|
|
]}
|
|
]
|
|
},
|
|
{
|
|
"name": "attribution",
|
|
"primary_field": "attribution_titre",
|
|
"fields": [
|
|
{"name": "attribution_titre", "type": "text", "primary": true, "comment": "Sera remplace par formula apres link"},
|
|
{"name": "attribution_heures_attribuees", "type": "number", "number_decimal_places": 2},
|
|
{"name": "attribution_heures_realisees", "type": "number", "number_decimal_places": 2, "number_default": 0},
|
|
{"name": "attribution_date_debut", "type": "date"},
|
|
{"name": "attribution_date_fin", "type": "date"},
|
|
{"name": "attribution_statut", "type": "single_select", "select_options": [
|
|
{"value": "planifie", "color": "gray"},
|
|
{"value": "en_cours", "color": "yellow"},
|
|
{"value": "realise", "color": "green"},
|
|
{"value": "annule", "color": "red"}
|
|
]}
|
|
]
|
|
},
|
|
{
|
|
"name": "client",
|
|
"primary_field": "client_nom",
|
|
"fields": [
|
|
{"name": "client_nom", "type": "text", "primary": true},
|
|
{"name": "client_contact_principal", "type": "text"},
|
|
{"name": "client_contact_email", "type": "email"},
|
|
{"name": "client_contact_telephone", "type": "phone_number"},
|
|
{"name": "client_secteur", "type": "text"},
|
|
{"name": "client_notes", "type": "long_text"},
|
|
{"name": "client_statut", "type": "single_select", "select_options": [
|
|
{"value": "prospect", "color": "yellow"},
|
|
{"value": "actif", "color": "green"},
|
|
{"value": "inactif", "color": "gray"},
|
|
{"value": "archive", "color": "dark-gray"}
|
|
]},
|
|
{"name": "client_created_at", "type": "created_on"}
|
|
]
|
|
},
|
|
{
|
|
"name": "projet",
|
|
"primary_field": "projet_nom",
|
|
"fields": [
|
|
{"name": "projet_nom", "type": "text", "primary": true},
|
|
{"name": "projet_description", "type": "long_text"},
|
|
{"name": "projet_type", "type": "single_select", "select_options": [
|
|
{"value": "site_web", "color": "blue"},
|
|
{"value": "app_mobile", "color": "green"},
|
|
{"value": "api", "color": "yellow"},
|
|
{"value": "infra", "color": "orange"},
|
|
{"value": "audit", "color": "red"},
|
|
{"value": "support", "color": "purple"},
|
|
{"value": "autre", "color": "gray"}
|
|
]},
|
|
{"name": "projet_charge_heures", "type": "number", "number_decimal_places": 2},
|
|
{"name": "projet_date_debut", "type": "date"},
|
|
{"name": "projet_date_fin_prevue", "type": "date"},
|
|
{"name": "projet_date_livraison", "type": "date"},
|
|
{"name": "projet_statut", "type": "single_select", "select_options": [
|
|
{"value": "devis", "color": "yellow"},
|
|
{"value": "en_cours", "color": "blue"},
|
|
{"value": "livre", "color": "green"},
|
|
{"value": "cloture", "color": "dark-green"},
|
|
{"value": "abandonne", "color": "red"}
|
|
]},
|
|
{"name": "projet_url", "type": "url"},
|
|
{"name": "projet_repository", "type": "url"}
|
|
]
|
|
},
|
|
{
|
|
"name": "tache",
|
|
"primary_field": "tache_titre",
|
|
"fields": [
|
|
{"name": "tache_titre", "type": "text", "primary": true},
|
|
{"name": "tache_description", "type": "long_text"},
|
|
{"name": "tache_charge_heures", "type": "number", "number_decimal_places": 2},
|
|
{"name": "tache_priorite", "type": "single_select", "select_options": [
|
|
{"value": "faible", "color": "gray"},
|
|
{"value": "normale", "color": "blue"},
|
|
{"value": "haute", "color": "orange"},
|
|
{"value": "critique", "color": "red"}
|
|
]},
|
|
{"name": "tache_statut", "type": "single_select", "select_options": [
|
|
{"value": "todo", "color": "gray"},
|
|
{"value": "in_progress", "color": "blue"},
|
|
{"value": "review", "color": "yellow"},
|
|
{"value": "done", "color": "green"},
|
|
{"value": "abandoned", "color": "red"}
|
|
]},
|
|
{"name": "tache_date_debut", "type": "date"},
|
|
{"name": "tache_date_fin_prevue", "type": "date"}
|
|
]
|
|
},
|
|
{
|
|
"name": "intervention",
|
|
"primary_field": "intervention_titre",
|
|
"fields": [
|
|
{"name": "intervention_titre", "type": "text", "primary": true, "comment": "Sera remplace par formula apres link"},
|
|
{"name": "intervention_heures", "type": "number", "number_decimal_places": 2},
|
|
{"name": "intervention_date", "type": "date"},
|
|
{"name": "intervention_notes", "type": "long_text"},
|
|
{"name": "intervention_statut", "type": "single_select", "select_options": [
|
|
{"value": "planifie", "color": "gray"},
|
|
{"value": "realise", "color": "green"},
|
|
{"value": "annule", "color": "red"}
|
|
]}
|
|
]
|
|
}
|
|
],
|
|
"links": [
|
|
{"from_table": "bloc", "from_field": "bloc_formation", "to_table": "formation", "related_field_name": "formation_blocs"},
|
|
{"from_table": "module", "from_field": "module_bloc", "to_table": "bloc", "related_field_name": "bloc_modules"},
|
|
{"from_table": "attribution", "from_field": "attribution_module", "to_table": "module", "related_field_name": "module_attributions"},
|
|
{"from_table": "attribution", "from_field": "attribution_personne", "to_table": "personne", "related_field_name": "personne_attributions"},
|
|
{"from_table": "projet", "from_field": "projet_client", "to_table": "client", "related_field_name": "client_projets"},
|
|
{"from_table": "projet", "from_field": "projet_formation_pedagogique", "to_table": "formation", "related_field_name": "formation_projets_pedagogiques"},
|
|
{"from_table": "tache", "from_field": "tache_projet", "to_table": "projet", "related_field_name": "projet_taches"},
|
|
{"from_table": "tache", "from_field": "tache_assignee", "to_table": "personne", "related_field_name": "personne_taches_assignees"},
|
|
{"from_table": "intervention", "from_field": "intervention_tache", "to_table": "tache", "related_field_name": "tache_interventions"},
|
|
{"from_table": "intervention", "from_field": "intervention_personne", "to_table": "personne", "related_field_name": "personne_interventions"}
|
|
],
|
|
"formulas": [
|
|
{"table": "module", "name": "module_heures_prevues_active", "expression": "if(field('module_statut') = 'annule', 0, field('module_heures_prevues'))"},
|
|
{"table": "attribution", "name": "attribution_heures_attribuees_active", "expression": "if(field('attribution_statut') = 'annule', 0, field('attribution_heures_attribuees'))"},
|
|
{"table": "intervention", "name": "intervention_heures_active", "expression": "if(field('intervention_statut') = 'annule', 0, field('intervention_heures'))"},
|
|
{"table": "bloc", "name": "bloc_heures_attribuees", "expression": "sum(lookup('bloc_modules', 'module_heures_prevues_active'))"},
|
|
{"table": "bloc", "name": "bloc_heures_restantes", "expression": "field('bloc_heures_prevues') - field('bloc_heures_attribuees')"},
|
|
{"table": "module", "name": "module_heures_attribuees", "expression": "sum(lookup('module_attributions', 'attribution_heures_attribuees_active'))"},
|
|
{"table": "module", "name": "module_heures_realisees", "expression": "sum(lookup('module_attributions', 'attribution_heures_realisees'))"},
|
|
{"table": "formation", "name": "formation_heures_attribuees", "expression": "sum(lookup('formation_blocs', 'bloc_heures_prevues'))"},
|
|
{"table": "formation", "name": "formation_heures_restantes", "expression": "field('formation_heures_totales') - field('formation_heures_attribuees')"},
|
|
{"table": "personne", "name": "personne_heures_attribuees_formation", "expression": "sum(lookup('personne_attributions', 'attribution_heures_attribuees_active'))"},
|
|
{"table": "personne", "name": "personne_heures_attribuees_agence", "expression": "sum(lookup('personne_interventions', 'intervention_heures_active'))"},
|
|
{"table": "personne", "name": "personne_heures_restantes_formation", "expression": "(field('personne_capacite_annuelle') * field('personne_split_formation_pct') / 100) - field('personne_heures_attribuees_formation')"},
|
|
{"table": "personne", "name": "personne_heures_restantes_agence", "expression": "(field('personne_capacite_annuelle') * field('personne_split_agence_pct') / 100) - field('personne_heures_attribuees_agence')"},
|
|
{"table": "personne", "name": "personne_heures_restantes_total", "expression": "field('personne_capacite_annuelle') - field('personne_heures_attribuees_formation') - field('personne_heures_attribuees_agence')"},
|
|
{"table": "tache", "name": "tache_heures_realisees", "expression": "sum(lookup('tache_interventions', 'intervention_heures_active'))"},
|
|
{"table": "projet", "name": "projet_heures_realisees", "expression": "sum(lookup('projet_taches', 'tache_heures_realisees'))"},
|
|
{"table": "projet", "name": "projet_heures_restantes", "expression": "field('projet_charge_heures') - field('projet_heures_realisees')"}
|
|
]
|
|
}
|