API · v1 · estable
CODEMETA OSDeveloper Center
ES
Abrir la consola
Entidad · contracts

Contract Schema

ID del esquema
contract
Colección
contracts
Permisos
  • Leercontract_view
  • Crearcontract_create
  • Modificarcontract_edit
  • Eliminarcontract_delete

Campos

Contract Schema

contracts4 permisos

Schema for validating contract entities

namestringobligatorio

Contract name

1–200 caracteres
descriptionstringopcional

Contract description

admite null
descriptionHtmlstringopcional

Rich text HTML version of the contract description

admite null
contractTypeIduuidopcional

Contract type UUID

admite null
contractCategorystringobligatorio

Contract category — MAINTENANCE covers all service contracts (positions, asset assignments, contingents, SLA, compliance, coverage); LICENSE is the separate license-billing flow (positions grid + Weclapp invoice import).

MAINTENANCELICENSE
partyIduuidobligatorio

Associated party UUID

contactPartyIduuidopcional

Associated contact person UUID

admite null
deliveryAddressIdstringopcional

Delivery address (party.addresses[]._id of partyId) for invoices from this contract. Null/absent = none (weclapp default).

máx. 64 caracteresadmite null
billingAddressIdstringopcional

Invoice address (party.addresses[]._id of partyId) for invoices from this contract. Null/absent = the customer default (BILLING → MAIN → first).

máx. 64 caracteresadmite null
parentContractIduuidopcional

Parent contract UUID for sub-contracts

admite null
statusstringobligatorio

Contract status (ADR 0198 R7): DRAFT → PENDING_APPROVAL → ACTIVE → EXPIRING → CANCELLED (+ TEMPLATE). SUSPENDED/RENEWED/EXPIRED removed — pausing gone, renewal is in-place, lapse at endDate ends in CANCELLED.

DRAFTPENDING_APPROVALACTIVEEXPIRINGCANCELLEDTEMPLATE
startDatedateobligatorio

Contract start date (YYYY-MM-DD)

endDatedateopcional

Contract end date (YYYY-MM-DD)

admite null
cancellationDeadlinedateopcional

Earliest cancellation deadline across the contract + positions (R5).

solo lecturaadmite null
nextNotificationDatedateopcional

Earliest expiry reminder date across the contract + positions (R5).

solo lecturaadmite null
nextRenewalDatedateopcional

Earliest auto-renewal boundary across the contract + positions (R5).

solo lecturaadmite null
cancellationDeadlineSourcestringopcional
solo lecturaadmite null
nextNotificationSourcestringopcional
solo lecturaadmite null
nextRenewalSourcestringopcional
solo lecturaadmite null
contractDatedatetimeopcional

Contract signing date (from legacy Toast import)

admite null
activatedAtdatetimeopcional

Activation timestamp

admite null
cancelledAtdatetimeopcional

Cancellation timestamp

admite null
expiredAtdatetimeopcional

Expiration timestamp

admite null
cancellationobjectopcional
admite null
noticePeriodDaysnumberobligatorio
≥ 0
extensionDaysnumberopcional

Auto-renewal extension length in days (day-precise, replaces extensionMonths)

≥ 0
extensionMonthsnumberopcional

deprecated — migrated to extensionDays; kept for backward compatibility

≥ 0
autoRenewbooleanobligatorio
nextPossibleDatedateopcional
admite null
cancellationRequestedAtdatetimeopcional
admite null
cancellationRequestedByuuidopcional
admite null
cancellationReasonstringopcional
admite null
cancellationEffectiveDatedateopcional
admite null
softframestringopcional

Reference frame for cancellation period (weclapp: cancellationPeriodSoftframe)

