From 63d888354100ac436629f81509a9685abe2564f4 Mon Sep 17 00:00:00 2001 From: itsmegood Date: Fri, 9 Feb 2024 21:30:50 +0530 Subject: [PATCH] create new customer accounts --- app/components/ui/input.tsx | 2 +- app/routes/_auth+/login.tsx | 1 + app/routes/c.$companyId+/_layout_company.tsx | 4 +- .../{accounts.tsx => customers.tsx} | 12 +- app/routes/c.$companyId+/purchases.tsx | 4 +- app/routes/c.$companyId+/sales.tsx | 4 +- .../$customerId_.edit.tsx | 58 +++ .../__customer-account-editor.tsx | 267 ++++++++++++++ .../index.tsx | 14 +- app/routes/c.$companyId.customers+/new.tsx | 16 + app/routes/c.$companyId.purchases+/index.tsx | 13 +- .../new.tsx | 13 +- app/routes/studio+/c.new.tsx | 2 +- app/routes/studio+/index.tsx | 2 +- .../$username_+/notes.$noteId_.edit.tsx | 2 +- app/styles/tailwind.css | 5 + app/utils/permissions.server.ts | 63 +++- app/utils/user.ts | 9 +- package-lock.json | 330 +++++++++--------- package.json | 22 +- prisma/schema.prisma | 79 +++-- prisma/seed.ts | 10 +- 22 files changed, 689 insertions(+), 243 deletions(-) rename app/routes/c.$companyId+/{accounts.tsx => customers.tsx} (70%) create mode 100644 app/routes/c.$companyId.customers+/$customerId_.edit.tsx create mode 100644 app/routes/c.$companyId.customers+/__customer-account-editor.tsx rename app/routes/{c.$companyId.accounts+ => c.$companyId.customers+}/index.tsx (73%) create mode 100644 app/routes/c.$companyId.customers+/new.tsx rename app/routes/{c.$companyId.accounts+ => c.$companyId.purchases+}/new.tsx (82%) diff --git a/app/components/ui/input.tsx b/app/components/ui/input.tsx index 18801dc..255252f 100644 --- a/app/components/ui/input.tsx +++ b/app/components/ui/input.tsx @@ -11,7 +11,7 @@ const Input = React.forwardRef( LoginFormSchema.transform(async (data, ctx) => { diff --git a/app/routes/c.$companyId+/_layout_company.tsx b/app/routes/c.$companyId+/_layout_company.tsx index 208ccdd..085715c 100644 --- a/app/routes/c.$companyId+/_layout_company.tsx +++ b/app/routes/c.$companyId+/_layout_company.tsx @@ -11,8 +11,8 @@ const companyRoutes = [ end: true, }, { - title: 'Accounts', - href: 'accounts', + title: 'Customers', + href: 'customers', }, { title: 'Sales', diff --git a/app/routes/c.$companyId+/accounts.tsx b/app/routes/c.$companyId+/customers.tsx similarity index 70% rename from app/routes/c.$companyId+/accounts.tsx rename to app/routes/c.$companyId+/customers.tsx index bb3c18d..f495278 100644 --- a/app/routes/c.$companyId+/accounts.tsx +++ b/app/routes/c.$companyId+/customers.tsx @@ -15,8 +15,8 @@ const salesRoutes = [ href: 'customers', }, { - title: 'Quotes', - href: 'quotes', + title: 'New Account', + href: 'new', }, { title: 'Payments', @@ -24,17 +24,17 @@ const salesRoutes = [ }, ] -export default function AccountsLayout() { +export default function CustomerAccountsLayout() { return ( <> -

Accounts

+

Customer Accounts

-