Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions src/types/api/opportunity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,24 @@ export enum OpportunityStatusType {
NEW = "opp-new",
SEARCHING = "opp-searching",
ACTIVE = "opp-active",
INACTIVE = "opp-inactive",
PAST = "opp-past",
}

export enum OpportunityMatchStatusType {
PENDING_MATCH = "opp-vol-pending-match",
NO_MATCHES = "opp-vol-no-matches",
MATCHED = "opp-vol-matched",
NEEDS_REMATCH = "opp-vol-needs-rematch",
UNMATCHED = "opp-vol-unmatched",
PAST = "opp-vol-past",
}

export enum OpportunityMatchStatus {
PENDING_MATCH = "opp-pending-match",
MATCHED = "opp-matched",
NEEDS_REMATCH = "opp-needs-rematch",
UNMATCHED = "opp-unmatched",
NO_MATCHES = "vol-no-matches",
PENDING_MATCH = "vol-pending-match",
MATCHED = "vol-matched",
PAST = "vol-past",
}

export enum OpportunityVolunteerStatusType {
Expand Down Expand Up @@ -101,6 +111,7 @@ export interface OpportunityLegacyFormData {
}

export interface ApiOpportunityAgent {
id: number;
type: AgentType;
name: string;
address: string;
Expand All @@ -119,24 +130,26 @@ export interface ApiOpportunityGetList {
id: Id;
title: string;
category: OptionById;
district: OptionById;
volunteerType: VolunteerStateTypeType;
statusOpportunity: OpportunityStatusType;
statusMatch: OpportunityMatchStatusType;
createdAt: Date;
activities: OptionById[];
languages: ApiLanguage[];
availability: ApiAvailability[];
location: OptionById[];
accompanyingDetails: ApiOpportunityAccompanyingDetails;
}

export interface ApiOpportunityGet extends ApiOpportunityGetList {
createdAt: Date;
numberOfVolunteers: number;
description: string;
skills: OptionById[];
location: OptionById[];
comments: ApiComment[];
contact: ApiOpportunityContact;
agent: ApiOpportunityAgent;
accompanyingDetails: ApiOpportunityAccompanyingDetails;
}

export type ApiOpportunityLean = Omit<ApiOpportunityGet, "comments">;
Expand All @@ -162,14 +175,7 @@ export type ApiOpportunityPatch = Partial<{
address: string;
district: string;
};
accompanyingDetails: {
appointmentAddress: string;
appointmentDate: string;
appointmentTime: string;
refugeeNumber: string;
refugeeName: string;
languagesToTranslate: number;
};
accompanyingDetails: ApiOpportunityAccompanyingDetails;
}>;

export interface OpportunityVolunteer {
Expand Down