major claude changes
This commit is contained in:
@@ -54,26 +54,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Payment Status Card -->
|
||||
<div class="bg-neutral rounded-lg p-5">
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div class="col-span-2">
|
||||
<div class="font-bold text-sm">Payment Status</div>
|
||||
<div class="badge badge-lg"
|
||||
:class="{
|
||||
'badge-success': autoTicket.payment_status == 3,
|
||||
'badge-info': autoTicket.payment_status == 1,
|
||||
'badge-error': autoTicket.payment_status == 0 || autoTicket.payment_status == null,
|
||||
'badge-warning': [2, 4].includes(autoTicket.payment_status)
|
||||
}">
|
||||
<span v-if="autoTicket.payment_status == 0 || autoTicket.payment_status == null">Unpaid</span>
|
||||
<span v-else-if="autoTicket.payment_status == 1">Pre-authorized</span>
|
||||
<span v-else-if="autoTicket.payment_status == 2">Processing</span>
|
||||
<span v-else-if="autoTicket.payment_status == 3">Paid</span>
|
||||
<span v-else-if="autoTicket.payment_status == 4">Failed</span>
|
||||
<span v-else>Unknown</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Payment Status Card -->
|
||||
<div class="bg-neutral rounded-lg p-5">
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div class="col-span-2">
|
||||
<div class="font-bold text-sm">Payment Status</div>
|
||||
<div class="badge badge-lg"
|
||||
:class="{
|
||||
'badge-success': autoTicket.payment_status === PAYMENT_STATUS.PAID,
|
||||
'badge-info': autoTicket.payment_status === PAYMENT_STATUS.PRE_AUTHORIZED,
|
||||
'badge-error': autoTicket.payment_status === PAYMENT_STATUS.UNPAID || autoTicket.payment_status == null,
|
||||
'badge-warning': [PAYMENT_STATUS.PROCESSING, PAYMENT_STATUS.FAILED].includes(autoTicket.payment_status)
|
||||
}">
|
||||
<span v-if="autoTicket.payment_status === PAYMENT_STATUS.UNPAID || autoTicket.payment_status == null">Unpaid</span>
|
||||
<span v-else-if="autoTicket.payment_status === PAYMENT_STATUS.PRE_AUTHORIZED">Pre-authorized</span>
|
||||
<span v-else-if="autoTicket.payment_status === PAYMENT_STATUS.PROCESSING">Processing</span>
|
||||
<span v-else-if="autoTicket.payment_status === PAYMENT_STATUS.PAID">Paid</span>
|
||||
<span v-else-if="autoTicket.payment_status === PAYMENT_STATUS.FAILED">Failed</span>
|
||||
<span v-else>Unknown</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="font-bold text-sm">Fill Date</div>
|
||||
<div>{{ autoTicket.fill_date }}</div>
|
||||
@@ -150,8 +150,8 @@
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span>Status:</span>
|
||||
<span :class="transaction.status === 0 ? 'text-success' : 'text-error'">
|
||||
{{ transaction.status === 0 ? 'Approved' : 'Declined' }}
|
||||
<span :class="transaction.status === TRANSACTION_STATUS.APPROVED ? 'text-success' : 'text-error'">
|
||||
{{ transaction.status === TRANSACTION_STATUS.APPROVED ? 'Approved' : 'Declined' }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -242,25 +242,21 @@
|
||||
import { defineComponent } from 'vue'
|
||||
import axios from 'axios'
|
||||
import authHeader from '../../services/auth.header'
|
||||
|
||||
interface UserCard {
|
||||
id: number;
|
||||
last_four: string;
|
||||
type_of_card: string;
|
||||
expiration_month: number;
|
||||
expiration_year: number;
|
||||
name_on_card: string;
|
||||
card_number: string;
|
||||
security_number: string;
|
||||
main_card?: boolean;
|
||||
}
|
||||
import {
|
||||
PAYMENT_STATUS,
|
||||
AUTO_STATUS,
|
||||
TRANSACTION_STATUS,
|
||||
getPaymentStatusLabel,
|
||||
getTransactionStatusLabel
|
||||
} from '../../constants/status';
|
||||
|
||||
import Header from '../../layouts/headers/headerauth.vue'
|
||||
import SideBar from '../../layouts/sidebar/sidebar.vue'
|
||||
import Footer from '../../layouts/footers/footer.vue'
|
||||
import useValidate from "@vuelidate/core";
|
||||
import { notify } from "@kyvg/vue3-notification"
|
||||
import moment from 'moment';
|
||||
import dayjs from 'dayjs';
|
||||
import {AutoDelivery, Customer, AuthorizeTransaction, CreditCard} from '../../types/models';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'automaticDeliveryView',
|
||||
@@ -273,62 +269,25 @@ export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
v$: useValidate(),
|
||||
autoTicket: {
|
||||
id: 0,
|
||||
customer_id: 0,
|
||||
account_number: '',
|
||||
customer_town: '',
|
||||
customer_state: 0,
|
||||
customer_address: '',
|
||||
customer_zip: '',
|
||||
customer_full_name: '',
|
||||
customer_apt: '',
|
||||
fill_date: '',
|
||||
oil_prices_id: 0,
|
||||
gallons_delivered: '',
|
||||
price_per_gallon: '',
|
||||
total_amount_customer: '',
|
||||
payment_type: 0,
|
||||
payment_card_id: null,
|
||||
payment_status: null,
|
||||
open_ticket_id: null,
|
||||
} as any,
|
||||
autoDelivery: {
|
||||
id: 0,
|
||||
customer_id: 0,
|
||||
account_number: '',
|
||||
customer_town: '',
|
||||
customer_state: 0,
|
||||
customer_address: '',
|
||||
customer_zip: '',
|
||||
customer_full_name: '',
|
||||
last_fill: '',
|
||||
days_since_last_fill: 0,
|
||||
last_updated: '',
|
||||
estimated_gallons_left: 0,
|
||||
estimated_gallons_left_prev_day: 0,
|
||||
tank_height: '',
|
||||
tank_size: '',
|
||||
house_factor: 0,
|
||||
auto_status: 0,
|
||||
open_ticket_id: null,
|
||||
},
|
||||
customer: {
|
||||
id: 0,
|
||||
user_id: 0,
|
||||
customer_first_name: '',
|
||||
customer_last_name: '',
|
||||
customer_town: '',
|
||||
customer_state: 0,
|
||||
customer_address: '',
|
||||
customer_zip: '',
|
||||
customer_apt: '',
|
||||
customer_home_type: 0,
|
||||
customer_phone_number: '',
|
||||
},
|
||||
transaction: null as any,
|
||||
autoTicket: {} as any,
|
||||
autoDelivery: {} as AutoDelivery,
|
||||
customer: {} as Customer,
|
||||
transaction: {} as AuthorizeTransaction,
|
||||
userCardfound: false,
|
||||
userCard: {} as UserCard,
|
||||
userCard: {} as CreditCard,
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
// Expose constants to template
|
||||
PAYMENT_STATUS() {
|
||||
return PAYMENT_STATUS;
|
||||
},
|
||||
AUTO_STATUS() {
|
||||
return AUTO_STATUS;
|
||||
},
|
||||
TRANSACTION_STATUS() {
|
||||
return TRANSACTION_STATUS;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -339,10 +298,11 @@ export default defineComponent({
|
||||
methods: {
|
||||
format_date(value: string) {
|
||||
if (value) {
|
||||
return moment(String(value)).format('LLLL')
|
||||
return dayjs(String(value)).format('LLLL')
|
||||
}
|
||||
},
|
||||
getTypeColor(transactionType: number) {
|
||||
getTypeColor(transactionType: number | undefined) {
|
||||
if (transactionType === undefined) return 'text-gray-600';
|
||||
switch (transactionType) {
|
||||
case 1: return 'text-blue-600'; // Auth
|
||||
case 0: return 'text-orange-600'; // Charge
|
||||
@@ -360,7 +320,7 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
|
||||
getCustomer(customerId: number) {
|
||||
getCustomer(customerId: number | undefined) {
|
||||
if (!customerId) return;
|
||||
const path = `${import.meta.env.VITE_BASE_URL}/customer/${customerId}`;
|
||||
axios.get(path, { withCredentials: true })
|
||||
@@ -384,12 +344,12 @@ export default defineComponent({
|
||||
this.userCard = response.data;
|
||||
this.userCardfound = true;
|
||||
} else {
|
||||
this.userCard = {} as UserCard;
|
||||
this.userCard = {} as CreditCard;
|
||||
this.userCardfound = false;
|
||||
}
|
||||
})
|
||||
.catch((_error: any) => {
|
||||
this.userCard = {} as UserCard;
|
||||
this.userCard = {} as CreditCard;
|
||||
this.userCardfound = false;
|
||||
});
|
||||
},
|
||||
@@ -438,7 +398,7 @@ export default defineComponent({
|
||||
})
|
||||
.catch((error: any) => {
|
||||
console.error("No transaction found for delivery:", error);
|
||||
this.transaction = null;
|
||||
this.transaction = {} as AuthorizeTransaction;
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user