CONTRACT_ENDEND_OF_MONTHEND_OF_QUARTEREND_OF_CALENDAR_YEAREND_OF_CONTRACT_YEARnull
Valor por defecto: nulladmite null
notificationobjectopcional
admite null
enabledbooleanopcional
admite null
channelsstring[]opcional
admite null
recipientsobject[]opcional
admite null
typestringobligatorio
USERTEAMEMAIL
valuestringobligatorio
targetsobjectopcional
admite null
inAppobjectopcional
admite null
recipientsobject[]opcional
admite null
typestringobligatorio
USERTEAMEMAIL
valuestringobligatorio
prioritystringopcional
LOWNORMALHIGHCRITICALnull
admite null
contactPartyIdstringopcional
admite null
emailobjectopcional
admite null
recipientsobject[]opcional
admite null
typestringobligatorio
USERTEAMEMAIL
valuestringobligatorio
prioritystringopcional
LOWNORMALHIGHCRITICALnull
admite null
contactPartyIdstringopcional
admite null
taskobjectopcional
admite null
recipientsobject[]opcional
admite null
typestringobligatorio
USERTEAMEMAIL
valuestringobligatorio
prioritystringopcional
LOWNORMALHIGHCRITICALnull
admite null
contactPartyIdstringopcional
admite null
opportunityobjectopcional
admite null
recipientsobject[]opcional
admite null
typestringobligatorio
USERTEAMEMAIL
valuestringobligatorio
prioritystringopcional
LOWNORMALHIGHCRITICALnull
admite null
contactPartyIdstringopcional
admite null
leadQuantitynumberopcional
≥ 0admite null
leadUnitstringopcional
DAYWEEKMONTHYEARnull
admite null
lastNotifiedAtdatetimeopcional
admite null
monthlyRevenuestringopcional

Monthly revenue as decimal string

Patrónadmite null
currencyCodestringobligatorio

Three-letter currency code (ISO 4217)

Patrón
billingCyclestringopcional

Billing cycle

MONTHLYQUARTERLYSEMI_ANNUALYEARLYONE_TIMENONE
admite null
paymentTermsDaysnumberopcional

Payment terms in days

≥ 0admite null
priceEscalationobjectopcional
admite null
typestringobligatorio
FIXED_PERCENTCPI_INDEXMANUAL
percentPerYearstringopcional
Patrónadmite null
effectiveMonthnumberopcional
1 – 12admite null
lastAppliedAtdatetimeopcional
admite null
serviceTargetProfileIduuidopcional

Service target profile UUID (ADR 0117a — replaces slaProfileId)

admite null
inlineTargetsanyopcional
defaultCoverageanyopcional
scopeobjectopcional
admite null
coverageTypestringobligatorio

Legacy coverage type — kept for backwards-compat. New code reads `coverageMode` (see below).

ALL_ASSETSASSIGNED_ONLYCUSTOM
coverageModestringopcional

Defines what counts as a contract-covered service. ALL_WITH_EXCLUSIONS: all services except the excluded* lists. ONLY_SPECIFIC: only the included* lists. ONLY_EXPLICIT_ASSIGNMENTS: only matches via explicit assignments[]. Falls back to coverageType mapping when unset.

ALL_WITH_EXCLUSIONSONLY_SPECIFICONLY_EXPLICIT_ASSIGNMENTS
admite null
excludedServiceTypeIdsuuid[]opcional
Valor por defecto: []
excludedLocationIdsuuid[]opcional
Valor por defecto: []
excludedTechnicianIdsuuid[]opcional
Valor por defecto: []
excludedTicketTypeKeysstring[]opcional

Ticket types (ticket_type.key, e.g. CHANGE_REQUEST) whose work does NOT count as contract work (ADR 0579). Empty = no ticket-type exclusion. A booking without a ticket carries no type and is therefore never excluded here.

Valor por defecto: []
excludedAssetIdsuuid[]opcional

Assets, die VERTRAGSWEIT ausgenommen sind — sie werden von keiner Regel dieses Vertrags gedeckt, auch nicht über Standort, Leistungstyp oder die allgemeine Deckung. Das ist die Bedeutung von „der Server gehört nicht zum Vertrag": eine Ausnahme, die nur eine einzelne Zuweisung entfernt, fienge das Asset über `defaultCoverage` sofort wieder ein. Leere Liste = keine Ausnahme; ein Vertrag ohne das Feld verhält sich identisch zu vorher (kein Backfill).

