Drupal 8: Commerce cart expiration

I need your help to achieve below function.

We are using Commerce module in Drupal 8. I am told to configure timeout for the cart.

A user’s cart will be clear after 60 min of adding the item to the cart. Items will be removed individually as per the add time.

Would you please advise me how to configure this rule? I found there is a module called https://www.drupal.org/project/commerce_cart_expiration but it’s not available for D8.

Can you guide me how this can be achieved?

Thanks – Hitesh

Travel before start of an Italian long-term (Type D) visa and the 90/180 rule following its expiration

Ok, I wrote a very lengthy question about being able to stay as a tourist in Italy (I am American) following the expiration of my Italian long-term (type D) student visa. After some searching, I found Article 6 Entry conditions for third country nationals Point 2 of the Schengen Borders Code and deleted the original question. The relevant text from the code is as follows:

…the date of entry shall be considered as the first day of stay on the territory of the Member States and the date of exit shall be considered as the last day of stay on the territory of the Member States. Periods of stay authorised under a residence permit or a long-stay visa shall not be taken into account in the calculation of the duration of stay on the territory of the Member States.

Great. If I’ve just finished a long-stay visa, those days don’t count in calculating the 90 days I have in the 90/180 rule for tourism.

However, the question I have is now this:

Even though I have been on a long-term Type D visa in Italy for longer than 180 days, does any time I spent in Italy as a tourist before the visa started count?

I know this might seem like a ridiculous question, but I spent slightly less than 90 days in Italy as a tourist before my long-term visa started and if these days did count, it would significantly reduce the amount of time I could stay in Italy as a tourist after my visa expires.

I’m asking because “shall not be taken into account” can be interpreted in slightly different ways: 1) as if they don’t count at all in the 90 days of the 90/180 day rule and I’m good to go or 2) as if the entire period of your visa didn’t exist at all and you need to factor in any time you spent in the Schengen Zone the day before your visa started. Does anyone have any idea about this?

This is just a side note, but I did make sure to exit the Schengen Zone and re-enter on the start-date of my visa, so I have a stamp with the visa’s start-date.

Thanks for any information!

Representing asset expiration and rating in a single dashboard

We’re presently going through introducing a new concept into an existing customer facing dashboard. At present customers are used to navigating their assets by using a site-wide “rating”. This is safety based and represented using Red/Orange/Green traffic light colours.

The new requirement is to also surface asset expiration in the same screen. There’s a few different schools of thought internally on how’s best to do this.

Existing

Our Existing UI showing simply the safety of the assets on a user account. As is quite clear the separate bins add up to the total. They provide navigation to the asset management page pre-filtered to the safety level clicked.

Contributing to totals The first suggestion internally is to have an extra row supplementing our pre-existing safety categorisation showing the same safety figures, but adjusted for expiration. These new figures are not just the numbers of safe/warning/dangerous assets that are now expired. The new red section is an amalgamation of both Dangerous & Expired. The new orange section is an amalgamation of Warning & Expiring. The new green section being all Safe assets less those that are expired or expiring. The further 2 new boxes representing the expiring assets without any reference to their safety rating.

Separate Concerns Keep the 2 facets to an asset as separate figures and allow diving into either of them separately without any combined figures.

Hybrid Display both facets to an asset as equal but separate concerns but make clear the assets that are problematic because of safety of expiration.

There is a strong internal desire to provide a “quick view” of assets that have problems. Though I’m very conscious of the fact that existing users will have a learning curve and potentially different figures than they’re used to. I’ve intentionally kept mine and the product team’s opinions out of this post in the interest of a fair representation of all ideas.

Find the next expiration date

Say I have an agreement with a customer. When the agreement ends, the customer needs to pay. The amount which the customer needs to pay, increases for each month that has passed, since the agreement was initiated. The maximum duration is 3 years, so I have a final expiration date. From this final expiration date, I must be able to find the periodic expiration date (the date, where the payment increases). In other words, I need a functions which does this:

DateTime GetNextExpirationDate(finalExpirationDate) 

One of the issues, which I am struggling with is that the algorithm needs to consider whether the expiration date in the current month, has already passed (there will be a date each month). It also needs to consider that the day of the month for the final expiration date, might not exist for the periodic expiration dates (e.g. if the final expiration date is the 31st of something).

I have some code which is working, but it appears somewhat redundant and with many steps. I was wondering, if perhaps it could be simplified (either a little or a lot).

Actual code:

