feat(member): rename contributionTier → contributionAmount (Number)
This commit is contained in:
parent
e4dade18b9
commit
74ea932cd2
1 changed files with 7 additions and 4 deletions
|
|
@ -7,7 +7,6 @@ const __dirname = fileURLToPath(new URL(".", import.meta.url));
|
|||
|
||||
// Import configs using dynamic imports to avoid build issues
|
||||
const getValidCircleValues = () => ["community", "founder", "practitioner"];
|
||||
const getValidContributionValues = () => ["0", "5", "15", "30", "50"];
|
||||
|
||||
const memberSchema = new mongoose.Schema({
|
||||
email: { type: String, required: true, unique: true },
|
||||
|
|
@ -23,10 +22,14 @@ const memberSchema = new mongoose.Schema({
|
|||
enum: getValidCircleValues(),
|
||||
required: true,
|
||||
},
|
||||
contributionTier: {
|
||||
type: String,
|
||||
enum: getValidContributionValues(),
|
||||
contributionAmount: {
|
||||
type: Number,
|
||||
required: true,
|
||||
min: 0,
|
||||
validate: {
|
||||
validator: Number.isInteger,
|
||||
message: 'contributionAmount must be a whole number',
|
||||
},
|
||||
},
|
||||
role: {
|
||||
type: String,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue