Skip to content

Commit

Permalink
feat(core): Create entities & fields needed for stock control
Browse files Browse the repository at this point in the history
Relates to #81. No logic is implemented yet.
  • Loading branch information
michaelbromley committed May 2, 2019
1 parent 1a7dc05 commit aace38f
Show file tree
Hide file tree
Showing 20 changed files with 6,281 additions and 5,124 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0-alpha.17",
"private": true,
"scripts": {
"core:watch": "concurrently -n tsc,gulp \"cd packages/core && yarn tsc:watch\" \"cd packages/core && yarn gulp:watch\"",
"core:watch": "concurrently -n tsc,gulp,common \"cd packages/core && yarn tsc:watch\" \"cd packages/core && yarn gulp:watch\" \"cd packages/common && yarn watch\"",
"bootstrap": "lerna bootstrap",
"docs:watch": "concurrently -n docgen,hugo,webpack -c green,blue,cyan \"yarn generate-graphql-docs && yarn generate-typescript-docs -w\" \"cd docs && hugo server\" \"cd docs && yarn webpack -w\"",
"docs:build": "yarn generate-graphql-docs && yarn generate-typescript-docs && cd docs && yarn webpack --prod && node build.js && hugo",
Expand Down
81 changes: 80 additions & 1 deletion packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// tslint:disable
// Generated in 2019-04-25T20:45:59+02:00
// Generated in 2019-05-02T11:33:31+02:00
export type Maybe<T> = T | null;

export interface OrderListOptions {
Expand Down Expand Up @@ -768,6 +768,13 @@ export enum Permission {
DeleteSettings = 'DeleteSettings',
}

export enum StockMovementType {
ADJUSTMENT = 'ADJUSTMENT',
SALE = 'SALE',
CANCELLATION = 'CANCELLATION',
RETURN = 'RETURN',
}

export enum DeletionResult {
DELETED = 'DELETED',
NOT_DELETED = 'NOT_DELETED',
Expand Down Expand Up @@ -1675,6 +1682,22 @@ export interface AssetList extends PaginatedList {
totalItems: number;
}

export interface Cancellation extends Node {
id: string;

createdAt: DateTime;

updatedAt: DateTime;

productVariant: ProductVariant;

type: StockMovementType;

quantity: number;

orderLine: OrderLine;
}

export interface CountryList extends PaginatedList {
items: Country[];

Expand Down Expand Up @@ -1708,6 +1731,8 @@ export interface GlobalSettings {

availableLanguages: LanguageCode[];

trackInventory: boolean;

serverConfig: ServerConfig;

customFields?: Maybe<Json>;
Expand Down Expand Up @@ -1761,12 +1786,44 @@ export interface PromotionList extends PaginatedList {
totalItems: number;
}

export interface Return extends Node {
id: string;

createdAt: DateTime;

updatedAt: DateTime;

productVariant: ProductVariant;

type: StockMovementType;

quantity: number;

orderItem: OrderItem;
}

export interface RoleList extends PaginatedList {
items: Role[];

totalItems: number;
}

export interface Sale extends Node {
id: string;

createdAt: DateTime;

updatedAt: DateTime;

productVariant: ProductVariant;

type: StockMovementType;

quantity: number;

orderLine: OrderLine;
}

export interface SearchReindexResponse {
success: boolean;

Expand All @@ -1781,6 +1838,26 @@ export interface ShippingMethodList extends PaginatedList {
totalItems: number;
}

export interface StockAdjustment extends Node {
id: string;

createdAt: DateTime;

updatedAt: DateTime;

productVariant: ProductVariant;

type: StockMovementType;

quantity: number;
}

export interface StockMovementList {
items: StockMovement[];

totalItems: number;
}

export interface TaxRateList extends PaginatedList {
items: TaxRate[];

Expand Down Expand Up @@ -1912,3 +1989,5 @@ export interface ResetPasswordMutationArgs {

/** The price of a search result product, either as a range or as a single price */
export type SearchResultPrice = PriceRange | SinglePrice;

export type StockMovement = StockAdjustment | Sale | Cancellation | Return;
Loading

0 comments on commit aace38f

Please sign in to comment.