/* Options: Date: 2024-12-04 19:20:42 Version: 8.12 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://vue-vite-api.jamstacks.net //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: CreateBooking.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; enum RoomType { Single, Double, Queen, Twin, Suite, } /** * Booking Details */ class Booking extends AuditBase implements IConvertible { int? id; String? name; RoomType? roomType; int? roomNumber; DateTime? bookingStartDate; DateTime? bookingEndDate; double? cost; String? notes; bool? cancelled; // @DataMember(Order=1) DateTime? createdDate; // @DataMember(Order=2) // @required() String? createdBy; // @DataMember(Order=3) DateTime? modifiedDate; // @DataMember(Order=4) // @required() String? modifiedBy; // @DataMember(Order=5) DateTime? deletedDate; // @DataMember(Order=6) String? deletedBy; Booking({this.id,this.name,this.roomType,this.roomNumber,this.bookingStartDate,this.bookingEndDate,this.cost,this.notes,this.cancelled,this.createdDate,this.createdBy,this.modifiedDate,this.modifiedBy,this.deletedDate,this.deletedBy}); 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']); notes = json['notes']; cancelled = json['cancelled']; createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!); createdBy = json['createdBy']; modifiedDate = JsonConverters.fromJson(json['modifiedDate'],'DateTime',context!); modifiedBy = json['modifiedBy']; deletedDate = JsonConverters.fromJson(json['deletedDate'],'DateTime',context!); deletedBy = json['deletedBy']; 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, 'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!), 'createdBy': createdBy, 'modifiedDate': JsonConverters.toJson(modifiedDate,'DateTime',context!), 'modifiedBy': modifiedBy, 'deletedDate': JsonConverters.toJson(deletedDate,'DateTime',context!), 'deletedBy': deletedBy }); getTypeName() => "Booking"; TypeContext? context = _ctx; } /** * Create a new Booking */ // @Route("/bookings", "POST") // @ValidateRequest(Validator="HasRole(`Employee`)") class CreateBooking implements IReturn, ICreateDb, IConvertible, IPost { /** * Name this Booking is for */ // @Validate(Validator="NotEmpty") String? name; RoomType? roomType; // @Validate(Validator="GreaterThan(0)") int? roomNumber; // @Validate(Validator="GreaterThan(0)") double? cost; DateTime? bookingStartDate; DateTime? bookingEndDate; String? notes; CreateBooking({this.name,this.roomType,this.roomNumber,this.cost,this.bookingStartDate,this.bookingEndDate,this.notes}); CreateBooking.fromJson(Map json) { fromMap(json); } fromMap(Map json) { name = json['name']; roomType = JsonConverters.fromJson(json['roomType'],'RoomType',context!); roomNumber = json['roomNumber']; cost = JsonConverters.toDouble(json['cost']); bookingStartDate = JsonConverters.fromJson(json['bookingStartDate'],'DateTime',context!); bookingEndDate = JsonConverters.fromJson(json['bookingEndDate'],'DateTime',context!); notes = json['notes']; return this; } Map toJson() => { 'name': name, 'roomType': JsonConverters.toJson(roomType,'RoomType',context!), 'roomNumber': roomNumber, 'cost': cost, 'bookingStartDate': JsonConverters.toJson(bookingStartDate,'DateTime',context!), 'bookingEndDate': JsonConverters.toJson(bookingEndDate,'DateTime',context!), 'notes': notes }; createResponse() => IdResponse(); getResponseTypeName() => "IdResponse"; getTypeName() => "CreateBooking"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'vue_vite_api.jamstacks.net', types: { 'RoomType': TypeInfo(TypeOf.Enum, enumValues:RoomType.values), 'Booking': TypeInfo(TypeOf.Class, create:() => Booking()), 'CreateBooking': TypeInfo(TypeOf.Class, create:() => CreateBooking()), });