Untitled

 avatar
unknown
plain_text
a month ago
1.5 kB
1
Indexable



@Schema({ timestamps: true })
export class TenantDueEntity extends AbstractMongoEntity {

    @Prop({ type: mongoose.SchemaTypes.ObjectId, ref: PropertyEntity.name, index: 1, required: true })
    propertyId: string;

    @Prop({ type: mongoose.SchemaTypes.ObjectId, ref: TenantEntity.name, index: 1, required: true })
    tenantId: string;

    @Prop({ type: mongoose.SchemaTypes.ObjectId, ref: UnitEntity.name })
    unitId: string;

    @Prop({ required: true, enum: DueCategoryEnum })
    dueCategory: string;

    @Prop({ type: mongoose.SchemaTypes.ObjectId, ref: DuePlanEntity.name })
    duePlanId: string;

    @Prop()
    monthly: boolean;

    @Prop()
    planAmount: number;

    @Prop()
    amount: number;

    @Prop()
    concessionAmount: number;

    @Prop()
    totalAmount: number;

    @Prop()
    appliedDate: Date;

    @Prop({ default: false })
    isCompleted: boolean;

    @Prop()
    isPreviousDue: boolean;

    @Prop()
    completedDate: Date;

    @Prop()
    remark: string;

    @Prop({ type: mongoose.SchemaTypes.ObjectId, ref: AccountEntity.name })
    createdBy: string;

    @Prop({ type: mongoose.SchemaTypes.ObjectId, ref: StaffRequestEntity.name })
    staffRequestId: string;

}


export const TenantDueDatabaseName = 'tenantDues';
export const TenantDueSchema = SchemaFactory.createForClass(TenantDueEntity);
TenantDueSchema.plugin(mongoosePaginate);
export type TenantDueDocument = TenantDueEntity & Document;
Leave a Comment