/* Options: Date: 2024-12-22 21:33:15 Version: 8.51 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://blazor-gallery.servicestack.net //GlobalNamespace: //AddServiceStackTypes: True //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True IncludeTypes: UpdateCoupon.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart,dart:typed_data */ import 'package:servicestack/servicestack.dart'; import 'dart:typed_data'; /** * Discount Coupons */ class Coupon implements IConvertible { String? id; String? description; int? discount; DateTime? expiryDate; Coupon({this.id,this.description,this.discount,this.expiryDate}); Coupon.fromJson(Map json) { fromMap(json); } fromMap(Map json) { id = json['id']; description = json['description']; discount = json['discount']; expiryDate = JsonConverters.fromJson(json['expiryDate'],'DateTime',context!); return this; } Map toJson() => { 'id': id, 'description': description, 'discount': discount, 'expiryDate': JsonConverters.toJson(expiryDate,'DateTime',context!) }; getTypeName() => "Coupon"; TypeContext? context = _ctx; } // @Route("/coupons/{Id}", "PATCH") // @ValidateRequest(Validator="HasRole(`Employee`)") class UpdateCoupon implements IReturn, IPatchDb, IConvertible, IPatch { String? id; // @Validate(Validator="NotEmpty") String? description; // @Validate(Validator="GreaterThan(0)") int? discount; // @required() DateTime? expiryDate; UpdateCoupon({this.id,this.description,this.discount,this.expiryDate}); UpdateCoupon.fromJson(Map json) { fromMap(json); } fromMap(Map json) { id = json['id']; description = json['description']; discount = json['discount']; expiryDate = JsonConverters.fromJson(json['expiryDate'],'DateTime',context!); return this; } Map toJson() => { 'id': id, 'description': description, 'discount': discount, 'expiryDate': JsonConverters.toJson(expiryDate,'DateTime',context!) }; createResponse() => IdResponse(); getResponseTypeName() => "IdResponse"; getTypeName() => "UpdateCoupon"; TypeContext? context = _ctx; } TypeContext _ctx = TypeContext(library: 'blazor_gallery.servicestack.net', types: { 'Coupon': TypeInfo(TypeOf.Class, create:() => Coupon()), 'UpdateCoupon': TypeInfo(TypeOf.Class, create:() => UpdateCoupon()), });