module Deontic.Civil.AcquisitivePrescription () where
import Deontic.Core.Types
import Deontic.Core.Verdict
import Deontic.Core.Adjudicate
import Deontic.Core.Layer (Base, Resolvable)
import Deontic.Civil.Types
type instance Resolvable AcqPrescriptionAct = '[ShortPrescription, Base]
instance Adjudicate AcqPrescriptionAct '[Base] where
adjudicate :: AcqPrescriptionAct -> Facts AcqPrescriptionAct -> Judgment '[Base]
adjudicate AcqPrescriptionAct
_ Facts AcqPrescriptionAct
facts
| AcqPrescFacts -> Bool
apfSelfPossession Facts AcqPrescriptionAct
AcqPrescFacts
facts
, AcqPrescFacts -> Bool
apfPeaceful Facts AcqPrescriptionAct
AcqPrescFacts
facts
, AcqPrescFacts -> Bool
apfPublic Facts AcqPrescriptionAct
AcqPrescFacts
facts
, Integer -> Day -> Day
addGregorianYearsClip Integer
20 (AcqPrescFacts -> Day
apfStartDate Facts AcqPrescriptionAct
AcqPrescFacts
facts) Day -> Day -> Bool
forall a. Ord a => a -> a -> Bool
<= AcqPrescFacts -> Day
apfCurrentDate Facts AcqPrescriptionAct
AcqPrescFacts
facts =
Verdict -> ArticleRef -> Text -> Judgment '[Base]
forall l. Verdict -> ArticleRef -> Text -> Judgment '[l]
JBase Verdict
Valid
(Text -> Int -> Maybe Int -> ArticleRef
ArticleRef Text
"민법" Int
245 (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
1))
Text
"20년간 소유의 의사로 평온, 공연하게 부동산을 점유하여 취득시효가 완성되었다."
| Bool
otherwise =
Verdict -> ArticleRef -> Text -> Judgment '[Base]
forall l. Verdict -> ArticleRef -> Text -> Judgment '[l]
JBase Verdict
Void
(Text -> Int -> Maybe Int -> ArticleRef
ArticleRef Text
"민법" Int
245 (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
1))
Text
"취득시효의 요건이 충족되지 아니하였다."
instance Adjudicate AcqPrescriptionAct rest
=> Adjudicate AcqPrescriptionAct (ShortPrescription ': rest) where
adjudicate :: AcqPrescriptionAct
-> Facts AcqPrescriptionAct -> Judgment (ShortPrescription : rest)
adjudicate AcqPrescriptionAct
act Facts AcqPrescriptionAct
facts
| AcqPrescFacts -> Bool
apfSelfPossession Facts AcqPrescriptionAct
AcqPrescFacts
facts
, AcqPrescFacts -> Bool
apfPeaceful Facts AcqPrescriptionAct
AcqPrescFacts
facts
, AcqPrescFacts -> Bool
apfPublic Facts AcqPrescriptionAct
AcqPrescFacts
facts
, AcqPrescFacts -> Bool
apfGoodFaith Facts AcqPrescriptionAct
AcqPrescFacts
facts
, AcqPrescFacts -> Bool
apfNoNegligence Facts AcqPrescriptionAct
AcqPrescFacts
facts
, Integer -> Day -> Day
addGregorianYearsClip Integer
10 (AcqPrescFacts -> Day
apfStartDate Facts AcqPrescriptionAct
AcqPrescFacts
facts) Day -> Day -> Bool
forall a. Ord a => a -> a -> Bool
<= AcqPrescFacts -> Day
apfCurrentDate Facts AcqPrescriptionAct
AcqPrescFacts
facts =
Judgment rest
-> Verdict
-> ArticleRef
-> Text
-> Judgment (ShortPrescription : rest)
forall (prev :: [*]) l.
Judgment prev
-> Verdict -> ArticleRef -> Text -> Judgment (l : prev)
JOverride (forall act (layers :: [*]).
Adjudicate act layers =>
act -> Facts act -> Judgment layers
adjudicate @_ @rest AcqPrescriptionAct
act Facts AcqPrescriptionAct
facts)
Verdict
Valid
(Text -> Int -> Maybe Int -> ArticleRef
ArticleRef Text
"민법" Int
245 (Int -> Maybe Int
forall a. a -> Maybe a
Just Int
2))
Text
"10년간 소유의 의사로 평온, 공연하게 선의이며 과실 없이 부동산을 점유하여 단기 취득시효가 완성되었다."
| Bool
otherwise =
Judgment rest -> Judgment (ShortPrescription : rest)
forall (prev :: [*]) l. Judgment prev -> Judgment (l : prev)
JDelegate (forall act (layers :: [*]).
Adjudicate act layers =>
act -> Facts act -> Judgment layers
adjudicate @_ @rest AcqPrescriptionAct
act Facts AcqPrescriptionAct
facts)