feat: billing for groups of deals
This commit is contained in:
		@@ -25,6 +25,7 @@ export type { BaseEnumListSchema } from './models/BaseEnumListSchema';
 | 
			
		||||
export type { BaseEnumSchema } from './models/BaseEnumSchema';
 | 
			
		||||
export type { BaseMarketplaceSchema } from './models/BaseMarketplaceSchema';
 | 
			
		||||
export type { BaseShippingWarehouseSchema } from './models/BaseShippingWarehouseSchema';
 | 
			
		||||
export type { BillPaymentInfo } from './models/BillPaymentInfo';
 | 
			
		||||
export type { BillPaymentStatus } from './models/BillPaymentStatus';
 | 
			
		||||
export type { BillStatusUpdateRequest } from './models/BillStatusUpdateRequest';
 | 
			
		||||
export type { Body_upload_product_barcode_image } from './models/Body_upload_product_barcode_image';
 | 
			
		||||
@@ -169,6 +170,7 @@ export type { GetProductBarcodeResponse } from './models/GetProductBarcodeRespon
 | 
			
		||||
export type { GetServiceKitSchema } from './models/GetServiceKitSchema';
 | 
			
		||||
export type { GetTimeTrackingRecordsRequest } from './models/GetTimeTrackingRecordsRequest';
 | 
			
		||||
export type { GetTimeTrackingRecordsResponse } from './models/GetTimeTrackingRecordsResponse';
 | 
			
		||||
export type { GroupBillRequestSchema } from './models/GroupBillRequestSchema';
 | 
			
		||||
export type { HTTPValidationError } from './models/HTTPValidationError';
 | 
			
		||||
export type { MarketplaceCreateSchema } from './models/MarketplaceCreateSchema';
 | 
			
		||||
export type { MarketplaceSchema } from './models/MarketplaceSchema';
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@
 | 
			
		||||
import type { BillPaymentStatus } from './BillPaymentStatus';
 | 
			
		||||
import type { NotificationChannel } from './NotificationChannel';
 | 
			
		||||
