feat: Add time block approval workflow and staff permission system

- Add TimeBlock approval status with manager approval workflow
- Create core mixins for staff permission restrictions (DenyStaffWritePermission, etc.)
- Add StaffDashboard page for staff-specific views
- Refactor MyAvailability page for time block management
- Update field mobile status machine and views
- Add per-user permission overrides via JSONField
- Document core mixins and permission system in CLAUDE.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-07 17:49:37 -05:00
parent 01020861c7
commit 410b46a896
27 changed files with 3192 additions and 1237 deletions

View File

@@ -60,7 +60,6 @@ export interface StatusHistoryItem {
export interface JobDetail {
id: number;
title: string;
description: string | null;
start_time: string;
end_time: string;
status: JobStatus;
@@ -70,23 +69,29 @@ export interface JobDetail {
id: number;
name: string;
email: string | null;
phone: string | null;
phone_masked?: string;
phone_masked: string | null;
} | null;
address: string | null;
latitude: number | null;
longitude: number | null;
service: {
id: number;
name: string;
duration_minutes: number;
duration: number;
price: string | null;
} | null;
notes: string | null;
available_transitions: JobStatus[];
allowed_transitions: JobStatus[];
is_tracking_location: boolean;
can_track_location: boolean;
has_active_call_session: boolean;
status_history?: StatusHistoryItem[];
latest_location?: {
latitude: number;
longitude: number;
timestamp: string;
accuracy: number | null;
} | null;
deposit_amount?: string | null;
final_price?: string | null;
created_at: string;
updated_at: string;
can_edit_schedule?: boolean;
}
@@ -125,10 +130,8 @@ export interface LocationPoint {
export interface RouteResponse {
job_id: number;
status: JobStatus;
is_tracking: boolean;
route: LocationPoint[];
latest_location: LocationPoint | null;
point_count: number;
}
export interface CallResponse {
@@ -151,11 +154,16 @@ export interface SMSResponse {
export interface CallHistoryItem {
id: number;
call_type: 'OUTBOUND_CALL' | 'INBOUND_CALL' | 'OUTBOUND_SMS' | 'INBOUND_SMS';
type_display: string;
direction: 'outbound' | 'inbound';
duration_seconds: number | null;
direction_display: string;
status: string;
created_at: string;
sms_body: string | null;
status_display: string;
duration_seconds: number | null;
initiated_at: string;
answered_at: string | null;
ended_at: string | null;
employee_name: string | null;
}
export interface ApiError {