geek-cafe-saas-sdk 0.7.0__py3-none-any.whl → 0.7.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of geek-cafe-saas-sdk might be problematic. Click here for more details.

Files changed (79) hide show
  1. geek_cafe_saas_sdk/__init__.py +1 -1
  2. geek_cafe_saas_sdk/domains/files/models/directory.py +42 -6
  3. geek_cafe_saas_sdk/domains/files/models/file.py +40 -4
  4. geek_cafe_saas_sdk/domains/files/models/file_share.py +33 -0
  5. geek_cafe_saas_sdk/domains/files/models/file_version.py +24 -0
  6. geek_cafe_saas_sdk/domains/files/services/directory_service.py +54 -135
  7. geek_cafe_saas_sdk/domains/files/services/file_share_service.py +60 -136
  8. geek_cafe_saas_sdk/domains/files/services/file_system_service.py +43 -104
  9. geek_cafe_saas_sdk/domains/files/services/file_version_service.py +57 -131
  10. geek_cafe_saas_sdk/domains/messaging/services/contact_thread_service.py +55 -7
  11. geek_cafe_saas_sdk/domains/notifications/__init__.py +18 -0
  12. geek_cafe_saas_sdk/domains/notifications/handlers/__init__.py +1 -0
  13. geek_cafe_saas_sdk/domains/notifications/handlers/create_webhook/app.py +73 -0
  14. geek_cafe_saas_sdk/domains/notifications/handlers/get/app.py +40 -0
  15. geek_cafe_saas_sdk/domains/notifications/handlers/get_preferences/app.py +34 -0
  16. geek_cafe_saas_sdk/domains/notifications/handlers/list/app.py +43 -0
  17. geek_cafe_saas_sdk/domains/notifications/handlers/list_webhooks/app.py +40 -0
  18. geek_cafe_saas_sdk/domains/notifications/handlers/mark_read/app.py +40 -0
  19. geek_cafe_saas_sdk/domains/notifications/handlers/send/app.py +83 -0
  20. geek_cafe_saas_sdk/domains/notifications/handlers/update_preferences/app.py +45 -0
  21. geek_cafe_saas_sdk/domains/notifications/models/__init__.py +16 -0
  22. geek_cafe_saas_sdk/domains/notifications/models/notification.py +717 -0
  23. geek_cafe_saas_sdk/domains/notifications/models/notification_preference.py +365 -0
  24. geek_cafe_saas_sdk/domains/notifications/models/webhook_subscription.py +339 -0
  25. geek_cafe_saas_sdk/domains/notifications/services/__init__.py +10 -0
  26. geek_cafe_saas_sdk/domains/notifications/services/notification_service.py +576 -0
  27. geek_cafe_saas_sdk/domains/payments/__init__.py +16 -0
  28. geek_cafe_saas_sdk/domains/payments/handlers/README.md +334 -0
  29. geek_cafe_saas_sdk/domains/payments/handlers/__init__.py +6 -0
  30. geek_cafe_saas_sdk/domains/payments/handlers/billing_accounts/create/app.py +105 -0
  31. geek_cafe_saas_sdk/domains/payments/handlers/billing_accounts/get/app.py +60 -0
  32. geek_cafe_saas_sdk/domains/payments/handlers/billing_accounts/update/app.py +97 -0
  33. geek_cafe_saas_sdk/domains/payments/handlers/payment_intents/create/app.py +97 -0
  34. geek_cafe_saas_sdk/domains/payments/handlers/payment_intents/get/app.py +60 -0
  35. geek_cafe_saas_sdk/domains/payments/handlers/payments/get/app.py +60 -0
  36. geek_cafe_saas_sdk/domains/payments/handlers/payments/list/app.py +68 -0
  37. geek_cafe_saas_sdk/domains/payments/handlers/payments/record/app.py +118 -0
  38. geek_cafe_saas_sdk/domains/payments/handlers/refunds/create/app.py +89 -0
  39. geek_cafe_saas_sdk/domains/payments/handlers/refunds/get/app.py +60 -0
  40. geek_cafe_saas_sdk/domains/payments/models/__init__.py +17 -0
  41. geek_cafe_saas_sdk/domains/payments/models/billing_account.py +521 -0
  42. geek_cafe_saas_sdk/domains/payments/models/payment.py +639 -0
  43. geek_cafe_saas_sdk/domains/payments/models/payment_intent_ref.py +539 -0
  44. geek_cafe_saas_sdk/domains/payments/models/refund.py +404 -0
  45. geek_cafe_saas_sdk/domains/payments/services/__init__.py +11 -0
  46. geek_cafe_saas_sdk/domains/payments/services/payment_service.py +405 -0
  47. geek_cafe_saas_sdk/domains/subscriptions/__init__.py +19 -0
  48. geek_cafe_saas_sdk/domains/subscriptions/handlers/README.md +408 -0
  49. geek_cafe_saas_sdk/domains/subscriptions/handlers/__init__.py +1 -0
  50. geek_cafe_saas_sdk/domains/subscriptions/handlers/addons/create/app.py +81 -0
  51. geek_cafe_saas_sdk/domains/subscriptions/handlers/addons/get/app.py +48 -0
  52. geek_cafe_saas_sdk/domains/subscriptions/handlers/addons/list/app.py +54 -0
  53. geek_cafe_saas_sdk/domains/subscriptions/handlers/addons/update/app.py +54 -0
  54. geek_cafe_saas_sdk/domains/subscriptions/handlers/discounts/create/app.py +83 -0
  55. geek_cafe_saas_sdk/domains/subscriptions/handlers/discounts/get/app.py +47 -0
  56. geek_cafe_saas_sdk/domains/subscriptions/handlers/discounts/validate/app.py +62 -0
  57. geek_cafe_saas_sdk/domains/subscriptions/handlers/plans/create/app.py +82 -0
  58. geek_cafe_saas_sdk/domains/subscriptions/handlers/plans/get/app.py +48 -0
  59. geek_cafe_saas_sdk/domains/subscriptions/handlers/plans/list/app.py +66 -0
  60. geek_cafe_saas_sdk/domains/subscriptions/handlers/plans/update/app.py +54 -0
  61. geek_cafe_saas_sdk/domains/subscriptions/handlers/usage/aggregate/app.py +72 -0
  62. geek_cafe_saas_sdk/domains/subscriptions/handlers/usage/record/app.py +89 -0
  63. geek_cafe_saas_sdk/domains/subscriptions/models/__init__.py +13 -0
  64. geek_cafe_saas_sdk/domains/subscriptions/models/addon.py +604 -0
  65. geek_cafe_saas_sdk/domains/subscriptions/models/discount.py +492 -0
  66. geek_cafe_saas_sdk/domains/subscriptions/models/plan.py +569 -0
  67. geek_cafe_saas_sdk/domains/subscriptions/models/usage_record.py +300 -0
  68. geek_cafe_saas_sdk/domains/subscriptions/services/__init__.py +10 -0
  69. geek_cafe_saas_sdk/domains/subscriptions/services/subscription_manager_service.py +694 -0
  70. geek_cafe_saas_sdk/domains/tenancy/models/subscription.py +123 -1
  71. geek_cafe_saas_sdk/domains/tenancy/services/subscription_service.py +213 -0
  72. geek_cafe_saas_sdk/lambda_handlers/_base/base_handler.py +7 -0
  73. geek_cafe_saas_sdk/services/database_service.py +10 -6
  74. geek_cafe_saas_sdk/utilities/environment_variables.py +16 -0
  75. geek_cafe_saas_sdk/utilities/logging_utility.py +77 -0
  76. {geek_cafe_saas_sdk-0.7.0.dist-info → geek_cafe_saas_sdk-0.7.2.dist-info}/METADATA +1 -1
  77. {geek_cafe_saas_sdk-0.7.0.dist-info → geek_cafe_saas_sdk-0.7.2.dist-info}/RECORD +79 -20
  78. {geek_cafe_saas_sdk-0.7.0.dist-info → geek_cafe_saas_sdk-0.7.2.dist-info}/WHEEL +0 -0
  79. {geek_cafe_saas_sdk-0.7.0.dist-info → geek_cafe_saas_sdk-0.7.2.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,83 @@
1
+ """Lambda handler for sending notifications."""
2
+
3
+ from typing import Dict, Any
4
+ from geek_cafe_saas_sdk.lambda_handlers import create_handler
5
+ from geek_cafe_saas_sdk.domains.notifications.services import NotificationService
6
+
7
+
8
+ handler_wrapper = create_handler(
9
+ service_class=NotificationService,
10
+ require_body=True,
11
+ convert_case=True
12
+ )
13
+
14
+
15
+ def handler(event: Dict[str, Any], context: Any, injected_service=None) -> Dict[str, Any]:
16
+ """
17
+ Send a notification.
18
+
19
+ POST /notifications
20
+
21
+ Body:
22
+ {
23
+ "notificationType": "payment_receipt",
24
+ "channel": "email",
25
+ "recipientId": "user-123",
26
+ "body": "Your payment was successful",
27
+ "subject": "Payment Confirmation",
28
+ "priority": "normal"
29
+ }
30
+ """
31
+ return handler_wrapper.execute(event, context, send_notification, injected_service)
32
+
33
+
34
+ def send_notification(
35
+ event: Dict[str, Any],
36
+ service: NotificationService,
37
+ user_context: Dict[str, str]
38
+ ) -> Any:
39
+ """Business logic for sending notification."""
40
+ tenant_id = user_context.get("tenant_id")
41
+ payload = event["parsed_body"]
42
+
43
+ notification_type = payload.get("notification_type")
44
+ if not notification_type:
45
+ raise ValueError("notification_type is required")
46
+
47
+ channel = payload.get("channel")
48
+ if not channel:
49
+ raise ValueError("channel is required")
50
+
51
+ recipient_id = payload.get("recipient_id")
52
+ if not recipient_id:
53
+ raise ValueError("recipient_id is required")
54
+
55
+ body = payload.get("body")
56
+ if not body:
57
+ raise ValueError("body is required")
58
+
59
+ # Extract optional fields
60
+ kwargs = {}
61
+ optional_fields = [
62
+ "subject", "title", "body_html", "template_id", "template_data",
63
+ "recipient_email", "recipient_phone", "recipient_device_token", "recipient_name",
64
+ "send_after_utc_ts", "expires_utc_ts", "priority",
65
+ "email_config", "sms_config", "push_config", "webhook_config",
66
+ "triggered_by_event", "related_resource_type", "related_resource_id",
67
+ "campaign_id", "tags", "metadata"
68
+ ]
69
+
70
+ for field in optional_fields:
71
+ if field in payload:
72
+ kwargs[field] = payload[field]
73
+
74
+ result = service.create_notification(
75
+ tenant_id=tenant_id,
76
+ notification_type=notification_type,
77
+ channel=channel,
78
+ recipient_id=recipient_id,
79
+ body=body,
80
+ **kwargs
81
+ )
82
+
83
+ return result
@@ -0,0 +1,45 @@
1
+ """Lambda handler for updating user notification preferences."""
2
+
3
+ from typing import Dict, Any
4
+ from geek_cafe_saas_sdk.lambda_handlers import create_handler
5
+ from geek_cafe_saas_sdk.domains.notifications.services import NotificationService
6
+
7
+
8
+ handler_wrapper = create_handler(
9
+ service_class=NotificationService,
10
+ require_body=True,
11
+ convert_case=True
12
+ )
13
+
14
+
15
+ def handler(event: Dict[str, Any], context: Any, injected_service=None) -> Dict[str, Any]:
16
+ """
17
+ Update user notification preferences.
18
+
19
+ PATCH /notifications/preferences
20
+
21
+ Body:
22
+ {
23
+ "emailEnabled": true,
24
+ "smsEnabled": false,
25
+ "quietHoursEnabled": true,
26
+ "quietHoursStart": "22:00",
27
+ "quietHoursEnd": "08:00",
28
+ "doNotDisturb": false
29
+ }
30
+ """
31
+ return handler_wrapper.execute(event, context, update_preferences, injected_service)
32
+
33
+
34
+ def update_preferences(
35
+ event: Dict[str, Any],
36
+ service: NotificationService,
37
+ user_context: Dict[str, str]
38
+ ) -> Any:
39
+ """Business logic for updating preferences."""
40
+ user_id = user_context.get("user_id")
41
+ payload = event["parsed_body"]
42
+
43
+ result = service.update_preferences(user_id, payload)
44
+
45
+ return result
@@ -0,0 +1,16 @@
1
+ """
2
+ Notifications Domain Models.
3
+
4
+ Geek Cafe, LLC
5
+ MIT License. See Project Root for the license information.
6
+ """
7
+
8
+ from .notification import Notification
9
+ from .notification_preference import NotificationPreference
10
+ from .webhook_subscription import WebhookSubscription
11
+
12
+ __all__ = [
13
+ "Notification",
14
+ "NotificationPreference",
15
+ "WebhookSubscription"
16
+ ]