|
|
@ -1,12 +1,8 @@ |
|
|
|
|
|
import { NON_INVESTMENT_ACTIVITY_TYPES } from '@ghostfolio/common/config'; |
|
|
|
|
|
|
|
|
import { Type as ActivityType } from '@prisma/client'; |
|
|
import { Type as ActivityType } from '@prisma/client'; |
|
|
import { endOfToday, isAfter } from 'date-fns'; |
|
|
import { endOfToday, isAfter } from 'date-fns'; |
|
|
|
|
|
|
|
|
const ACTIVITY_TYPES_NEVER_DRAFT: ActivityType[] = [ |
|
|
|
|
|
'FEE', |
|
|
|
|
|
'INTEREST', |
|
|
|
|
|
'LIABILITY' |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
export function isDraftTagToBeAssigned({ |
|
|
export function isDraftTagToBeAssigned({ |
|
|
date, |
|
|
date, |
|
|
endOfTodayDate = endOfToday(), |
|
|
endOfTodayDate = endOfToday(), |
|
|
@ -18,7 +14,7 @@ export function isDraftTagToBeAssigned({ |
|
|
storedDate?: Date; |
|
|
storedDate?: Date; |
|
|
type: ActivityType; |
|
|
type: ActivityType; |
|
|
}) { |
|
|
}) { |
|
|
if (ACTIVITY_TYPES_NEVER_DRAFT.includes(type)) { |
|
|
if (NON_INVESTMENT_ACTIVITY_TYPES.includes(type)) { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|