Commit Graph

1120 Commits

Author SHA1 Message Date
5a5a331306 backup: n8n workflows + pg dump 20260716_020002 2026-07-16 02:00:08 +00:00
4a9e56dfb1 backup: n8n workflows + pg dump 20260715_020001 2026-07-15 02:00:04 +00:00
52310524db backup: n8n workflows + pg dump 20260714_020002 2026-07-14 02:00:08 +00:00
032bb1ec90 backup: n8n workflows + pg dump 20260713_020001 2026-07-13 02:00:08 +00:00
e2df9168c9 backup: n8n workflows + pg dump 20260712_020001 2026-07-12 02:00:03 +00:00
a3885121b9 backup: n8n workflows + pg dump 20260711_020002 2026-07-11 02:00:07 +00:00
5918a66db1 backup: n8n workflows + pg dump 20260710_020001 2026-07-10 02:00:06 +00:00
cc047b1b19 backup: n8n workflows + pg dump 20260709_020002 2026-07-09 02:00:07 +00:00
11d32fbbad backup: n8n workflows + pg dump 20260708_020002 2026-07-08 02:00:05 +00:00
6a6d2a3028 backup: n8n workflows + pg dump 20260707_020001 2026-07-07 02:00:07 +00:00
dc9394a205 backup: n8n workflows + pg dump 20260706_020001 2026-07-06 02:00:06 +00:00
076e7b425e backup: n8n workflows + pg dump 20260705_020001 2026-07-05 02:00:07 +00:00
00e350cac9 fix(products): DETTE-STD-9 shared pricing predicate + DETTE-STD-8-A audit logs (SPEC-STD-9-DETTES)
DETTE-STD-9: shared lineRequiresPricing predicate in src/shared/pricing-line-types.ts
consumed by products.service.ts (badge L51) and orders.service.ts (createStandard
L240 + preview L583) to prevent badge/canCreate divergence.

DETTE-STD-8-A: PRODUCT_DELETE audit in $transaction with snapshot (id/code/name/
smetaId/counts) captured BEFORE cascade. PRODUCT_ARCHIVE audit best-effort.
userId passed from route handlers.

E2E fix: Popconfirm selector scoped via .ant-popover:visible + .first() for
duplicate toast messages (T-STD8-02/03).

13/13 Vitest, 23/23 Playwright products green.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-05 02:18:56 +04:00
0e4f28d4b8 feat(products): SPEC-STD-8 product deletion — ADMIN-only cascade + $transaction + 409 guard
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-05 01:10:07 +04:00
cdd0f8917d fix(promote): TS2352 cast via unknown for Record access
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-05 00:05:45 +04:00
ecaa60ab04 fix(promote): TS2869 nullish coalescing on non-nullish operand
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-05 00:05:04 +04:00
512c5db414 fix(promote): TS2339 laborNodes not on OrderSmeta type
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-05 00:04:11 +04:00
2fcec74ccb Merge remote-tracking branch 'vps/master' 2026-07-05 00:01:12 +04:00
73f9be47bf feat(std-6): promotion UI + 5 E2E tests + display:none bug fix (SPEC-STD-6-UI-PROMOTION)
PromoteSmetaDrawer 3-step UI (info→compare→result), findSimilarSmetas
Jaccard ≥80%, comparison table with override "Б" for MATERIAL lines,
non-MATERIAL read-only + Alert banner. Fix AntD Form.Items unmount on
conditional rendering (display:none pattern preserves values).
5 E2E Playwright tests (T-PROM-01..05). 18/18 std-6 green.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-05 00:00:38 +04:00
17226c245f backup: n8n workflows + pg dump 20260704_020001 2026-07-04 02:00:06 +00:00
6ff8a63887 feat(orders): Segmented UI + catalog thumbnails in CreateOrderDrawer (SPEC-STD-5)
Replace Select→Segmented for order type (Импорт Excel / Товар из каталога).
Product Select shows 28x28 thumbnails, code+name, and base price ₽/ед.
Fix critical notification modal blocking E2E tests (dismissCriticalModal in loginAs).
Fix std-6 strict mode violation (scope getByText to psm-lines-table).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-03 09:58:03 +04:00
d53f597069 backup: n8n workflows + pg dump 20260703_020001 2026-07-03 02:00:07 +00:00
673f816d99 feat(products): promotion smeta→product + OZ57 comparison script (SPEC-STD-2)
ProductPromotionService: validate source smeta, create DRAFT product, clone
smeta LOCKED via cloneSmeta (reused as-is), init ACTIVE pricings for MATERIAL
lines from default supplier, best-effort image copy. Route POST /products/
promote-from-smeta (WRITE_ROLES). 13 Vitest + 13 clone non-regression green.
compare-oz57-smetas.cjs: DB-driven comparison script for smetas 18 vs 25.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-02 23:04:06 +04:00
b65121ef50 feat(std): generic cloneSmeta service + wire into createStandardOrder (SPEC-STD-1-CLONE-SMETA)
Phase 0: CHECK constraints chk_smeta_xor_parent + chk_order_standard_product
deployed on erp_local, erp_test, erp_staging (already existed on erp_local).

