system-praktyk-front/src/state/actions/proposal.ts
2021-01-18 01:24:18 +01:00

45 lines
1.4 KiB
TypeScript

import { Internship } from "@/data";
import {
ReceiveSubmissionApproveAction,
ReceiveSubmissionDeclineAction,
ReceiveSubmissionUpdateAction,
SaveSubmissionAction,
SendSubmissionAction
} from "@/state/actions/submission";
import { SubmissionState } from "@/api/dto/internship-registration";
export enum InternshipProposalActions {
Send = "SEND_PROPOSAL",
Save = "SAVE_PROPOSAL",
Approve = "RECEIVE_PROPOSAL_APPROVE",
Decline = "RECEIVE_PROPOSAL_DECLINE",
Receive = "RECEIVE_PROPOSAL_STATE",
}
export interface SendProposalAction extends SendSubmissionAction<InternshipProposalActions.Send> {
}
export interface ReceiveProposalApproveAction extends ReceiveSubmissionApproveAction<InternshipProposalActions.Approve> {
}
export interface ReceiveProposalDeclineAction extends ReceiveSubmissionDeclineAction<InternshipProposalActions.Decline> {
}
export interface ReceiveProposalUpdateAction extends ReceiveSubmissionUpdateAction<InternshipProposalActions.Receive> {
internship: Internship;
state: SubmissionState;
comment?: string;
grade?: number;
}
export interface SaveProposalAction extends SaveSubmissionAction<InternshipProposalActions.Save> {
internship: Internship;
}
export type InternshipProposalAction
= SendProposalAction
| SaveProposalAction
| ReceiveProposalApproveAction
| ReceiveProposalDeclineAction
| ReceiveProposalUpdateAction;