Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions yoti_python_sdk/doc_scan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
)
from .session.create.check.face_match import RequestedFaceMatchCheckBuilder
from .session.create.check.liveness import RequestedLivenessCheckBuilder
from .session.create.check.watchlist_screen import WatchlistScreeningCheckBuilder
from .session.create.check.watchlist_advanced_ca import (
WatchlistAdvancedCaProfilesCheckBuilder,
WatchlistAdvancedCaSourcesConfig,
)
from .session.create.task.text_extraction import RequestedTextExtractionTaskBuilder
from .session.create.task.supplementary_doc_text_extraction import (
RequestedSupplementaryDocTextExtractionTaskBuilder,
)
from .session.create.task.face_capture import RequestedFaceCaptureTaskBuilder
from .session.create.notification_config import NotificationConfigBuilder
from .session.create.sdk_config import SdkConfigBuilder
from .session.create.session_spec import SessionSpecBuilder
Expand All @@ -20,8 +26,12 @@
"RequestedLivenessCheckBuilder",
"RequestedFaceMatchCheckBuilder",
"RequestedIDDocumentComparisonCheckBuilder",
"WatchlistScreeningCheckBuilder",
"WatchlistAdvancedCaProfilesCheckBuilder",
"WatchlistAdvancedCaSourcesConfig",
"RequestedTextExtractionTaskBuilder",
"RequestedSupplementaryDocTextExtractionTaskBuilder",
"RequestedFaceCaptureTaskBuilder",
"SessionSpecBuilder",
"NotificationConfigBuilder",
"SdkConfigBuilder",
Expand Down
11 changes: 11 additions & 0 deletions yoti_python_sdk/doc_scan/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,14 @@
PROOF_OF_ADDRESS = "PROOF_OF_ADDRESS"

WATCHLIST_SCREENING_CHECK_TYPE = "WATCHLIST_SCREENING"
WATCHLIST_ADVANCED_CA_CHECK_TYPE = "WATCHLIST_ADVANCED_CA"

FACE_CAPTURE = "FACE_CAPTURE"

ID_DOCUMENT_EDUCATION = "ID_DOCUMENT_EDUCATION"
ID_DOCUMENT_REQUIREMENTS = "ID_DOCUMENT_REQUIREMENTS"
SUPPLEMENTARY_DOCUMENT_EDUCATION = "SUPPLEMENTARY_DOCUMENT_EDUCATION"
ZOOM_LIVENESS_EDUCATION = "ZOOM_LIVENESS_EDUCATION"
STATIC_LIVENESS_EDUCATION = "STATIC_LIVENESS_EDUCATION"
FACE_CAPTURE_EDUCATION = "FACE_CAPTURE_EDUCATION"
FLOW_COMPLETION = "FLOW_COMPLETION"
2 changes: 2 additions & 0 deletions yoti_python_sdk/doc_scan/session/create/check/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .face_match import RequestedFaceMatchCheckBuilder
from .liveness import RequestedLivenessCheckBuilder
from .watchlist_screen import WatchlistScreeningCheckBuilder
from .watchlist_advanced_ca import WatchlistAdvancedCaProfilesCheckBuilder


__all__ = [
Expand All @@ -11,4 +12,5 @@
"RequestedFaceMatchCheckBuilder",
"RequestedLivenessCheckBuilder",
"WatchlistScreeningCheckBuilder",
"WatchlistAdvancedCaProfilesCheckBuilder",
]
164 changes: 164 additions & 0 deletions yoti_python_sdk/doc_scan/session/create/check/watchlist_advanced_ca.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from yoti_python_sdk.doc_scan import constants
from yoti_python_sdk.utils import YotiSerializable, remove_null_values
from .requested_check import RequestedCheck


class WatchlistAdvancedCaProfilesCheckConfig(YotiSerializable):
"""
The configuration applied when creating a Watchlist Advanced CA Profiles check.
"""

def __init__(self, remove_deceased=None, share_url=None, sources=None):
"""
:param remove_deceased: whether to remove deceased individuals from results
:type remove_deceased: bool or None
:param share_url: whether to share the URL in results
:type share_url: bool or None
:param sources: the sources configuration
:type sources: WatchlistAdvancedCaSourcesConfig or None
"""
self.__remove_deceased = remove_deceased
self.__share_url = share_url
self.__sources = sources

