P5 7619 refactor products to return list (#11)

This commit is contained in:
Niklas Fondberg
2021-08-20 08:16:01 +02:00
committed by GitHub
parent 234996abfd
commit 964a904f42
15 changed files with 235 additions and 92 deletions
+7
View File
@@ -1,3 +1,10 @@
import { PaginationResult } from './types';
export interface OrdersResult {
pagination: PaginationResult;
items: Array<Order> | Promise<Array<Order>>;
}
export interface Address {
id: number;
firstname: string;
+16
View File
@@ -1,3 +1,19 @@
import { PaginationInput, PaginationResult } from './types';
export interface ProductsFilterInput {
pagination: PaginationInput;
filter?: ProductsFilter;
}
export interface ProductsFilter {
visible?: boolean;
browsable?: boolean;
}
export interface ProductListResult {
pagination: PaginationResult;
items: Array<Product> | Promise<Array<Product>>;
}
export enum ProductGroup {
PHOTO_WALLPAPER = 1,
CANVAS = 2,
+15 -5
View File
@@ -1,16 +1,26 @@
export type Maybe<T> = T | undefined;
export interface PaginationInput {
limit: number;
offset?: number;
}
export interface DateInput {
from: Date;
to: Date;
}
export interface GeneralInput {
export interface DateFilterInput {
dates: DateInput;
limit: number;
offset: number;
}
export interface FilterInput {
filter: GeneralInput;
export interface GeneralInput {
pagination: PaginationInput;
filter?: DateFilterInput;
}
export interface PaginationResult {
total: Promise<number> | number;
offset: number;
limit: number;
}