first commit
This commit is contained in:
commit
e6c52820cd
227 changed files with 16156 additions and 0 deletions
27
modules/proposition/app.py
Normal file
27
modules/proposition/app.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Importation des modules nécessaires
|
||||
from modules.proposition.fields import fields
|
||||
from core.form import Form
|
||||
from core.generator import Generator
|
||||
from core.data import Data
|
||||
|
||||
def main():
|
||||
print("=== Générateur de proposition commerciale ===\n")
|
||||
|
||||
form = Form(fields())
|
||||
form.ask()
|
||||
data = form.get_data()
|
||||
|
||||
# Transformer les fonctionnalités en une liste de dictionnaires
|
||||
features = data.get("features", "").split(",")
|
||||
data["features"] = [{"description": feature.strip()} for feature in features if feature.strip()]
|
||||
|
||||
client_name = data.get("client_name", "").replace(" ", "_").lower()
|
||||
|
||||
data_manager = Data(f"Data/clients/{client_name}.json")
|
||||
client_data = data_manager.save_data(data)
|
||||
print("\n✅ Données du client enregistrées avec succès.")
|
||||
|
||||
generator = Generator(data)
|
||||
content = generator.generate_pdf("propositions")
|
||||
|
||||
print("\n✅ Proposition générée avec succès.")
|
||||
16
modules/proposition/fields.py
Normal file
16
modules/proposition/fields.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
def fields() -> list[dict]:
|
||||
return [
|
||||
{"name": "client_name", "label": "Nom du client", "type": "text", "required": True},
|
||||
{"name": "email", "label": "Email", "type": "email"},
|
||||
{"name": "telephone", "label": "Téléphone", "type": "tel"},
|
||||
{"name": "adresse", "label": "Adresse", "type": "text"},
|
||||
{"name": "project_name", "label": "Nom du projet", "type": "text", "required": True},
|
||||
{"name": "project_type", "label": "Type de projet", "type": "text"},
|
||||
{"name": "deadline", "label": "Délai de livraison", "type": "date"},
|
||||
{"name": "project_description", "label": "Description du projet", "type": "textarea"},
|
||||
{"name": "features", "label": "Fonctionnalités principales (séparées par des virgules)", "type": "textarea"},
|
||||
{"name": "budget", "label": "Budget estimé", "type": "text"},
|
||||
{"name": "payment_terms", "label": "Conditions de paiement", "type": "text"},
|
||||
{"name": "contact_info", "label": "Coordonnées", "type": "text"},
|
||||
{"name": "additional_info", "label": "Informations complémentaires", "type": "textarea"}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue