@@ -503,23 +503,22 @@ Other disruptive changes in this release include nullable reference type annotat
503503public partial class CreateBooking
504504 : IReturn <IdResponse >, ICreateDb <Booking >
505505{
506- [Validate ( " NotEmpty " ) ]
507- public virtual string Name { get ; set ; }
506+ [ValidateNotEmpty ]
507+ public string Name { get ; set ; }
508508
509- public virtual RoomType RoomType { get ; set ; }
509+ public RoomType RoomType { get ; set ; }
510510
511- [Validate ( " GreaterThan(0) " )]
512- public virtual int RoomNumber { get ; set ; }
511+ [ValidateGreaterThan ( 0 )]
512+ public int RoomNumber { get ; set ; }
513513
514- [ Validate ( " GreaterThan(0) " )]
515- public virtual decimal Cost { get ; set ; }
514+ public DateTime BookingStartDate { get ; set ; }
515+ public DateTime ? BookingEndDate { get ; set ; }
516516
517- [Required ]
518- public virtual DateTime BookingStartDate { get ; set ; }
517+ [ValidateGreaterThan ( 0 ) ]
518+ public decimal Cost { get ; set ; }
519519
520- public virtual DateTime ? BookingEndDate { get ; set ; }
521- public virtual string Notes { get ; set ; }
522- public virtual string CouponId { get ; set ; }
520+ public string ? Notes { get ; set ; }
521+ public bool ? Cancelled { get ; set ; }
523522}
524523```
525524
@@ -533,19 +532,16 @@ public partial class CreateBooking
533532 public virtual string Name { get ; set ; }
534533
535534 public virtual RoomType RoomType { get ; set ; }
536-
537535 [Validate (" GreaterThan(0)" )]
538536 public virtual int RoomNumber { get ; set ; }
539537
538+ public virtual DateTime BookingStartDate { get ; set ; }
539+ public virtual DateTime ? BookingEndDate { get ; set ; }
540540 [Validate (" GreaterThan(0)" )]
541541 public virtual decimal Cost { get ; set ; }
542542
543- [Required ]
544- public virtual DateTime BookingStartDate { get ; set ; }
545-
546- public virtual DateTime ? BookingEndDate { get ; set ; }
547543 public virtual string ? Notes { get ; set ; }
548- public virtual string ? CouponId { get ; set ; }
544+ public virtual bool ? Cancelled { get ; set ; }
549545}
550546```
551547
@@ -554,24 +550,21 @@ This is also reflected in generated TypeScript DTOs where required reference pro
554550``` ts
555551export class CreateBooking implements IReturn <IdResponse >, ICreateDb <Booking >
556552{
557- /** @description Name this Booking is for */
558553 // @Validate(Validator="NotEmpty")
559554 public name: string ;
560555
561- public roomType? : RoomType ;
562- // @Validate(Validator="GreaterThan(0)")
563- public roomNumber? : number ;
564-
556+ public roomType: RoomType ;
565557 // @Validate(Validator="GreaterThan(0)")
566- public cost ? : number ;
558+ public roomNumber : number ;
567559
568- // @Required()
569560 public bookingStartDate: string ;
570-
571561 public bookingEndDate? : string ;
572- public notes ? : string ;
573- public couponId ? : string ;
562+ // @Validate(Validator="GreaterThan(0)")
563+ public cost : number ;
574564
565+ public notes? : string ;
566+ public cancelled? : boolean ;
567+
575568 public constructor (init ? : Partial <CreateBooking >) { (Object as any ).assign (this , init ); }
576569 public getTypeName() { return ' CreateBooking' ; }
577570 public getMethod() { return ' POST' ; }
0 commit comments