import { WithMongooseProps } from './with-mongoose-props' import { WithTenantProps } from './with-tenant-props' import { WithTranslations } from './with-translations' import { Document } from './document' import { AggregationPage } from './aggregation-page' import { WebAppCategory } from './category' import { EntityType } from './entity-type' import { AnnouncementType, AnnouncementPhaseType, AnnouncementPhaseStatus, NoticeType, DebateType, EvaluationOutcome, SponsorshipType, InterventionType } from '../constants' // ============================================ // Public Debate Schema // ============================================ export type PublicDebate = { debateType?: DebateType debateDocumentId?: string debateDocument?: Document debateOutcomeId?: string debateOutcome?: Document } // ============================================ // Announcement Phase Types // ============================================ export type AnnouncementPhaseBase = WithMongooseProps< WithTenantProps<{ announcementId: string phaseType: AnnouncementPhaseType status: AnnouncementPhaseStatus publishedAt?: string bdncpLink?: string updatedById?: string }> > export type PublicationPhase = AnnouncementPhaseBase & { phaseType: 'Publication' publicDebate?: PublicDebate contractingResolutionId?: string contractingResolution?: Document noticeType?: NoticeType noticeId?: string notice?: Document disciplinaryId?: string disciplinary?: Document technicalSpecificationsId?: string technicalSpecifications?: Document contractConditionsId?: string contractConditions?: Document cigCode?: string cupCode?: string } export type AwardPhase = AnnouncementPhaseBase & { phaseType: 'Award' awardResolutionId?: string awardResolution?: Document awardNoticeId?: string awardNotice?: Document contractId?: string contract?: Document awardDate?: string contractorName?: string awardAmount?: number } export type ExecutionPhase = AnnouncementPhaseBase & { phaseType: 'Execution' executionStartDate?: string executionEndDate?: string progressReportIds?: string[] progressReports?: Document[] finalReportId?: string finalReport?: Document completionCertificateId?: string completionCertificate?: Document } export type SponsorshipPhase = AnnouncementPhaseBase & { phaseType: 'Sponsorship' sponsorshipType?: SponsorshipType sponsorshipNoticeId?: string sponsorshipNotice?: Document sponsorshipContractId?: string sponsorshipContract?: Document sponsorName?: string sponsorshipValue?: number } export type ProjectFinancePhase = AnnouncementPhaseBase & { phaseType: 'ProjectFinance' proposalId?: string proposal?: Document feasibilityStudyId?: string feasibilityStudy?: Document evaluationOutcome?: EvaluationOutcome evaluationReportId?: string evaluationReport?: Document } export type LocalPublicServicePhase = AnnouncementPhaseBase & { phaseType: 'LocalPublicService' serviceContractId?: string serviceContract?: Document serviceCharterId?: string serviceCharter?: Document qualityReportIds?: string[] qualityReports?: Document[] } export type EmergencyPhase = AnnouncementPhaseBase & { phaseType: 'Emergency' interventionType?: InterventionType emergencyDecreeId?: string emergencyDecree?: Document urgencyReportId?: string urgencyReport?: Document completionReportId?: string completionReport?: Document emergencyAmount?: number } export type AnnouncementPhase = | PublicationPhase | AwardPhase | ExecutionPhase | SponsorshipPhase | ProjectFinancePhase | LocalPublicServicePhase | EmergencyPhase // ============================================ // Announcement Translations // ============================================ export type AnnouncementTranslations = { object: string // titolo del bando o del concorso whatIs?: string targetDescription: string // a chi è rivolto howToParticipate?: string selectionModality?: string } export type Announcement = WithMongooseProps< WithTenantProps< AnnouncementTranslations & { publishedDate: string expirationDate: string rankingExpectedPublishedDate: string isActive: boolean whatIsDocumentId?: string // cos'è (documento) whatIsDocument?: Document rankingId?: string // graduatoria (documento) ranking?: Document otherDocumentsIds?: string[] // altri allegati otherDocuments?: Document[] consequentDocumentsIds?: string[] // dempimenti conseguenziali (documento) consequentDocuments?: Document[] aggregationPageIds?: string[] // parliamo di aggregationPages: AggregationPage[] isPublished: boolean announcementType?: AnnouncementType categoryId: string category: WebAppCategory entityTypeId: string entityType: EntityType translations: WithTranslations pageUrl: string onlineUrl?: string targetPageIds?: string[] targetPages?: AggregationPage[] currentPhaseId?: string currentPhaseType?: string currentPhase?: AnnouncementPhase phases?: AnnouncementPhase[] } > >