Skip to main content

Warranty & Assets (Mongo)

The asset registry — the continuous record of every serial-numbered unit. Owns assets, registrations, claims, and the decisioning inputs.

Asset​

Asset {
_id: uuid // internal UUID v7
shortId: string // nanoid base32 — used on warranty card / My Products
tenantId: string
serial: string // unique within tenant
product: { medusaProductId: string; medusaVariantId: string; name: string; family: string } // snapshot
ownerId?: string // medusaCustomerId (null until registered)
source: { medusaOrderId?: string; channel?: string; dealerId?: string; soldAt?: Date }
status: 'manufactured'|'dispatched'|'sold'|'registered'|'in_service'|'eol'
coverage: {
warranty?: { start: Date; end: Date }
extended?: { start: Date; end: Date; sku: string }
amc?: { contractId: string; end: Date }
}
installation?: { jobId: string; commissionedAt: Date }
history: AssetEvent[] // append-only lifecycle log
createdAt: Date; updatedAt: Date
}

AssetEvent { at: Date; type: string; ref?: string; note?: string } // sold, registered, serviced, claim, etc.

WarrantyRegistration​

WarrantyRegistration {
_id: uuid
assetId: uuid
method: 'serial'|'qr'|'invoice'
customerId: string
proof?: string // invoice image/storage key
registeredAt: Date
}

WarrantyClaim​

WarrantyClaim {
_id: uuid
claimNo: string // short ID
assetId: uuid
raisedBy: { role: 'customer'|'dealer'|'service'; id: string }
issue: string; media: string[]
decision?: { status: 'approved'|'rejected'; basis: 'warranty'|'extended'|'amc'|'none'; payable?: number; by: string; at: Date }
resolution?: { type: 'repair'|'replace'; jobId?: string; costRecovery?: number }
status: 'open'|'approved'|'rejected'|'resolved'
}

Decisioning engine (inputs → output)​

// GET /warranty/decision?assetId=&issue=
DecisionResult {
covered: boolean
basis: 'warranty'|'extended'|'amc'|'none'
payable: number // 0 if covered
notes?: string // e.g. "pro-rata applies"
}

Rules are tenant-configurable (warranty periods per family, pro-rata vs full, exclusions). Default warranty start = commissioning for installed goods, delivery otherwise.

ExternalAsset​

See FSM model — non-our-brand units, always paid, no coverage.

Indexes​

tenantId, unique serial per tenant, shortId, ownerId, status, coverage.warranty.end (for expiry analytics/reminders).

Cross-store rules​

  • Created from serial.assigned (Medusa dispatch); enriched by installation.completed.
  • Emits warranty.registered, claim.approved → consumed by FSM, Finance, CRM.
  • Paid repairs → Finance invoice; claim stores costRecovery only.