Book 1 - Enemies after a few exchanges. She thinks him cute but wants to crush him.
2, Chamber of Secrets - Draco is shocked by Harry's bravery and learns of his background, making her doubt her emnity but still very hostile openly.
3, Prisoner of Azkaban - She openly despises him but she is becoming enamored with his bravery in secret. "He breaks rules like a good Slytherin"
4, Goblet of Fire - This is where things change. Not only does she start seeing him in actual danger but she realizes she is excited by him losing a bet and asking her to the Yule Ball. They end up arguing, yet share a sweet moment that Harry ruins. She is now confused by her feelings and Harry wonders why she he finds her pretty when she's still so cruel to him. At the end of the book, she even says she will miss him while School is out. Their relationship looks positive.
5, Order of the Phoenix - Draco starts acting very weird. She avoids him then seeks him out to ask strange questions. Her mood is fluctuating, her motives don't make any sense. Harry tries to date Cho and Malfoid is actively sabotaging it. She has feelings for him but she knows Voldemort is back and doesn't know what to do about that. At the end Harry wonders how much she knew given her strange behavior.
6, Half-Blood Prince - Malfoid is distant and cold. Harry pursues her throughout the story trying to find out what's happening. She leaves him a cryptic note he can never decipher. He tells her he cares about her, that he can tell something is wrong. She tells him to leave her alone for his own sake. She goes to finally admit what's going on, to beg him for help... But he has kissed Ginny. So she commits to Voldemorts plan. The end of the story is the same but now the fallout crushes them both further. Harry can't tell if she's a traitor or not, if he cares for her or hates her. Malfoid knows she betrayed him but is in denial about her feelings. Believing she just wants a Hero to save her, which she sees as weak, not something a Slytherin should want. Not what Lord Voldemort would want
7 Deathly Hallows - Harry and Ginny's relationship doesn't stand a chance because early on, Harry reveals he thinks Malfoid should be saved. This angers everyone and more so when Harry makes a risky attempt to contact her. Doing this however, makes Malfoid realize Harry doesn't hate her and gives her Hope. Harry then reunited with the main cast saying he needs to deal with Voldemort AND save Malfoid as she's been held against her will. This drama replaces the boring start to Deathly Hallows. The rest continues until the end where Harry's fake death breaks Malfoid apart and her true feelings are revealed, then we get the iconic image of them teaming up to defeat Voldemort.
All I can say is, imagine the frigging self-discipline required to pull off this kind of ending. Most authors would not—could not—believably write this over seven books. And I don't mean in terms spice. That's easy. I mean in terms of payoff and character progression.
Part of what made Male Malfoy easier to write is that he remained a sniveling little shit until book 6. His female counterpart, as has been demonstrated, would be infinitely more likeable from the get-go. Maintaining that tension with the core trio while also going through most of the same story beats as the original Malfoy, would be an impressive exercise in self-control.
I don't think I've seen such a long-form transition from villain to hero without the author rushing it, or the audience wondering, "Wait, why are they enemies again after that big moment in the previous book?"
Except Vegeta. He is the quintessential tsundere.