Phase 1: smeta-clone.service.ts — generic cloneSmeta(prisma, sourceId, opts)
deep-copies Smeta + SmetaLine[] + SmetaLaborNode[] in $transaction, best-effort
photo file copies after commit. Designed bidirectional (product→order, order→product).

Phase 2: createStandardOrder now clones the product smeta into the order,
initializes FinancialTracking from the cloned smeta (budgetX × qty).

Phase 3: 13 Vitest unit tests (T-CLONE-01..13). 0 TS errors. 0 regressions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-02 21:58:55 +04:00
818e4edc72 fix(engagement): replace paidAt with status filter on ClientInstallment
ClientInstallment has no paidAt field — use status IN (PENDING,
PARTIALLY_PAID) to find unpaid overdue installments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-02 21:10:13 +04:00
545e45e1f6 fix(inbound-email): resilient FETCH + 2h alert cooldown + merge heartbeat metadata
- processMessage: wrap client.fetch() in try/catch, skip gracefully on
  IMAP protocol errors instead of creating ERROR records
- Cron heartbeat: merge with existing metadata (preserves lastUid)
- Alert cooldown: suppress duplicate INBOUND_EMAIL_ERROR notifications
  within 2h window, downgrade priority URGENT→HIGH
- Cleans up the spam caused by 4 malformed emails on zakupki@t-laser.ru

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-02 21:08:23 +04:00
cdcb11c387 test(smeta): add 8 file persistence assertions + CLAUDE.md session 170
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-02 12:53:27 +04:00
a1b96ed98d feat(smeta): persist Excel file at import via Document+DocumentFile (SPEC-SMETA-FILE-PERSIST-1)
Backend: importXlsx() now creates a Document(type=SMETA) and stores the
Excel buffer via DocumentFileService after successful parse+transaction.
Smeta.filePath is written with the storedPath. Best-effort try/catch —
a storage failure never blocks a successful import.

Frontend: EstimatesTab drawer and GeneralTab show a download button
(FileExcelOutlined → /storage/{filePath}) when filePath starts with
'documents/', falling back to the UNC FilePathButton for legacy paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-02 12:39:07 +04:00
d394b457de backup: n8n workflows + pg dump 20260702_020001 2026-07-02 02:00:06 +00:00
f237090065 Merge remote-tracking branch 'github/master' 2026-07-01 22:53:28 +00:00
d9dc369a51 docs: add session 169 SPEC-TRUD-RAPPORT-PDF to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-02 02:52:20 +04:00
44eedc5a22 fix(work-log): replace ruble sign with руб. in PDF (LiberationSans lacks U+20BD)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-02 02:50:32 +04:00
5d33b53a46 Merge remote-tracking branch 'github/master' 2026-07-01 22:50:16 +00:00
42559614f0 feat(work-log): salary report PDF with Cyrillic + X/Y pagination (SPEC-TRUD-RAPPORT-PDF)
- Add LiberationSans TTF fonts (versioned in src/assets/fonts/)
- New labor-report.pdf.ts: pdfkit canvas, landscape A4, bufferPages for page X/Y
- Extend salary endpoint format=pdf (alongside json/xlsx)
- Frontend PDF button (FilePdfOutlined) in SalaryReportsTab

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-02 02:47:29 +04:00
9ddd8adf11 Merge remote-tracking branch 'github/master' 2026-07-01 22:47:17 +00:00
a767aec689 feat(work-log): admin recompute endpoint + convention actualLabor (SPEC-RECOMPUTE-ACTUALLABOR-ROBUSTE)
POST /work-logs/recompute/:orderId (ADMIN-only, idempotent) repairs
ghost actualLabor after SQL-direct deletion of VERIFIED WorkLogs.
Convention documented in CLAUDE.md. 3 test-gardes (T-TRUD3-19/20/18a).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-02 00:59:33 +04:00
a9d72947cf Merge remote-tracking branch 'github/master' 2026-07-01 20:59:16 +00:00
34b6b980ab docs(CLAUDE.md): add SPEC-BACKEND-FIX-TS session 167 entry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 22:50:19 +04:00
de5e4de0f9 fix(backend): resolve all 23 TypeScript errors — 2 real bugs found (SPEC-BACKEND-FIX-TS)
8 error categories fixed across 11 files:
- TenderStatus enum: added CANCELLED (real bug — order cancel crashed for tenders)
- creatorId→createdById: 6 sites in copilot engagement tools (real bug — ownership checks always false)
- Order.constructor Prisma 5 clash: removed select constraints in estimates+labor-report
- Prisma Json null: DbNull for Json? fields, InputJsonValue for Record<string,unknown>
- Anthropic SDK ContentBlock: TextBlock→TextBlockParam, ToolUseBlock→ToolUseBlockParam
- Role[] vs Role: estimates.service approveFinancial+delete accept union type
- ActionValueClass: string→enum in discharge-kpi CatalogEntry
- SendEmailOptions: added required html field in claim-draft

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 22:48:15 +04:00
194ebdc6c5 Merge remote-tracking branch 'github/master' 2026-07-01 18:48:02 +00:00
f0e1be1592 chore(trud): remove temporary debug script debug-pouzlovoy-structure.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 21:33:57 +04:00
3432e9193d Merge remote-tracking branch 'github/master' 2026-07-01 17:33:41 +00:00
428dc2f12c docs(CLAUDE.md): add SPEC-TRUD-FINITION-IMPRESSION entry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 20:39:27 +04:00
979ed93809 Merge remote-tracking branch 'github/master' 2026-07-01 16:37:09 +00:00
36b6aff875 feat(salary-report): print-friendly layout for comptability (SPEC-TRUD-FINITION-IMPRESSION)
Hide app chrome (sidebar, topbar, banner, filters, KPI cards, buttons) at print.
Show print header (title, period, grouping, summary stats) + fixed footer
(company, generation date) on every page. Landscape, break-inside:avoid on rows,
N&B-safe Tags. Screen unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 20:35:25 +04:00
8318b2f2f6 docs(CLAUDE.md): add SPEC-TRUD-4C piège entry (node photos in LaborTab)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 09:16:52 +04:00
7890ee748f feat(labor): node photos in operation progress cards (TRUD-4C)
Backend: enrich summaryByOrder with priceSource and nodePhoto (photoPath
from SmetaLaborNode via sourceLaborNode relation). No new endpoint —
reuses existing @fastify/static /storage/ prefix for image serving.

Frontend: AntD Image with preview in NODE_PRICE operation cards.
Defensive: no photo = no thumbnail, 404 = transparent fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-01 09:12:47 +04:00
9f4b4511b1 Merge remote-tracking branch 'github/master' 2026-07-01 05:12:32 +00:00
7273e79299 backup: n8n workflows + pg dump 20260701_020001 2026-07-01 02:00:06 +00:00
b9eccbeee0 docs: add SPEC-TRUD-4D-BIS-FIX to CLAUDE.md (summary index pattern)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-30 23:21:54 +04:00