feat(tickets): finish PMS-11 story (JOINed DTOs, note email, automation dispatch) #21
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/tickets-story-pms-11"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements YouTrack story PMS-11 (tickets). One commit per sub-task.
Stacked on top of #20 (PMS-4 auth story). Targets that branch as base so the
utils::email::Mailerinfra appears once. Retarget tomainafter #20 merges.Sub-tasks
String::new()forstatus.name,priority.name, queue/company/contact/assigned/created-by names. NewTicketService::get_ticket_response/list_ticket_responsesissue one JOINed SELECT against the seven lookup tables and produce wire-shapedTicketResponsedirectly. Routes for list, get, create, update, assign all read from these methods.tickets/service.rs::create_ticket; closed administratively.tickets/service.rs::update_ticket; closed administratively.TicketService::with_mailerinjects the host-crateMailer. Whenadd_notehassend_email = trueon a public note, the service sends a plain-text update to the ticket's contact and flipsticket_notes.is_email_sent. Internal notes never leave the building.AutomationEngine::with_depstakes the mailer + a reqwest client (10s timeout). Thesend_notificationaction readsto/subject/bodyfrom params and sends viaMailer::send_text. Thewebhookaction POSTs (or GET/PUT/PATCH/DELETE) toparams.urlwithparams.payload(default a JSON envelope naming tenant + ticket + rule).Behaviour-visible changes
GET /api/v1/tickets,GET /api/v1/tickets/:id,POST /api/v1/tickets,PUT /api/v1/tickets/:id,POST /api/v1/tickets/:id/assignnow return complete names instead of empty strings.POST /api/v1/tickets/:id/noteswithsend_email: trueon a public note delivers an email to the ticket contact via the configured mailer (LogMailer dev, SmtpMailer prod) and stamps the note's email metadata.send_notificationorwebhookaction now actually act.Test plan
cargo check --bin mokosh-serverclean (verified locally).GET /api/v1/tickets/:idreturns populatedstatus.name,priority.name,company_name, etc.POST /api/v1/tickets/:id/noteswith{ "note_type": "public", "content": "...", "send_email": true }for a ticket with a contact email triggers an SMTP send (mailpit at http://localhost:8025 in dev) and flipsis_email_sent.webhookaction pointing at a request-bin URL; observe the POST body.Closes #PMS-11
Pull request closed