# 🧠 ERP DOMÉSTICO – PROMPT COMPLETO (CLAUDE)

## 📌 INSTRUÇÕES GERAIS

- Executar **UMA PARTE DE CADA VEZ**
- Nunca pedir tudo de uma vez
- Se o Claude responder `CONTINUAR?`, responder apenas:
  CONTINUAR
- Testar cada parte antes de avançar

---

# ⚠️ REGRAS GLOBAIS (USAR EM TODAS AS PARTES)

Copiar SEMPRE antes de cada pedido:


IMPORTANT RESPONSE RULES:

DO NOT truncate any file.

DO NOT skip required files.

DO NOT rewrite previous parts unless strictly necessary.

DO NOT rename tables, models or architecture.

If response becomes too long, STOP and write only:
CONTINUAR?

Output COMPLETE file contents only.

Do not summarise code.

Do not omit dependencies.

Use this exact format:

FILE: path/to/file.ext

<complete code>

All UI text must be in Portuguese (Portugal).

Confirm you understand before generating code.


---

# 🧩 PARTE 1 — INFRAESTRUTURA (JÁ FEITA)

👉 (Usar apenas se precisares regenerar)

- Laravel setup
- Auth
- Storage (R2 + local)
- Base DB
- Layout base

---

# 🧩 PARTE 2A — MOTOR FINANCEIRO (CORE)


We will now implement PART 2A of the Household ERP.

Generate FINAL PRODUCTION CODE.

Before generating:
verify infrastructure compatibility.

Implement:

Accounts (use existing)

Categories (hierarchical)

Cost Centers

Tags

Financial movements:

Expense

Income

Transfer

Fields:

account_id

amount

currency EUR

description/supplier

category_id

cost_center_id

issued_at

due_at

paid_at

status

payment_method

notes

Transfer must be atomic.

UI:

list

create expense

create income

transfer

Tests:

expense

income

transfer

Generate code.


---

# 🧩 PARTE 2B — ANEXOS, AUDITORIA, RELATÓRIOS


We will now implement PART 2B.

Generate FINAL CODE.

Implement:

Attachments:

invoice

proof

receipt

optional on create

can add later

Mark as paid:

paid_at

partial payment

upload proof

Audit:

track amount, status, dates, attachments

Filters:

date ranges

supplier

category

tags

account

status

value range

overdue

due soon

Reports:

monthly totals

yearly totals

by category

top suppliers

balance

UI:

detail page

filters

reports

Tests:

add invoice later

mark paid with proof

audit log

monthly totals

Generate code.


---

# 🧩 PARTE 3 — COMPRAS + INVENTÁRIO + VIATURAS + EMPRÉSTIMOS


We will now implement PART 3.

Generate FINAL CODE.

ShoppingTrip:

store

date

account

gross total

discount

net paid

Items:

product (optional)

name

quantity

total price

unit price auto

promotion flag

Supermarket mode:

checklist mobile

mark items

prompt for monitored products

finalize:

remove bought

keep missing

create expense

Product catalog:

brand

unit

price tracking

Inventory:

stock

min stock

alerts

auto add to shopping list

Vehicles:

fuel logs

km auto

liters

gross vs net

calculations

Maintenance:

services

costs

alerts

Loans:

housing

car

others

Features:

amortization schedule

recurring payment

early payment simulation

Generate code.


---

# 🧩 PARTE 4 — UI FINAL + TELEGRAM + NOTIFICAÇÕES


We will now implement PART 4.

Generate FINAL CODE.

UI:

modern SaaS design

mobile-first

dark/light

dashboard

charts

Notifications:

due bills

subscriptions

vehicles

inventory

loans

Telegram bot:

webhook

commands:

/compras
/addcompra
/faturas
/alertas
/estado
/inbox

buttons where needed

Security:

only allowed user_ids

Testing:

telegram commands

notifications

core flows

Generate code.


---

# ✅ ESTRATÉGIA FINAL

1. Parte 1 ✅ (já tens)
2. Parte 2A
3. Parte 2B
4. Parte 3
5. Parte 4

---

# ⚠️ NOTA FINAL

Este sistema é equivalente a:
- mini ERP
- sistema financeiro
- gestor doméstico avançado

Nunca gerar tudo de uma vez.