Skip to content

Commit

Permalink
CACHE -> CASH
Browse files Browse the repository at this point in the history
  • Loading branch information
OlliL committed Jul 21, 2024
1 parent 3507219 commit 2ae1d67
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/moneyflow/EditMoneyflowBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ const resetCreateForm = () => {
const capitalsources = capitalsourceStore
.getBookableValidCapitalsources(bookingDate)
.filter((mcs) => (mcs.state = CapitalsourceState.CACHE));
.filter((mcs) => (mcs.state = CapitalsourceState.CASH));
if (capitalsources && capitalsources.length > 0) {
const mcs = capitalsources[0];
Expand Down
4 changes: 2 additions & 2 deletions src/model/capitalsource/CapitalsourceState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type { SelectBoxValue } from "../SelectBoxValue";

export enum CapitalsourceState {
__PLACEHOLDER,
NON_CACHE,
CACHE,
NON_CASH,
CASH,
}

export const capitalsourceStateNames = [
Expand Down
6 changes: 3 additions & 3 deletions src/service/mapper/CapitalsourceStateMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { CapitalsourceState } from "@/model/capitalsource/CapitalsourceState";
export function mapCapitalsourceStateTransportToEnum(
source: number,
): CapitalsourceState {
if (source === 1) return CapitalsourceState.NON_CACHE;
return CapitalsourceState.CACHE;
if (source === 1) return CapitalsourceState.NON_CASH;
return CapitalsourceState.CASH;
}

export function mapCapitalsourceStateEnumToTransport(
source: CapitalsourceState,
): number {
if (source === CapitalsourceState.NON_CACHE) return 1;
if (source === CapitalsourceState.NON_CASH) return 1;
return 2;
}
4 changes: 2 additions & 2 deletions src/tests/views/moneyflow/CreateMoneyflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ beforeAll(async () => {
id: 1,
userId: 1,
type: CapitalsourceType.CURRENT_ASSET,
state: CapitalsourceState.CACHE,
state: CapitalsourceState.CASH,
comment: "cash",
validTil: new Date("2999-12-01"),
validFrom: new Date("2000-01-01"),
Expand All @@ -66,7 +66,7 @@ beforeAll(async () => {
id: 2,
userId: 1,
type: CapitalsourceType.CURRENT_ASSET,
state: CapitalsourceState.NON_CACHE,
state: CapitalsourceState.NON_CASH,
comment: "non-cash",
validTil: new Date("2999-12-01"),
validFrom: new Date("2000-01-01"),
Expand Down

0 comments on commit 2ae1d67

Please sign in to comment.