/* Options: Date: 2025-12-16 01:42:04 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: UpdateCoupon.* //ExcludeTypes: //DefaultImports: package:servicestack/servicestack.dart */ import 'package:servicestack/servicestack.dart'; /** * Discount Coupons */ class Coupon implements IConvertible { String id = ""; String description = ""; int discount = 0; DateTime expiryDate = DateTime(0); 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="NotNull") // @Validate(Validator="GreaterThan(0)") int discount = 0; // @Validate(Validator="NotNull") DateTime expiryDate = DateTime(0); 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_vue.web_templates.io', types: { 'Coupon': TypeInfo(TypeOf.Class, create:() => Coupon()), 'UpdateCoupon': TypeInfo(TypeOf.Class, create:() => UpdateCoupon()), });