Mobile App Models¶
All data models are defined in lib/models/models.dart. Each model includes a fromJson() factory constructor for JSON deserialization, handling snake_case to camelCase field mapping.
AuthUser¶
Represents the currently logged-in user.
| Field | Type | Description |
|---|---|---|
id |
String |
User UUID |
name |
String |
Display name |
email |
String |
Email address |
role |
String |
User role (owner, admin, cleaner, guest) |
CleanSession¶
A complete cleaning job record.
| Field | Type | Description |
|---|---|---|
id |
String |
Session UUID |
propertyId |
String |
Associated property |
assignedTo |
String? |
Assigned cleaner ID |
status |
String |
Session status (pending, accepted, in_progress, submitted, approved, rejected) |
sessionType |
String |
Type (turnover, deep_clean, scheduled) |
propertyName |
String? |
Property display name |
cleanerName |
String? |
Assigned cleaner name |
scheduledDate |
String? |
Scheduled cleaning date |
notes |
String? |
Session notes |
createdAt |
String |
Creation timestamp |
completedAt |
String? |
Completion timestamp |
guestRating |
int? |
Post-clean guest rating (1–5) |
RoomClean¶
An individual room within a cleaning session.
| Field | Type | Description |
|---|---|---|
id |
String |
Room clean UUID |
roomId |
String |
Associated room |
sessionId |
String |
Parent session |
status |
String |
Room cleaning status |
displayName |
String |
Room display name |
themeName |
String? |
Room theme/grouping |
displayOrder |
int |
Sort order |
Task¶
A single checklist item for a room.
| Field | Type | Description |
|---|---|---|
id |
String |
Task UUID |
label |
String |
Task description text |
taskType |
String |
Task type (checkbox, photo, quantity) |
required |
bool |
Whether task is mandatory |
displayOrder |
int |
Sort order within room |
category |
String? |
Task category grouping |
isHighTouch |
bool |
High-touch surface flag |
frequency |
String? |
How often task should be performed |
Photo¶
Photo metadata for before/after/issue photos captured during cleaning.
| Field | Type | Description |
|---|---|---|
id |
String |
Photo UUID |
type |
String |
Photo type: before, after, or issue |
storagePath |
String |
Server-side file path |
UpcomingClean¶
Combined reservation and session data used by the schedule screen.
| Field | Type | Description |
|---|---|---|
reservationId |
String |
Reservation UUID |
propertyId |
String |
Property UUID |
propertyName |
String |
Property display name |
checkinDate |
String |
Guest check-in date |
checkoutDate |
String |
Guest check-out date |
guestName |
String? |
Guest name |
summary |
String? |
Reservation summary |
numGuests |
int? |
Number of guests |
sessionId |
String? |
Linked session ID (if session exists) |
sessionStatus |
String? |
Session status (if session exists) |
cleanerId |
String? |
Assigned cleaner ID |
cleanerName |
String? |
Assigned cleaner name |
sessionType |
String? |
Session type |
JSON Deserialization¶
All models use factory constructors for JSON parsing:
class CleanSession {
final String id;
final String propertyId;
final String status;
// ...
factory CleanSession.fromJson(Map<String, dynamic> json) {
return CleanSession(
id: json['id'],
propertyId: json['property_id'],
status: json['status'],
// ...
);
}
}
API responses use snake_case field names, while Dart models use camelCase. The fromJson() constructors handle this mapping.