Skip to content

Commit

Permalink
First draft of multivendor data model for Orders
Browse files Browse the repository at this point in the history
Relates to #1329. This implements the "partial order" concept (renamed to VendorOrder). This commit
includes just the bare minimum data model changes and assignment flow.
  • Loading branch information
michaelbromley committed Jan 6, 2023
1 parent ec09e37 commit 6f970d4
Show file tree
Hide file tree
Showing 29 changed files with 14,744 additions and 9,376 deletions.
4,705 changes: 2,374 additions & 2,331 deletions packages/common/src/generated-shop-types.ts

Large diffs are not rendered by default.

94 changes: 94 additions & 0 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ export type Channel = Node & {
pricesIncludeTax: Scalars['Boolean'];
token: Scalars['String'];
updatedAt: Scalars['DateTime'];
vendor?: Maybe<Vendor>;
};

/**
Expand Down Expand Up @@ -661,6 +662,7 @@ export type CreateChannelInput = {
defaultTaxZoneId: Scalars['ID'];
pricesIncludeTax: Scalars['Boolean'];
token: Scalars['String'];
vendorId?: InputMaybe<Scalars['ID']>;
};

export type CreateChannelResult = Channel | LanguageNotAvailableError;
Expand Down Expand Up @@ -847,6 +849,10 @@ export type CreateTaxRateInput = {
zoneId: Scalars['ID'];
};

export type CreateVendorInput = {
name: Scalars['String'];
};

export type CreateZoneInput = {
customFields?: InputMaybe<Scalars['JSON']>;
memberIds?: InputMaybe<Array<Scalars['ID']>>;
Expand Down Expand Up @@ -2486,6 +2492,8 @@ export type Mutation = {
createTaxCategory: TaxCategory;
/** Create a new TaxRate */
createTaxRate: TaxRate;
/** Create a new Vendor */
createVendor: Vendor;
/** Create a new Zone */
createZone: Zone;
/** Delete an Administrator */
Expand Down Expand Up @@ -2541,6 +2549,8 @@ export type Mutation = {
deleteTaxCategory: DeletionResponse;
/** Delete a TaxRate */
deleteTaxRate: DeletionResponse;
/** Delete a Vendor */
deleteVendor: DeletionResponse;
/** Delete a Zone */
deleteZone: DeletionResponse;
flushBufferedJobs: Success;
Expand Down Expand Up @@ -2643,6 +2653,8 @@ export type Mutation = {
updateTaxCategory: TaxCategory;
/** Update an existing TaxRate */
updateTaxRate: TaxRate;
/** Update an existing Vendor */
updateVendor: Vendor;
/** Update an existing Zone */
updateZone: Zone;
};
Expand Down Expand Up @@ -2868,6 +2880,11 @@ export type MutationCreateTaxRateArgs = {
};


export type MutationCreateVendorArgs = {
input: CreateVendorInput;
};


export type MutationCreateZoneArgs = {
input: CreateZoneInput;
};
Expand Down Expand Up @@ -3017,6 +3034,11 @@ export type MutationDeleteTaxRateArgs = {
};


export type MutationDeleteVendorArgs = {
id: Scalars['ID'];
};


export type MutationDeleteZoneArgs = {
id: Scalars['ID'];
};
Expand Down Expand Up @@ -3309,6 +3331,11 @@ export type MutationUpdateTaxRateArgs = {
};


export type MutationUpdateVendorArgs = {
input: UpdateVendorInput;
};


export type MutationUpdateZoneArgs = {
input: UpdateZoneInput;
};
Expand Down Expand Up @@ -3874,6 +3901,8 @@ export enum Permission {
CreateTaxCategory = 'CreateTaxCategory',
/** Grants permission to create TaxRate */
CreateTaxRate = 'CreateTaxRate',
/** Grants permission to create Vendor */
CreateVendor = 'CreateVendor',
/** Grants permission to create Zone */
CreateZone = 'CreateZone',
/** Grants permission to delete Administrator */
Expand Down Expand Up @@ -3914,6 +3943,8 @@ export enum Permission {
DeleteTaxCategory = 'DeleteTaxCategory',
/** Grants permission to delete TaxRate */
DeleteTaxRate = 'DeleteTaxRate',
/** Grants permission to delete Vendor */
DeleteVendor = 'DeleteVendor',
/** Grants permission to delete Zone */
DeleteZone = 'DeleteZone',
/** Owner means the user owns this entity, e.g. a Customer's own Order */
Expand Down Expand Up @@ -3958,6 +3989,8 @@ export enum Permission {
ReadTaxCategory = 'ReadTaxCategory',
/** Grants permission to read TaxRate */
ReadTaxRate = 'ReadTaxRate',
/** Grants permission to read Vendor */
ReadVendor = 'ReadVendor',
/** Grants permission to read Zone */
ReadZone = 'ReadZone',
/** SuperAdmin has unrestricted access to all operations */
Expand Down Expand Up @@ -4002,6 +4035,8 @@ export enum Permission {
UpdateTaxCategory = 'UpdateTaxCategory',
/** Grants permission to update TaxRate */
UpdateTaxRate = 'UpdateTaxRate',
/** Grants permission to update Vendor */
UpdateVendor = 'UpdateVendor',
/** Grants permission to update Zone */
UpdateZone = 'UpdateZone'
}
Expand Down Expand Up @@ -4426,6 +4461,8 @@ export type Query = {
taxRates: TaxRateList;
testEligibleShippingMethods: Array<ShippingMethodQuote>;
testShippingMethod: TestShippingMethodResult;
vendor?: Maybe<Vendor>;
vendors: VendorList;
zone?: Maybe<Zone>;
zones: Array<Zone>;
};
Expand Down Expand Up @@ -4665,6 +4702,16 @@ export type QueryTestShippingMethodArgs = {
};


export type QueryVendorArgs = {
id: Scalars['ID'];
};


export type QueryVendorsArgs = {
options?: InputMaybe<VendorListOptions>;
};


export type QueryZoneArgs = {
id: Scalars['ID'];
};
Expand Down Expand Up @@ -5372,6 +5419,7 @@ export type UpdateChannelInput = {
id: Scalars['ID'];
pricesIncludeTax?: InputMaybe<Scalars['Boolean']>;
token?: InputMaybe<Scalars['String']>;
vendorId?: InputMaybe<Scalars['ID']>;
};

export type UpdateChannelResult = Channel | LanguageNotAvailableError;
Expand Down Expand Up @@ -5585,6 +5633,11 @@ export type UpdateTaxRateInput = {
zoneId?: InputMaybe<Scalars['ID']>;
};

export type UpdateVendorInput = {
id: Scalars['ID'];
name?: InputMaybe<Scalars['String']>;
};

export type UpdateZoneInput = {
customFields?: InputMaybe<Scalars['JSON']>;
id: Scalars['ID'];
Expand All @@ -5604,6 +5657,47 @@ export type User = Node & {
verified: Scalars['Boolean'];
};

export type Vendor = Node & {
__typename?: 'Vendor';
createdAt: Scalars['DateTime'];
id: Scalars['ID'];
name: Scalars['String'];
updatedAt: Scalars['DateTime'];
};

export type VendorFilterParameter = {
createdAt?: InputMaybe<DateOperators>;
id?: InputMaybe<IdOperators>;
name?: InputMaybe<StringOperators>;
updatedAt?: InputMaybe<DateOperators>;
};

export type VendorList = PaginatedList & {
__typename?: 'VendorList';
items: Array<Vendor>;
totalItems: Scalars['Int'];
};

export type VendorListOptions = {
/** Allows the results to be filtered */
filter?: InputMaybe<VendorFilterParameter>;
/** Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. */
filterOperator?: InputMaybe<LogicalOperator>;
/** Skips the first n results, for use in pagination */
skip?: InputMaybe<Scalars['Int']>;
/** Specifies which properties to sort the results by */
sort?: InputMaybe<VendorSortParameter>;
/** Takes n results, for use in pagination */
take?: InputMaybe<Scalars['Int']>;
};

export type VendorSortParameter = {
createdAt?: InputMaybe<SortOrder>;
id?: InputMaybe<SortOrder>;
name?: InputMaybe<SortOrder>;
updatedAt?: InputMaybe<SortOrder>;
};

export type Zone = Node & {
__typename?: 'Zone';
createdAt: Scalars['DateTime'];
Expand Down
Loading

0 comments on commit 6f970d4

Please sign in to comment.