Appointment Workflow Manager
appointment-workflow-manager is a Python package designed to simplify and standardize the management of appointment workflows in Django applications. It provides utilities for managing appointment approvals, rejections, cancellations, auditing status changes, and conflict detection.
Features
-
Workflow Management:
- Approve, reject, or cancel appointments.
- Automatically update appointment status and manage notifications.
-
Audit Logging:
- Log status changes of appointments with timestamps.
- Helps maintain a historical record of changes for reporting and debugging.
-
Conflict Detection:
- Detect overlapping or conflicting appointments for the same user.
- Prevent scheduling conflicts during appointment creation.
-
Reusable Logic:
- Encapsulates complex business logic into a reusable package for modular and maintainable code.
Installation
To install the package, use pip:
pip install appointment-workflow-manager
Usage
1. Workflow Management
The AppointmentWorkflowManager class simplifies appointment workflows such as approval, rejection, and cancellation.
Approving an Appointment
from appointment_workflow_manager.workflow_manager import AppointmentWorkflowManager
appointment = Appointment.objects.get(id=1) # Fetch an appointment instance
AppointmentWorkflowManager.approve(appointment)
from appointment_workflow_manager.workflow_manager import AppointmentWorkflowManager
appointment = Appointment.objects.get(id=1) # Fetch an appointment instance
AppointmentWorkflowManager.reject(appointment, "Customer unavailable")
from appointment_workflow_manager.workflow_manager import AppointmentWorkflowManager
appointment = Appointment.objects.get(id=1) # Fetch an appointment instance
AppointmentWorkflowManager.cancel(appointment)
###Conflict Detection ####The ConflictChecker class detects overlapping or conflicting appointments. ####Checking for Appointment Conflicts
from appointment_workflow_manager.conflict_checker import ConflictChecker
# Appointment details
appointment_date = datetime.date(2024, 11, 20)
appointment_time = datetime.time(10, 0) # 10:00 AM
duration_minutes = 60 # 1-hour duration
# Check for conflicts
if ConflictChecker.has_conflicts(user=request.user, appointment_date=appointment_date, appointment_time=appointment_time, duration_minutes=duration_minutes):
print("Conflict detected! Please choose another time.")
else:
print("No conflicts. Proceed with appointment creation.")
###Audit Logging ####The AuditLogger class tracks changes in appointment statuses for historical records or debugging.
####Logging Status Changes
from appointment_workflow_manager.audit_logger import AuditLogger
# Log a status change for an appointment
AuditLogger.log_status_change(
user=request.user,
appointment=appointment,
old_status="pending",
new_status="approved"
)
Metadata
Release files for appointment-workflow-manager 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| appointment-workflow-manager-0.2.1.tar.gz | 3.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| appointment_workflow_manager-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / appointment-workflow-manager-0.2.1.tar.gz
| Download URL | appointment-workflow-manager-0.2.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a199a8557ccf8112a5b463917bd8e3ed5b7ca6e0e3a08ecdff07ed0fdcf63fc
|
|
BLAKE2b-256 checksum How to use checksums |
8bd5f3b3155a4238006d870bad9e4c753680a6de8b561ea31a4ed744b256e0f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / appointment_workflow_manager-0.2.1-py3-none-any.whl
| Download URL | appointment_workflow_manager-0.2.1-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8dc9e4e12965a27b7782b8cd1ca7686ecf69ab84bbf7fe8e0dcac4876aa64257
|
|
BLAKE2b-256 checksum How to use checksums |
62123e98ed20410e4213305f0f19fdf28844fb1deb9c318122e5f0de0ab2b49b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Security for appointment-workflow-manager 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.