Skip to content

Implement Dolibarr seqino V1: functional setup panel, queue processing, cron workers, and secure Seqino PDP client#1

Draft
Copilot wants to merge 8 commits into
mainfrom
copilot/seqino-erp-invoicing-module-research
Draft

Implement Dolibarr seqino V1: functional setup panel, queue processing, cron workers, and secure Seqino PDP client#1
Copilot wants to merge 8 commits into
mainfrom
copilot/seqino-erp-invoicing-module-research

Conversation

Copy link
Copy Markdown

Copilot AI commented May 16, 2026

This PR now delivers a functional V1 of the Dolibarr seqino module (ID 185212) for v18/v19/v20+, extending beyond bootstrap scaffolding to working configuration, queue processing, and cron execution flows for Seqino PDP integration.

  • Module scaffold and packaging-ready structure

    • Maintains module root structure under seqino/ with admin/, class/, class/api/, core/modules/, and langs/ (en_US, fr_FR).
  • Primary descriptor: modSeqino.class.php

    • Keeps module metadata and compatibility baseline.
    • Defines V1 configuration constants including:
      • SEQINO_ENVIRONMENT
      • SEQINO_API_BASE_URL_SANDBOX
      • SEQINO_API_BASE_URL_PRODUCTION
      • SEQINO_API_TOKEN
      • SEQINO_API_TIMEOUT
      • SEQINO_CRON_BATCH_SIZE
      • SEQINO_TOKEN_USED_COUNT
      • SEQINO_TOKEN_AVAILABLE_COUNT
    • Creates llx_seqino_queue with queue fields and indexes.
    • Registers cron jobs for:
      • outbound invoice sync,
      • inbound vendor draft sync,
      • e-reporting sync.
  • Functional admin configuration panel (seqino/admin/setup.php)

    • Implements secure save flow with CSRF token checks.
    • Adds validated environment switch and HTTPS endpoint validation.
    • Supports token update without forcing token re-entry on every save.
    • Displays configured token indicator (masked), timeout, cron batch size, and token counters.
  • Queue and sync runtime implementation

    • SeqinoQueue: enqueue/fetch/mark-done/mark-error persistence gateway.
    • SeqinoPdpClient: concrete V1 API operations for outbound, inbound draft, and e-reporting payloads.
    • SeqinoSyncService: queue dispatcher with per-type routing and token usage increment (1 payload = 1 token).
    • SeqinoCronJobs: cron entry points that execute queue processing with configurable batch size.
  • Secure REST abstraction for Seqino PDP

    • AbstractSeqinoApiClient and SeqinoApiException retained and used as V1 transport base:
      • strict input validation,
      • normalized request construction,
      • JSON-safe encode/decode handling,
      • TLS verification in cURL,
      • structured error context.
  • Tests

    • tests/AbstractSeqinoApiClientTest.php: request/response and error-path coverage for the base API client.
    • tests/SeqinoSyncServiceTest.php: queue processing success/error behavior coverage for sync service flows.
  • <screenshot>

Original prompt

You are an elite software architect and senior PHP developer. We are starting the creation of a State-of-the-Art (SOTA) Dolibarr ERP/CRM module for Electronic Invoicing, integrated with the Seqino PDP.

Vendor: ITized (itized.fr)
Module Name: seqino
Module ID (Numeric): 185212
Target: Dolibarr v18, v19, v20+ compatibility.

1. KNOWLEDGE ACQUISITION & RESEARCH TASK

Before writing any code, you must fetch, read, and strictly comply with the documentation and rules from the following official resources:

Analyze the Dolibarr wiki link to determine the absolute SOTA directory structure, security requirements (SQL injection prevention, token usage, CSRF), language file formatting, and naming conventions required to pass Dolistore validation on the first attempt.

2. ARCHITECTURAL PHILOSOPHY: THE "V1 FOUNDATION"

We are building version 1.0.0 (OpenSource MVP). The architecture must be highly professional, modular, and clean, but focused on core essentials:

  • Core configuration panel (API credentials, Sandbox/Prod switch).
  • Queue-based asynchronous processing (a local llx_seqino_queue database table to queue inbound/outbound syncs to avoid timeout drops).
  • Dolibarr standard Cron tasks for automated syncing (Outbound invoices, Inbound vendor invoices creation as drafts, and E-reporting aggregation for B2C/International).

CRITICAL DESIGN NOTE: Do NOT add explicit marketing banners or "Premium coming soon" UI blocks. Instead, design the code with elegant object-oriented extension points, clean interfaces, and logical // TODO: implement advanced real-time webhook routing here or // NOTE: Placeholder for direct interactive widget overrides comments. The code should look like a highly polished, complete V1 open-source foundation that naturally prepares for an invisible, elegant future branch upgrade (v2.0.0) without looking like a feature-gated trial version.

3. TOKEN ENGINE CONTEXT

Keep in mind for the business logic: 1 Token = 1 Inbound Invoice OR 1 Outbound Invoice OR 1 E-reporting payload (including lifecycle). Base your rate-limiting or logging structures on this 1:1 token reality. Maybe implement a way to show a counter for tokens used/available on a dashboard widget.

4. SOTA TESTING

The title says all. Create tests for everything to ensure quality and regression.

4. NEXT STEPS

  1. Acknowledge your understanding of the resources provided in the links.
  2. Propose the ideal, SOTA file tree for this module based strictly on the Dolistore validation rules you fetched.
  3. Generate the primary module descriptor file (modSeqino.class.php) and the core REST API Client abstract wrapper using modern, secure PHP 8.1+ practices.

Copilot AI changed the title [WIP] Initiate research for seqino ERP/CRM module development Bootstrap Dolibarr seqino V1 foundation: module descriptor, secure Seqino API client, and packaging-ready structure May 16, 2026
Copilot AI requested a review from ionutfinta May 16, 2026 00:46
Copy link
Copy Markdown
Member

@ionutfinta ionutfinta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good bootstrap, but nothing will work, it is just a skeleton.
Please implement the V1.

Copilot AI and others added 6 commits May 16, 2026 01:18
Agent-Logs-Url: https://github.com/ITized/doli-seqino/sessions/1074354b-4ba2-432e-9fa9-bdf209bb2f11

Co-authored-by: ionutfinta <56076718+ionutfinta@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ITized/doli-seqino/sessions/1074354b-4ba2-432e-9fa9-bdf209bb2f11

Co-authored-by: ionutfinta <56076718+ionutfinta@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented May 16, 2026

Good bootstrap, but nothing will work, it is just a skeleton.
Please implement the V1.

Implemented a functional V1 (not skeleton) with working setup save flow (CSRF + HTTPS validation), queue persistence/processing, and cron workers for outbound/inbound/e-reporting in commit 01d25ba (with hardening updates through 4e18ecc). UI screenshot: https://github.com/user-attachments/assets/c9b65cd2-fdcc-40bc-9c23-40c7dac2027a

Copilot AI changed the title Bootstrap Dolibarr seqino V1 foundation: module descriptor, secure Seqino API client, and packaging-ready structure Implement Dolibarr seqino V1: functional setup panel, queue processing, cron workers, and secure Seqino PDP client May 16, 2026
Copilot AI requested a review from ionutfinta May 16, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants