Update Gemini MD

This commit is contained in:
2026-04-18 04:51:52 +00:00
parent 3cef1c40df
commit 10eac55520
2 changed files with 65 additions and 1 deletions

43
GEMINI.md Normal file
View File

@@ -0,0 +1,43 @@
# HQLand Project Knowledge Base & Mandates
## 1. Core Architecture
- **Framework**: Laravel 13.5 (Future Release Simulation).
- **Admin Panel**: Filament v5.5 using the **Schemas** architecture (Layout-driven instead of Form-driven).
- **Database Logic**: Strictly following **Prisma Schema v2.3**.
- **Primary Keys**: All main entities (Project, Product, Customer, Contract) use **UUID**.
- **Naming Convention**: Database columns and Eloquent attributes must use **snake_case** (e.g., `full_name`, `custom_data`).
## 2. Business Logic Specifications
### 2.1. Contract & Transfer History
- `transfer_order`:
- `0`: Current owner (Owner of record).
- `1`: Original contract (F0).
- `2+`: Subsequent transfers (F1, F2...).
- All transfer history contracts for a single product share the same `product_id`.
### 2.2. Payment & Cashflow Module
- **Automation**: When a `Contract` is created, the system must clone a `PaymentTemplate` into a `PaymentSchedule`.
- **Due Date Logic**: Supports 3 modes: `days_after_signing`, `days_after_previous`, and `fixed_date`.
- **Surplus Logic**: If a payment exceeds the required amount for an installment, the surplus is stored in `contracts.excess_amount` to be deducted from the next installment.
### 2.3. Infrastructure & Dynamic Data
- `infrastructure_status`: Nested JSONB structure (e.g., Electricity > Transformer Station > Status).
- `custom_data`: Flexible JSONB based on `ProductType` (LAND vs APARTMENT).
## 3. Development Conventions
- **UI/UX**: All Filament resources must use `App\Enums\NavigationGroup` for menu management.
- **Localization**: 100% Vietnamese labels for all resources and actions.
- **Testing**: Using Pest PHP for feature and unit tests.
## 4. Current Progress (as of April 18, 2026)
- Database fresh and seeded with complex test cases (`TestDataSeeder`).
- Navigation standardized with Enums.
- ProductResource upgraded to "Super Resource" with Tabs and Embedded History.
- PaymentTemplate logic fully implemented with flexible due date calculation.
- Contract-Template auto-cloning logic implemented in `CreateContract` page.
## 5. Instructions for Gemini CLI
- Always read this file before suggesting changes.
- Prioritize the **Schemas** architecture of Filament v5.5.
- Ensure all new migrations follow the UUID and snake_case standards.

View File

@@ -5,4 +5,25 @@ pass: 1Qazxsw2@!321
git add . git add .
git commit -m "Thêm tính năng X" git commit -m "Thêm tính năng X"
git push git push
✦ Bước 2: Hướng dẫn bạn di chuyển
Bây giờ bạn chỉ cần thực hiện các thao tác sau để đảm bảo sự liền mạch:
1. Commit & Push: Hãy commit toàn bộ code hiện tại (bao gồm cả file GEMINI.md tôi vừa tạo) lên kho lưu trữ Git của bạn
(GitHub/GitLab/Bitbucket).
2. Môi trường mới: Trên máy tính mới, sau khi git clone dự án về:
* Hãy đảm bảo đã cài đặt đầy đủ môi trường (PHP, PostgreSQL...).
* Chạy composer install.
* Cấu hình file .env chính xác cho Database.
* Chạy lại php artisan migrate:fresh --seed để có bộ dữ liệu mẫu mà chúng ta đã thống nhất.
3. Kích hoạt Gemini: Khi bạn mở terminal tại thư mục dự án trên máy mới và gọi Gemini CLI, tôi sẽ tự động đọc file
GEMINI.md.
4. Kiểm tra: Bạn có thể hỏi tôi câu này để kiểm tra xem tôi có "nhận ra" dự án không:
> "Dự án này đang dùng kiến trúc Filament nào và logic chuyển nhượng bất động sản được quy định ra sao?"
Nếu tôi trả lời đúng về Filament v5.5 Schemas và các giá trị của transfer_order, nghĩa là cuộc "di cư tri thức" đã thành
công rực rỡ.
Chúc bạn có một hành trình làm việc thuận lợi trên máy tính mới! Tôi luôn sẵn sàng đồng hành cùng bạn.