fix(journal): validate date_on is required

Amolith created

Assisted-by: Claude Opus 4.5 via Crush

Change summary

journal.go | 5 +++++
1 file changed, 5 insertions(+)

Detailed changes

journal.go 🔗

@@ -6,6 +6,7 @@ package lunatask
 
 import (
 	"context"
+	"fmt"
 	"net/http"
 	"time"
 )
@@ -67,6 +68,10 @@ func (b *JournalEntryBuilder) WithContent(content string) *JournalEntryBuilder {
 // Create sends the journal entry to Lunatask. Returns the created entry's metadata;
 // Name and Content won't round-trip due to E2EE.
 func (b *JournalEntryBuilder) Create(ctx context.Context, c *Client) (*JournalEntry, error) {
+	if b.req.DateOn.IsZero() {
+		return nil, fmt.Errorf("%w: date_on is required", ErrBadRequest)
+	}
+
 	resp, _, err := doJSON[journalEntryResponse](ctx, c, http.MethodPost, "/journal_entries", b.req)
 	if err != nil {
 		return nil, err