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">
|
<script setup lang="ts">
|
||||||
import type { RegistrationConfig, Member } from '~/utils/types';
|
import type { RegistrationConfig, Member } from '~/utils/types';
|
||||||
|
import {
|
||||||
|
isPaymentOverOneYear as checkPaymentOverOneYear,
|
||||||
|
isDuesActuallyCurrent as checkDuesActuallyCurrent,
|
||||||
|
calculateOverdueDays
|
||||||
|
} from '~/utils/dues-calculations';
|
||||||
|
|
||||||
// Get auth state
|
// Get auth state
|
||||||
const { user, isAdmin } = useAuth();
|
const { user, isAdmin } = useAuth();
|
||||||
|
|
@ -191,21 +196,11 @@ const isInGracePeriod = computed(() => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a member's last payment is over 1 year old
|
* 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(() => {
|
const isPaymentOverOneYear = computed(() => {
|
||||||
if (!memberData.value?.membership_date_paid) return false;
|
if (!memberData.value) return false;
|
||||||
|
return checkPaymentOverOneYear(memberData.value);
|
||||||
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;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -257,17 +252,13 @@ const isDueSoon = computed(() => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if dues are overdue
|
* Check if dues are overdue
|
||||||
|
* Uses standardized dues calculation function
|
||||||
*/
|
*/
|
||||||
const isDuesOverdue = computed(() => {
|
const isDuesOverdue = computed(() => {
|
||||||
if (!memberData.value) return false;
|
if (!memberData.value) return false;
|
||||||
|
|
||||||
// If dues are current, not overdue
|
// Use the standardized function - if not current, then overdue
|
||||||
const duesCurrentlyPaid = memberData.value.current_year_dues_paid === 'true';
|
return !checkDuesActuallyCurrent(memberData.value);
|
||||||
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);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue