Kaizen
Browse modulesFormsforms/sharedInterfaces

Interface: SavePayload

Defined in: shared/forms/save-port.ts:17

Wire payload sent to the persistence layer on save. Mirrors the shape a builder UI's "Save" / "Confirm import" actions would hand off to a server-side mutation, but the contract here is the neutral one — an implementer can wire to tRPC, REST, a custom RPC, anything.

Field-omission semantics matter:

  • name and description should only be present when they changed from the form's initial values. Their absence signals "no form-level field change" to consumers that gate post-save side effects (e.g. RSC refresh) on shouldRefreshAfterSuccess.
  • description: null is a clear (vs. undefined, which means no-change). Consumers that don't carry a description column can ignore the field.

Properties

changeReason

changeReason: string;

Defined in: shared/forms/save-port.ts:22


description?

optional description?: string | null;

Defined in: shared/forms/save-port.ts:20


id

id: string;

Defined in: shared/forms/save-port.ts:18


name?

optional name?: string;

Defined in: shared/forms/save-port.ts:19


schema

schema: {
  fields: {
     additionalInfo?: {
        body?: string;
        title?: string;
     };
     adoptionStatement?: string;
     allowedFonts?: string[];
     asset?: {
        alt?: string;
        fileId?: string;
        filename?: string;
        mimeType?: string;
        url?: string;
     };
     dataSource?: string;
     defaultValue?:   | string
        | {
        from: string;
        to: string | null;
      };
     description?: string;
     fields?: {
        additionalInfo?: {
           body?: string;
           title?: string;
        };
        adoptionStatement?: string;
        allowedFonts?: string[];
        asset?: {
           alt?: string;
           fileId?: string;
           filename?: string;
           mimeType?: string;
           url?: string;
        };
        dataSource?: string;
        defaultValue?:   | string
           | {
           from: string;
           to: string | null;
         };
        description?: string;
        format?: string;
        label: string;
        maxDate?: string;
        maxFiles?: number;
        maxLength?: number;
        minDate?: string;
        name: string;
        options?: (
           | string
           | {
           description?: ... | ...;
           value: string;
        })[];
        placeholder?: string;
        prefillFrom?: string;
        required: boolean;
        showRange?: boolean;
        showTime?: boolean;
        signatureMode?: "typed" | "drawn";
        timezone?: string;
        type:   | "number"
           | "date"
           | "file"
           | "email"
           | "url"
           | "select"
           | "text"
           | "checkbox"
           | "textarea"
           | "phone"
           | "radio-group"
           | "multiselect"
           | "field-array"
           | "image"
           | "file-download"
           | "section-header"
           | "section-unset"
           | "signature"
           | "signature-adopted";
     }[];
     format?: string;
     label: string;
     maxDate?: string;
     maxFiles?: number;
     maxLength?: number;
     maxRows?: number;
     minDate?: string;
     minRows?: number;
     name: string;
     options?: (
        | string
        | {
        description?: string;
        value: string;
     })[];
     placeholder?: string;
     prefillFrom?: string;
     required: boolean;
     showRange?: boolean;
     showTime?: boolean;
     signatureMode?: "typed" | "drawn";
     timezone?: string;
     type:   | "number"
        | "date"
        | "file"
        | "email"
        | "url"
        | "select"
        | "text"
        | "checkbox"
        | "textarea"
        | "phone"
        | "radio-group"
        | "multiselect"
        | "field-array"
        | "image"
        | "file-download"
        | "section-header"
        | "section-unset"
        | "signature"
        | "signature-adopted";
  }[];
};

Defined in: shared/forms/save-port.ts:21

fields

fields: {
  additionalInfo?: {
     body?: string;
     title?: string;
  };
  adoptionStatement?: string;
  allowedFonts?: string[];
  asset?: {
     alt?: string;
     fileId?: string;
     filename?: string;
     mimeType?: string;
     url?: string;
  };
  dataSource?: string;
  defaultValue?:   | string
     | {
     from: string;
     to: string | null;
   };
  description?: string;
  fields?: {
     additionalInfo?: {
        body?: string;
        title?: string;
     };
     adoptionStatement?: string;
     allowedFonts?: string[];
     asset?: {
        alt?: string;
        fileId?: string;
        filename?: string;
        mimeType?: string;
        url?: string;
     };
     dataSource?: string;
     defaultValue?:   | string
        | {
        from: string;
        to: string | null;
      };
     description?: string;
     format?: string;
     label: string;
     maxDate?: string;
     maxFiles?: number;
     maxLength?: number;
     minDate?: string;
     name: string;
     options?: (
        | string
        | {
        description?: ... | ...;
        value: string;
     })[];
     placeholder?: string;
     prefillFrom?: string;
     required: boolean;
     showRange?: boolean;
     showTime?: boolean;
     signatureMode?: "typed" | "drawn";
     timezone?: string;
     type:   | "number"
        | "date"
        | "file"
        | "email"
        | "url"
        | "select"
        | "text"
        | "checkbox"
        | "textarea"
        | "phone"
        | "radio-group"
        | "multiselect"
        | "field-array"
        | "image"
        | "file-download"
        | "section-header"
        | "section-unset"
        | "signature"
        | "signature-adopted";
  }[];
  format?: string;
  label: string;
  maxDate?: string;
  maxFiles?: number;
  maxLength?: number;
  maxRows?: number;
  minDate?: string;
  minRows?: number;
  name: string;
  options?: (
     | string
     | {
     description?: string;
     value: string;
  })[];
  placeholder?: string;
  prefillFrom?: string;
  required: boolean;
  showRange?: boolean;
  showTime?: boolean;
  signatureMode?: "typed" | "drawn";
  timezone?: string;
  type:   | "number"
     | "date"
     | "file"
     | "email"
     | "url"
     | "select"
     | "text"
     | "checkbox"
     | "textarea"
     | "phone"
     | "radio-group"
     | "multiselect"
     | "field-array"
     | "image"
     | "file-download"
     | "section-header"
     | "section-unset"
     | "signature"
     | "signature-adopted";
}[];

On this page