REFACTOR: Belonging → Property system migration + utilities update
Property system: - Rename belonging → property throughout (model, controller, routes, service) - Add property sub-models: buildingModel, landModel, belongingModel - Add property lifecycle events: createProperty, deleteProperty - Add propertyStatus component (model, controller, routes, service, seeder) - Add commodity and commodityTransaction model stubs Infrastructure: - Update transactionModel and transactionService - Update events/index.js for new property events - Update seeder (seederDBConnection, seederRunner) - Update typesense client configuration - Update upload utilities (bucket, minio) - Update featureModel and featureSeeder - Update categorySeeder - Update TsApiFeatures utility - Remove docker-compose.yml (moved to root) - Remove legacy belonging component files
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
const propertyStatusSchema = new mongoose.Schema(
|
||||
{
|
||||
nativeName: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
englishName: {
|
||||
type: String,
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
// Color token for UI badge (success/info/warn/danger/secondary/contrast)
|
||||
color: {
|
||||
type: String,
|
||||
default: 'secondary',
|
||||
},
|
||||
},
|
||||
{
|
||||
toJSON: { virtuals: true },
|
||||
toObject: { virtuals: true },
|
||||
timestamps: true,
|
||||
}
|
||||
)
|
||||
|
||||
const PropertyStatus = mongoose.model('PropertyStatus', propertyStatusSchema)
|
||||
module.exports = PropertyStatus
|
||||
Reference in New Issue
Block a user