Performance Record Schema
Felder
Performance Record Schema
Schema for validating Leistungsnachweis entities
documentLanguage
Language the document (PDF) is rendered in. Decided when the document is created (explicit → customer language → tenant default → de) and never re-derived. Missing = de.
deenesfrnlnullpartyId
Customer party UUID
contractId
Associated contract UUID
projectId
Project this record was generated for (per-project standalone billing run). Null/absent for collective and per-ticket runs and for legacy records.
ticketId
ADR 0963 — ticket this record was generated for (per-ticket standalone billing run). Null/absent for collective and per-project runs and for records created before ADR 0963 (those count as a collective record when the weclapp commission is chosen).
performanceRecordNumber
Auto-generated sequence number
performanceRecordDate
Date of the performance record
servicePeriodFrom
Service period start date
servicePeriodTo
Service period end date
status
Lifecycle status. CLOSED_WITHOUT_INVOICE (ADR 0929, ADR 1065) = a record that was deliberately settled without an invoice (any net value, with a mandatory reason); its time records stay RECORDED. Set and lifted only via POST /performance-records/:id/close-without-invoice and …/reopen.
OPENRECORDEDDOCUMENT_CREATEDCLOSED_WITHOUT_INVOICECANCELLEDclosedWithoutInvoiceAt
ADR 1065 — when the record was closed without an invoice. Cleared on reopen. Missing on records closed before ADR 1065 (the UI falls back to the history).
closedWithoutInvoiceBy
ADR 1065 — internal user id (users._id) who closed the record without invoice.
closedWithoutInvoiceReason
ADR 1065 — mandatory reason given when closing without invoice.
reopenedAt
ADR 1065 — when a close-without-invoice was last lifted.
reopenedBy
ADR 1065 — internal user id (users._id) who last reopened the record.
reopenedReason
ADR 1065 — mandatory reason given when reopening.
kind
ADR 0914 — billing stream this record was generated for. EMERGENCY = a Notdienst-Leistungsnachweis holding only emergency-service bookings (isEmergencyService) of a customer whose emergency billing is SEPARATE. Missing on documents created before ADR 0914 (= STANDARD).
STANDARDEMERGENCYtitle
Title / summary
note
Internal note
timeRecordIds
Linked time record UUIDs
expenseIds
Linked expense UUIDs
tripIds
Linked trip UUIDs
materialBucketIds
Material buckets selected during a per-project billing preview. Materialised as invoice positions when the invoice is generated (default for opts.materialBucketIds).
positionIds
Flat-rate project positions (ADR 0310/0406) billed in this per-project run. Their FLAT_RATE line items are part of the snapshot; the invoice stamps project_position.invoiceId from this list.
totalMinutes
Total tracked minutes
totalBillableMinutes
Total billable minutes (after rounding and inclusive deduction)
totalBillingUnits
Total billing units (Arbeitseinheiten) derived from billable minutes and billingUnitMinutes
totalAmount
Total net amount in EUR as decimal string. Mirrors netAmount; kept for backward compatibility.
items
Snapshot of calculated line items (services + trips). Frozen at PR creation, reused 1:1 when generating the invoice — no recalculation.
position
description
unit
quantity
unitPrice
Decimal string, e.g. "125.00"
vatRate
VAT rate as percent string
netAmount
Computed: quantity * unitPrice
articleId
articleNumber
itemType
SERVICETRAVEL_DISTANCETRAVEL_TIMETRAVEL_OTHERFLAT_RATETICKETMATERIALEXPENSEexpenseId
Source expense UUID (EXPENSE lines of a per-project billing run)
positionId
Source project_position UUID (FLAT_RATE lines of a per-project billing run)
contractId
contractItemId
pricedAt
ADR 0415 — date (YYYY-MM-DD) at which the base rate of this line was resolved: the service date (default) or the billing-run date (pricingDateBasis=BILLING_DATE). Only set on lines built from a single time record.
rateSource
ADR 0415 — provenance of the applied hourly rate. `position` = price of the sold order line (ADR 1056). `record` = rate frozen at booking time with unknown origin (legacy). Only set on lines built from a single time record.
positioncontractparty_overrideparty_discountarticleservice_typerecordnullnonBillableService
ADR 0873 §7 — travel line of a non-billable booking: the 0.00 is the result, not noise. The weclapp zero-value travel filter lets marked lines through. Only set on travel lines.
timeRecordId
Source time record of a service or travel line.
timeRecordNumber
Leistungsnummer (L-YYYY-NNNNN) of the source time record.
ticketId
Ticket the line belongs to — only for bookings with referenceType TICKET (travel lines inherit it from their booking).
groupLabel
ADR 0909 — heading of the position group this line belongs to ("Ticket #… // …" or "Helpdesk ohne Ticketzuweisung"). Rendered once at generation time when grouping by ticket is active; missing = ungrouped document. Pushed to weclapp as item.groupName (maxLength 1000 there).
coveredTimeRecordIds
ADR 0909 — subset of timeRecordIds that is linked but not priced (contract-covered INCLUDED/CONTINGENT, ADR 0563; covered by a flat-rate position, ADR 0416). These bookings have no line item; the PDF lists them in a separate "already settled" section. Missing on records created before ADR 0909 — those keep the legacy PDF table.
omittedNonBillableTimeRecordIds
ADR 1274 — subset of timeRecordIds that is non-billable (billableType NONE) and was deliberately left off this record because the tenant set billingSettings.omitNonBillableFromInvoice. Linked and closed like every other booking, but no line item, no section, not in totalMinutes. Missing or empty = nothing was omitted.
billingAddressId
Separately billed customer site (party.addresses[]._id with separateBilling) this record was generated for. Only bookings of that site are on it; the invoice is addressed to the site. Null/absent = the customer itself.
groupPositionsByTicket
ADR 0909 — snapshot of the effective "group positions by ticket" setting (customer override → tenant default) at generation time. Items then carry groupLabel. Missing on documents created before ADR 0909 (= ungrouped).
vatRate
Default VAT rate applied to the items snapshot (percent string)
netAmount
Sum of item netAmounts in EUR as decimal string
vatAmount
Total VAT in EUR as decimal string
grossAmount
Gross total (net + VAT) in EUR as decimal string
invoiceId
Linked invoice UUID (when converted to invoice)
openTicketNotes
ADR 0146 — snapshot of tickets that were still open when this Leistungsnachweis was generated but were unlocked via `ticket.billingOverride`. Frozen at PR creation so the invoice PDF can render a neutral "Hinweise"-section ("Ticket … wird weiterhin bearbeitet") without re-querying ticket state at print time. Internal `reason` is intentionally NOT included — it stays on the ticket.
ticketId
ticketNumber
title
releaseSource
ADR 1209 — internal: what released the open ticket (per-ticket override, customer rule, tenant rule). Missing on snapshots before ADR 1209 = TICKET.
TICKETCUSTOMERTENANTnullKeine Felder passen zum Filter.
Standard-Endpoints
Diese Resource folgt dem generischen CRUD-Vertrag der Plattform. Lesen Sie die Konventionen für Pagination, Idempotenz, Optimistic Locking und Audit. Die wichtigsten Endpoints:
GET /api/v1/performance_records— Liste, paginiert + filterbarGET /api/v1/performance_records/<id>— Einzelne EntityPOST /api/v1/performance_records— AnlegenPATCH /api/v1/performance_records/<id>— Teil-UpdateDELETE /api/v1/performance_records/<id>— Soft-DeleteGET /api/v1/performance_records/<id>/timeline— Audit + Aktivitäten