export type BillStatusUpdateRequest = {
 | 
			
		||||
    listenerTransactionId: number;
 | 
			
		||||
    listenerTransactionId: (number | string);
 | 
			
		||||
    channel: NotificationChannel;
 | 
			
		||||
    info: BillPaymentStatus;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -2,9 +2,11 @@
 | 
			
		||||
/* istanbul ignore file */
 | 
			
		||||
/* tslint:disable */
 | 
			
		||||
/* eslint-disable */
 | 
			
		||||
import type { GroupBillRequestSchema } from './GroupBillRequestSchema';
 | 
			
		||||
export type DealGroupSchema = {
 | 
			
		||||
    id: number;
 | 
			
		||||
    name?: (string | null);
 | 
			
		||||
    lexorank: string;
 | 
			
		||||
    billRequest?: (GroupBillRequestSchema | null);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@
 | 
			
		||||
/* eslint-disable */
 | 
			
		||||
import type { ClientSchema } from './ClientSchema';
 | 
			
		||||
import type { DealBillRequestSchema } from './DealBillRequestSchema';
 | 
			
		||||
import type { DealGroupSchema } from './DealGroupSchema';
 | 
			
		||||
import type { DealProductSchema } from './DealProductSchema';
 | 
			
		||||
import type { DealServiceSchema } from './DealServiceSchema';
 | 
			
		||||
import type { DealStatusHistorySchema } from './DealStatusHistorySchema';
 | 
			
		||||
@@ -26,6 +27,7 @@ export type DealSchema = {
 | 
			
		||||
    shippingWarehouse?: (ShippingWarehouseSchema | string | null);
 | 
			
		||||
    billRequest?: (DealBillRequestSchema | null);
 | 
			
		||||
    category?: (ServicePriceCategorySchema | null);
 | 
			
		||||
    group?: (DealGroupSchema | null);
 | 
			
		||||
    deliveryDate?: (string | null);
 | 
			
		||||
    receivingSlotDate?: (string | null);
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								src/client/models/GroupBillRequestSchema.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								src/client/models/GroupBillRequestSchema.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
/* generated using openapi-typescript-codegen -- do not edit */
 | 
			
		||||
/* istanbul ignore file */
 | 
			
		||||
/* tslint:disable */
 | 
			
		||||
/* eslint-disable */
 | 
			
		||||
export type GroupBillRequestSchema = {
 | 
			
		||||
    groupId: number;
 | 
			
		||||
    createdAt: string;
 | 
			
		||||
    paid: boolean;
 | 
			
		||||
    pdfUrl: (string | null);
 | 
			
		||||
    invoiceNumber: (string | null);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -66,6 +66,9 @@ const DealSummaryCard: FC<Props> = ({ dealSummary, color }) => {
 | 
			
		||||
        }
 | 
			
		||||
        return { disabled: true };
 | 
			
		||||
    };
 | 
			
		||||
    const isPaid = () => {
 | 
			
		||||
        return dealSummary.billRequest?.paid || dealSummary.group?.billRequest?.paid;
 | 
			
		||||
    }
 | 
			
		||||
    return (
 | 
			
		||||
        <Indicator
 | 
			
		||||
            position={"top-end"}
 | 
			
		||||
@@ -194,15 +197,12 @@ const DealSummaryCard: FC<Props> = ({ dealSummary, color }) => {
 | 
			
		||||
                                    </Popover>
 | 
			
		||||
                                )}
 | 
			
		||||
                            </CopyButton>
 | 
			
		||||
                            {dealSummary.billRequest?.paid && (
 | 
			
		||||
                            {isPaid() && (
 | 
			
		||||
                                <Tooltip label={"Оплачен"}>
 | 
			
		||||
                                    <ThemeIcon variant={"transparent"}>
 | 
			
		||||
                                        <IconCheck />
 | 
			
		||||
                                    </ThemeIcon>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                                </Tooltip>
 | 
			
		||||
 | 
			
		||||
                            )}
 | 
			
		||||
                        </Flex>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -121,6 +121,8 @@ const Content: FC<Props> = ({ deal }) => {
 | 
			
		||||
            clipboard.copy(`${window.location.origin}/${url}`);
 | 
			
		||||
        });
 | 
			
		||||
    };
 | 
			
		||||
    const billRequestPdfUrl = deal?.billRequest?.pdfUrl || deal?.group?.billRequest?.pdfUrl;
 | 
			
		||||
 | 
			
		||||
    return (
 | 
			
		||||
        <form onSubmit={form.onSubmit(values => handleSubmit(values))}>
 | 
			
		||||
            <Flex
 | 
			
		||||
@@ -270,12 +272,12 @@ const Content: FC<Props> = ({ deal }) => {
 | 
			
		||||
                            </Tooltip>
 | 
			
		||||
 | 
			
		||||
                            <Flex gap={rem(10)}>
 | 
			
		||||
                                {deal.billRequest && deal.billRequest.pdfUrl ? (
 | 
			
		||||
                                {billRequestPdfUrl ? (
 | 
			
		||||
                                    <ButtonCopy
 | 
			
		||||
                                        onCopiedLabel={
 | 
			
		||||
                                            "Ссылка скопирована в буфер обмена"
 | 
			
		||||
                                        }
 | 
			
		||||
                                        value={deal.billRequest.pdfUrl}>
 | 
			
		||||
                                        value={billRequestPdfUrl}>
 | 
			
		||||
                                        Ссылка на оплату
 | 
			
		||||
                                    </ButtonCopy>
 | 
			
		||||
                                ) : (
 | 
			
		||||
@@ -308,7 +310,7 @@ const Content: FC<Props> = ({ deal }) => {
 | 
			
		||||
                        <Flex gap={rem(10)}>
 | 
			
		||||
                            <Checkbox
 | 
			
		||||
                                label={"Оплачен"}
 | 
			
		||||
                                checked={deal.billRequest?.paid || false}
 | 
			
		||||
                                checked={deal.billRequest?.paid || deal.group?.billRequest?.paid || false}
 | 
			
		||||
                                disabled
 | 
			
		||||
                            />
 | 
			
		||||
                            <Checkbox
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ import classNames from "classnames";
 | 
			
		||||
const ProductAndServiceTab: FC = () => {
 | 
			
		||||
    const { dealState, dealServicesState, dealProductsState } =
 | 
			
		||||
        useDealProductAndServiceTabState();
 | 
			
		||||
    const isLocked = Boolean(dealState.deal?.billRequest);
 | 
			
		||||
    const isLocked = Boolean(dealState.deal?.billRequest || dealState.deal?.group?.billRequest);
 | 
			
		||||
    const onAddProductClick = () => {
 | 
			
		||||
        if (!dealProductsState.onCreate || !dealState.deal) return;
 | 
			
		||||
        const productIds = dealState.deal.products.map(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user