import { Attr } from 'ts-framework' import { PromotionsTypes } from '../constants' export class CreatePromotionDTO { @Attr({ type: String, optional: true }) accountId?: string; @Attr({ type: String, optional: true }) orgId?: string; @Attr({ type: String, optional: true }) productId?: string; @Attr({ type: String, optional: true }) serviceId?: string; @Attr({ type: String, optional: false, defaultValue: '' }) title: string; @Attr({ type: String, optional: false }) promotionType: PromotionsTypes; @Attr({ type: Number, optional: false }) promotionValue: number; @Attr({ type: Number, optional: false }) maxRedemptions: number; @Attr({ type: String, optional: true }) createdBy: string; @Attr({ type: Date, optional: true }) expiresAt: Date; } export class PromotionsListDTO { @Attr({ type: String, optional: true }) orgId: string @Attr({ type: String, optional: true }) serviceId?: string @Attr({ type: String, optional: true }) productId?: string } export class PromotionResponseDTO { @Attr({ type: String }) id: string; @Attr({ type: Boolean }) active: boolean; @Attr({ type: String }) accountId: string; @Attr({ type: String }) orgId: string; @Attr({ type: String }) productId?: string; @Attr({ type: String }) serviceId?: string; @Attr({ type: String }) title: string; @Attr({ type: String }) promotionType: PromotionsTypes; @Attr({ type: Number }) promotionValue: number; @Attr({ type: Number }) maxRedemptions: number; @Attr({ type: String }) createdBy: string; @Attr({ type: Date }) expiresAt: Date; @Attr({ type: Date }) createdAt: Date; @Attr({ type: Date }) updatedAt: Date; } export class CreatePromotionResponseDTO extends PromotionResponseDTO {} export class ApplyPromotionDTO { @Attr({ type: String, optional: false }) userId: string; @Attr({ type: String, optional: false }) promotionId: string; @Attr({ type: Number, optional: false }) maxRedemptions?: number; @Attr({ type: String, optional: true }) createdBy: string; @Attr({ type: Date, optional: true }) expiresAt?: Date; } export class AppliedPromotionResponseDTO { @Attr({ type: String }) id: string; @Attr({ type: Boolean }) active: boolean; @Attr({ type: String }) userId: string; @Attr({ type: String }) walletId: string; @Attr({ type: String }) accountId: string; @Attr({ type: String }) orgId: string; @Attr({ type: String }) productId?: string; @Attr({ type: String }) serviceId?: string; @Attr({ type: String }) title: string; @Attr({ type: String }) promotionType: PromotionsTypes; @Attr({ type: Number }) promotionValue: number; @Attr({ type: Number }) maxRedemptions: number; @Attr({ type: Number }) redemptionCount: number; @Attr({ type: Date }) expiresAt: Date; @Attr({ type: String }) createdBy: string; } export class ApplyPromotionResponseDTO extends AppliedPromotionResponseDTO { }