Valor por defecto: []
includedServiceTypeIdsuuid[]opcional
Valor por defecto: []
includedLocationIdsuuid[]opcional
Valor por defecto: []
includedTechnicianIdsuuid[]opcional
Valor por defecto: []
includedTicketTypeKeysstring[]opcional

Ticket types (ticket_type.key) that count as contract work in ONLY_SPECIFIC mode (ADR 0579). Empty = any ticket type. Non-empty means a booking WITHOUT a ticket (and thus without a type) falls out of coverage — same semantics as the other dimensions.

Valor por defecto: []
serviceTypeIdsuuid[]opcional
Valor por defecto: []
technicianUserIdsuuid[]opcional
Valor por defecto: []
technicianOrgUnitIdsuuid[]opcional
Valor por defecto: []
locationIdsuuid[]opcional
Valor por defecto: []
excludeAfterHoursbooleanopcional
excludeTravelbooleanopcional
assignedToIduuidopcional

Assigned user UUID

admite null
orgUnitIduuidopcional

Associated org unit UUID

admite null
amendmentOfuuidopcional

Original contract UUID this amends

admite null
amendmentNumbernumberopcional

Amendment sequence number

≥ 0admite null
templateIduuidopcional

Template contract UUID this was created from

admite null
releasedServiceTypeIdsuuid[]opcional

Service types with requiresContract that this contract unlocks for its customer. Only decides whether the type may be booked: pricing and coverage stay with scope.* and assignments. Missing/empty = releases nothing (no backfill).

admite null
assignmentsobject[]opcional

Contract assignments (assets, parties, locations, service types)

Valor por defecto: []
iduuidobligatorio
assignmentTypestringobligatorio

Subject of the assignment. ASSET = concrete asset; ASSET_TYPE = curated asset-type bucket (see `assetTypeKey`); PARTY = concrete customer employee; ALL_ASSETS = default coverage for any asset under the contract; ALL_PARTIES = default coverage for any customer employee; LOCATION = matches when `asset.locationId === assignment.locationId` (ADR 0151 Phase B). SERVICE_TYPE is legacy.

ASSETASSET_TYPEPARTYALL_ASSETSALL_PARTIESLOCATIONSERVICE_TYPE
assetIduuidopcional
admite null
assetTypeKeystringopcional

Curated asset-type bucket key for `assignmentType: ASSET_TYPE`. Each key maps to a set of asset.schema discriminator patterns (see `constants/contract-asset-types.ts`).

PCSERVERNETWORKPERIPHERALMOBILELICENSEAPPLICATIONDATABASEBACKUPSTORAGECLOUD_SERVICEWEBSITEDOMAINTELEPHONYCOMMUNICATIONCONTAINERBUSINESS_PROCESSIPGENERIC
admite null
excludedAssetIdsuuid[]opcional

Assets, die von DIESER Zuweisung ausgenommen sind ("der Server SRV-X gehört nicht zum Vertrag"). Leere Liste = keine Ausnahme, ein Vertrag ohne das Feld verhält sich identisch zu vorher — kein Backfill. Wirkt zusätzlich vertragsweit über `scope.excludedAssetIds`, damit ein ausgenommenes Asset nicht über eine andere Regel desselben Vertrags wieder eingefangen wird.

Valor por defecto: []
partyIduuidopcional
admite null
locationDescriptionstringopcional
admite null
locationIduuidopcional

Reference to a Location entity. Required when `assignmentType === "LOCATION"` (ADR 0151 Phase B); the resolver matches assets whose `asset.locationId` equals this value at Specificity 2.5 (between ASSET_TYPE and SERVICE_TYPE).

admite null
serviceTypeIduuidopcional
admite null
itemIduuidopcional

Optional link to a contract.items[].id — when set, billing is driven by the position and the assignment-level monthlyPrice/discountPercent are ignored by the UI.

admite null
monthlyPricestringopcional
Patrónadmite null
discountPercentstringopcional
Patrónadmite null
stockingCoststringopcional
Patrónadmite null
targetsOverrideanyopcional
coverageanyopcional
responseTimeMinutesnumberopcional

