/* Options: Date: 2026-09-02 15:29:40 Version: 10.09 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://test.servicestack.net //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: DeleteBooking.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; /** * 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; // @References(typeof(Coupon)) String? couponId; Coupon? discount; String? notes; bool? cancelled; // @References(typeof(Address)) int? permanentAddressId; Address? permanentAddress; // @References(typeof(Address)) int? postalAddressId; Address? postalAddress; Booking({this.id=0,this.name="",this.roomType,this.roomNumber=0,this.bookingStartDate,this.bookingEndDate,this.cost=0,this.couponId,this.discount,this.notes,this.cancelled,this.permanentAddressId,this.permanentAddress,this.postalAddressId,this.postalAddress}); 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; couponId = json['couponId']; discount = JsonConverters.fromJson(json['discount'],'Coupon',context!); notes = json['notes']; cancelled = json['cancelled']; permanentAddressId = json['permanentAddressId']; permanentAddress = JsonConverters.fromJson(json['permanentAddress'],'Address',context!); postalAddressId = json['postalAddressId']; postalAddress = JsonConverters.fromJson(json['postalAddress'],'Address',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, 'couponId': couponId, 'discount': JsonConverters.toJson(discount,'Coupon',context!), 'notes': notes, 'cancelled': cancelled, 'permanentAddressId': permanentAddressId, 'permanentAddress': JsonConverters.toJson(permanentAddress,'Address',context!), 'postalAddressId': postalAddressId, 'postalAddress': JsonConverters.toJson(postalAddress,'Address',context!) }); getTypeName() => "Booking"; TypeContext? context = _ctx; } /** * Delete a Booking */ // @Route("/booking/{Id}", "DELETE") class DeleteBooking implements IReturnVoid, IDeleteDb, IConvertible, IDelete { int id = 0; DeleteBooking({this.id=0}); DeleteBooking.fromJson(Map json) { fromMap(json); } fromMap(Map json) { id = json['id'] ?? 0; return this; } Map toJson() => { 'id': id }; createResponse() {} getTypeName() => "DeleteBooking"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'test.servicestack.net', types: { 'Booking': TypeInfo(TypeOf.Class, create:() => Booking()), 'RoomType': TypeInfo(TypeOf.Class, create:() => RoomType()), 'Coupon': TypeInfo(TypeOf.Class, create:() => Coupon()), 'Address': TypeInfo(TypeOf.Class, create:() => Address()), 'DeleteBooking': TypeInfo(TypeOf.Class, create:() => DeleteBooking()), });