Implement CiviCRM middleware form with stage-based visibility
- Initialize Next.js project with Tailwind CSS - Create CiviCRM APIv4 integration layer - Implement stage-based form visibility (stages 0-5) - Add field mapping configuration for CRM-to-form linking - Create API routes for data retrieval and submission - Record form submissions as CiviCRM activities - Support dynamic contactId and orgId via URL parameters - Ensure robust form state management with react-hook-form Co-authored-by: joelbrock <52835+joelbrock@users.noreply.github.com>
This commit is contained in:
49
config/mapping.json
Normal file
49
config/mapping.json
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"stageField": "custom_stage_field",
|
||||
"stages": [
|
||||
{
|
||||
"id": 0,
|
||||
"label": "Stage 0: Intake",
|
||||
"fields": [
|
||||
{ "name": "first_name", "label": "First Name", "entity": "Contact", "crmField": "first_name" },
|
||||
{ "name": "last_name", "label": "Last Name", "entity": "Contact", "crmField": "last_name" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"label": "Stage 1: Assessment",
|
||||
"fields": [
|
||||
{ "name": "email", "label": "Email", "entity": "Contact", "crmField": "email_primary.email" },
|
||||
{ "name": "phone", "label": "Phone", "entity": "Contact", "crmField": "phone_primary.phone" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"label": "Stage 2: Planning",
|
||||
"fields": [
|
||||
{ "name": "custom_planning_date", "label": "Planning Date", "entity": "Contact", "crmField": "custom_123" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"label": "Stage 3: Implementation",
|
||||
"fields": [
|
||||
{ "name": "custom_status", "label": "Implementation Status", "entity": "Contact", "crmField": "custom_124" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"label": "Stage 4: Evaluation",
|
||||
"fields": [
|
||||
{ "name": "custom_results", "label": "Evaluation Results", "entity": "Contact", "crmField": "custom_125" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"label": "Stage 5: Completion",
|
||||
"fields": [
|
||||
{ "name": "custom_completion_notes", "label": "Completion Notes", "entity": "Contact", "crmField": "custom_126" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user