In March 2016, Chula Vista officials struck a deal with one of the biggest developers around. The developers would build new dorm rooms for Olympic athletes and the city would call the dorms affordable housing.

Because of the deal, there will be fewer affordable apartments built for Chula Vista residents.

City officials thought they were getting a good deal. Chula Vista was taking over the Olympic Training Center from the U.S. Olympic Committee. To ensure the center’s future as a “valuable asset and economic driver,” the city wanted to provide housing for Olympians and other elite athletes. The deal allowed the city to get someone else to build the dorms for free.

For its part, Newport Beach-based Baldwin & Sons also thought it was getting a good deal. Like any developer, it must provide affordable housing whenever it does a big housing project. Baldwin & Sons is building several thousand new homes at Otay Ranch in Chula Vista and it’s on the hook to come up with several hundred new affordable units as part of the project.

Instead, the deal allowed the developers to build a 100-bed dorm for the athletes that would be given to the city. To prepare for this, the city in late 2015, had changed its definition of “affordable housing” to include rooms for “student/amateur athletes.”

Most Olympic athletes that aren’t named Michael Phelps aren’t making a whole lot of money from their sports. The city suspected that most athletes would qualify for affordable housing anyway, but wanted them to stay at the center and focus on their training rather than commuting from elsewhere in the region.

Typically, when Baldwin & Sons has to provide income-restricted affordable housing, it does so on its own property next to other homes it’s building to sell for full price. Typically, it also creates a mix of one, two and three bedroom apartments — enough space for hundreds of people to live in affordable units, including whole families. The city only wanted 100 beds for athletes, but the city said it would count each of those beds the same way it counts 100 apartments.

This meant Baldwin & Sons might be able to save some money. Some of the company’s other affordable units have cost about $55,000 apiece, said Baldwin & Sons senior vice president Stephen Haase. That means 100 apartments would cost about $5.5 million.

When the company signed its deal with Chula Vista, it said it could build the dorms for $3.2 million — a potential savings of about $2 million. It would also be building the dorms on city-owned land, rather on the developer’s own land, meaning it had more land to develop into market-rate homes.

There were some trade-offs for Baldwin & Sons, though. Sometimes it works with another developer that specializes in affordable housing who can help share the costs. In this case, Baldwin & Sons is paying all the costs.

Or, Baldwin & Sons sometimes hangs on to a piece of the affordable housing property until the end of what’s typically a 55 year price restriction. That allows the company to sell off the property for whatever the market can bear. In this case, the company is turning the athlete building over to the city. “There’s no economic benefit downstream for this project for us,” Haase said.

Chula Vista’s director of development services, Kelly Broughton, said the deal is a way to help prop up the Elite Athlete Training Facility, which is the new name for the Olympic Training Center.

“The city looked at this agreement as way to accomplish multiple goals,” he said in an email. “In doing due diligence for consideration of taking over the Elite Athlete Training Facility, the construction of additional beds to add additional athlete training capacity was fundamental to making the facility work financially.”

Broughton said Chula Vista has done a good job providing affordable housing. The city has roughly 7 percent of the total households in the San Diego region, but over 8 percent of the housing stock reserved for low-income people.

Besides that, he said, most of the athletes would qualify for low-income housing anyway. The Olympic Training Committee and staff found that most amateur athletes, “because of their training requirements and limited employment, fall into a low or moderate income category.”

In the case of this project, Chula Vista can define “affordable housing” however it wants and the developer only has to comply with that definition. But the city also has obligations to meet statewide affordable housing targets — and the state says this deal doesn’t cut it.

The new athlete dorms will not count as “affordable housing” in the eyes of the state, said Greg Nickless, a policy analyst at the California Department of Housing and Community Development.

Haase, the developer, said he hopes that the state will change its mind.

What does and doesn’t count as affordable housing has changed over time. For instance, granny flats — small housing units that are often converted garages or freestanding structures in homeowners’ backyards — didn’t use to count as affordable housing, but now the state is trying to make it easier to build them to help solve the affordable housing crisis.

But dorms aren’t supposed to count, and issues of who benefits from city-mandated affordable housing aren’t new. In National City, residents were upset when they realized that 201 new homes they had built for low-income people wouldn’t necessary be reserved for residents of the city. In Chula Vista, the athlete dorms are designed to be used by people coming to Chula Vista from elsewhere.

That shouldn’t be an issue, though, said Haase. Once they’re in Chula Vista, they’re in Chula Vista.

“The folks that are training at the center are residents of Chula Vista because they are using a facility in Chula Vista,” he said.

In the end, Baldwin & Sons doesn’t seem to be getting the deal it hoped, either.

The dorms were supposed to be open by July 1, 2017, and cost $3.2 million. Now, they won’t open until late spring or early summer 2018. In conjunction with delays, construction costs have tripled, according to the city, which is monitoring the project. The project is now expected to cost $10 million.

“If we knew that going in, we might have said, ‘Thank you very much, we’re going to build our own stuff on site,’” Haase said.

Haase blamed a variety of factors: The developer’s deal with the city required it to pay prevailing wage, which meant dealing with unions, something that Baldwin & Sons usually doesn’t have to do. The company also estimated its construction costs using the wrong building codes. And it’s dealing with a lot that has presented construction challenges.

In the end, however, the city is making the big bet — that the dorms will help revitalize the training center, which might have closed without the city’s intervention.

“The city felt there was a long-term opportunity down the road for their community rather than a vacant facility,” Haase said.