/* Options: Date: 2025-12-16 01:39:52 Version: 10.04 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://blazor-vue.web-templates.io //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(0); DateTime? bookingEndDate; double cost = 0; // @References(typeof(Coupon)) String? couponId; Coupon discount; String? notes; bool? cancelled; User employee; Booking({this.id,this.name,this.roomType,this.roomNumber,this.bookingStartDate,this.bookingEndDate,this.cost,this.couponId,this.discount,this.notes,this.cancelled,this.employee}); Booking.fromJson(Map json) { fromMap(json); } fromMap(Map json) { super.fromMap(json); id = json['id']; name = json['name']; roomType = JsonConverters.fromJson(json['roomType'],'RoomType',context!); roomNumber = json['roomNumber']; bookingStartDate = JsonConverters.fromJson(json['bookingStartDate'],'DateTime',context!); bookingEndDate = JsonConverters.fromJson(json['bookingEndDate'],'DateTime',context!); cost = JsonConverters.toDouble(json['cost']); couponId = json['couponId']; discount = JsonConverters.fromJson(json['discount'],'Coupon',context!); 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, 'couponId': couponId, 'discount': JsonConverters.toJson(discount,'Coupon',context!), 'notes': notes, 'cancelled': cancelled, 'employee': JsonConverters.toJson(employee,'User',context!) }); getTypeName() => "Booking"; TypeContext? context = _ctx; } /** * Delete a Booking */ // @Route("/booking/{Id}", "DELETE") // @ValidateRequest(Validator="HasRole(`Manager`)") class DeleteBooking implements IReturnVoid, IDeleteDb, IConvertible, IDelete { int id = 0; DeleteBooking({this.id}); DeleteBooking.fromJson(Map json) { fromMap(json); } fromMap(Map json) { id = json['id']; return this; } Map toJson() => { 'id': id }; createResponse() {} getTypeName() => "DeleteBooking"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'blazor_vue.web_templates.io', types: { 'Booking': TypeInfo(TypeOf.Class, create:() => Booking()), 'RoomType': TypeInfo(TypeOf.Class, create:() => RoomType()), 'Coupon': TypeInfo(TypeOf.Class, create:() => Coupon()), 'User': TypeInfo(TypeOf.Class, create:() => User()), 'DeleteBooking': TypeInfo(TypeOf.Class, create:() => DeleteBooking()), });