Commit Graph

10 Commits

Author SHA1 Message Date
Julien Nahum ae21cae8cd
Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks

- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.

These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.

* Refactor Dockerfile for Improved Build Process

- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.

These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
JhumanJ 89885d418e Update tax rate for Finland in GenerateTaxExport command
- Modified the tax rate for Finland from 24 to 25.5 in the `GenerateTaxExport.php` command file. This change reflects the updated tax regulations and ensures accurate tax calculations in the export process.

These modifications aim to maintain compliance with the latest tax standards and improve the reliability of tax-related functionalities.
2025-04-28 14:25:23 +02:00
Chirag Chhatrala 61e9493e1e
Add Template Creation Functionality in Admin Panel (#729)
* Add create template functionality in Admin Panel

- Implemented a new endpoint for creating templates in AdminController, utilizing the GenerateTemplate command.
- Added a form in the admin settings Vue component to allow users to input a template description and submit it.
- Enhanced the user experience with loading states and success/error alerts during template creation.

These changes facilitate the generation of new form templates directly from the admin interface, improving usability and functionality.

* Update template prompt validation length in AdminController

- Increased the maximum length of the 'template_prompt' field from 1000 to 4000 characters in the createTemplate method.

This change allows for more extensive template descriptions, enhancing the flexibility of template creation in the admin panel.

* Refactor template generation to use job-based approach

- Migrate template generation logic from the GenerateTemplate command to a new GenerateTemplateJob class for improved separation of concerns and better handling of asynchronous processing.
- Update AdminController to utilize the new job for generating templates, enhancing maintainability and clarity in the codebase.
- Remove unused dependencies and streamline the command's handle method for better performance and readability.

* fix lint

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-25 12:14:09 +01:00
Chirag Chhatrala aa5c1acf3a
Decouple title from title block (#696)
* Decouple title from title block

* fix lint

* remove dry run for FormTitleMigration

* Skip form title migration for forms with hidden titles

* Refactor AI Form Generation with Dedicated Prompt Services

- Extract AI form generation logic from GenerateTemplate command into dedicated prompt service classes
- Update GenerateAiForm job to use new prompt generation services
- Improve GptCompleter with more robust error handling and token tracking
- Add error field to AiFormCompletion model for better error logging
- Simplify command signature from 'ai:make-form-template' to 'form:generate'

* Consolidate Template Metadata Generation with Unified Prompt Service

- Create GenerateTemplateMetadataPrompt to centralize template metadata generation
- Update GenerateTemplate command to use new consolidated metadata generation approach
- Enhance GptCompleter to support strict JSON schema validation
- Increase form prompt max length to support more complex form descriptions
- Refactor form generation to simplify metadata extraction and processing

* Implement Form Mode Strategy for Flexible Form Rendering

- Introduce FormModeStrategy to centralize form rendering logic
- Add support for different form modes: LIVE, PREVIEW, TEST, EDIT, PREFILL
- Refactor components to use mode-based rendering strategy
- Remove legacy boolean props like adminPreview and creating
- Enhance form component flexibility and reusability

* Refine Form Mode Strategy Display Behavior

- Update FormModeStrategy to hide hidden fields in PREVIEW mode
- Add FormMode getter in UrlFormPrefill component for mode-specific rendering
- Clarify mode-specific validation and display logic in form strategies

* Enhance Form Template Generation with Advanced Field Options

- Update GenerateTemplate command to use front_url for template URL output
- Expand GenerateFormPrompt with comprehensive field configuration options
- Add support for advanced field types: date with time, toggle switches, radio/checkbox selections
- Introduce field width configuration and HTML formatting for text elements
- Re-enable select, multi-select, and matrix field type definitions with enhanced configurations

* Remove Deprecated Template Metadata Generation Services

- Delete multiple AI prompt services related to template metadata generation
- Simplify GenerateTemplate command to use default values instead of complex metadata generation
- Remove GenerateTemplateMetadataPrompt and related classes like GenerateTemplateDescriptionPrompt, GenerateTemplateImageKeywordsPrompt, etc.
- Update form template generation to use basic fallback metadata generation approach

* Restore GenerateTemplateMetadataPrompt for Comprehensive Template Generation

- Reintroduce GenerateTemplateMetadataPrompt to replace default metadata generation
- Update GenerateTemplate command to use consolidated metadata generation approach
- Extract detailed metadata components including title, description, industries, and image search query
- Improve template generation with more dynamic and AI-generated metadata

* Refactor Template Preview Section Layout

- Remove unnecessary nested div in template preview section
- Simplify HTML structure for the template preview component
- Maintain existing styling and functionality while improving code readability

* Refactor Constructor and Code Formatting in AI Form Generation and Prompt Classes

- Updated the constructor in GenerateAiForm.php to use a block structure for improved readability and consistency.
- Added a blank line in the Prompt.php file to enhance code formatting and maintain consistency with PHP coding standards.
- Modified the migration file to use a more concise class declaration syntax, improving clarity.

These changes aim to enhance code readability and maintainability across the affected files.

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2025-03-21 16:59:18 +01:00
Julien Nahum 06328a47ab Enhance Tax Export Command with Comprehensive Invoice Processing and Metrics
- Improve invoice processing with advanced error handling and tracking
- Add detailed volume metrics for USD and EUR
- Implement robust country detection with multiple fallback strategies
- Enhance logging and progress tracking during tax export generation
- Add performance timing and more granular invoice exclusion reporting
2025-03-10 17:25:15 +08:00
Julien Nahum a67dff14a4 Fixed linting 2025-01-16 10:09:54 +01:00
Julien Nahum 9bf83d5f89 Enhance Tax Export Command Date Handling
- Improved date validation logic in the GenerateTaxExport command.
- Added default start date as the first day of the previous month if not specified, with user confirmation.
- Set default end date to the end of the month based on the start date if not provided.
- Refactored date formatting for better readability and consistency in log messages.
- Enhanced the clarity of the progress bar query options by formatting the expand array.

These changes improve user experience by providing sensible defaults for date inputs and ensuring clear communication of the command's actions.
2025-01-14 14:40:26 +01:00
Chirag Chhatrala 6bdce23967
improve email notfication migration (#602)
* improve email notfication migration

* Fix lint

* Added dry run

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-10-24 15:48:04 +02:00
Chirag Chhatrala dad5c825b1
Apply Mentions everywhere (#595)
* variables and mentions

* fix lint

* add missing changes

* fix tests

* update quilly, fix bugs

* fix lint

* apply fixes

* apply fixes

* Fix MentionParser

* Apply Mentions everywhere

* Fix MentionParserTest

* Small refactoring

* Fixing quill import issues

* Polished email integration, added customer sender mail

* Add missing changes

* improve migration command

---------

Co-authored-by: Frank <csskfaves@gmail.com>
Co-authored-by: Julien Nahum <julien@nahum.net>
2024-10-22 10:34:29 +02:00
Julien Nahum 5bd1dda504
Separated laravel app to its own folder (#540) 2024-08-26 18:24:56 +02:00