Commit dadbd1d8 authored by Neosoulink's avatar Neosoulink
Browse files

feat: add queries to get warehouse products

parent d41b6f01
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -120,3 +120,12 @@ export interface ProductsQueryArgsInterface {
	options?: MaybeType<GetGeoLocationProductsOptions>;
	geoLocation: GeoLocationInputInterface;
}

export interface ProductQueryArgsInterface {
	productId: ScalarsInterface['String'];
}

export interface QueryGetWarehouseProductArgs {
	warehouseId: ScalarsInterface['String'];
	warehouseProductId: ScalarsInterface['String'];
}
+89 −0
Original line number Diff line number Diff line
@@ -38,6 +38,95 @@ export const PRODUCTS_QUERY: TypedDocumentNode = gql`
	}
`;

export const PRODUCT_QUERY: TypedDocumentNode = gql`
	query ProductQuery($productId: String!) {
		product(id: $productId) {
			_id
			id
			title {
				value
				locale
			}
			description {
				locale
				value
			}
			details {
				locale
				value
			}
			images {
				locale
				url
				width
				height
				orientation
			}
			categories
			_createdAt
			_updatedAt
		}
	}
`;

export const WAREHOUSE_PRODUCT_QUERY: TypedDocumentNode = gql`
	query GetWarehouseProduct(
		$warehouseId: String!
		$warehouseProductId: String!
	) {
		getWarehouseProduct(
			warehouseId: $warehouseId
			warehouseProductId: $warehouseProductId
		) {
			_id
			price
			initialPrice
			count
			soldCount
			product {
				_id
				id
				title {
					locale
					value
				}
				description {
					locale
					value
				}
				details {
					locale
					value
				}
				images {
					locale
					url
					width
					height
					orientation
				}
				categories
				_createdAt
				_updatedAt
			}
			isManufacturing
			isCarrierRequired
			isDeliveryRequired
			isProductAvailable
			isTakeaway
			deliveryTimeMin
			deliveryTimeMax
			id
		}

		warehouse(id: $warehouseId) {
			name
			logo
			id
		}
	}
`;

export const GEO_LOCATION_PRODUCTS_BY_PAGING = gql`
	query GeoLocationProductsByPaging(
		$geoLocation: GeoLocationFindInput!