Files
toanhoang d9b360c1df
CI / test (push) Failing after 8s
Auto-fill AssetItem.warrantyEndDate from AssetModel.warrantyMonths
AssetModel gains an optional warrantyMonths (standard vendor warranty
length). createAssetItem() now defaults warrantyEndDate to purchaseDate +
warrantyMonths (month-end clamped, e.g. Dec 31 + 2mo -> Feb 28, not Mar 3)
whenever the caller omits warrantyEndDate -- still overridable per item
for batches with extended/different warranty terms. /asset-models UI gets
an input for the new field; /assets needs no change since it already
omits warrantyEndDate from the payload when left blank.

Hand-written migration + manual smoke test (tsx script, not Vitest),
same deviation as the other 2026-08-2x work in this branch -- see
CLAUDE.md. tsc/lint clean.
2026-08-21 09:10:55 -04:00

4 lines
171 B
SQL

-- Hand-written (same deviation as other 2026-08-2x migrations in this
-- feature area -- see CLAUDE.md).
ALTER TABLE "asset_models" ADD COLUMN "warranty_months" INTEGER;