Unions, district finalize contracts