feat: add get quotation payment

This commit is contained in:
Methapon Metanipat 2024-10-16 17:21:30 +07:00
parent 314d33aefa
commit 4feaa5cd75
2 changed files with 26 additions and 0 deletions

View file

@ -7,6 +7,7 @@ import {
Quotation,
QuotationFull,
QuotationPayload,
QuotationPaymentData,
QuotationStats,
} from './types';
import { PaginationResult } from 'src/types';
@ -125,3 +126,19 @@ export const useQuotationStore = defineStore('quotation-store', () => {
deleteQuottaion,
};
});
export const useQuotationPayment = defineStore('quotation-payment', () => {
async function getQuotationPayment(quotationId: string) {
const res = await api.get<
Quotation & { quotationPaymentData: QuotationPaymentData[] }
>(`/quotation/${quotationId}/payment`);
if (res.status < 400) {
return res.data;
}
return null;
}
return {
getQuotationPayment,
};
});

View file

@ -331,3 +331,12 @@ export type ProductGroup = {
remark: string;
registeredBranchId: string;
};
export type QuotationPaymentData = {
quotationId: string;
paymentStatus: string;
amount: number;
remark: string;
date: string;
id: string;
};