fix(display): cadence-aware contribution suffix across UI + admin dashboard
Add formatContribution helper in app/config/contributions.js and route all member-facing and admin contribution displays through cadence-aware expressions so annual members see /yr instead of /mo. Normalize annual amounts to monthly equivalents in the admin dashboard revenue aggregate now that contributionAmount is stored in cadence units.
This commit is contained in:
parent
5023fb14ad
commit
0dd68ff1aa
6 changed files with 29 additions and 12 deletions
|
|
@ -111,7 +111,7 @@
|
|||
<td>
|
||||
<CircleBadge :circle="member.circle" />
|
||||
</td>
|
||||
<td class="col-mono">${{ member.contributionAmount ?? 0 }}/mo</td>
|
||||
<td class="col-mono">${{ member.contributionAmount ?? 0 }}{{ member.billingCadence === 'annual' ? '/yr' : '/mo' }}</td>
|
||||
<td>
|
||||
<span class="badge status" :class="`status-${member.status || 'pending_payment'}`">{{ statusLabel(member.status) }}</span>
|
||||
</td>
|
||||
|
|
@ -192,7 +192,7 @@
|
|||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Contribution ($/mo)</label>
|
||||
<label>Contribution ({{ newMember.billingCadence === 'annual' ? '$/yr' : '$/mo' }})</label>
|
||||
<input v-model.number="newMember.contributionAmount" type="number" min="0" step="1">
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
|
|
@ -286,7 +286,7 @@
|
|||
<td>{{ row.name }}</td>
|
||||
<td class="col-email">{{ row.email }}</td>
|
||||
<td>{{ row.circle }}</td>
|
||||
<td>${{ row.contributionAmount }}/mo</td>
|
||||
<td>${{ row.contributionAmount }}{{ row.billingCadence === 'annual' ? '/yr' : '/mo' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -366,7 +366,7 @@
|
|||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Contribution ($/mo)</label>
|
||||
<label>Contribution ({{ editingMember.billingCadence === 'annual' ? '$/yr' : '$/mo' }})</label>
|
||||
<input v-model.number="editingMember.contributionAmount" type="number" min="0" step="1">
|
||||
</div>
|
||||
<div class="field">
|
||||
|
|
@ -860,6 +860,7 @@ const editingMember = reactive({
|
|||
email: "",
|
||||
circle: "community",
|
||||
contributionAmount: 0,
|
||||
billingCadence: "monthly",
|
||||
status: "pending_payment",
|
||||
});
|
||||
|
||||
|
|
@ -870,6 +871,7 @@ const editMember = (member) => {
|
|||
email: member.email,
|
||||
circle: member.circle,
|
||||
contributionAmount: member.contributionAmount ?? 0,
|
||||
billingCadence: member.billingCadence || "monthly",
|
||||
status: member.status || "pending_payment",
|
||||
});
|
||||
showEditModal.value = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue