Skip to content

Commit 591fa06

Browse files
committed
Refactor data structure and form handling for account and lead creation
- Updated icons from FontAwesome to Lucide in the project documentation. - Added new data files for account ownership, account types, countries, industries, lead sources, lead statuses, and ratings. - Re-exported new data constants in index.js for easier imports. - Enhanced the Sidebar component to include dropdowns for account management. - Implemented a new page for creating accounts with comprehensive form validation and submission handling. - Integrated dropdown data for industries, account types, ownership, ratings, and countries in the account creation form. - Updated lead creation logic to utilize centralized data constants for industries, lead sources, lead statuses, and countries.
1 parent aab9098 commit 591fa06

File tree

13 files changed

+839
-55
lines changed

13 files changed

+839
-55
lines changed

.github/copilot-instructions.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ BottleCRM is a modern CRM application built with:
1717
- **Framework**: SvelteKit 2.21.x, Svelte 5.x, Prisma
1818
- **Styling**: tailwind 4.1.x css
1919
- **Database**: postgresql
20-
- **Icons**: fontawesome, we are migrating to lucide icons
20+
- **Icons**: lucide icons
2121

2222
## Important Notes
23-
- We need to ensure access control is strictly enforced based on user roles. No record is accessible unless the user or the org has the appropriate permissions.
23+
- We need to ensure access control is strictly enforced based on user roles.
24+
- No record should be accessible unless the user or the org has the appropriate permissions.
2425
- When implementing forms in sveltekit A form label must be associated with a control

src/lib/data/accountOwnership.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const accountOwnership = [
2+
['', 'Select Ownership'],
3+
['PUBLIC', 'Public'],
4+
['PRIVATE', 'Private'],
5+
['SUBSIDIARY', 'Subsidiary'],
6+
['NON_PROFIT', 'Non-Profit'],
7+
['GOVERNMENT', 'Government'],
8+
['OTHER', 'Other']
9+
];

src/lib/data/accountTypes.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const accountTypes = [
2+
['', 'Select Type'],
3+
['CUSTOMER', 'Customer'],
4+
['PARTNER', 'Partner'],
5+
['PROSPECT', 'Prospect'],
6+
['VENDOR', 'Vendor'],
7+
['COMPETITOR', 'Competitor'],
8+
['OTHER', 'Other']
9+
];

src/lib/data/countries.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
export const countries = [
2+
['', 'Select Country'],
3+
['US', 'United States'],
4+
['UK', 'United Kingdom'],
5+
['CA', 'Canada'],
6+
['AU', 'Australia'],
7+
['IN', 'India'],
8+
['DE', 'Germany'],
9+
['FR', 'France'],
10+
['JP', 'Japan'],
11+
['CN', 'China'],
12+
['BR', 'Brazil'],
13+
['MX', 'Mexico'],
14+
['IT', 'Italy'],
15+
['ES', 'Spain'],
16+
['NL', 'Netherlands'],
17+
['SE', 'Sweden'],
18+
['NO', 'Norway'],
19+
['DK', 'Denmark'],
20+
['FI', 'Finland'],
21+
['CH', 'Switzerland'],
22+
['AT', 'Austria'],
23+
['BE', 'Belgium'],
24+
['IE', 'Ireland'],
25+
['PL', 'Poland'],
26+
['RU', 'Russia'],
27+
['KR', 'South Korea'],
28+
['SG', 'Singapore'],
29+
['TH', 'Thailand'],
30+
['MY', 'Malaysia'],
31+
['ID', 'Indonesia'],
32+
['PH', 'Philippines'],
33+
['VN', 'Vietnam'],
34+
['NZ', 'New Zealand'],
35+
['ZA', 'South Africa'],
36+
['EG', 'Egypt'],
37+
['NG', 'Nigeria'],
38+
['KE', 'Kenya'],
39+
['AR', 'Argentina'],
40+
['CL', 'Chile'],
41+
['CO', 'Colombia'],
42+
['PE', 'Peru'],
43+
['OTHER', 'Other']
44+
];

src/lib/data/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Re-export all data constants for easy importing
2+
export { industries } from './industries.js';
3+
export { accountTypes } from './accountTypes.js';
4+
export { accountOwnership } from './accountOwnership.js';
5+
export { ratings } from './ratings.js';
6+
export { countries } from './countries.js';
7+
export { leadSources } from './leadSources.js';
8+
export { leadStatuses } from './leadStatuses.js';

src/lib/data/industries.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export const industries = [
2+
['', 'Select Industry'],
3+
['TECHNOLOGY', 'Technology'],
4+
['HEALTHCARE', 'Healthcare'],
5+
['FINANCE', 'Finance'],
6+
['EDUCATION', 'Education'],
7+
['RETAIL', 'Retail'],
8+
['MANUFACTURING', 'Manufacturing'],
9+
['ENERGY', 'Energy'],
10+
['REAL_ESTATE', 'Real Estate'],
11+
['CONSTRUCTION', 'Construction'],
12+
['TRANSPORTATION', 'Transportation'],
13+
['HOSPITALITY', 'Hospitality'],
14+
['AGRICULTURE', 'Agriculture'],
15+
['OTHER', 'Other']
16+
];

src/lib/data/leadSources.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export const leadSources = [
2+
['', 'Select Source'],
3+
['WEB', 'Website'],
4+
['PHONE_INQUIRY', 'Phone Inquiry'],
5+
['PARTNER_REFERRAL', 'Partner Referral'],
6+
['COLD_CALL', 'Cold Call'],
7+
['TRADE_SHOW', 'Trade Show'],
8+
['EMPLOYEE_REFERRAL', 'Employee Referral'],
9+
['ADVERTISEMENT', 'Advertisement'],
10+
['SOCIAL_MEDIA', 'Social Media'],
11+
['EMAIL_CAMPAIGN', 'Email Campaign'],
12+
['WEBINAR', 'Webinar'],
13+
['CONTENT_MARKETING', 'Content Marketing'],
14+
['SEO', 'SEO/Organic Search'],
15+
['PPC', 'Pay-Per-Click Advertising'],
16+
['DIRECT_MAIL', 'Direct Mail'],
17+
['OTHER', 'Other']
18+
];

src/lib/data/leadStatuses.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const leadStatuses = [
2+
['NEW', 'New'],
3+
['PENDING', 'Pending'],
4+
['CONTACTED', 'Contacted'],
5+
['QUALIFIED', 'Qualified'],
6+
['UNQUALIFIED', 'Unqualified']
7+
];

src/lib/data/ratings.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const ratings = [
2+
['', 'Select Rating'],
3+
['HOT', '🔥 Hot'],
4+
['WARM', '🟡 Warm'],
5+
['COLD', '🟦 Cold']
6+
];

src/routes/(app)/Sidebar.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,14 @@
8686
]
8787
},
8888
{
89-
href: '/app/accounts',
89+
key: 'accounts',
9090
label: 'Accounts',
9191
icon: Building,
92-
type: 'link'
92+
type: 'dropdown',
93+
children: [
94+
{ href: '/app/accounts', label: 'All Accounts', icon: List },
95+
{ href: '/app/accounts/new', label: 'New Account', icon: Plus }
96+
]
9397
},
9498
{
9599
key: 'opportunities',

0 commit comments

Comments
 (0)