# DEMO DATA STRUCTURE

[← Data Models](./02-data-models.md) | [Next: Data Adapter Implementation →](./04-data-adapter-implementation.md)

---

## Cấu trúc thư mục

```
data/
└── demo/
    ├── companies.json
    ├── projects.json
    ├── assets.json
    ├── contracts.json
    ├── tickets.json
    ├── workOrders.json
    ├── inventoryItems.json
    ├── users.json
    ├── roles.json
    └── ...
```

---

## Format JSON (giống MongoDB documents)

**Example: data/demo/assets.json**
```json
[
  {
    "_id": "507f1f77bcf86cd799439011",
    "projectId": "507f191e810c19729de860ea",
    "parentAssetId": null,
    "assetType": "Plant",
    "name": "Solar Farm A",
    "code": "PLANT-001",
    "serialNumber": "SN-001",
    "manufacturer": "Trina Solar",
    "model": "TSM-500",
    "capacityKW": 5000,
    "commissioningDate": "2023-01-15T00:00:00.000Z",
    "warrantyEndDate": "2028-01-15T00:00:00.000Z",
    "status": "active",
    "locationGPS": {
      "lat": 10.762622,
      "lng": 106.660172
    },
    "metadata": {},
    "createdAt": "2023-01-15T00:00:00.000Z",
    "updatedAt": "2023-01-15T00:00:00.000Z"
  }
]
```

**Example: data/demo/companies.json**
```json
[
  {
    "_id": "507f1f77bcf86cd799439001",
    "name": "VuPhong Energy Group",
    "code": "VPEG",
    "taxCode": "0123456789",
    "address": "123 Energy Street, Ho Chi Minh City",
    "phone": "+84-28-1234-5678",
    "email": "info@vuphong.com",
    "status": "active",
    "createdAt": "2023-01-01T00:00:00.000Z",
    "updatedAt": "2023-01-01T00:00:00.000Z"
  }
]
```

**Example: data/demo/projects.json**
```json
[
  {
    "_id": "507f191e810c19729de860ea",
    "companyId": "507f1f77bcf86cd799439001",
    "name": "Solar Farm A",
    "code": "SFA-001",
    "location": {
      "address": "Binh Thuan Province",
      "coordinates": {
        "lat": 11.5564,
        "lng": 108.9281
      }
    },
    "capacityMWp": 50,
    "commissioningDate": "2023-01-15T00:00:00.000Z",
    "status": "operational",
    "createdAt": "2022-06-01T00:00:00.000Z"
  }
]
```

**Example: data/demo/users.json**
```json
[
  {
    "_id": "507f1f77bcf86cd799439021",
    "email": "admin@vuphong.com",
    "passwordHash": "$2b$10$...",
    "firstName": "Admin",
    "lastName": "User",
    "phone": "+84-912-345-678",
    "department": "IT",
    "position": "System Administrator",
    "status": "Active",
    "companyId": "507f1f77bcf86cd799439001",
    "roles": [
      {
        "roleId": "507f1f77bcf86cd799439031",
        "projectId": null,
        "assignedAt": "2023-01-01T00:00:00.000Z"
      }
    ],
    "createdAt": "2023-01-01T00:00:00.000Z",
    "lastLoginAt": null
  }
]
```

---

## Lưu ý quan trọng

- Tất cả `_id` phải là string 24 hex characters (giống MongoDB ObjectId)
- Dates phải là ISO 8601 strings
- Nested objects giữ nguyên cấu trúc
- References sử dụng `_id` strings
- Demo data phải đầy đủ và có quan hệ đúng (foreign keys)

---

**Next**: [Data Adapter Implementation](./04-data-adapter-implementation.md)
