fixes
Build And Push Image / docker (push) Successful in 1m27s
Details
Build And Push Image / docker (push) Successful in 1m27s
Details
This commit is contained in:
parent
4b78080f53
commit
031ed4fd9e
|
|
@ -151,6 +151,11 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import type { RegistrationConfig, Member } from '~/utils/types';
|
||||
import {
|
||||
isPaymentOverOneYear as checkPaymentOverOneYear,
|
||||
isDuesActuallyCurrent as checkDuesActuallyCurrent,
|
||||
calculateOverdueDays
|
||||
} from '~/utils/dues-calculations';
|
||||
|
||||
// Get auth state
|
||||
const { user, isAdmin } = useAuth();
|
||||
|
|
@ -191,21 +196,11 @@ const isInGracePeriod = computed(() => {
|
|||
|
||||
/**
|
||||
* Check if a member's last payment is over 1 year old
|
||||
* Uses the same logic as dues-status API
|
||||
* Uses standardized dues calculation function
|
||||
*/
|
||||
const isPaymentOverOneYear = computed(() => {
|
||||
if (!memberData.value?.membership_date_paid) return false;
|
||||
|
||||
try {
|
||||
const lastPaidDate = new Date(memberData.value.membership_date_paid);
|
||||
const oneYearFromPayment = new Date(lastPaidDate);
|
||||
oneYearFromPayment.setFullYear(oneYearFromPayment.getFullYear() + 1);
|
||||
const today = new Date();
|
||||
|
||||
return today > oneYearFromPayment;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
if (!memberData.value) return false;
|
||||
return checkPaymentOverOneYear(memberData.value);
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
@ -257,17 +252,13 @@ const isDueSoon = computed(() => {
|
|||
|
||||
/**
|
||||
* Check if dues are overdue
|
||||
* Uses standardized dues calculation function
|
||||
*/
|
||||
const isDuesOverdue = computed(() => {
|
||||
if (!memberData.value) return false;
|
||||
|
||||
// If dues are current, not overdue
|
||||
const duesCurrentlyPaid = memberData.value.current_year_dues_paid === 'true';
|
||||
const paymentTooOld = isPaymentOverOneYear.value;
|
||||
const gracePeriod = isInGracePeriod.value;
|
||||
|
||||
// Member is overdue if payment is too old OR (dues not paid AND not in grace period)
|
||||
return paymentTooOld || (!duesCurrentlyPaid && !gracePeriod);
|
||||
// Use the standardized function - if not current, then overdue
|
||||
return !checkDuesActuallyCurrent(memberData.value);
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue