real-estate-management icon indicating copy to clipboard operation
real-estate-management copied to clipboard

Add transaction type to properties "For Rent" and "For Sale"

Open eevan7a9 opened this issue 8 months ago • 0 comments

Update the Real Estate Properties Model to include a transaction type field to clearly indicate if a property is "For Rent" or "For Sale".

Tasks:

Backend Changes are needed:

  • The transactionType field should be of type String.
  • It should accept only two values: "sale" and "rent".
  • This field should be required.
  • Add validation to ensure only sale and rent are accepted as values for the transactionType field.
Propose Schema Change:
const propertySchema = new mongoose.Schema(
  {
    ...
    transactionType: { type: String, enum: ['for_sale', 'for_rent'], required: true },
   ...
  },
  {
    timestamps: true,
  }
);

Frontend Changes are needed.

  • Modify the property creation form and edit forms to include a field for selecting transactionType.
  • Ensure that users can only select either "Sale" or "Rent".

eevan7a9 avatar Jun 21 '24 08:06 eevan7a9