Skip to content

feat(pipelinq): build products-quote-from-lead - #3954

Open
rubenvdlinde wants to merge 5 commits into
developmentfrom
quality/build-products-quote-from-lead-2
Open

rubenvdlinde wants to merge 5 commits into
developmentfrom
quality/build-products-quote-from-lead-2

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Builds openspec/changes/products-quote-from-lead (round 2): Send quote on a lead. filinq renders the lead's lines to a PDF and files a copy in the sender's Files; pipelinq mails it to the lead's contact (else the client) and logs an outbound contact moment on the lead.

Tasks done

  • 3 QuoteController: POST /api/leads/{id}/quotes (body templateId, optional validUntil, default 30 days) and GET /api/leads/{id}/quotes/recipient, both #[NoAdminRequired]. The lead is read as the caller and checked against ObjectOwnerAccessPolicy (assignee or privileged group), so an unreadable lead is 404. 503 without filinq, 422 without a recipient, 502 when the render or the mail fails. Routes and openapi.json updated.
  • 4 QuoteSender reads the client, contact, lines and their products as the caller, works out the totals per VAT rate (QuoteService), takes the next OFF-YYYY-NNNN number and renders through FilinqLetterAdapter. The adapter gained an optional trailing adHocData (filinq's own option) for the quote, the totals and the frozen lines. QuoteMailer mails through IMailer with the PDF attached. The contact moment (channel quote; lead, client and contact; number, total, validity and the file) is saved through TicketService. When the mail fails nothing is logged and the copy stays in Files. With no recipient nothing is numbered, rendered or sent.
  • 5 SendQuoteModal (template, valid-until date, the recipient before sending) behind a send-quote header action on LeadDetail. It is hidden, not disabled, when /api/letters/templates answers available: false. FileSendOutline registered.
  • 6 nl and en strings (l10n/*.json, catalogues rebuilt); docs/Features/quotes.md, including how to write the template in filinq.

Tasks left, and why

  • 1 The line form is CnChildRecordsField (lead.lines.addFrom). It copies the product's own unitPrice and has no hook to call resolve-price for the entered quantity, so the tier or variant price needs that hook in @conduction/nextcloud-vue first (2.181.0 has none).
  • 7 Playwright on a live instance; 8 the archive step.

Tests

  • PHP: QuoteControllerTest (every status, the recipient preview, the validity date), QuoteSenderTest (real QuoteService, ProductCatalogService and CallerObjectReader over ObjectEntity rows; the exact contact-moment payload; 21% and 9% lines give VAT 210.00 and 45.00 and 1755.00 incl.; no recipient; failed mail; refused render; the second send takes the next number), QuoteMailerTest, FilinqLetterAdapterTest::testAdHocDataReachesFilinq. Removing the access check or the recipient guard turns a test red.
  • Vitest: sendQuoteFromLead.spec.js (shown and hidden, send, no recipient, a refused send, axe on the dialog, date helpers).
  • PHP unit suite: 9280 tests before, 9304 after, no failures. Vitest: same three inherited failures as development (myWorkPage, notificationLabels, reportSectionPeriod), none added. phpcs, phpstan and eslint clean on the touched files.

Generated by Claude Code

Send quote on a lead: filinq renders the lead's lines to a PDF and files
a copy in the sender's Files, pipelinq mails it to the contact (else the
client) and logs an outbound contact moment on the lead.

- QuoteController: POST /api/leads/{id}/quotes and the recipient preview,
  the lead read as the caller (404), 503 without filinq, 422 without a
  recipient, 502 when the render or the mail fails.
- QuoteSender and QuoteMailer; the letter adapter passes filinq's
  adHocData (quote, totals per VAT rate, the frozen lines).
- SendQuoteModal behind a send-quote header action, hidden without filinq.
- nl/en strings, docs/Features/quotes.md, openapi.json.

Assisted-by: ClaudeCode:claude-opus-5-5
… ci]

Keep both sides' new l10n keys (quote strings and the Outlook add-in
strings) and regenerate the browser catalogues from the json.

Assisted-by: ClaudeCode:claude-opus-5-5
…test arguments

QuoteSender reads the lead's lines through an injected
ObjectServiceInterface instead of a container lookup (ADR-083 rule 1).
QuoteController parses the valid-until date without static access. The
new tests name their arguments and document their methods.

Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/pipelinq @ bfacff4

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ❌
psalm ❌
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
check-vue-demi ✅
test-l10n ✅
format ❌
check-schema-l10n ❌
check-l10n-js ✅
check-e2e-nav ✅
check-lib-link ✅
composer ✅ ✅ 109/109
npm ✅ ✅ 646/646
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ❌
Newman ❌
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-11-20 04:32 UTC

Download the full PDF report from the workflow artifacts.

This branch has not been deployed

No deployments
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.

1 participant