@property
def remove_deceased(self):
"""
Whether deceased individuals are removed from results

:return: remove deceased flag
:rtype: bool or None
"""
return self.__remove_deceased

@property
def share_url(self):
"""
Whether the URL is shared in results

:return: share URL flag
:rtype: bool or None
"""
return self.__share_url

@property
def sources(self):
"""
The sources configuration for the advanced CA profiles check

:return: the sources configuration
:rtype: WatchlistAdvancedCaSourcesConfig or None
"""
return self.__sources

def to_json(self):
return remove_null_values(
{
"remove_deceased": self.__remove_deceased,
"share_url": self.__share_url,
"sources": self.__sources,
}
)


class WatchlistAdvancedCaSourcesConfig(YotiSerializable):
"""
Configures the sources for a Watchlist Advanced CA Profiles check.
"""

def __init__(self, types=None):
"""
:param types: the list of source types to check against
:type types: list[str] or None
"""
self.__types = types or []

@property
def types(self):
"""
The list of source types

:return: the source types
:rtype: list[str]
"""
return self.__types

def to_json(self):
return remove_null_values({"types": self.__types})


class WatchlistAdvancedCaProfilesCheck(RequestedCheck):
"""
Requests creation of a Watchlist Advanced CA Profiles check
"""

def __init__(self, config):
"""
:param config: the Watchlist Advanced CA Profiles check configuration
:type config: WatchlistAdvancedCaProfilesCheckConfig
"""
self.__config = config

@property
def type(self):
return constants.WATCHLIST_ADVANCED_CA_CHECK_TYPE

@property
def config(self):
return self.__config


class WatchlistAdvancedCaProfilesCheckBuilder(object):
"""
Builder to assist creation of :class:`WatchlistAdvancedCaProfilesCheck`
"""

def __init__(self):
self.__remove_deceased = None
self.__share_url = None
self.__sources = None

def with_remove_deceased(self, remove_deceased):
"""
Sets whether deceased individuals should be removed from results

:param remove_deceased: the remove deceased flag
:type remove_deceased: bool
:return: the builder
:rtype: WatchlistAdvancedCaProfilesCheckBuilder
"""
self.__remove_deceased = remove_deceased
return self

def with_share_url(self, share_url):
"""
Sets whether the URL should be shared in results

:param share_url: the share URL flag
:type share_url: bool
:return: the builder
:rtype: WatchlistAdvancedCaProfilesCheckBuilder
"""
self.__share_url = share_url
return self

def with_sources(self, sources):
"""
Sets the sources configuration for the check

:param sources: the sources configuration
:type sources: WatchlistAdvancedCaSourcesConfig
:return: the builder
:rtype: WatchlistAdvancedCaProfilesCheckBuilder
"""
self.__sources = sources
return self

def build(self):
config = WatchlistAdvancedCaProfilesCheckConfig(
self.__remove_deceased, self.__share_url, self.__sources
)
return WatchlistAdvancedCaProfilesCheck(config)
Comment on lines +9 to +164
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces a new check builder/config (WatchlistAdvancedCaProfilesCheck*), but there are no unit tests alongside existing check builder tests (e.g. in tests/doc_scan/session/create/check/). Please add coverage for builder defaults vs. set fields and the expected to_json() output, including how sources/types serializes.

