diff --git a/src/stores/quotations/index.ts b/src/stores/quotations/index.ts index ad83cc93..4237501f 100644 --- a/src/stores/quotations/index.ts +++ b/src/stores/quotations/index.ts @@ -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, + }; +}); diff --git a/src/stores/quotations/types.ts b/src/stores/quotations/types.ts index 9446e872..3f15354c 100644 --- a/src/stores/quotations/types.ts +++ b/src/stores/quotations/types.ts @@ -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; +};