Convenience field: when set, the save-helper synthesises a `targetsOverride.stages[]` entry with `kind=time_to_first_response` and this duration. Read back from the same stage.

≥ 0admite null
resolutionTimeMinutesnumberopcional

Convenience field: when set, the save-helper synthesises a `targetsOverride.stages[]` entry with `kind=time_to_close` and this duration. Read back from the same stage.

≥ 0admite null
validFromdateopcional
admite null
validUntildateopcional
admite null
isActivebooleanobligatorio
sortOrdernumberobligatorio
notesstringopcional
admite null
contingentsobject[]opcional

Contract contingents (prepaid hours, monetary budgets, trips)

Valor por defecto: []
iduuidobligatorio
contingentTypestringobligatorio
HOURSMONETARYTRIPS
labelstringobligatorio
totalAmountstringobligatorio
Patrón
usedAmountstringobligatorio
Patrón
unitstringobligatorio
HOURSMINUTESEURTRIPS
periodTypestringobligatorio
MONTHLYQUARTERLYYEARLYONE_TIMEUNLIMITED
periodStartdateobligatorio
periodEnddateopcional
admite null
carryOverobjectobligatorio
typestringobligatorio
NONEFULLCAPPEDPERCENT
maxCarryOverstringopcional
Patrónadmite null
maxCarryOverPercentnumberopcional
admite null
expiresAfterPeriodsnumberopcional
admite null
overagePolicystringobligatorio
BLOCKALLOWALLOW_WITH_SURCHARGENOTIFY
overageSurchargePercentstringopcional
Patrónadmite null
overageCapAmountstringopcional
Patrónadmite null
autoRefillobjectopcional
admite null
enabledbooleanopcional
schedulestringopcional
PERIOD_STARTMANUALTHRESHOLD
thresholdPercentnumberopcional
admite null
refillAmountstringopcional
Patrón
conversionRatestringopcional
Patrónadmite null
fallbackContractIduuidopcional
admite null
fallbackPrioritynumberopcional
1 – 9admite null
isActivebooleanobligatorio
exhaustedAtdatetimeopcional
admite null
itemsobject[]opcional

Contract line items (incl. GROUP divider rows for positional grouping)

Valor por defecto: []
iduuidobligatorio
itemTypestringobligatorio
RECURRINGONE_TIMESURCHARGEDISCOUNTNOTEGROUP
namestringobligatorio
máx. 200 caracteres
descriptionstringopcional
admite null
quantitynumberobligatorio
≥ 0
minQuantitynumberopcional

Lower clamp for a datasource-resolved quantity (ADR 0357). Ignored for static quantities.

Valor por defecto: nulladmite null
maxQuantitynumberopcional

Upper clamp for a datasource-resolved quantity (ADR 0357).

Valor por defecto: nulladmite null
unitPricestringobligatorio
Patrón
discountPercentstringopcional
Patrónadmite null
intervalstringobligatorio
MONTHLYQUARTERLYSEMI_ANNUALYEARLYONE_TIMENONEDAILYWEEKLYTWO_YEARLYTHREE_YEARLY
validFromdateopcional
admite null
validUntildateopcional
admite null
isActivebooleanobligatorio
sortOrdernumberobligatorio
assetIduuidopcional
admite null
serviceTypeIduuidopcional
admite null
nextBillingDatedateopcional

Next billing date for this specific item

Valor por defecto: nulladmite null
previousBillingDatedateopcional

Last time this item was billed

Valor por defecto: nulladmite null
billingSchedulestringopcional

ITEM = bill this position on its own schedule (nextBillingDate + interval); missing/CONTRACT = contract cadence (legacy behaviour)

CONTRACTITEMnull
admite null
billingGroupIdstringopcional

Group ID for splitting items across multiple invoices

Valor por defecto: nulladmite null
articleIduuidopcional

Optional link to a Codemeta catalog article

admite null
articleNumberstringopcional
admite null
isBillOfMaterialbooleanopcional

When true, this item is a sales bill of material with sub-items

admite null
useSubItemPricesbooleanopcional

