expiries_renew
Renew an expiry item: creates the next one, closes the old, and preserves it as history. Uses the kind's usual validity when no new expiry date is given.
Instructions
Renew an expiry item: creates the next one (same kind, label, vehicle, provider and reminder setting) and closes the old one, kept as history (renewedFrom). Without expiresAt the usual validity of the kind is added to the old expiry (RCA / rovinietă / CASCO / certificate 12 months, ITP / tahograf 24, trusă medicală 36), counted from today when it had already expired. Returns item (the new one) and previous.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | Expiry item UUID to renew | |
| notes | No | ||
| number | No | New policy / document number | |
| provider | No | Default: the old provider | |
| companyId | No | Company UUID (overrides STORNO_COMPANY_ID env var) | |
| expiresAt | No | New expiry date, YYYY-MM-DD | |
| validFrom | No | Default: the old expiry date (or today when already expired) |