diff --git a/api/thirdfort/consumer/tasksteps/type/v1/form.proto b/api/thirdfort/consumer/tasksteps/type/v1/form.proto new file mode 100644 index 0000000..12dc4f4 --- /dev/null +++ b/api/thirdfort/consumer/tasksteps/type/v1/form.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package thirdfort.consumer.tasksteps.type.v1; + +message FormTaskStepParams { + // The display name of the form. + string display_name = 1; + + // Markdown formatted description providing more context for the form. + string description = 2; + + // Defines a specific field in the form. + message FormField { + // Machine-readable name of the field. + string name = 1; + + // Human-readable display name of the field. + string display_name = 2; + + // Human-readable description of the field. + string description = 3; + + // The type of the field. + oneof field_type { + TextField text_field = 4; + } + } + // The fields to display in the form. + repeated FormField fields = 3; + + // The text to display on the submit button. + string submit_button_text = 4; +} + +// The field is a text input. +message TextField { + // The placeholder text to display in the text input. + string placeholder = 1; + + // The maximum length of the text input. + int32 max_length = 2; + + // Flag to determine whether the text input is required. + bool required = 3; +} + + +// The data submitted by the user in response to a form. +message FormTaskStepData { + // Defines a specific field in the form. + repeated FormFieldData fields = 1; + + message FormFieldData { + // Name of the field. + string name = 1; + + // The value of the field. + string value = 2; + } +} diff --git a/mobile/libs/genproto/thirdfort/consumer/tasksteps/type/v1/form_pb.ts b/mobile/libs/genproto/thirdfort/consumer/tasksteps/type/v1/form_pb.ts new file mode 100644 index 0000000..da6b8c4 --- /dev/null +++ b/mobile/libs/genproto/thirdfort/consumer/tasksteps/type/v1/form_pb.ts @@ -0,0 +1,184 @@ +// @generated by protoc-gen-es v2.2.3 with parameter "target=ts" +// @generated from file thirdfort/consumer/tasksteps/type/v1/form.proto (package thirdfort.consumer.tasksteps.type.v1, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file thirdfort/consumer/tasksteps/type/v1/form.proto. + */ +export const file_thirdfort_consumer_tasksteps_type_v1_form: GenFile = /*@__PURE__*/ + fileDesc("Ci90aGlyZGZvcnQvY29uc3VtZXIvdGFza3N0ZXBzL3R5cGUvdjEvZm9ybS5wcm90bxIkdGhpcmRmb3J0LmNvbnN1bWVyLnRhc2tzdGVwcy50eXBlLnYxIssCChJGb3JtVGFza1N0ZXBQYXJhbXMSFAoMZGlzcGxheV9uYW1lGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJElIKBmZpZWxkcxgDIAMoCzJCLnRoaXJkZm9ydC5jb25zdW1lci50YXNrc3RlcHMudHlwZS52MS5Gb3JtVGFza1N0ZXBQYXJhbXMuRm9ybUZpZWxkEhoKEnN1Ym1pdF9idXR0b25fdGV4dBgEIAEoCRqZAQoJRm9ybUZpZWxkEgwKBG5hbWUYASABKAkSFAoMZGlzcGxheV9uYW1lGAIgASgJEhMKC2Rlc2NyaXB0aW9uGAMgASgJEkUKCnRleHRfZmllbGQYBCABKAsyLy50aGlyZGZvcnQuY29uc3VtZXIudGFza3N0ZXBzLnR5cGUudjEuVGV4dEZpZWxkSABCDAoKZmllbGRfdHlwZSJGCglUZXh0RmllbGQSEwoLcGxhY2Vob2xkZXIYASABKAkSEgoKbWF4X2xlbmd0aBgCIAEoBRIQCghyZXF1aXJlZBgDIAEoCCKWAQoQRm9ybVRhc2tTdGVwRGF0YRJUCgZmaWVsZHMYASADKAsyRC50aGlyZGZvcnQuY29uc3VtZXIudGFza3N0ZXBzLnR5cGUudjEuRm9ybVRhc2tTdGVwRGF0YS5Gb3JtRmllbGREYXRhGiwKDUZvcm1GaWVsZERhdGESDAoEbmFtZRgBIAEoCRINCgV2YWx1ZRgCIAEoCULoAgooY29tLnRoaXJkZm9ydC5jb25zdW1lci50YXNrc3RlcHMudHlwZS52MUIJRm9ybVByb3RvUAFafGdpdGh1Yi5jb20vdGhpcmRmb3J0L3RoaXJkZm9ydC1tb2JpbGUtZnVsbHN0YWNrLWNvZGUtcmV2aWV3L3NlcnZlci9saWJzL2dlbnByb3RvL3RoaXJkZm9ydC9jb25zdW1lci90YXNrc3RlcHMvdHlwZS92MTt0eXBldjGiAgRUQ1RUqgIkVGhpcmRmb3J0LkNvbnN1bWVyLlRhc2tzdGVwcy5UeXBlLlYxygIkVGhpcmRmb3J0XENvbnN1bWVyXFRhc2tzdGVwc1xUeXBlXFYx4gIwVGhpcmRmb3J0XENvbnN1bWVyXFRhc2tzdGVwc1xUeXBlXFYxXEdQQk1ldGFkYXRh6gIoVGhpcmRmb3J0OjpDb25zdW1lcjo6VGFza3N0ZXBzOjpUeXBlOjpWMWIGcHJvdG8z"); + +/** + * @generated from message thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams + */ +export type FormTaskStepParams = Message<"thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams"> & { + /** + * The display name of the form. + * + * @generated from field: string display_name = 1; + */ + displayName: string; + + /** + * Markdown formatted description providing more context for the form. + * + * @generated from field: string description = 2; + */ + description: string; + + /** + * The fields to display in the form. + * + * @generated from field: repeated thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams.FormField fields = 3; + */ + fields: FormTaskStepParams_FormField[]; + + /** + * The text to display on the submit button. + * + * @generated from field: string submit_button_text = 4; + */ + submitButtonText: string; +}; + +/** + * Describes the message thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams. + * Use `create(FormTaskStepParamsSchema)` to create a new message. + */ +export const FormTaskStepParamsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_thirdfort_consumer_tasksteps_type_v1_form, 0); + +/** + * Defines a specific field in the form. + * + * @generated from message thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams.FormField + */ +export type FormTaskStepParams_FormField = Message<"thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams.FormField"> & { + /** + * Machine-readable name of the field. + * + * @generated from field: string name = 1; + */ + name: string; + + /** + * Human-readable display name of the field. + * + * @generated from field: string display_name = 2; + */ + displayName: string; + + /** + * Human-readable description of the field. + * + * @generated from field: string description = 3; + */ + description: string; + + /** + * The type of the field. + * + * @generated from oneof thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams.FormField.field_type + */ + fieldType: { + /** + * @generated from field: thirdfort.consumer.tasksteps.type.v1.TextField text_field = 4; + */ + value: TextField; + case: "textField"; + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams.FormField. + * Use `create(FormTaskStepParams_FormFieldSchema)` to create a new message. + */ +export const FormTaskStepParams_FormFieldSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_thirdfort_consumer_tasksteps_type_v1_form, 0, 0); + +/** + * The field is a text input. + * + * @generated from message thirdfort.consumer.tasksteps.type.v1.TextField + */ +export type TextField = Message<"thirdfort.consumer.tasksteps.type.v1.TextField"> & { + /** + * The placeholder text to display in the text input. + * + * @generated from field: string placeholder = 1; + */ + placeholder: string; + + /** + * The maximum length of the text input. + * + * @generated from field: int32 max_length = 2; + */ + maxLength: number; + + /** + * Flag to determine whether the text input is required. + * + * @generated from field: bool required = 3; + */ + required: boolean; +}; + +/** + * Describes the message thirdfort.consumer.tasksteps.type.v1.TextField. + * Use `create(TextFieldSchema)` to create a new message. + */ +export const TextFieldSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_thirdfort_consumer_tasksteps_type_v1_form, 1); + +/** + * The data submitted by the user in response to a form. + * + * @generated from message thirdfort.consumer.tasksteps.type.v1.FormTaskStepData + */ +export type FormTaskStepData = Message<"thirdfort.consumer.tasksteps.type.v1.FormTaskStepData"> & { + /** + * Defines a specific field in the form. + * + * @generated from field: repeated thirdfort.consumer.tasksteps.type.v1.FormTaskStepData.FormFieldData fields = 1; + */ + fields: FormTaskStepData_FormFieldData[]; +}; + +/** + * Describes the message thirdfort.consumer.tasksteps.type.v1.FormTaskStepData. + * Use `create(FormTaskStepDataSchema)` to create a new message. + */ +export const FormTaskStepDataSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_thirdfort_consumer_tasksteps_type_v1_form, 2); + +/** + * @generated from message thirdfort.consumer.tasksteps.type.v1.FormTaskStepData.FormFieldData + */ +export type FormTaskStepData_FormFieldData = Message<"thirdfort.consumer.tasksteps.type.v1.FormTaskStepData.FormFieldData"> & { + /** + * Name of the field. + * + * @generated from field: string name = 1; + */ + name: string; + + /** + * The value of the field. + * + * @generated from field: string value = 2; + */ + value: string; +}; + +/** + * Describes the message thirdfort.consumer.tasksteps.type.v1.FormTaskStepData.FormFieldData. + * Use `create(FormTaskStepData_FormFieldDataSchema)` to create a new message. + */ +export const FormTaskStepData_FormFieldDataSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_thirdfort_consumer_tasksteps_type_v1_form, 2, 0); + diff --git a/mobile/src/components/FormField.tsx b/mobile/src/components/FormField.tsx new file mode 100644 index 0000000..5c47487 --- /dev/null +++ b/mobile/src/components/FormField.tsx @@ -0,0 +1,92 @@ +import { useState } from 'react'; +import { View, Text, StyleSheet, TextInput, Platform } from 'react-native'; + +import { FormTaskStepParams_FormField} from '../../libs/genproto/thirdfort/consumer/tasksteps/type/v1/form_pb'; + +import { typography, scheme } from '../styles/values'; + +type FormFieldProps = { + params: FormTaskStepParams_FormField +} + +export function FormField({params}: FormFieldProps) { + + if (!params.fieldType || !params.fieldType.case) return null; + + const [isFocused, setIsFocused] = useState(false); + + switch (params.fieldType.case) { + case 'textField': + return ( + + + {params.displayName} + + + + + ); + default: + return null; + } +}; + +const styles = StyleSheet.create({ + container: { + display: 'flex', + flex: 1, + flexDirection: 'column', + }, + label: { + color: '#333', + position: 'absolute', + left: 10, + backgroundColor: scheme.background1, + paddingHorizontal: 5, + paddingVertical: 3, + height: 22, + zIndex: 9, + }, + inputSelected: { + borderColor: scheme.secondary, + borderWidth: 2, + }, + input: { + height: 70, + borderColor: '#ccc', + backgroundColor: '#fff', + borderWidth: 1, + borderRadius: 4, + fontSize: 16, + width: '100%', + paddingHorizontal: 20, + color: scheme.bodyPanel, + zIndex: 1, + elevation: 0, + }, + inputError: { + borderColor: scheme.error, + }, + iconError: { + position: 'absolute', + right: 20, + top: 45, + zIndex: 999, + }, + requireField: { + alignContent: 'flex-end', + textAlign: 'right', + height: 25, + }, + requiredText: { + ...typography.smallRegular, + fontSize: 12, + textAlign: 'right', + }, +}); \ No newline at end of file diff --git a/mobile/src/components/TaskFormTaskStep.tsx b/mobile/src/components/TaskFormTaskStep.tsx new file mode 100644 index 0000000..a039544 --- /dev/null +++ b/mobile/src/components/TaskFormTaskStep.tsx @@ -0,0 +1,75 @@ +import { View, Text, StyleSheet } from 'react-native'; +import { Button } from '@react-navigation/elements'; + +import { FormTaskStepParams} from '../../libs/genproto/thirdfort/consumer/tasksteps/type/v1/form_pb'; + +import { spacing, typography, scheme } from '../styles/values'; +import { FormField } from './FormField'; + +type TaskCompletionTaskStepProps = { + params: FormTaskStepParams; + onTaskStepComplete: () => void; +}; + +export function TaskFormTaskStep({ params, onTaskStepComplete } : TaskCompletionTaskStepProps) { + return ( + + + + + {params.displayName} + + + {params.description} + + + + {params.fields.map((item) => ( + + ))} + + + + + ); +}; + +const styles = StyleSheet.create({ + containerText: { + color: scheme.body1, + }, + container: { + flex: 1, + backgroundColor: scheme.background1, + gap: 1 + }, + content: { + flex: 1, + marginTop: 40, + gap: spacing.lg, + padding: spacing.lg, + justifyContent: 'space-between', + }, + input: { + height: 120, + width: '100%', + }, + icon: { + marginTop: 10, + width: 32, + height: 32, + }, + descriptionContainer: { + paddingVertical: spacing.lg, + gap: spacing.md, + }, + title: { + ...typography.title, + }, + description: { + ...typography.paragraph, + }, +}); diff --git a/mobile/src/components/TaskStepRenderer.tsx b/mobile/src/components/TaskStepRenderer.tsx index 7707ec4..fc9bf6f 100644 --- a/mobile/src/components/TaskStepRenderer.tsx +++ b/mobile/src/components/TaskStepRenderer.tsx @@ -5,6 +5,7 @@ import { taskStepMap } from '../mapping'; import { file_thirdfort_consumer_tasksteps_type_v1_task_description } from '../../libs/genproto/thirdfort/consumer/tasksteps/type/v1/task-description_pb'; import { file_thirdfort_consumer_tasksteps_type_v1_task_information } from '../../libs/genproto/thirdfort/consumer/tasksteps/type/v1/task-information_pb'; +import { file_thirdfort_consumer_tasksteps_type_v1_form } from '../../libs/genproto/thirdfort/consumer/tasksteps/type/v1/form_pb'; import { file_thirdfort_consumer_tasksteps_type_v1_task_completion } from '../../libs/genproto/thirdfort/consumer/tasksteps/type/v1/task-completion_pb'; type TaskStepRendererProps = { @@ -15,6 +16,7 @@ type TaskStepRendererProps = { export const registry = createRegistry( file_thirdfort_consumer_tasksteps_type_v1_task_description, file_thirdfort_consumer_tasksteps_type_v1_task_information, + file_thirdfort_consumer_tasksteps_type_v1_form, file_thirdfort_consumer_tasksteps_type_v1_task_completion, ); @@ -23,6 +25,7 @@ export function TaskStepRenderer({taskStep, onTaskStepComplete} : TaskStepRender switch(taskStep.name) { case "TaskDescription": case "TaskInformation": + case "TaskForm": case "TaskCompletion": params = anyUnpack(taskStep.params as any, registry); break; diff --git a/mobile/src/mapping.ts b/mobile/src/mapping.ts index d724aa0..e2ccc09 100644 --- a/mobile/src/mapping.ts +++ b/mobile/src/mapping.ts @@ -3,12 +3,15 @@ import { TaskDescriptionTaskStep } from './components/TaskDescriptionTaskStep'; import { TaskDescriptionTaskStepParamsSchema } from '../libs/genproto/thirdfort/consumer/tasksteps/type/v1/task-description_pb'; import { TaskInformationTaskStep } from './components/TaskInformationTaskStep'; import { TaskInformationTaskStepParamsSchema } from '../libs/genproto/thirdfort/consumer/tasksteps/type/v1/task-information_pb'; +import { TaskFormTaskStep } from './components/TaskFormTaskStep'; +import { FormTaskStepDataSchema } from '../libs/genproto/thirdfort/consumer/tasksteps/type/v1/form_pb'; import { TaskCompletionTaskStep } from './components/TaskCompletionTaskStep'; import { TaskCompletionTaskStepParamsSchema } from '../libs/genproto/thirdfort/consumer/tasksteps/type/v1/task-completion_pb'; type TaskStepParamName = | 'TaskDescription' | 'TaskInformation' + | 'TaskForm' | 'TaskCompletion' type TaskStepMap = { @@ -28,6 +31,10 @@ export const taskStepMap: TaskStepMap = { component: TaskInformationTaskStep, paramsSchema: TaskInformationTaskStepParamsSchema, }, + 'TaskForm': { + component: TaskFormTaskStep, + paramsSchema: FormTaskStepDataSchema, + }, 'TaskCompletion': { component: TaskCompletionTaskStep, paramsSchema: TaskCompletionTaskStepParamsSchema, diff --git a/server/libs/genproto/thirdfort/consumer/tasksteps/type/v1/form.pb.go b/server/libs/genproto/thirdfort/consumer/tasksteps/type/v1/form.pb.go new file mode 100644 index 0000000..86b8ad3 --- /dev/null +++ b/server/libs/genproto/thirdfort/consumer/tasksteps/type/v1/form.pb.go @@ -0,0 +1,490 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.2 +// protoc (unknown) +// source: thirdfort/consumer/tasksteps/type/v1/form.proto + +package typev1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type FormTaskStepParams struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The display name of the form. + DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // Markdown formatted description providing more context for the form. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // The fields to display in the form. + Fields []*FormTaskStepParams_FormField `protobuf:"bytes,3,rep,name=fields,proto3" json:"fields,omitempty"` + // The text to display on the submit button. + SubmitButtonText string `protobuf:"bytes,4,opt,name=submit_button_text,json=submitButtonText,proto3" json:"submit_button_text,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FormTaskStepParams) Reset() { + *x = FormTaskStepParams{} + mi := &file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FormTaskStepParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormTaskStepParams) ProtoMessage() {} + +func (x *FormTaskStepParams) ProtoReflect() protoreflect.Message { + mi := &file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FormTaskStepParams.ProtoReflect.Descriptor instead. +func (*FormTaskStepParams) Descriptor() ([]byte, []int) { + return file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescGZIP(), []int{0} +} + +func (x *FormTaskStepParams) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *FormTaskStepParams) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *FormTaskStepParams) GetFields() []*FormTaskStepParams_FormField { + if x != nil { + return x.Fields + } + return nil +} + +func (x *FormTaskStepParams) GetSubmitButtonText() string { + if x != nil { + return x.SubmitButtonText + } + return "" +} + +// The field is a text input. +type TextField struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The placeholder text to display in the text input. + Placeholder string `protobuf:"bytes,1,opt,name=placeholder,proto3" json:"placeholder,omitempty"` + // The maximum length of the text input. + MaxLength int32 `protobuf:"varint,2,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` + // Flag to determine whether the text input is required. + Required bool `protobuf:"varint,3,opt,name=required,proto3" json:"required,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TextField) Reset() { + *x = TextField{} + mi := &file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TextField) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TextField) ProtoMessage() {} + +func (x *TextField) ProtoReflect() protoreflect.Message { + mi := &file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TextField.ProtoReflect.Descriptor instead. +func (*TextField) Descriptor() ([]byte, []int) { + return file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescGZIP(), []int{1} +} + +func (x *TextField) GetPlaceholder() string { + if x != nil { + return x.Placeholder + } + return "" +} + +func (x *TextField) GetMaxLength() int32 { + if x != nil { + return x.MaxLength + } + return 0 +} + +func (x *TextField) GetRequired() bool { + if x != nil { + return x.Required + } + return false +} + +// The data submitted by the user in response to a form. +type FormTaskStepData struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Defines a specific field in the form. + Fields []*FormTaskStepData_FormFieldData `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FormTaskStepData) Reset() { + *x = FormTaskStepData{} + mi := &file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FormTaskStepData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormTaskStepData) ProtoMessage() {} + +func (x *FormTaskStepData) ProtoReflect() protoreflect.Message { + mi := &file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FormTaskStepData.ProtoReflect.Descriptor instead. +func (*FormTaskStepData) Descriptor() ([]byte, []int) { + return file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescGZIP(), []int{2} +} + +func (x *FormTaskStepData) GetFields() []*FormTaskStepData_FormFieldData { + if x != nil { + return x.Fields + } + return nil +} + +// Defines a specific field in the form. +type FormTaskStepParams_FormField struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Machine-readable name of the field. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Human-readable display name of the field. + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // Human-readable description of the field. + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // The type of the field. + // + // Types that are valid to be assigned to FieldType: + // + // *FormTaskStepParams_FormField_TextField + FieldType isFormTaskStepParams_FormField_FieldType `protobuf_oneof:"field_type"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FormTaskStepParams_FormField) Reset() { + *x = FormTaskStepParams_FormField{} + mi := &file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FormTaskStepParams_FormField) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormTaskStepParams_FormField) ProtoMessage() {} + +func (x *FormTaskStepParams_FormField) ProtoReflect() protoreflect.Message { + mi := &file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FormTaskStepParams_FormField.ProtoReflect.Descriptor instead. +func (*FormTaskStepParams_FormField) Descriptor() ([]byte, []int) { + return file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *FormTaskStepParams_FormField) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FormTaskStepParams_FormField) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *FormTaskStepParams_FormField) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *FormTaskStepParams_FormField) GetFieldType() isFormTaskStepParams_FormField_FieldType { + if x != nil { + return x.FieldType + } + return nil +} + +func (x *FormTaskStepParams_FormField) GetTextField() *TextField { + if x != nil { + if x, ok := x.FieldType.(*FormTaskStepParams_FormField_TextField); ok { + return x.TextField + } + } + return nil +} + +type isFormTaskStepParams_FormField_FieldType interface { + isFormTaskStepParams_FormField_FieldType() +} + +type FormTaskStepParams_FormField_TextField struct { + TextField *TextField `protobuf:"bytes,4,opt,name=text_field,json=textField,proto3,oneof"` +} + +func (*FormTaskStepParams_FormField_TextField) isFormTaskStepParams_FormField_FieldType() {} + +type FormTaskStepData_FormFieldData struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Name of the field. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The value of the field. + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FormTaskStepData_FormFieldData) Reset() { + *x = FormTaskStepData_FormFieldData{} + mi := &file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FormTaskStepData_FormFieldData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FormTaskStepData_FormFieldData) ProtoMessage() {} + +func (x *FormTaskStepData_FormFieldData) ProtoReflect() protoreflect.Message { + mi := &file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FormTaskStepData_FormFieldData.ProtoReflect.Descriptor instead. +func (*FormTaskStepData_FormFieldData) Descriptor() ([]byte, []int) { + return file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *FormTaskStepData_FormFieldData) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FormTaskStepData_FormFieldData) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_thirdfort_consumer_tasksteps_type_v1_form_proto protoreflect.FileDescriptor + +var file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDesc = []byte{ + 0x0a, 0x2f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x66, 0x6f, 0x72, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x73, + 0x75, 0x6d, 0x65, 0x72, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x74, 0x65, 0x70, 0x73, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x24, 0x74, 0x68, 0x69, 0x72, 0x64, 0x66, 0x6f, 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6e, + 0x73, 0x75, 0x6d, 0x65, 0x72, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x74, 0x65, 0x70, 0x73, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x22, 0xaa, 0x03, 0x0a, 0x12, 0x46, 0x6f, 0x72, 0x6d, + 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x65, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, + 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x5a, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x74, 0x68, 0x69, 0x72, 0x64, 0x66, 0x6f, 0x72, 0x74, 0x2e, + 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x74, 0x65, + 0x70, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x54, + 0x61, 0x73, 0x6b, 0x53, 0x74, 0x65, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x46, 0x6f, + 0x72, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, + 0x2c, 0x0a, 0x12, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5f, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, + 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x73, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x1a, 0xc4, 0x01, + 0x0a, 0x09, 0x46, 0x6f, 0x72, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x50, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x74, 0x68, 0x69, 0x72, 0x64, + 0x66, 0x6f, 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x2e, 0x74, 0x61, + 0x73, 0x6b, 0x73, 0x74, 0x65, 0x70, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x65, 0x78, + 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x22, 0x68, 0x0a, 0x09, 0x54, 0x65, 0x78, 0x74, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, + 0x64, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x22, 0xab, + 0x01, 0x0a, 0x10, 0x46, 0x6f, 0x72, 0x6d, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x65, 0x70, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x5c, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x74, 0x68, 0x69, 0x72, 0x64, 0x66, 0x6f, 0x72, 0x74, 0x2e, + 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x74, 0x65, + 0x70, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x54, + 0x61, 0x73, 0x6b, 0x53, 0x74, 0x65, 0x70, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x6f, 0x72, 0x6d, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x73, 0x1a, 0x39, 0x0a, 0x0d, 0x46, 0x6f, 0x72, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0xe8, 0x02, 0x0a, + 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x68, 0x69, 0x72, 0x64, 0x66, 0x6f, 0x72, 0x74, 0x2e, 0x63, + 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x74, 0x65, 0x70, + 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x46, 0x6f, 0x72, 0x6d, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x7c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x66, 0x6f, 0x72, 0x74, 0x2f, 0x74, 0x68, 0x69, + 0x72, 0x64, 0x66, 0x6f, 0x72, 0x74, 0x2d, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x2d, 0x66, 0x75, + 0x6c, 0x6c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x72, 0x65, 0x76, + 0x69, 0x65, 0x77, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x62, 0x73, 0x2f, + 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x66, 0x6f, + 0x72, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x2f, 0x74, 0x61, 0x73, 0x6b, + 0x73, 0x74, 0x65, 0x70, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x79, + 0x70, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x54, 0x43, 0x54, 0x54, 0xaa, 0x02, 0x24, 0x54, 0x68, + 0x69, 0x72, 0x64, 0x66, 0x6f, 0x72, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, + 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x74, 0x65, 0x70, 0x73, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x24, 0x54, 0x68, 0x69, 0x72, 0x64, 0x66, 0x6f, 0x72, 0x74, 0x5c, 0x43, + 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x5c, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x74, 0x65, 0x70, + 0x73, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x30, 0x54, 0x68, 0x69, 0x72, + 0x64, 0x66, 0x6f, 0x72, 0x74, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x5c, 0x54, + 0x61, 0x73, 0x6b, 0x73, 0x74, 0x65, 0x70, 0x73, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x28, 0x54, + 0x68, 0x69, 0x72, 0x64, 0x66, 0x6f, 0x72, 0x74, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, + 0x65, 0x72, 0x3a, 0x3a, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x74, 0x65, 0x70, 0x73, 0x3a, 0x3a, 0x54, + 0x79, 0x70, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescOnce sync.Once + file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescData = file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDesc +) + +func file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescGZIP() []byte { + file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescOnce.Do(func() { + file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescData = protoimpl.X.CompressGZIP(file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescData) + }) + return file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDescData +} + +var file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_thirdfort_consumer_tasksteps_type_v1_form_proto_goTypes = []any{ + (*FormTaskStepParams)(nil), // 0: thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams + (*TextField)(nil), // 1: thirdfort.consumer.tasksteps.type.v1.TextField + (*FormTaskStepData)(nil), // 2: thirdfort.consumer.tasksteps.type.v1.FormTaskStepData + (*FormTaskStepParams_FormField)(nil), // 3: thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams.FormField + (*FormTaskStepData_FormFieldData)(nil), // 4: thirdfort.consumer.tasksteps.type.v1.FormTaskStepData.FormFieldData +} +var file_thirdfort_consumer_tasksteps_type_v1_form_proto_depIdxs = []int32{ + 3, // 0: thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams.fields:type_name -> thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams.FormField + 4, // 1: thirdfort.consumer.tasksteps.type.v1.FormTaskStepData.fields:type_name -> thirdfort.consumer.tasksteps.type.v1.FormTaskStepData.FormFieldData + 1, // 2: thirdfort.consumer.tasksteps.type.v1.FormTaskStepParams.FormField.text_field:type_name -> thirdfort.consumer.tasksteps.type.v1.TextField + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_thirdfort_consumer_tasksteps_type_v1_form_proto_init() } +func file_thirdfort_consumer_tasksteps_type_v1_form_proto_init() { + if File_thirdfort_consumer_tasksteps_type_v1_form_proto != nil { + return + } + file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes[3].OneofWrappers = []any{ + (*FormTaskStepParams_FormField_TextField)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_thirdfort_consumer_tasksteps_type_v1_form_proto_goTypes, + DependencyIndexes: file_thirdfort_consumer_tasksteps_type_v1_form_proto_depIdxs, + MessageInfos: file_thirdfort_consumer_tasksteps_type_v1_form_proto_msgTypes, + }.Build() + File_thirdfort_consumer_tasksteps_type_v1_form_proto = out.File + file_thirdfort_consumer_tasksteps_type_v1_form_proto_rawDesc = nil + file_thirdfort_consumer_tasksteps_type_v1_form_proto_goTypes = nil + file_thirdfort_consumer_tasksteps_type_v1_form_proto_depIdxs = nil +} diff --git a/server/tasks/kyc.go b/server/tasks/kyc.go index 1bb5fe7..d168e4e 100644 --- a/server/tasks/kyc.go +++ b/server/tasks/kyc.go @@ -43,6 +43,52 @@ func getTaskInformationParams() (*tasksv1.TaskInformationTaskStepParams, error) }, nil } +func getTaskFormNameParams() (*tasksv1.FormTaskStepParams, error) { + return &tasksv1.FormTaskStepParams{ + DisplayName: "What's your name?", + Description: "Enter your name as it appears on your government-issued ID", + Fields: []*tasksv1.FormTaskStepParams_FormField{ + { + Name: "given_name", + DisplayName: "First name", + Description: "Your legal first or given name", + FieldType: &tasksv1.FormTaskStepParams_FormField_TextField{ + TextField: &tasksv1.TextField{ + Required: true, + Placeholder: "First name", + MaxLength: 32, + }, + }, + }, + { + Name: "middle_names", + DisplayName: "Middle name", + Description: "Your legal middle name(s)", + FieldType: &tasksv1.FormTaskStepParams_FormField_TextField{ + TextField: &tasksv1.TextField{ + Required: false, + Placeholder: "Middle name", + MaxLength: 32, + }, + }, + }, + { + Name: "family_name", + DisplayName: "Last name", + Description: "Your legal last, family, or surname", + FieldType: &tasksv1.FormTaskStepParams_FormField_TextField{ + TextField: &tasksv1.TextField{ + Required: true, + Placeholder: "Last name", + MaxLength: 32, + }, + }, + }, + }, + SubmitButtonText: "Next", + }, nil +} + func getTaskCompletionParams() (*tasksv1.TaskCompletionTaskStepParams, error) { return &tasksv1.TaskCompletionTaskStepParams{ DisplayName: "Task complete", @@ -93,6 +139,27 @@ func createTaskInformationTaskStep() (*consumerv1.TaskStep, error) { }, nil } +func createTaskNameFormTaskStep() (*consumerv1.TaskStep, error) { + params, err := getTaskFormNameParams() + if err != nil { + return nil, err + } + + anyParams, err := anypb.New(params) + if err != nil { + return nil, err + } + + return &consumerv1.TaskStep{ + Name: "TaskForm", + CreateTime: timestamppb.New(time.Now()), + UpdateTime: timestamppb.New(time.Now()), + State: taskStepStateToProto("NOT_COMPLETED"), + Type: "TaskForm", + Params: anyParams, + }, nil +} + func createTaskCompletionTaskStep() (*consumerv1.TaskStep, error) { params, err := getTaskCompletionParams() if err != nil { @@ -134,6 +201,11 @@ func createKYCCheck(id string) *Check { return nil } + nameFormStep, err := createTaskNameFormTaskStep() + if err != nil { + return nil + } + compStep, err := createTaskCompletionTaskStep() if err != nil { return nil @@ -144,6 +216,7 @@ func createKYCCheck(id string) *Check { TaskSteps: []consumerv1.TaskStep{ *descStep, *infoStep, + *nameFormStep, *compStep, }, }