Former employees of Tesla  have filed a lawsuit against the US electric car company over its alleged decision to carry out a “mass layoff” violated federal law as the company did not provide advance notice of the job cuts.

It is reported that the lawsuit was filed on late Sunday in Texas by two workers who said they were terminated from Tesla’s gigafactory plant in Sparks, Nevada in June. According to the suit, more than 500 employees were terminated at the Nevada factory.

Also read: Elon Musk meets Twitter employees, 5 things Tesla CEO discussed during interaction

The workers allegedly said that Tesla failed to adhere to federal laws on mass layoffs that require a 60-day notification period under the Worker Adjustment and Retraining Notification Act, according to the lawsuit.

The former Tesla workers are now seeking class action status for all employees throughout the United States who were laid off in May or June without advance notice.

Also read: Elon Musk meets Twitter staff: Aliens, ads discussed but no update on deal

“Tesla has simply notified the employees that their terminations would be effective immediately,” the complaint said.

Tesla, which has not commented on numbers of layoffs, did not immediately respond to requests for comment about the lawsuit.

Earlier, Tesla CEo and SpaceX chief said that this month he had a “super bad feeling” about the economy and that Tesla needed to cut staff by about 10%.

Also read: US records nearly 400 crashes of automated tech vehicles, including 273 Teslas

More than 20 people identifying themselves as Tesla employees said they were laid off, let go or had positions terminated this month. The action filed by John Lynch and Daxton Hartsfield, who were fired on June 10 and June 15 respectively, seeks pay and benefits for the 60-day notification period.

“It’s pretty shocking that Tesla would just blatantly violate federal labor law by laying off so many workers without providing the required notice,” Shannon Liss-Riordan, an attorney representing the workers told Reuters.

Also read: ‘Psychedelics and MDMA’: Musk’s solution to the US mental health crisis

She said Tesla is offering some employees only one week of severance, adding that she is preparing an emergency motion with a court to try to block Tesla from trying to get releases from employees in exchange for just one week of severance.

The suit was filed in the US District Court, Western District of Texas.