Copilot uses AI. Check for mistakes.
28 changes: 28 additions & 0 deletions yoti_python_sdk/doc_scan/session/create/sdk_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __init__(
error_url,
allow_handoff=None,
privacy_policy_url=None,
suppressed_screens=None,
):
"""
:param allowed_capture_methods: the allowed capture methods
Expand All @@ -45,6 +46,8 @@ def __init__(
:type privacy_policy_url: str
:param allow_handoff: boolean flag for allow_handoff
:type allow_handoff: bool
:param suppressed_screens: the screens to suppress in the IDV flow
:type suppressed_screens: list[str]
"""
self.__allowed_capture_methods = allowed_capture_methods
self.__primary_colour = primary_colour
Expand All @@ -56,6 +59,7 @@ def __init__(
self.__error_url = error_url
self.__privacy_policy_url = privacy_policy_url
self.__allow_handoff = allow_handoff
self.__suppressed_screens = suppressed_screens

@property
def allowed_capture_methods(self):
Expand Down Expand Up @@ -148,6 +152,15 @@ def allow_handoff(self):
"""
return self.__allow_handoff

@property
def suppressed_screens(self):
"""
The screens to suppress in the IDV flow.

:return: the suppressed screens
"""
return self.__suppressed_screens

def to_json(self):
return remove_null_values(
{
Expand All @@ -161,6 +174,7 @@ def to_json(self):
"error_url": self.error_url,
"privacy_policy_url": self.privacy_policy_url,
"allow_handoff": self.allow_handoff,
"suppressed_screens": self.suppressed_screens,
}
)

Expand All @@ -181,6 +195,7 @@ def __init__(self):
self.__error_url = None
self.__privacy_policy_url = None
self.__allow_handoff = None
self.__suppressed_screens = None

def with_allowed_capture_methods(self, allowed_capture_methods):
"""
Expand Down Expand Up @@ -320,6 +335,18 @@ def with_allow_handoff(self, flag):
self.__allow_handoff = flag
return self

def with_suppressed_screens(self, screens):
"""
Sets the screens to suppress in the IDV flow

:param screens: the suppressed screen identifiers
:type screens: list[str]
:return: the builder
:rtype: SdkConfigBuilder
"""
self.__suppressed_screens = screens
return self

def build(self):
return SdkConfig(
self.__allowed_capture_methods,
Expand All @@ -332,4 +359,5 @@ def build(self):
self.__error_url,
self.__allow_handoff,
self.__privacy_policy_url,
self.__suppressed_screens,
)
2 changes: 2 additions & 0 deletions yoti_python_sdk/doc_scan/session/create/task/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
from .supplementary_doc_text_extraction import (
RequestedSupplementaryDocTextExtractionTaskBuilder,
)
from .face_capture import RequestedFaceCaptureTaskBuilder

__all__ = [
"RequestedTextExtractionTaskBuilder",
"RequestedSupplementaryDocTextExtractionTaskBuilder",
"RequestedFaceCaptureTaskBuilder",
]
47 changes: 47 additions & 0 deletions yoti_python_sdk/doc_scan/session/create/task/face_capture.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from yoti_python_sdk.doc_scan import constants
from yoti_python_sdk.utils import YotiSerializable
from .requested_task import RequestedTask


class RequestedFaceCaptureTaskConfig(YotiSerializable):
"""
The configuration applied when creating a Face Capture Task
"""

def to_json(self):
return {}


class RequestedFaceCaptureTask(RequestedTask):
"""
Requests creation of a Face Capture Task
"""

def __init__(self, config):
"""
:param config: the face capture task configuration
:type config: RequestedFaceCaptureTaskConfig
"""
self.__config = config

@property
def type(self):
return constants.FACE_CAPTURE

@property
def config(self):
return self.__config


class RequestedFaceCaptureTaskBuilder(object):
"""
Builder to assist creation of :class:`RequestedFaceCaptureTask`
"""

@staticmethod
def build():
config = RequestedFaceCaptureTaskConfig()
return RequestedFaceCaptureTask(config)
Comment on lines +18 to +47
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds a new task builder/config (RequestedFaceCaptureTask*), but there is no corresponding unit test in tests/doc_scan/session/create/task/ (similar tasks like text extraction have coverage). Please add tests covering type, config.to_json(), and serialization via YotiEncoder to prevent regressions.

Copilot uses AI. Check for mistakes.
8 changes: 8 additions & 0 deletions yoti_python_sdk/doc_scan/session/retrieve/check_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,11 @@ class WatchlistScreeningCheckResponse(CheckResponse):
"""

pass


class WatchlistAdvancedCaProfilesCheckResponse(CheckResponse):
"""
Represents a Watchlist Advanced CA Profiles check for a given session
"""

pass
Loading
Loading