This post has been updated.

Among the scrum slugging it out over employee classification rules in California – a group that includes billion-dollar companies, powerful state lawmakers and the state’s highest court – there’s another, lesser known figure: San Diego City Attorney Mara Elliott.

Last year, Elliott’s office sued Instacart, an app that allows shoppers to purchase groceries online and have them delivered to their home, arguing it illegally classifies its delivery drivers as independent contractors in violation of a state Supreme Court ruling.

The lawsuit puts the city attorney in uncharted legal territory that’s sure to be complicated by competing lawsuits, new legislation and a potential November ballot measure over employee classification.

That state’s Supreme Court ruling, known as Dynamex, laid out a three-part “ABC” test to determine whether a company should make a worker a part-time or full-time employee instead of a contractor.

Since the lawsuit was filed, a new state law went into effect codifying the ruling and carving out exceptions for certain industries. Individual companies, including Uber, as well as groups representing various groups of workers, have sued over the law.

The case is one “with some very, very cutting-edge legal issues involving a statute that is 33 days old … and one in which there’s no appellate guidance because of the newness of the issues,” San Diego Superior Court Judge Timothy Taylor said during a hearing in the case last week, according to a transcript.

It also marks the first time a government agency has taken on a gig economy company over worker misclassification, Leslie Wolf Branscomb, a spokeswoman for the city attorney’s office, wrote in an email.

Taylor dealt the city a blow last week when he denied a temporary restraining order that could have forced Instacart to suddenly stop operating as the case plays out. But the larger questions about the company’s business model have yet to be answered in court.

The city attorney’s office has provided a mountain of details it says shows that Instacart violates all three prongs of the ABC test. Instacart shoppers, which is what the company calls its delivery drivers, aren’t free from the direction or control of the company, the city attorney argues, they’re performing a core part of the company’s business and aren’t part of any established trade requiring specialized skills.

“Instead of a minimum wage, overtime pay, and health insurance, Instacart offers its shoppers free shirts and beanies for completing over 2,500 deliveries and discounted insurance at the shopper’s expense,” the suit says. “Through the misclassification, Instacart unlawfully burdens its shoppers with a substantial amount of its expenses and fails to pay its shoppers a lawful wage. This is fundamentally an unfair business practice.”

A spokeswoman for Elliott’s office noted the company’s slogan is “Groceries Delivered in Under an Hour.” “So there’s no way they can claim (under the B part of the ABC test) that the drivers aren’t part of the company’s core business. It’s abundantly clear that their business is shopping and delivery, which means Instacart can’t carry its burden under Dynamex. Instacart must comply with California law by changing how it classifies its employees,” Hilary Nemchik, a spokeswoman for Elliott, wrote in an email.

Instacart disagrees. Though the city attorney points out that an Instacart training video assures future shoppers, “You will be a crucial part of the Instacart team. Without our shoppers Instacart is just a website. With our shoppers, Instacart is a service and an experience. As a shopper, you will be the face of Instacart and the reason customers keep coming back.”

In a response, Instacart argues that it’s simply a “communications platform” that “facilitates same-day, on-demand grocery services.” (Uber has used a similar argument by suggesting that Dynamex and AB 5 do not apply to its drivers because they’re not a core part of its business.)

In response to the claim it exerts control over its shoppers, the company argues they cherish the flexibility the work allows. It also offers technical and procedural arguments to claim the San Diego city attorney doesn’t have standing to sue on behalf of California citizens, and that she’s trying to apply the wrong legal standards.

Then Instacart makes another argument about why the case should be tossed.

Instacart argues the city attorney’s lawsuit is moot because its shoppers signed arbitration agreements when they agreed to their gigs. Any individual grievance a shopper has about their employment classification, Instacart says, should be handled in arbitration – a private system that’s separate from the courts.

In arguing that its gig workers should resolve any disputes with the company via arbitration, Instacart has put itself at the center of two of the biggest firestorms over the future of work.

On top of writing AB 5, the law cementing the rules around worker classification, Assemblywoman Lorena Gonzalez also wrote a law banning companies from requiring new employees to sign arbitration agreements (that law, like AB 5, is being challenged in court).

“Arbitration and misclassification in California are kind of the issues of the time,” said Cornelia Dai, a partner at Hadsell Stormer Renick & Dai in Pasadena who specializes in employment law.

Taylor was skeptical of the claim that the matter belonged in arbitration instead of the court system.

“It seems doubtful to me that the people signed an arbitration agreement. … So that’s another thing where we’re going to have to carefully unpeel a very difficult onion,” he said, according to a court transcript.

Despite Taylor’s decision not to grant the temporary restraining order, Dai said Instacart could have a hard time proving that the Dynamex decision doesn’t apply to it.

In Dynamex, the court specifically “contemplated that the ABC test made sense for this industry, the on-demand economy, and that it would be helpful,” Dao said. She noted that the state Supreme Court said there was “nothing preventing businesses from offering workers freedom to set their own hours or to accept or decline a particular assignment while still treating the worker as an employee. And that applies exactly to these companies.”

♦♦♦

The city attorney’s lawsuit was filed before AB 5 became law. But the lawsuit and the issues it addresses are tangled together as gig economy companies like Uber, Postmates, DoorDash and others simultaneously argue that the law doesn’t apply to them, and that it should be overturned.

Separate lawsuits filed by members of the trucking industry and freelance journalists argue AB 5 is unconstitutional. A lawsuit filed by Uber and Postmates argues Gonzalez specifically and improperly targeted gig companies. A Los Angeles judge this week declined to put the law on hold while the case plays out, and cast doubt on a number of the companies’ claims.

Nemchick, the city attorney’s office spokeswoman, said that ruling bolsters their case.

“We believe strongly in the merits of our case and are finding increased support for our interpretation of California law — for example, the ruling yesterday by Judge Gee in LA denying the motion for a preliminary injunction motion by Uber and Postmates,” Nemchik wrote. “Every day that passes, another worker misses out on essential protections as an employee under state and federal law.”

Gonzalez has promised to further clarify the law with a new bill this year. The language of that measure has not yet been released, but Gonzalez has said it will make clear that freelance journalists qualify for exemptions, and will also address musicians.

Republican lawmakers, meanwhile, have written a number of new bills seeking to exempt more groups from AB 5’s provisions or to overturn the law entirely.

A statewide ballot initiative being funded by Uber, Lyft and DoorDash would establish “different criteria for determining whether app-based transportation (rideshare) and delivery drivers are ‘employees’ or ‘independent contractors,’” according to the secretary of state’s office. Backers of the measure have until June 30 to collect more than 630,000 valid signatures to qualify it for the November ballot.

Dai, the employment attorney, said it’s actually par for the course that there are so many lawsuits and efforts addressing the employment classification issue.

“With any new legislation that impacts a lot of industries, this is expected. I think all sides expected the number of lawsuits because it had such a wide-reaching impact on different industries,” she said.

The Instacart lawsuit is set for another hearing on Feb. 14.