Skip to content

Commit

Permalink
refactor: moved CUSTOM_PROJECT_PRICE_TYPE enum to shared folder
Browse files Browse the repository at this point in the history
  • Loading branch information
atrincas committed Jan 17, 2025
1 parent e2677b7 commit 3b55f4f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { CUSTOM_PROJECT_PRICE_TYPE } from "@shared/dtos/custom-projects/custom-projects.enums";
import { COST_TYPE_SELECTOR } from "@shared/entities/projects.entity";
import { z } from "zod";

import { FILTER_KEYS } from "@/app/(overview)/constants";

import { INITIAL_COST_RANGE } from "@/containers/overview/filters/constants";
import {
CUSTOM_PROJECT_PRICE_TYPE,
filtersSchema,
useCustomProjectFilters,
} from "@/containers/projects/url-store";
Expand Down
6 changes: 1 addition & 5 deletions client/src/containers/projects/url-store.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { CUSTOM_PROJECT_PRICE_TYPE } from "@shared/dtos/custom-projects/custom-projects.enums";
import { COST_TYPE_SELECTOR } from "@shared/entities/projects.entity";
import { parseAsJson, useQueryState } from "nuqs";
import { z } from "zod";

import { FILTER_KEYS } from "@/app/(overview)/constants";

export enum CUSTOM_PROJECT_PRICE_TYPE {
INITIAL_CARBON_PRICE_ASSUMPTION = "Initial carbon price assumption",
BREAKEVEN_PRICE = "Breakeven price",
}

export const filtersSchema = z.object({
[FILTER_KEYS[2]]: z.nativeEnum(CUSTOM_PROJECT_PRICE_TYPE),
[FILTER_KEYS[3]]: z.nativeEnum(COST_TYPE_SELECTOR),
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/use-custom-project-output.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useMemo } from "react";

import { CUSTOM_PROJECT_PRICE_TYPE } from "@shared/dtos/custom-projects/custom-projects.enums";
import { CustomProject } from "@shared/entities/custom-project.entity";
import { useAtomValue } from "jotai";

Expand All @@ -14,7 +15,6 @@ import {
} from "@/containers/projects/custom-project/annual-project-cash-flow/utils";
import { parseCostDetailsForTable } from "@/containers/projects/custom-project/cost-details/table/utils";
import { useCustomProjectFilters } from "@/containers/projects/url-store";
import { CUSTOM_PROJECT_PRICE_TYPE } from "@/containers/projects/url-store";

export const useCustomProjectOutput = (
data: InstanceType<typeof CustomProject>,
Expand Down
4 changes: 4 additions & 0 deletions shared/dtos/custom-projects/custom-projects.enums.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum CUSTOM_PROJECT_PRICE_TYPE {
INITIAL_CARBON_PRICE_ASSUMPTION = "Initial carbon price assumption",
BREAKEVEN_PRICE = "Breakeven price",
}

0 comments on commit 3b55f4f

Please sign in to comment.