Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@IsOptional()
amount: number;
@IsString()
@IsOptional()
city: string;
@IsString()
@IsOptional()
state: string;
@IsString()
@IsOptional()
zip: string;
@IsEnum(ContributorType)
@IsOptional()
contributorType: ContributorType;
@IsString()
@IsOptional()
email: string;
@IsString()
@IsOptional()
firstName: string;
@IsString()
@IsOptional()
lastName: string;
@IsString()
export class VPasswordReset {
@ApiModelProperty()
@IsDefined() @IsString() @Length(6)
password: string;
@ApiModelProperty()
@IsDefined() @IsString()
token: string;
}
export class VUserQuery {
@ApiModelProperty()
@IsString()
search: string;
@ApiModelProperty()
@IsString() @IsEnum(USER_ROLE)
role: USER_ROLE;
@ApiModelProperty()
@IsBoolean() @ToBoolean()
blocked: boolean;
}
export class VBlocked {
@ApiModelProperty()
@IsBoolean()
blocked: boolean;
}
export class VChangeUserRole {
@ApiModelProperty()
@IsString() @IsEnum(USER_ROLE)
readonly title: string;
@IsNotEmpty()
@IsString()
@MinLength(10)
@MaxLength(100)
readonly body: string;
@IsNotEmpty()
@IsAscii()
@MinLength(3)
@MaxLength(50)
readonly target: string;
@IsNotEmpty()
@IsEnum(TargetType)
readonly targetType: TargetType;
@IsOptional()
@IsEnum(NotificationIcon)
readonly icon?: NotificationIcon = NotificationIcon.NOTIFICATIONS;
@IsOptional()
@IsEnum(NotificationColor)
readonly color?: NotificationColor = NotificationColor.PRIMARY;
@IsOptional()
@IsBoolean()
readonly native?: boolean = false;
}
@IsNumber()
@Min(0)
@Column({ type: "float", nullable: true })
billAmount?: number;
@IsPositive()
@Column({ type: "float" })
amountPaid: number;
@Column({ type: "float" })
balance: number;
@Column({ type: "float" })
totalDebt: number;
@IsEnum(CreditTransactionsType)
@Column()
type: CreditTransactionsType;
@IsNotEmpty()
@Column()
paidDate: Date;
@Column() isReverted: boolean;
}
@IsOptional()
state: string;
@IsString()
@IsOptional()
zip: string;
@IsString()
@IsOptional()
name: string;
@IsEnum(PayeeType)
@IsOptional()
payeeType: PayeeType;
@IsEnum(ExpenditureSubType)
@IsOptional()
subType: ExpenditureSubType;
@IsEnum(ExpenditureStatus)
@IsOptional()
status: ExpenditureStatus;
@IsEnum(ExpenditureType)
@IsOptional()
type: ExpenditureType;
@IsNumber()
@IsOptional()
date: number;
@IsEnum(PaymentMethod)
@IsNotEmpty()
@IsAscii()
@MinLength(3)
@MaxLength(50)
readonly target: string;
@IsNotEmpty()
@IsEnum(TargetType)
readonly targetType: TargetType;
@IsOptional()
@IsEnum(NotificationIcon)
readonly icon?: NotificationIcon = NotificationIcon.NOTIFICATIONS;
@IsOptional()
@IsEnum(NotificationColor)
readonly color?: NotificationColor = NotificationColor.PRIMARY;
@IsOptional()
@IsBoolean()
readonly native?: boolean = false;
}
@Entity()
export class User {
@IsNotEmpty()
@PrimaryColumn()
id: string;
@IsNotEmpty()
@Column()
name: string;
@IsNotEmpty()
@Column()
password: string;
@IsEnum(Role)
@Column()
role: Role;
@IsNotEmpty()
@CreateDateColumn()
createdAt: Date;
@IsNotEmpty()
@UpdateDateColumn()
updatedAt: Date;
}
@IsOptional()
suffix: string;
@IsString()
@IsOptional()
title: string;
@IsBoolean()
@IsOptional()
submitForMatch: boolean;
@IsEnum(ContributionSubType)
@IsOptional()
subType: ContributionSubType;
@IsEnum(InKindDescriptionType)
@IsOptional()
inKindType: InKindDescriptionType;
@IsEnum(ContributionType)
@IsOptional()
type: ContributionType;
@IsEnum(OaeType)
@IsOptional()
oaeType: OaeType;
@IsEnum(PaymentMethod)
@IsOptional()
paymentMethod: PaymentMethod;
@IsNumber()
@IsOptional()
description: string;
@IsString()
@IsOptional()
state: string;
@IsString()
@IsOptional()
zip: string;
@IsString()
@IsOptional()
name: string;
@IsEnum(PayeeType)
@IsOptional()
payeeType: PayeeType;
@IsEnum(ExpenditureSubType)
@IsOptional()
subType: ExpenditureSubType;
@IsEnum(ExpenditureStatus)
@IsOptional()
status: ExpenditureStatus;
@IsEnum(ExpenditureType)
@IsOptional()
type: ExpenditureType;
@IsNumber()
@IsOptional()
occupation: string;
@IsString()
@IsOptional()
employerName: string;
@IsString()
@IsOptional()
employerCity: string;
@IsString()
@IsOptional()
employerState: string;
@IsEnum(PhoneType)
@IsOptional()
phoneType: PhoneType;
@IsString()
@IsOptional()
checkNumber: string;
@IsString()
@IsOptional()
notes: string;
}
export async function addContribution(request: IRequest, response: Response, next: Function) {
try {
checkCurrentUser(request);