BOM pricing: when true, unitPrice mirrors the sum of subItems; else own price

admite null
subItemsany[]opcional
admite null
quantitySourceobjectopcional

Dynamic quantity source — resolved at billing time

Valor por defecto: nulladmite null
conditionsobjectopcional

Contract-level overrides for billing conditions. Each block is optional; unset fields fall back to service-type / tenant defaults (punctual override strategy).

admite null
surchargeStackingModestringopcional

How surcharges combine when several apply to the same minute (ADR 0431). ADDITIVE (default) sums them (1 + Σ pct/100) — the long-standing behaviour; MAX lets the single highest surcharge win (collective-agreement practice). Unset = fall back to service_type.billing.surchargeStackingMode, then ADDITIVE.

ADDITIVEMAX
admite null
serviceRatesobject[]opcional

Per-service-type rate schedule (overrides service-type.billing.pricing). Multiple entries per serviceTypeId are allowed: each may carry a validFrom date; an entry without validFrom is the baseline. For a given booking date the effective entry is the one with the latest validFrom <= date. To change a rate, ADD a new entry (do not overwrite an existing one) so historical bookings keep their old rate.

Valor por defecto: []
iduuidopcional
admite null
serviceTypeIduuidobligatorio
validFromdateopcional
admite null
ratePerHourstringopcional
Patrónadmite null
ratePerKmstringopcional
Patrónadmite null
travelAllowanceobjectopcional

Arrival/departure travel costs: per-km rate, flat per-trip fee, vehicle base fee.

admite null
ratePerKmstringopcional
Patrónadmite null
flatRatestringopcional
Patrónadmite null
vehicleBaseFeestringopcional
Patrónadmite null
overtimeSurchargesobject[]opcional

Overtime / evening / weekend / holiday surcharges applied multiplicatively to the service rate when the time-of-day + day-of-week (+ optional service-type / holiday) match.

Valor por defecto: []
iduuidobligatorio
namestringobligatorio
1–100 caracteres
fromTimestringobligatorio
Patrón
toTimestringobligatorio
Patrón
daysOfWeeknumber[]obligatorio
elementos únicos
surchargePercentstringobligatorio
Patrón
serviceTypeIdsuuid[]opcional

Service types this surcharge applies to. Empty/omitted = all service types (ADR 0163).

elementos únicosValor por defecto: []
holidayModestringopcional

Public-holiday behaviour (ADR 0163). IGNORE/unset = match weekday windows only (never on a holiday); ALSO_ON_HOLIDAYS = weekday windows OR any holiday; ONLY_ON_HOLIDAYS = only on holidays (daysOfWeek ignored). Region resolved per technician via holiday-resolver.

IGNOREALSO_ON_HOLIDAYSONLY_ON_HOLIDAYS
admite null
validFromdateopcional
admite null
validUntildateopcional
admite null
serviceRoundingobject[]opcional

Per-service-type rounding overrides. Unset fields fall back to service-type.billing.{roundingMinutes,roundingMode,minimumMinutes,billingUnitMinutes}.

Valor por defecto: []
serviceTypeIduuidobligatorio
roundingMinutesnumberopcional
≥ 0admite null
roundingModestringopcional
UPDOWNNEAREST
admite null
minimumMinutesnumberopcional
≥ 0admite null
billingUnitMinutesnumberopcional
≥ 0admite null
remarksobject[]opcional

Structured free-text remarks list for capturing miscellaneous contract data (per ADR 0149).

Valor por defecto: []
iduuidobligatorio
textstringobligatorio
mín. 1 caracteres
textHtmlstringopcional

Optional Tiptap-rendered HTML with mention spans (`<span data-mention-id data-mention-type>...</span>`). Falls back to `text` when not set.

admite null
mentionsobject[]opcional

Structured sidecar: every @-user or #-ticket mention extracted from `textHtml` at save time. Server-side resolvers can pick this up without parsing HTML.

