If you want a happy ending, that depends, of course, on where you stop your story.
I mean, of course, comedy in the sense of a positive ending, not ha-ha. I was thinking that in popular fiction, we have the same structure as a tragedy, but the tragedy happens in the dark moment ("When the worst that can happen happens"), not at the climax-- in "comedy" there's a climax where the tragedy is resolved and maybe fixed or at least transcended. (The tragedy, I suppose, does have to be fixable-- you don't really have much room for a happy ending tacked on to Hamlet, after all! Everyone's dead! But you know, it IS a happy ending for Fortinbras, who gets a new kingdom without any work at all.)
Hey, I learned something! I was wondering why there's this trend in performances of Shakespeare comedies to have all the actors appear at the curtain call and then dance to some happy music (usually pop). I assumed there was some Journal of Shakespearian Comic Theatre and they'd had an article saying that audiences like this, so all the directors stole the idea. Turns out this has been done since S's time, and it's called "the Jig," and the purpose was to get the audience to see that all the actors were alive again and everyone was happy. (I don't know why they didn't have those after tragedies, where you think they'd be more needed.) What a good idea. It's fun, but what if you could act but you couldn't dance???