diff --git a/src/entities/Grant/types.ts b/src/entities/Grant/types.ts index bd2717ac6..59eed2801 100644 --- a/src/entities/Grant/types.ts +++ b/src/entities/Grant/types.ts @@ -88,6 +88,24 @@ export function toGrantSubtype(value: string | null | undefined, orElse: return isGrantSubtype(value) ? (value as SubtypeOptions) : orElse() } +const MilestoneItemSchema = { + title: { + type: 'string', + minLength: 1, + maxLength: 80, + }, + tasks: { + type: 'string', + minLength: 1, + maxLength: 750, + }, + delivery_date: { + type: 'string', + minLength: 1, + maxLength: 10, + }, +} + export const GrantRequestGeneralInfoSchema = { title: { type: 'string', @@ -108,10 +126,14 @@ export const GrantRequestGeneralInfoSchema = { type: 'string', format: 'email', }, - roadmap: { - type: 'string', - minLength: 20, - maxLength: 2000, + milestones: { + type: 'array', + items: { + type: 'object', + additionalProperties: false, + required: [...Object.keys(MilestoneItemSchema)], + properties: MilestoneItemSchema, + }, }, coAuthors: { type: 'array', @@ -315,6 +337,10 @@ export const TeamMemberItemSchema = { minLength: 1, maxLength: 750, }, + address: { + type: 'string', + format: 'address', + }, relevantLink: { type: 'string', minLength: 0, @@ -391,7 +417,7 @@ export type GrantRequestGeneralInfo = { email: string specification?: string personnel?: string - roadmap: string + milestones: Milestone[] coAuthors?: string[] } @@ -415,6 +441,12 @@ export type TeamMember = { relevantLink?: string } +type Milestone = { + title: string + tasks: string + delivery_date: string +} + export type ProposalRequestTeam = { members: TeamMember[] } diff --git a/src/entities/Proposal/templates/grant.ts b/src/entities/Proposal/templates/grant.ts index 95828f085..b4394af6e 100644 --- a/src/entities/Proposal/templates/grant.ts +++ b/src/entities/Proposal/templates/grant.ts @@ -39,7 +39,7 @@ ${proposal.email} ${formatMarkdown(proposal.description)} -## Roadmap and milestones +## Milestones -${formatMarkdown(proposal.roadmap)} +${formatMarkdown(proposal.milestones.map((milestone) => `${milestone.delivery_date} - ${milestone.title}`).join('\n'))} `