fields
This commit is contained in:
@@ -54,23 +54,20 @@ const RequestDetail: FC = () => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Attributes */}
|
{/* Attributes from field */}
|
||||||
{/* {fields?.data?.length ? (
|
{item.attributes?.length ? (
|
||||||
<>
|
<>
|
||||||
<div className='font-bold mb-5 mt-7'>ویژگی ها</div>
|
<div className='font-bold mb-5 mt-7'>ویژگیها</div>
|
||||||
{
|
<div className='flex flex-col gap-3'>
|
||||||
fields.data.map((field) => {
|
{item.attributes.map((attr) => (
|
||||||
const value = item.attributes?.find((o) => String(o.attributeId) === String(field.id))
|
<div className='flex gap-3 items-center' key={attr.fieldId}>
|
||||||
return (
|
<div className='text-sm text-gray-500'>{attr.field?.name}:</div>
|
||||||
<div className='flex gap-3 items-center mt-3' key={field.id}>
|
<div className='text-sm -mt-px'>{attr.value ?? '—'}</div>
|
||||||
<div className='text-sm text-gray-500'>{field.name}:</div>
|
</div>
|
||||||
<div className='text-sm -mt-px'>{value?.value || '-'}</div>
|
))}
|
||||||
</div>
|
</div>
|
||||||
)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</>
|
</>
|
||||||
) : null} */}
|
) : null}
|
||||||
|
|
||||||
{/* Attachments */}
|
{/* Attachments */}
|
||||||
{item.attachments?.length ? (
|
{item.attachments?.length ? (
|
||||||
|
|||||||
@@ -99,7 +99,86 @@ export interface MyRequestType extends RowDataType {
|
|||||||
|
|
||||||
export type MyRequestsResponseType = BaseResponse<MyRequestType[]>;
|
export type MyRequestsResponseType = BaseResponse<MyRequestType[]>;
|
||||||
|
|
||||||
export type RequestDetailResponseType = BaseResponse<MyRequestType>;
|
/** User in request detail response */
|
||||||
|
export type RequestDetailUserType = {
|
||||||
|
id: string;
|
||||||
|
createdAt: string;
|
||||||
|
deletedAt: string | null;
|
||||||
|
firstName: string | null;
|
||||||
|
lastName: string | null;
|
||||||
|
isActive: boolean;
|
||||||
|
gender: boolean;
|
||||||
|
maxCredit: number;
|
||||||
|
addresse: string | null;
|
||||||
|
phone: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Option inside field (in request detail item attribute) */
|
||||||
|
export type RequestDetailFieldOptionType = {
|
||||||
|
id: string;
|
||||||
|
createdAt: string;
|
||||||
|
deletedAt: string | null;
|
||||||
|
value: string;
|
||||||
|
field: string;
|
||||||
|
order: number | null;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Field inside request detail item attribute */
|
||||||
|
export type RequestDetailFieldType = {
|
||||||
|
id: string;
|
||||||
|
createdAt: string;
|
||||||
|
deletedAt: string | null;
|
||||||
|
entityType: string;
|
||||||
|
entityId: string;
|
||||||
|
name: string;
|
||||||
|
type: string;
|
||||||
|
isRequired: boolean;
|
||||||
|
multiple: boolean;
|
||||||
|
order: number;
|
||||||
|
options: RequestDetailFieldOptionType[];
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Attribute in request detail item */
|
||||||
|
export type RequestDetailItemAttributeType = {
|
||||||
|
value: string;
|
||||||
|
fieldId: string;
|
||||||
|
field: RequestDetailFieldType;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Product in request detail (category is id string, linkUrl can be null) */
|
||||||
|
export type RequestDetailProductType = Omit<
|
||||||
|
ProductType,
|
||||||
|
"category" | "linkUrl"
|
||||||
|
> & {
|
||||||
|
category: string;
|
||||||
|
linkUrl: string | null;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Item in request detail response */
|
||||||
|
export type RequestDetailItemType = {
|
||||||
|
id: string;
|
||||||
|
createdAt: string;
|
||||||
|
deletedAt: string | null;
|
||||||
|
product: RequestDetailProductType;
|
||||||
|
attributes: RequestDetailItemAttributeType[];
|
||||||
|
request: string;
|
||||||
|
quantity: number;
|
||||||
|
description: string;
|
||||||
|
attachments: AttachmentsType[];
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Request detail (single request by id) */
|
||||||
|
export type RequestDetailType = {
|
||||||
|
id: string;
|
||||||
|
createdAt: string;
|
||||||
|
deletedAt: string | null;
|
||||||
|
user: RequestDetailUserType;
|
||||||
|
requestNumber: number;
|
||||||
|
status: string;
|
||||||
|
items: RequestDetailItemType[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type RequestDetailResponseType = BaseResponse<RequestDetailType>;
|
||||||
|
|
||||||
export type AddTicketType = {
|
export type AddTicketType = {
|
||||||
content: string;
|
content: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user