Skip to content

Commit 1a2563d

Browse files
gmorales96gabino
andauthored
Feature/tos and user agreement (#418)
* Add TermsCatalog resource * Add TermsOfService resource * Remove terms of service related attributes from Identity and User resources * Consolidate UserTOSAgreement and TermsOfService resources * Add TermsOfService and UserTOSAgreement to resource exports * Bump version to 2.1.2.dev3 * Rename terms_of_service and users_tos_agreements * Update UserTOSAgreement attributes to digital_signature and signed_document_url * Add updated_at and notification_id attributes to UserTOSAgreement * Remove version attribute from TermsOfService and UserTOSAgreement classes * Add version attribute to TermsOfService class * Bump version to 2.1.4.dev5 * Bump version to 2.1.4 --------- Co-authored-by: gabino <gabino@cuenca.com>
1 parent b3742d3 commit 1a2563d

File tree

5 files changed

+50
-1
lines changed

5 files changed

+50
-1
lines changed

cuenca/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
'configure',
4343
'get_balance',
4444
'JwtToken',
45+
'TermsOfService',
46+
'UserTOSAgreement',
4547
]
4648

4749
from . import http
@@ -76,12 +78,14 @@
7678
ServiceProvider,
7779
Session,
7880
Statement,
81+
TermsOfService,
7982
Transfer,
8083
User,
8184
UserCredential,
8285
UserEvent,
8386
UserListsValidation,
8487
UserLogin,
88+
UserTOSAgreement,
8589
Verification,
8690
WalletTransaction,
8791
Webhook,

cuenca/resources/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
'Webhook',
3939
'WhatsappTransfer',
4040
'JwtToken',
41+
'TermsOfService',
42+
'UserTOSAgreement',
4143
]
4244

4345
from .accounts import Account
@@ -71,12 +73,14 @@
7173
from .service_providers import ServiceProvider
7274
from .sessions import Session
7375
from .statements import Statement
76+
from .terms_of_service import TermsOfService
7477
from .transfers import Transfer
7578
from .user_credentials import UserCredential
7679
from .user_events import UserEvent
7780
from .user_lists_validation import UserListsValidation
7881
from .user_logins import UserLogin
7982
from .users import User
83+
from .users_tos_agreements import UserTOSAgreement
8084
from .verifications import Verification
8185
from .wallet_transactions import WalletTransaction
8286
from .webhooks import Webhook
@@ -123,6 +127,8 @@
123127
Webhook,
124128
Platform,
125129
JwtToken,
130+
TermsOfService,
131+
UserTOSAgreement,
126132
]
127133
for resource_cls in resource_classes:
128134
RESOURCES[resource_cls._resource] = resource_cls # type: ignore
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import datetime as dt
2+
from typing import ClassVar
3+
4+
from cuenca_validations.types import TermsOfService as TermsOfServiceEnum
5+
from cuenca_validations.types.general import SerializableHttpUrl
6+
7+
from .base import Queryable, Retrievable
8+
9+
10+
class TermsOfService(Retrievable, Queryable):
11+
_resource: ClassVar = 'terms_of_service'
12+
13+
id: str
14+
is_active: bool
15+
created_at: dt.datetime
16+
type: TermsOfServiceEnum
17+
version: str
18+
uri: SerializableHttpUrl
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import datetime as dt
2+
from typing import ClassVar
3+
4+
from cuenca_validations.types.general import SerializableHttpUrl
5+
6+
from .base import Creatable, Queryable, Retrievable
7+
8+
9+
class UserTOSAgreement(Creatable, Retrievable, Queryable):
10+
_resource: ClassVar = 'users_tos_agreements'
11+
12+
id: str
13+
created_at: dt.datetime
14+
updated_at: dt.datetime
15+
terms_of_service: str
16+
user_id: str
17+
ip: str
18+
location: str
19+
digital_signature: str
20+
signed_document_url: SerializableHttpUrl
21+
notification_id: str

cuenca/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = '2.1.3'
1+
__version__ = '2.1.4'
22
CLIENT_VERSION = __version__
33
API_VERSION = '2020-03-19'

0 commit comments

Comments
 (0)