Skip to main content

Organization Creation Fields

This document outlines the fields required when creating a new organization via the /organizations API endpoint.

Required Fields (Backend Validation)

The backend currently validates for the presence of the following fields:

  • orgName: The primary name of the organization (e.g., "Acme Corp").
  • fullName: The full legal name of the organization.
  • address: The physical address of the organization. Currently expected as a single string.
  • adminName: The name of the primary administrator for this organization.
  • adminEmail: The email address of the primary administrator for this organization.
  • industry: The industry the organization operates in.

Optional Fields (Backend Accepts)

The backend also accepts the following optional fields:

  • dunsNumber: The DUNS number of the organization.
  • creatorUserId: The ID of the user creating the organization (automatically added by frontend).
  • creatorEmail: The email of the user creating the organization (automatically added by frontend).
  • creatorDisplayName: The display name of the user creating the organization (automatically added by frontend).

Frontend Fields (Currently Sent)

The frontend form in CreateOrganizationForm.jsx currently sends the following fields:

  • orgName
  • fullName
  • address
  • industry
  • dunsNumber
  • adminName
  • adminEmail
  • subscriptionTier
  • licenses
  • contractStartDate
  • contractEndDate
  • primaryErp
  • creatorUserId (added in handleSubmit)

Notes & Questions

  • fullName vs. orgName: Please clarify the intended use of fullName. Is it the legal name, or can orgName serve this purpose?
  • Address Structure: The current address field is a single string. If a more granular structure (e.g., street, city, state, postal code, country) is desired, this would require:
    • Updates to the tenants table migration to add new columns.
    • Updates to the frontend form to collect these separate fields.
    • Updates to the backend API to process these separate fields.
  • DUNS Number Validation: Currently, dunsNumber is a free-text field. If a specific format (e.g., 9 digits) is required, frontend validation (e.g., regex) and backend validation should be implemented.