Gig Economy: A Dynamic Principal-Agent Model