Valor por defecto: []admite null
iduuidobligatorio
typestringobligatorio
userticketasset
labelstringobligatorio
createdAtdatetimeobligatorio
solo lectura
createdByuuidobligatorio
solo lectura
updatedAtdatetimeopcional
solo lecturaadmite null
notesstringopcional

External notes

admite null
internalNotesstringopcional

Internal notes (not visible to customer)

admite null
tagsstring[]opcional

Contract tags

Valor por defecto: []
customFieldsobjectopcional

Custom fields (tenant-specific)

admite null
linkedRiskIdsstring[]opcional

Linked risk IDs

Valor por defecto: []
licensePositionsobject[]opcional

License contract positions (for LICENSE category)

Valor por defecto: []
uuidstringobligatorio
typestringobligatorio
STATICDYNAMIC
articleIdstringobligatorio
articleNumberstringobligatorio
titlestringobligatorio
descriptionstringopcional
admite null
companyNamestringopcional
admite null
quantityoneOfobligatorio
unitPricenumberobligatorio
unchangedUnitPricenumberopcional
admite null
manualUnitPricenumberopcional

Manually overridden own unit price (may be negative, e.g. discount positions). Replaces the weclapp article price as billing basis; unchangedUnitPrice keeps the fetched article price as revert target.

admite null
discountPercentagenumberobligatorio
pricingDatedatetimeopcional
admite null
startDatedateopcional
admite null
endDatedateopcional
admite null
periodstringopcional

ISO-8601 billing period for this position (P1Y = yearly, P1M = monthly)

P1YP1Mnull
admite null
factornumberopcional
admite null
roundingstringopcional
EXACTCEILROUND
admite null
articleTypestringopcional
BASICSALES_BILL_OF_MATERIALSTORABLE
admite null
groupNamestringopcional
admite null
useSalesBillOfMaterialItemPricesbooleanopcional
admite null
salesBillOfMaterialItemsobject[]opcional
Valor por defecto: []
uuidstringopcional
typestringopcional
STATICDYNAMIC
articleIdstringopcional
articleNumberstringopcional
titlestringopcional
descriptionstringopcional
admite null
quantityoneOfopcional
unitPricenumberopcional
unchangedUnitPricenumberopcional
admite null
discountPercentagenumberopcional
admite null
pricingDatedatetimeopcional
admite null
articleFactornumberopcional
admite null
roundingstringopcional
EXACTCEILROUND
admite null
factornumberopcional
admite null
cancellationPeriodQuantitynumberopcional
admite null
cancellationPeriodUnitstringopcional
admite null
extensionQuantitynumberopcional
admite null
extensionUnitstringopcional
admite null
weclappContractIdstringopcional
máx. 64 caracteresadmite null
weclappContractItemIdstringopcional
máx. 64 caracteresadmite null
cancellationNotificationbooleanopcional
admite null
cancellationNotificationQuantitynumberopcional
admite null
cancellationNotificationUnitstringopcional
admite null
lastCancellationNotificationDatedatetimeopcional
admite null
notificationChannelsstring[]opcional
admite null
notificationRecipientsobject[]opcional
admite null
typestringobligatorio
USERTEAMEMAIL
valuestringobligatorio
notificationTargetsobjectopcional
admite null
inAppobjectopcional
admite null
recipientsobject[]opcional
admite null
typestringobligatorio
USERTEAMEMAIL
valuestringobligatorio
prioritystringopcional
LOWNORMALHIGHCRITICALnull
admite null
contactPartyIdstringopcional
admite null
emailobjectopcional
admite null
recipientsobject[]opcional
admite null
typestringobligatorio
USERTEAMEMAIL
valuestringobligatorio
prioritystringopcional
LOWNORMALHIGHCRITICALnull
admite null
contactPartyIdstringopcional
admite null
taskobjectopcional
admite null
recipientsobject[]opcional
admite null
typestringobligatorio
USERTEAMEMAIL
valuestringobligatorio
prioritystringopcional
LOWNORMALHIGHCRITICALnull
admite null
contactPartyIdstringopcional
admite null
opportunityobjectopcional
admite null
recipientsobject[]opcional
admite null
typestringobligatorio
USERTEAMEMAIL
valuestringobligatorio
prioritystringopcional
LOWNORMALHIGHCRITICALnull
admite null
contactPartyIdstringopcional
admite null
groupNamesobject[]opcional

