1
Collections
customers:email(unique, email format),full_name,companytickets:subject(required),body(Long Text),status(Select: open, pending, closed),priority(Select)invoices:number,amount(Number),due_date(Date),paid(Boolean)articles:title,content(Text Editor),status(Select: draft, published)
customers → tickets (one_to_many), customers → invoices (one_to_many).2
Guard
Guard
customers on the customers collection, login field email, registration on. Optionally turn on email verification.3
Permissions for the default user role
4
Row policies
5
Protect sensitive fields
Add a
beforeUpdate hook on tickets that rejects changes to priority from customers, and one on customers that blocks changes to email if you don’t want customers changing their login.6
Notify support
afterInsert hook on tickets that emails your support inbox with ctx.Msg().Send(...).7
Frontend
Create an
end_users key with your portal’s origin. Pages: sign-up, login, my tickets, new ticket, my invoices, help center.Test isolation
- Register two customers, A and B.
- As A, create a ticket. As B, list tickets: A’s ticket must not appear.
- As B,
GET /collections/tickets/{A's ticket id}: expect404. - As B,
PUTthe same ID: expect404.
