Merit integration #216

Open
opened 2026-07-11 15:07:56 +00:00 by rasmus · 0 comments
Owner

Since #83 is too big, instead first:

  • (stateless) Attach a viitenumbri alusnumber to every client in Merit without one. It's an unique (currently sequential) number across the clients required for automatic matching of payments to client/invoices.
  • Logic for creating clients in Merit based on OIDC users. Name, e-mail, for companies contact person (maybe custom field for username, to keep clients-oidc linked when e-mails change). Billing e-mail may differ from sign-in e-mail. Some are private clients, some use a company for billing (org:something group). Make sure the linked org is actually valid.
  • Create a periodic invoice based on OIDC groups (just k-space:floor = supporter, + k-space:workshop = member, k-space:resident = resident). For companies, add the numbers up, and include it in on invoice count.
  • Compatible with human review and edits: row classification (billing category not shown on invoice, the drop-down in UI), name displayed, discount (may be 100% for very custom deals) on invoice. If any user is added to the company, the price is supposed to automatically go up. Somehow don't touch fully custom rows (for now VM / server / office billing).
  • Logic for ending periodic invoices when adding tag k-space:offboarded.

Keep periodic invoice generation and sending out manual for now. There just needs to be better scheduling on the human end. This permits temporarily disabling generating invoices and sending out when there is a mistake / confusion.

Since https://git.k-space.ee/k-space/todo/issues/83 is too big, instead first: - (stateless) Attach a viitenumbri alusnumber to every client in Merit without one. It's an unique (currently sequential) number across the clients required for automatic matching of payments to client/invoices. - Logic for creating clients in Merit based on OIDC users. Name, e-mail, for companies contact person (maybe custom field for username, to keep clients-oidc linked when e-mails change). Billing e-mail may differ from sign-in e-mail. Some are private clients, some use a company for billing (`org:something` group). Make sure the linked org is actually valid. - Create a periodic invoice based on OIDC groups (just `k-space:floor` = supporter, + `k-space:workshop` = member, `k-space:resident` = resident). For companies, add the numbers up, and include it in on invoice count. - Compatible with human review and edits: row classification (billing category not shown on invoice, the drop-down in UI), name displayed, discount (may be 100% for very custom deals) on invoice. If any user is added to the company, the price is supposed to automatically go up. Somehow don't touch fully custom rows (for now VM / server / office billing). - Logic for ending periodic invoices when adding tag `k-space:offboarded`. Keep periodic invoice generation and sending out manual for now. There just needs to be better scheduling on the human end. This permits temporarily disabling generating invoices and sending out when there is a mistake / confusion.
rasmus added the
bounty
20€
label 2026-07-11 15:07:56 +00:00
rasmus added this to the k-space.ee/todo project 2026-07-11 15:08:50 +00:00
rasmus moved this to Management in k-space.ee/todo on 2026-07-11 15:09:00 +00:00
Sign in to join this conversation.