﻿# `vendors`

**Module:** Vendor

---

## Purpose

Vendor/supplier records. Tracks contact details, status, contract information, and optional budget expense link.

---

## Columns (Summary)

| Column | Notes |
|--------|-------|
| `id BIGINT UNSIGNED AUTO_INCREMENT PK` | — |
| `workspace_id BIGINT UNSIGNED NOT NULL FK→workspaces` | — |
| `category_id BIGINT UNSIGNED NOT NULL FK→vendor_categories` | — |
| `name VARCHAR(255) NOT NULL` | — |
| `company VARCHAR(255) NULL` | — |
| `contact_person VARCHAR(100) NULL` | — |
| `phone VARCHAR(30) NULL` | — |
| `whatsapp VARCHAR(30) NULL` | — |
| `email VARCHAR(100) NULL` | — |
| `website VARCHAR(255) NULL` | — |
| `instagram VARCHAR(100) NULL` | — |
| `address TEXT NULL` | — |
| `city VARCHAR(100) NULL` | — |
| `notes TEXT NULL` | — |
| `status VARCHAR(20) DEFAULT Researching` | — |
| `contract_number VARCHAR(100) NULL` | — |
| `contract_date DATE NULL` | — |
| `contract_value DECIMAL(15,2) NULL` | — |
| `contract_signed TINYINT(1) DEFAULT 0` | — |
| `budget_expense_id BIGINT UNSIGNED NULL FK→budget_expenses` | — |
| `is_deleted TINYINT(1) DEFAULT 0` | — |
| `created_at DATETIME DEFAULT CURRENT_TIMESTAMP` | — |
| `updated_at DATETIME NULL` | — |

---

## Referenced By

vendor_quotations(vendor_id), vendor_communications(vendor_id), timeline_tasks(vendor_id)

---

## Notes

See `docs/database/RELATIONSHIP.md` for full entity relationships and `database/schema.sql` for authoritative DDL.
