Implemented KYB, compliance decisions, integration, and testing
This commit is contained in:
@@ -32,6 +32,25 @@ enum DocumentCode {
|
||||
OWNERSHIP
|
||||
UBO_IDENTIFICATION
|
||||
BUSINESS_ACTIVITY
|
||||
AUTHORIZED_REPRESENTATIVE
|
||||
}
|
||||
enum RiskLevel {
|
||||
LOW
|
||||
MEDIUM
|
||||
HIGH
|
||||
}
|
||||
enum ActivationCode {
|
||||
API_CONNECTION
|
||||
WEBHOOK_SETUP
|
||||
TEST_PAYMENT
|
||||
RECONCILIATION
|
||||
}
|
||||
enum ActivationState {
|
||||
INCOMPLETE
|
||||
COMPLETE
|
||||
NOT_RUN
|
||||
PASSED
|
||||
FAILED
|
||||
}
|
||||
enum TaskStatus {
|
||||
OPEN
|
||||
@@ -70,6 +89,7 @@ model User {
|
||||
completedTasks Task[] @relation("TaskCompleter")
|
||||
activities Activity[]
|
||||
checklistChanges ChecklistChange[]
|
||||
activationChanges ActivationCheckChange[]
|
||||
submittedReviews ComplianceReview[] @relation("ReviewSubmitter")
|
||||
decidedReviews ComplianceReview[] @relation("ReviewReviewer")
|
||||
createdAt DateTime @default(now())
|
||||
@@ -202,6 +222,10 @@ model ComplianceReview {
|
||||
id String @id @default(uuid())
|
||||
merchantId String
|
||||
cycle Int
|
||||
policyVersion Int @default(2)
|
||||
riskLevel RiskLevel?
|
||||
corrections Json @default("[]")
|
||||
activationChecks ActivationCheck[]
|
||||
submittedById String
|
||||
reviewerId String?
|
||||
decision ReviewDecision @default(PENDING)
|
||||
@@ -215,6 +239,28 @@ model ComplianceReview {
|
||||
@@unique([merchantId, cycle])
|
||||
@@index([decision, submittedAt])
|
||||
}
|
||||
model ActivationCheck {
|
||||
id String @id @default(uuid())
|
||||
reviewId String
|
||||
code ActivationCode
|
||||
state ActivationState
|
||||
note String?
|
||||
review ComplianceReview @relation(fields: [reviewId], references: [id], onDelete: Cascade)
|
||||
changes ActivationCheckChange[]
|
||||
@@unique([reviewId, code])
|
||||
}
|
||||
model ActivationCheckChange {
|
||||
id String @id @default(uuid())
|
||||
checkId String
|
||||
actorId String
|
||||
fromState ActivationState
|
||||
toState ActivationState
|
||||
note String?
|
||||
occurredAt DateTime @default(now())
|
||||
check ActivationCheck @relation(fields: [checkId], references: [id], onDelete: Cascade)
|
||||
actor User @relation(fields: [actorId], references: [id])
|
||||
@@index([checkId, occurredAt])
|
||||
}
|
||||
model DemoSeedState {
|
||||
id String @id
|
||||
anchorAt DateTime @default(now())
|
||||
|
||||
Reference in New Issue
Block a user