What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

How do people deal, in general, with inconsistent data in Yves?

13Β»

Comments

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Posts: 113 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    @UKGT7RC7P let’s take PDP as an example. if the price is a mandatory filed for showing a PDP, in ProductStorageClient, you can introduce the validation check and throw 404 exception, you don’t need to check all template/pages

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    sure -- but overriding the storage client isn't a very nice thing to do

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    and there is no built-in way of ensuring consistent data

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    whatever your buseiness rules might be

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    in the end you just have an unstructured array from storage (or NULL)

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Posts: 113 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    StorageClient must return transfer-object not array

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Posts: 113 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    \Spryker\Client\ProductStorage\Finder\AbstractProductViewTransferFinder::findProductViewTransfer()

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    my mistake, but that in turn has no validation rules πŸ™‚

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Posts: 113 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020
        /**
         * @param int $idProduct
         * @param string $localeName
         * @param array $selectedAttributes
         *
         * @return \Generated\Shared\Transfer\ProductViewTransfer|null
         */
        public function findProductViewTransfer(int $idProduct, string $localeName, array $selectedAttributes = []): ?ProductViewTransfer
    
  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    a product view transfer doesn't mean a valid product view transfer as everything is nullable (which is a general problem with TOs in Spryker - none of them can be guaranteed to be valid at any given point in time but they are used in a way where they are expected to be valid)

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    and problems happen in the expanders

  • Ehsan Zanjani
    Ehsan Zanjani Head of Solution Architecture @ Spryker Posts: 113 πŸ§‘πŸ»β€πŸš€ - Cadet

    if expander fails with null or missing index in array, this is a bug and we need to fix it

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    (I think I was thinking of the Search / Catalog data when I mentioned the raw arrays)