saleor-dashboard/src/channels/fixtures.ts
Jonatan Witoszek 13ca6bbba8
Remove transactions feature flag (#3557)
* Update schema, remove transaction specific files

* Merge `.transaction` queries and mutations into regular files

* Merge OrderDetails fragments

* Remove usage of `.transaction` graphl types

* Update fixtures

* Remove usage of useFlag, remove duplicated queries & mutations

* Fix displayed event type for INFO

* Remove type alias from order/types.ts, remove type casting

* Fix failing tests

* Add preview label and better description in Channel settings

* Update button in GrantRefund page

* Fix missing data-test-id

* Extract messages

* Visual fixes

* Revert changes to generated files

* Revert changes to generated files

* Fix psp reference hover

* Fix colors on manu refunds screen

* Revert "Fix colors on manu refunds screen"

This reverts commit 02302930ab502a4fdc3c71558532a2d74f2e32c9.

---------

Co-authored-by: andrzejewsky <vox3r69@gmail.com>
Co-authored-by: Michal Miszczyszyn <michal@mmiszy.pl>
2023-04-28 13:24:10 +02:00

421 lines
8.8 KiB
TypeScript

import {
AllocationStrategyEnum,
ChannelDetailsFragment,
ChannelErrorCode,
ChannelErrorFragment,
MarkAsPaidStrategyEnum,
ProductFragment,
} from "@dashboard/graphql";
import { Money } from "@saleor/sdk/dist/apollo/types";
export const channelCreateErrors: ChannelErrorFragment[] = [
{
__typename: "ChannelError",
code: ChannelErrorCode.UNIQUE,
field: "slug",
message: "Channel with this Slug already exists.",
},
];
export const channelsList: ChannelDetailsFragment[] = [
{
__typename: "Channel",
currencyCode: "EUR",
hasOrders: false,
id: "Q2hhbm5lcDoy",
isActive: true,
name: "Test",
slug: "test",
defaultCountry: {
code: "PL",
country: "Poland",
__typename: "CountryDisplay",
},
stockSettings: {
__typename: "StockSettings",
allocationStrategy: AllocationStrategyEnum.PRIORITIZE_HIGH_STOCK,
},
warehouses: [
{
__typename: "Warehouse",
id: "WH1",
name: "Warehouse 1",
},
{
__typename: "Warehouse",
id: "WH2",
name: "Warehouse 2",
},
],
orderSettings: {
markAsPaidStrategy: MarkAsPaidStrategyEnum.TRANSACTION_FLOW,
__typename: "OrderSettings",
},
},
{
__typename: "Channel",
currencyCode: "EUR",
hasOrders: false,
id: "Q2hhbm7lbDoy213",
isActive: true,
name: "Channel",
slug: "channel",
defaultCountry: {
code: "PL",
country: "Poland",
__typename: "CountryDisplay",
},
stockSettings: {
__typename: "StockSettings",
allocationStrategy: AllocationStrategyEnum.PRIORITIZE_HIGH_STOCK,
},
warehouses: [
{
__typename: "Warehouse",
id: "WH1",
name: "Warehouse 1",
},
{
__typename: "Warehouse",
id: "WH2",
name: "Warehouse 2",
},
],
orderSettings: {
markAsPaidStrategy: MarkAsPaidStrategyEnum.TRANSACTION_FLOW,
__typename: "OrderSettings",
},
},
{
__typename: "Channel",
currencyCode: "EUR",
hasOrders: false,
id: "Q2hhbn5lbDoytr",
isActive: true,
name: "Channel test",
slug: "channeltest",
defaultCountry: {
code: "PL",
country: "Poland",
__typename: "CountryDisplay",
},
stockSettings: {
__typename: "StockSettings",
allocationStrategy: AllocationStrategyEnum.PRIORITIZE_HIGH_STOCK,
},
warehouses: [
{
__typename: "Warehouse",
id: "WH1",
name: "Warehouse 1",
},
{
__typename: "Warehouse",
id: "WH2",
name: "Warehouse 2",
},
],
orderSettings: {
markAsPaidStrategy: MarkAsPaidStrategyEnum.TRANSACTION_FLOW,
__typename: "OrderSettings",
},
},
{
__typename: "Channel",
currencyCode: "EUR",
hasOrders: false,
id: "Q2hhbm5lbDo5bot",
isActive: true,
name: "Channel USD",
slug: "channel-usd",
defaultCountry: {
code: "PL",
country: "Poland",
__typename: "CountryDisplay",
},
stockSettings: {
__typename: "StockSettings",
allocationStrategy: AllocationStrategyEnum.PRIORITIZE_HIGH_STOCK,
},
warehouses: [
{
__typename: "Warehouse",
id: "WH1",
name: "Warehouse 1",
},
{
__typename: "Warehouse",
id: "WH2",
name: "Warehouse 2",
},
],
orderSettings: {
markAsPaidStrategy: MarkAsPaidStrategyEnum.TRANSACTION_FLOW,
__typename: "OrderSettings",
},
},
{
__typename: "Channel",
currencyCode: "EUR",
hasOrders: false,
id: "Q2hhbm7lbDoyr0tr",
isActive: true,
name: "Channel",
slug: "channel2",
defaultCountry: {
code: "PL",
country: "Poland",
__typename: "CountryDisplay",
},
stockSettings: {
__typename: "StockSettings",
allocationStrategy: AllocationStrategyEnum.PRIORITIZE_HIGH_STOCK,
},
warehouses: [
{
__typename: "Warehouse",
id: "WH1",
name: "Warehouse 1",
},
{
__typename: "Warehouse",
id: "WH2",
name: "Warehouse 2",
},
],
orderSettings: {
markAsPaidStrategy: MarkAsPaidStrategyEnum.TRANSACTION_FLOW,
__typename: "OrderSettings",
},
},
{
__typename: "Channel",
currencyCode: "EUR",
hasOrders: false,
id: "Q2hhbn5lbDoyya",
isActive: true,
name: "Channel test",
slug: "channeltest4",
defaultCountry: {
code: "PL",
country: "Poland",
__typename: "CountryDisplay",
},
stockSettings: {
__typename: "StockSettings",
allocationStrategy: AllocationStrategyEnum.PRIORITIZE_HIGH_STOCK,
},
warehouses: [
{
__typename: "Warehouse",
id: "WH1",
name: "Warehouse 1",
},
{
__typename: "Warehouse",
id: "WH2",
name: "Warehouse 2",
},
],
orderSettings: {
markAsPaidStrategy: MarkAsPaidStrategyEnum.TRANSACTION_FLOW,
__typename: "OrderSettings",
},
},
{
__typename: "Channel",
currencyCode: "EUR",
hasOrders: false,
id: "Q2hhbm5lbDo5w0z",
isActive: true,
name: "Channel USD",
slug: "channel-usd1",
defaultCountry: {
code: "PL",
country: "Poland",
__typename: "CountryDisplay",
},
stockSettings: {
__typename: "StockSettings",
allocationStrategy: AllocationStrategyEnum.PRIORITIZE_HIGH_STOCK,
},
warehouses: [
{
__typename: "Warehouse",
id: "WH1",
name: "Warehouse 1",
},
{
__typename: "Warehouse",
id: "WH2",
name: "Warehouse 2",
},
],
orderSettings: {
markAsPaidStrategy: MarkAsPaidStrategyEnum.TRANSACTION_FLOW,
__typename: "OrderSettings",
},
},
];
export const channel: ChannelDetailsFragment = {
__typename: "Channel",
currencyCode: "zl",
hasOrders: false,
id: "Q2hhbm5lbDov78",
isActive: true,
name: "Test",
slug: "test",
defaultCountry: {
code: "PL",
country: "Poland",
__typename: "CountryDisplay",
},
stockSettings: {
__typename: "StockSettings",
allocationStrategy: AllocationStrategyEnum.PRIORITIZE_HIGH_STOCK,
},
warehouses: [
{
__typename: "Warehouse",
id: "WH1",
name: "Warehouse 1",
},
{
__typename: "Warehouse",
id: "WH2",
name: "Warehouse 2",
},
],
orderSettings: {
markAsPaidStrategy: MarkAsPaidStrategyEnum.TRANSACTION_FLOW,
__typename: "OrderSettings",
},
};
type ProductChannelsWithPricing = ProductFragment["channelListings"][0] & {
pricing: {
priceRange: {
start: {
net: Money;
};
stop: {
net: Money;
};
};
};
};
export const productChannels: ProductChannelsWithPricing[] = [
{
__typename: "ProductChannelListing",
availableForPurchase: null,
channel: {
__typename: "Channel",
currencyCode: "USD",
id: "123",
name: "Channel1",
},
isAvailableForPurchase: false,
isPublished: true,
pricing: {
priceRange: {
start: {
net: {
amount: 1.2,
currency: "USD",
},
},
stop: {
net: {
amount: 3.5,
currency: "USD",
},
},
},
},
publicationDate: "2020-07-14",
visibleInListings: true,
},
{
__typename: "ProductChannelListing",
availableForPurchase: null,
channel: {
__typename: "Channel",
currencyCode: "USD",
id: "124",
name: "Channel2",
},
isAvailableForPurchase: false,
isPublished: false,
pricing: {
priceRange: {
start: {
net: {
amount: 2.2,
currency: "USD",
},
},
stop: {
net: {
amount: 7.1,
currency: "USD",
},
},
},
},
publicationDate: "2020-07-30",
visibleInListings: true,
},
{
__typename: "ProductChannelListing",
availableForPurchase: null,
channel: {
__typename: "Channel",
currencyCode: "USD",
id: "125",
name: "Channel3",
},
isAvailableForPurchase: false,
isPublished: false,
pricing: {
priceRange: {
start: {
net: {
amount: 30.1,
currency: "USD",
},
},
stop: {
net: {
amount: 44.9,
currency: "USD",
},
},
},
},
publicationDate: null,
visibleInListings: true,
},
];
export const productPriceChannels = [
{
costPrice: "5",
id: "123",
name: "Channel1",
sellingPrice: "10",
},
{
costPrice: "15",
id: "124",
name: "Channel2",
sellingPrice: "20",
},
{
costPrice: "15",
id: "125",
name: "Channel3",
sellingPrice: "100",
},
];