Internal tools

Phone repair shop inventory and ticket tracker

Django and PostgreSQL app for three repair shops covering per-shop parts stock, repair tickets, ready-text SMS, and daily revenue reports.

djangopostgrespythonsmsruff

Built 1 time, downloaded 0 times.

Install from your terminal

Run this in your project folder. It signs you in, shows what changes and asks before it overwrites a file.

npx claude-lab add phone-repair-shop-inventory-and-ticket-tracker-4b2b3d
10 filesDownload zip
CLAUDE.md
# Repair shop tracker

Internal Django 5 and PostgreSQL app for a phone repair business with 3 shops. Users are shop staff (technician, front desk, manager) and one owner. It tracks per-shop parts stock, repair tickets, customer ready texts, and a daily revenue and parts-used report.

@REVIEW.md

## Commands

- `python manage.py runserver`
- `python manage.py test`
- `python manage.py check`
- `python manage.py makemigrations --check --dry-run`
- `ruff check .` and `ruff format .`
- `python manage.py daily_report --date YYYY-MM-DD`
- Seed data: the seed command in `shops` creates 3 shops and one user per role.

PostgreSQL must be running before `test` or `runserver`.

## Layout

- Apps: `shops`, `inventory`, `tickets`, `notifications`, `reports`.
- Business logic lives in each app's `services.py`, with type hints.
- Views stay thin: parse input, call a service, render.

## Stock and tickets

- Stock is tracked per (shop, part) in StockLevel.
- Change quantity only through StockMovement rows. Never edit `quantity` directly.
- Stock can never go below zero.
- Using a part on a ticket creates a negative StockMovement in the ticket's shop.
- Transfers between shops are one atomic operation that creates two linked movements.
- Ticket statuses: new, diagnosing, waiting_parts, repairing, ready, picked_up, cancelled.
- Status changes follow the allowed-transition table in `tickets/services.py`.

## Money

- Use Decimal and DecimalField. Never use float.
- Store all amounts in one currency. Currency and tax handling are open questions in SPEC.md.

## Access and scoping

- Staff queries are scoped to the user's shop. Only owners see all shops.
- Every view requires login.
- Every new view or query needs a test for shop scoping.

## SMS

- Send SMS only through `notifications/services.py`.
- The provider sits behind an interface. Tests and local dev use the fake backend.
- Send once, when a ticket first becomes ready. Respect `sms_opt_in`.
- Never send SMS in tests.
- Never log full customer phone numbers.

## Reports

- The `daily_report` command must be idempotent.
- Day boundaries use the shop's local timezone.
- Raw SQL is allowed only in reports, and each query needs a comment explaining it.

## Secrets

- Read secrets from environment variables: `DATABASE_URL` and `SMS_API_KEY`.
- Never commit `.env`. Never read or print it.
- Use YOUR_API_KEY placeholders in docs and examples.

## Conventions

- Django TestCase with factories.
- Commit migrations with the model changes that need them.
- Ruff handles formatting. Do not argue style in reviews.

## Workflow

- Explore, plan, code, then run the verify skill before saying done.
- Use `/clear` between unrelated tasks and `/compact` at natural breaks.
- Do not commit until asked.
Use for my project