public DateTime GetNextExpirationDate(DateTime finalExpirationDate) {     int expirationDay = finalExpirationDate.Day;     int currentMonth = DateTime.Now.Month;     int currentYear = DateTime.Now.Year;     int daysInCurrentMonth = DateTime.DaysInMonth(currentYear, currentMonth);      // If the month has less days that the day of the final expiration date,     // then we need to use the maximum date of the month.     int expirationDayThisMonth = Math.Min(expirationDay, daysInCurrentMonth);      DateTime expirationDateThisMonth = new DateTime(currentYear, currentMonth, expirationDayThisMonth);      // If the periodic expiration date in the current month is already surpassed,     // then we need to the date in the next month.     if (expirationDateThisMonth < DateTime.Now)     {         DateTime dateInOneMonth = DateTime.Now.AddMonths(1);         int nextMonthMonth = dateInOneMonth.Month;         int nextMonthYear = dateInOneMonth.Year;         int daysInNextMonth = DateTime.DaysInMonth(nextMonthYear, nextMonthMonth);          int expirationDayNextMonth = Math.Min(expirationDay, daysInNextMonth);          DateTime expirationDateNextMonth = new DateTime(nextMonthYear, nextMonthMonth, expirationDayNextMonth);          return expirationDateNextMonth;     }     else     {         return expirationDateThisMonth;     }             } 

Any ways to improve this?

Input/output examples:

Final expiration date: 15.12.2019 DateTime.Now: 12.03.2019 Output: 15.03.2019  Final expiration date 11.10.2019 DateTime.Now: 16.04.2019 Output: 11.05.2019 

(I know that I cannot change DateTime.Now but it does work as an pseudo-input, which is why I included it).

How to apply for Schengen visa after expiration of residence permit?

I am a Philippine passport holder and currently residing in Hungary as a student. I have been issued a residence permit here in Hungary which is valid until June 30, 2019. I am planning to take a short (15 days) vacation with my family, who are coming over from the Philippines, after finishing my studies by June 2019 and would like to visit other Schengen countries by July. In sum, I just wanted to extend my stay here in Europe for a couple of days, for tourism purposes, after the expiration of my residence permit.

Is it possible for a third country national to apply for a Schengen visa (Visa C since less than 90 days) while currently holding a residence permit issued by Hungary?

I tried contacting the Austrian Embassy in Bratislava that processes Schengen visa applications since Vienna is my planned point of entry and where we intended to stay the longest. However, I got confused with one of the requirements mentioned on their website,as written below:

“Original and copy of Schengen-Residence permit or long term national visa issued by Schengen member state: The current residence permit, issued from the country you are staying, needs to be at least 3 months valid, after your requested visa expires. If the applicant is planning to move to another country – other than the one the residence permit was issued before – please bring any kind of proof”

Since my residence permit in Hungary will expire by June 30,2019 and I can only lodge my application at the earliest three months before my intended date of travel which is June 30, 2019, my residence permit will no longer be valid for 3 months by the time I lodge my application which I intend to do around April 2019. So, it is impossible for me to meet this requirement. I sent an email to the Embassy to clarify and the response was that I cannot apply for a visa and there are no other option/s to apply for a Schengen visa.

I am totally confused since with respect to the abovementioned requirement, I need not apply for a Schengen visa anyway if my residence permit in Hungary would still be valid after June. I understand that should my residence permit still be effective, I can still freely enter other Schengen countries. Thus, if the requirement above is to have a residence permit that is valid for 3 months upon application of Schengen visa and the Visa C that I am applying for will only be valid also for 90 days, there is no point in actually applying for a Schengen visa.

Hope I was able to lay down the details clearly.

Would appreciate your suggestions on this especially those who experienced the same dilemma. Thank you so much in advance!

Is there an expiration date to free invokes of aspects?

I have been looking through FATE book and i couldn’t find something regarding when the free invoke of an aspect would expire which felt rather broken to me as i could carry several throwing daggers with me and i could add ‘Sharpened’ aspect and get +2 to my roll with each of my dagger throws.

What i wish to ask is that is there anything that might prevent me from doing so?

Given n drinks, find optimum way to spend money if for each drink the price and the expiration date is given

Let’s say we are given $ n$ types of drinks, integer $ m$ representing the budget we have and integer $ d$ representing the cost of delivery when we order some drinks. For each of the $ n$ drinks we are given $ P_i \text{ the price of i-th drink and } E_i – \text{expire date}$ . For example $ (3, 2)$ is representing drink with price $ 3$ for one bottle and the second number means that this drink can be used at most $ 2$ days after we buy it.

We can order as many drinks as we want from each type, but each time we order we are paying $ d$ dollars for delivery. Notice that the delivery doesn’t matter in the day, so we can buy drink with exprite date $ 2$ and used it either today, tomorrow, or the day after tomorrow.

I think that this problem can be solved with greedy strategy, but I’m not able to find anything that can lead to correct result and good time complexity.

Here are some things that I got so far:

We don’t want to buy things that will be expired, so from each drink with price $ P_i$ we will spend at most $ P_i \cdot(E_i + 1)$

Because we may have big budget, it is good to find one way of buying drinks and use it couple times, until we don’t run out of money from the budget.

We will first buy the cheaper drinks and for the more expensive ones we should decide should we make a new order, or buy some drinks from the next type.

I didn’t got anything that lead to correct strategy, so please share some of your ideas.