/* Options: Date: 2026-10-13 05:45:45 Version: 10.40 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://vue-spa.web-templates.io //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: QueryBookings.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; enum RoomType { Single, Double, Queen, Twin, Suite, } class User implements IConvertible { String id = ""; String userName = ""; String? firstName; String? lastName; String? displayName; String? profileUrl; User({this.id="",this.userName="",this.firstName,this.lastName,this.displayName,this.profileUrl}); User.fromJson(Map json) { fromMap(json); } fromMap(Map json) { id = json['id'] ?? ""; userName = json['userName'] ?? ""; firstName = json['firstName']; lastName = json['lastName']; displayName = json['displayName']; profileUrl = json['profileUrl']; return this; } Map toJson() => { 'id': id, 'userName': userName, 'firstName': firstName, 'lastName': lastName, 'displayName': displayName, 'profileUrl': profileUrl }; getTypeName() => "User"; TypeContext? context = _ctx; } /** * Booking Details */ class Booking extends AuditBase implements IConvertible { int id = 0; String name = ""; RoomType? roomType; int roomNumber = 0; DateTime? bookingStartDate; DateTime? bookingEndDate; double cost = 0; String? notes; bool? cancelled; User? employee; Booking({this.id=0,this.name="",this.roomType,this.roomNumber=0,this.bookingStartDate,this.bookingEndDate,this.cost=0,this.notes,this.cancelled,this.employee}); Booking.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); id = json['id'] ?? 0; name = json['name'] ?? ""; roomType = JsonConverters.fromJson(json['roomType'],'RoomType',context!); roomNumber = json['roomNumber'] ?? 0; bookingStartDate = JsonConverters.fromJson(json['bookingStartDate'],'DateTime',context!) ?? DateTime(0); bookingEndDate = JsonConverters.fromJson(json['bookingEndDate'],'DateTime',context!); cost = JsonConverters.toDouble(json['cost']) ?? 0; notes = json['notes']; cancelled = json['cancelled']; employee = JsonConverters.fromJson(json['employee'],'User',context!); return this; } Map toJson() => super.toJson()..addAll({ 'id': id, 'name': name, 'roomType': JsonConverters.toJson(roomType,'RoomType',context!), 'roomNumber': roomNumber, 'bookingStartDate': JsonConverters.toJson(bookingStartDate,'DateTime',context!), 'bookingEndDate': JsonConverters.toJson(bookingEndDate,'DateTime',context!), 'cost': cost, 'notes': notes, 'cancelled': cancelled, 'employee': JsonConverters.toJson(employee,'User',context!) }); getTypeName() => "Booking"; TypeContext? context = _ctx; } // @ValidateRequest(Validator="HasRole(`Employee`)") class QueryBookings extends QueryDb implements IReturn>, IConvertible, IGet { int? id; List? ids; QueryBookings({this.id,this.ids}); QueryBookings.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); id = json['id']; ids = JsonConverters.fromJson(json['ids'],'List',context!); return this; } Map toJson() => super.toJson()..addAll({ 'id': id, 'ids': JsonConverters.toJson(ids,'List',context!) }); createResponse() => QueryResponse(); getResponseTypeName() => "QueryResponse"; getTypeName() => "QueryBookings"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'vue_spa.web_templates.io', types: { 'RoomType': TypeInfo(TypeOf.Enum, enumValues:RoomType.values), 'User': TypeInfo(TypeOf.Class, create:() => User()), 'Booking': TypeInfo(TypeOf.Class, create:() => Booking()), 'QueryResponse': TypeInfo(TypeOf.Class, create:() => QueryResponse()), 'QueryBookings': TypeInfo(TypeOf.Class, create:() => QueryBookings()), 'List': TypeInfo(TypeOf.Class, create:() => []), });