import { Action } from '@ngrx/store'; import { DegreePlan } from '@app/core/models/degree-plan'; import { PlannedTerm } from '@app/core/models/planned-term'; import { DegreePlannerState } from '@app/degree-planner/store/state'; import { Course } from '@app/core/models/course'; export enum PlanActionTypes { InitialPlanLoadResponse = '[Plan] Initial Load Response', ChangeVisiblePlanRequest = '[Plan] Change Visible Request', ChangeVisiblePlanResponse = '[Plan] Change Visible Response', AddCourseRequest = '[Plan] Add Course Request', AddCourseResponse = '[Plan] Add Course Response', RemoveCourseRequest = '[Plan] Remove Course Request', RemoveCourseResponse = '[Plan] Remove Course Response', ChangeCourseTermRequest = '[Plan] Change Course Term Request', ChangeCourseTermResponse = '[Plan] Change Course Term Response', AddSavedForLaterRequest = '[Plan] Add Saved For Later Request', AddSavedForLaterResponse = '[Plan] Add Saved For Later Response', RemoveSavedForLaterRequest = '[Plan] Remove Saved For Later Request', RemoveSavedForLaterResponse = '[Plan] Remove Saved For Later Response', MoveFromSavedToTermRequest = '[Plan] Move Course From Saved to Term Request', MoveFromSavedToTermResponse = '[Plan] Move Course From Saved to Term Response', } export class InitialPlanLoadResponse implements Action { public readonly type = PlanActionTypes.InitialPlanLoadResponse; constructor(public payload: DegreePlannerState) {} } export class ChangeVisiblePlanRequest implements Action { public readonly type = PlanActionTypes.ChangeVisiblePlanRequest; constructor(public payload: { newVisibleRoadmapId: number }) {} } export class ChangeVisiblePlanResponse implements Action { public readonly type = PlanActionTypes.ChangeVisiblePlanResponse; constructor( public payload: { visibleDegreePlan: DegreePlan; visibleTerms: PlannedTerm[]; }, ) {} } export class ChangeCourseTermRequest implements Action { public readonly type = PlanActionTypes.ChangeCourseTermRequest; constructor(public payload: { to: string; from: string; id: number }) {} } export class ChangeCourseTermResponse implements Action { public readonly type = PlanActionTypes.ChangeCourseTermResponse; constructor(public payload: { to: string; from: string; id: number }) {} } export class AddCourseRequest implements Action { public readonly type = PlanActionTypes.AddCourseRequest; constructor( public payload: { subjectCode: string; courseId: string; termCode: string }, ) {} } export class AddCourseResponse implements Action { public readonly type = PlanActionTypes.AddCourseResponse; constructor(public payload: { course: Course }) {} } export class RemoveCourseRequest implements Action { public readonly type = PlanActionTypes.RemoveCourseRequest; constructor(public payload: { recordId: number }) {} } export class RemoveCourseResponse implements Action { public readonly type = PlanActionTypes.RemoveCourseResponse; constructor(public payload: { recordId: number }) {} } export class AddSavedForLaterRequest implements Action { public readonly type = PlanActionTypes.AddSavedForLaterRequest; constructor( public payload: { subjectCode: string; courseId: string; title: string; catalogNumber: string; }, ) {} } export class AddSavedForLaterResponse implements Action { public readonly type = PlanActionTypes.AddSavedForLaterResponse; constructor( public payload: { subjectCode: string; courseId: string; title: string; catalogNumber: string; }, ) {} } export class RemoveSavedForLaterRequest implements Action { public readonly type = PlanActionTypes.RemoveSavedForLaterRequest; constructor(public payload: { subjectCode: string; courseId: string }) {} } export class RemoveSavedForLaterResponse implements Action { public readonly type = PlanActionTypes.RemoveSavedForLaterResponse; constructor(public payload: { subjectCode: string; courseId: string }) {} }