Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7aab3fc
planning: multi-app architecture plan for QR, online ordering, curbsi…
esafwan Mar 25, 2026
1d65a61
feat(ury): Phase 0 - Foundation & Extraction
esafwan Mar 26, 2026
aaaa4d3
docs: update README and add AGENTS.md for multi-app architecture
esafwan Mar 26, 2026
6bc4978
docs: add README files for all packages and apps
esafwan Mar 26, 2026
130ffad
docs: mark Phase 0 as complete in TODO.md
esafwan Mar 26, 2026
b600fc6
feat(ury): Phase 1 - Add custom fields patch for POS Invoice
esafwan Mar 26, 2026
b5ab89d
feat(ury): Phase 1 - Create customer order API with auto-cashier assi…
esafwan Mar 26, 2026
f7f8294
feat(ury): Phase 1 - Create @ury/order and @ury/menu packages
esafwan Mar 26, 2026
82c2bf3
feat(ury): Phase 2 - QR Table Ordering app structure and pages
esafwan Mar 26, 2026
d2b97ca
docs: add comprehensive TESTING.md guide
esafwan Mar 26, 2026
d2d87eb
feat(ury): Complete Phase 2, 2.5, 3, 5 - Apps and Payment Gateway
esafwan Mar 26, 2026
95ed356
feat(ury): Complete all app pages
esafwan Mar 26, 2026
35329d2
docs: add IMPLEMENTATION_SUMMARY.md and app READMEs
esafwan Mar 26, 2026
6e858ca
feat(kiosk): add App.tsx and InactivityWarning component
esafwan Mar 26, 2026
4ce8d52
feat(kiosk): add DeviceSetup component and utilities
esafwan Mar 26, 2026
07d3077
docs(kiosk): add README with full documentation
esafwan Mar 26, 2026
1b7efae
docs: finalize TODO.md - all phases complete
esafwan Mar 26, 2026
2b2a23d
docs(skills): add comprehensive skills directory with 18 modular guides
esafwan Mar 26, 2026
11cf950
docs: add Skills Directory section to AGENTS.md and README.md
esafwan Mar 26, 2026
d9e89c8
docs: update FEATURES.md with multi-app architecture overview
esafwan Mar 26, 2026
db81fda
chore: remove obsolete IMPLEMENTATION_SUMMARY.md
esafwan Mar 26, 2026
b19813d
Merge pull request #99 from ury-erp/doc/add_comprehensive_skills_cove…
esafwan Mar 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions .scratchpad.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# URY Multi-App Architecture - SCRATCHPAD

> **Active Work Log & Context Dump**
> **Last Updated**: 2026-03-26
> **Current Branch**: planning/multi-app-architecture

---

## URGENT / KEY INFO

### Phase Status (Updated 2026-03-26)
- Phase 0: ✅ COMPLETE - Foundation & Extraction
- Phase 1: ✅ COMPLETE - Shared Ordering Core
- Phase 2: ✅ COMPLETE - QR Table Ordering MVP
- Phase 2.5: 🚧 IN PROGRESS - Payment Gateway (subagent working)
- Phase 3: 🚧 IN PROGRESS - Customer Ordering App (subagent working)
- Phase 4: ⏳ PENDING - Curbside Extension
- Phase 5: 🚧 IN PROGRESS - Kiosk Mode (subagent working)
- Phase 6: ✅ COMPLETE - Testing Documentation

### Critical Files Modified
- `ury/ury_customer/api.py` - Customer APIs (create_order, get_status, QR tokens)
- `ury/hooks.py` - Routes added for /order/t/<token>, /menu/<slug>
- `ury/patches/v2_0/add_customer_ordering_fields.py` - Custom fields for POS Invoice
- `apps/table-order/` - QR ordering app (pages: TokenResolver, Menu, Cart done)

### Package Dependencies
```
@ury/config - Constants, doctypes, order-types
@ury/ui - React UI components (Button, Card, Dialog, etc.)
@ury/api-client - Frappe SDK wrapper
@ury/cart - Zustand cart state
@ury/order - Order lifecycle hooks
@ury/menu - Menu fetching hooks
```

### Custom Fields Added to POS Invoice
- fulfillment_status (Select)
- order_source (Select)
- customer_order_token (Data)
- scheduled_pickup_time (Datetime)
- payment_gateway (Data)
- payment_gateway_ref (Data)

### URY DocType Fields Added
- URY Restaurant: slug, accepts_online_orders, logo, opening_hours
- URY Table: qr_token, qr_generated_at
- URY Menu: is_public

---

## WORK IN PROGRESS

### Phase 2: QR Table Ordering MVP
**Status**: 70% complete

**Done**:
- ✅ generate_table_qr() API
- ✅ validate_table_token() API
- ✅ apps/table-order structure
- ✅ TokenResolver page
- ✅ Menu page with categories
- ✅ Cart page with customer details

**Pending**:
- ⏳ OrderStatus page (for tracking)
- ⏳ Call waiter functionality
- ⏳ WhatsApp integration
- ⏳ QR code generator UI for staff

### Phase 2.5: Payment Gateway
**Status**: NOT STARTED

Need to create:
- URY Payment Gateway doctype
- Payment provider integrations (Stripe, Razorpay)
- initiate_payment() / verify_payment() APIs
- Payment UI components

---

## DEFERRED / CONTEXT DUMP

### API Endpoints Created
```python
# Customer APIs (ury.ury_customer.api)
get_public_menu(restaurant, order_type)
get_restaurant_info(slug)
get_order_status(order_token)
validate_table_token(token)
create_customer_order(...)
update_fulfillment_status(order_token, new_status)
generate_table_qr(table, expiry_hours)
```

### Routes Added
```python
website_route_rules = [
{"from_route": "/order/t/<token>", "to_route": "table-order"},
{"from_route": "/menu/<path:slug>", "to_route": "customer-order"},
]
```

### Commit History
```
130ffad docs: mark Phase 0 as complete
f7f8294 feat: Phase 1 - @ury/order and @ury/menu packages
b5ab89d feat: Phase 1 - create_customer_order API
b600fc6 feat: Phase 1 - Add custom fields patch
6bc4978 docs: add README files for packages
aaaa4d3 docs: update README and AGENTS.md
1d65a61 feat: Phase 0 - Foundation & Extraction
```

---

## DECISIONS MADE

1. Single Frappe app (ury) with multiple modules
2. npm workspaces for frontend packages
3. Guest access with token validation for customer APIs
4. Auto-cashier assignment from POS Opening Entry
5. JWT tokens for QR table validation
6. Pay-at-counter for Phase 2, online payment in Phase 2.5

---

## BLOCKERS / RISKS

1. **Frappe guest permissions** - Need to test allow_guest=True endpoints
2. **Auto-cashier edge cases** - No active POS Opening, multiple cashiers
3. **JWT secret** - Using encryption_key from config, fallback to hardcoded
4. **KOT generation** - May fail silently if kot app not installed

---

## NEXT ACTIONS (Priority Order)

1. ✅ Create OrderStatus page for table-order app
2. Create URY Payment Gateway doctype
3. Create customer-order app (Phase 3)
4. Create kiosk app (Phase 5)
5. Create comprehensive testing documentation

---

## NOTES

- Table-order app uses mobile-first design
- UI consistent with POS (colors, spacing, patterns)
- Real-time updates via frappe.publish_realtime
- All packages use TypeScript
- Components use Tailwind CSS
Loading
Loading