diff --git a/CLAUDE.md b/CLAUDE.md index 83c432b..29d8b94 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,47 +1,55 @@ -# CLAUDE.md +# MokoSuiteRealty -This file provides guidance to Claude Code when working with this repository. +Real estate management for Joomla 6 — listings, showings, offers, commissions, open houses, property search. -## Project Overview - -**Template-Joomla** -- Unified Joomla extension scaffolding templates — plugin, template, module, component, package, library +## Quick Reference | Field | Value | |---|---| -| **Platform** | template | -| **Language** | Markdown | -| **Default branch** | main | -| **License** | GPL-3.0-or-later | -| **Wiki** | [Template-Joomla Wiki](https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla/wiki) | -| **Standards** | [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home) | - -## Common Commands - -```bash -make build # Build the project -make lint # Run linters -make validate # Validate structure -make release # Full release pipeline -make minify # Minify CSS/JS assets -make clean # Clean build artifacts -``` - -```bash -composer install # Install PHP dependencies -``` +| **Package** | `pkg_mokosuiterealty` | +| **Layer** | 2 (requires: Client → CRM) | +| **Language** | PHP 8.3+ | +| **Branch** | develop on `dev`, merge to `main` (protected) | +| **Wiki** | [MokoSuiteRealty Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteRealty/wiki) | ## Architecture -This is a project template. Files are copied when creating new repos. -- Edit files here to change defaults for new projects -- `.mokogitea/workflows/` -- CI/CD workflow templates -- `Makefile` -- build targets inherited by new projects +Joomla **package** (`pkg_mokosuiterealty`) — Layer 2 add-on extending MokoSuiteCRM. + +### Dependencies +- MokoSuiteClient (Layer 0) — base platform +- MokoSuiteCRM (Layer 1) — contacts, deals, invoicing + +### Helpers (6) +- `ListingHelper` — filtered search, dashboard stats, price history (transactional) +- `CommissionHelper` — split calculations, agent YTD, pending payouts +- `ShowingHelper` — scheduling, agent calendar, buyer feedback +- `OfferHelper` — submit, accept (atomic FOR UPDATE), competing rejection +- `OpenHouseHelper` — event scheduling, visitor sign-in, lead capture +- `PropertySearchHelper` — Haversine geo proximity, saved searches + +### Database Tables (9) +`listings`, `listing_photos`, `showings`, `offers`, `commissions`, `open_houses`, `open_house_visitors`, `price_history`, `saved_searches` + +## Source Directory + +- `source/pkg_mokosuiterealty.xml` — package manifest +- `source/packages/` — sub-extensions ## Rules -- **Never commit** `.claude/`, `.mcp.json`, `TODO.md`, or `*.min.css`/`*.min.js` -- **Attribution**: use `Authored-by: Moko Consulting` in commits -- **Branch strategy**: develop on `dev`, merge to `main` for release -- **Minification**: handled at build time (CI) and runtime (MokoMinifyHelper for Joomla templates) -- **Wiki**: documentation lives in the Gitea wiki, not in `docs/` files -- **Standards**: this repo follows [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home) +- **Never commit** `.claude/`, `.mcp.json`, `TODO.md`, `*.min.css`/`*.min.js` +- **Attribution**: `Authored-by: Moko Consulting` +- **Workflow directory**: `.mokogitea/` +- **Wiki**: documentation lives in the Gitea wiki, not `docs/` files +- **Standards**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoCLI/wiki) +- **Changelog**: `[Unreleased]` only — release system assigns versions +- **No upstream references**: never reference competitor products + +## Coding Standards + +- PHP 8.3+ / Joomla 6 patterns +- `$this->getDatabase()` in models, `Factory::getContainer()->get(DatabaseInterface::class)` in helpers +- `Factory::getApplication()->getIdentity()` for user +- `FOR UPDATE` inside transactions for race-condition-prone operations +- `quoteName()` for columns, `(int)` cast for IDs, `quote()` for strings