Group names for license contract positions

Valor por defecto: []
uuidstringobligatorio
titlestringobligatorio
lastInvoicedAtdatetimeopcional

Timestamp of last billing/invoice creation

admite null
licenseBillingClaimobjectopcional

Lock of a collective billing run (ADR 1280) on this license contract while its weclapp invoice is being created. Server-written only.

solo lecturaadmite null
runIdstringopcional
unitKeystringopcional
claimedAtdatetimeopcional
billingConfigobjectopcional

Automatic billing configuration

Valor por defecto: nulladmite null
nextBillingDatedateopcional

Next billing date (calculated from lastInvoicedAt + billingCycle)

Valor por defecto: nulladmite null
billingFrequencystringopcional

Billing frequency for license contracts

monatlichjährlichno_billing
admite null
weclappCustomerIdstringopcional

weclapp ERP customer ID

admite null
weclappContractRefsobject[]opcional

weclapp contracts this contract was transferred from (one-off transfer; a bundled contract references several). Reference only, nothing syncs back.

máx. 200 elementosadmite null
idstringobligatorio
1–64 caracteres
contractNumberstringopcional
máx. 64 caracteressolo lecturaadmite null
productsobject[]opcional

Product logos for display

Valor por defecto: []
namestringobligatorio
imagestringopcional
admite null
initialsstringobligatorio
linkedDocumentsobject[]opcional

Linked documents (tickets, etc.)

Valor por defecto: []
typestringobligatorio
idoneOfobligatorio
titlestringobligatorio
descriptionstringopcional
admite null
linkedEntitiesobject[]opcional

Linked entities (assets, tickets, etc.)

Valor por defecto: []admite null
entityTypestringobligatorio
partyassetticketcontractprojectuseropportunity
entityIduuidobligatorio
rolestringobligatorio
ticketRulesobject[]opcional

Activated ticket-generation rules (ADR 0439). Each entry binds a tenant-wide contract_ticket_rule to this contract, usually to one position, with its own due-date cursor.

Valor por defecto: []
iduuidobligatorio

Activation UUID (stable key, used in generated tickets’ sourceRef).

ruleIduuidobligatorio

The contract_ticket_rule this activation executes.

positionIdstringopcional

items[].id or licensePositions[].uuid this activation is bound to; null = manual activation without a position.

Valor por defecto: nulladmite null
positionSourcestringopcional

Which position array positionId refers to — the two stay separate models (ADR 0357). null when positionId is null.

ITEMLICENSEnull
Valor por defecto: nulladmite null
startDatedateobligatorio

First due date, chosen at activation. The UI prevents past dates; the server tolerates them (sweep creates exactly one ticket, then continues from the next future occurrence).

nextDueDatedateobligatorio

Cursor: next due date (initially = startDate). Advanced by the sweep.

nextCreateDatedateobligatorio

Derived scan key: nextDueDate minus the rule’s leadDays. The sweep creates the ticket when nextCreateDate <= today.

lastTicketDatedateopcional

Due date of the most recently generated ticket.

Valor por defecto: nulladmite null
lastTicketIdstringopcional

Id of the most recently generated ticket.

PatrónValor por defecto: nulladmite null
isActivebooleanobligatorio

Paused activations are skipped by the sweep but stay documented on the contract.

Endpoints estándar

Este recurso sigue el contrato CRUD genérico de la plataforma. Lea las convenciones sobre paginación, idempotencia, bloqueo optimista y auditoría. Los endpoints principales:

  • GET /api/v1/contracts — Lista, paginada y filtrable
  • GET /api/v1/contracts/<id> — Una entidad
  • POST /api/v1/contracts — Crear
  • PATCH /api/v1/contracts/<id> — Actualización parcial
  • DELETE /api/v1/contracts/<id> — Eliminación lógica
  • GET /api/v1/contracts/<id>/timeline — Auditoría y actividades

Búsqueda