| 798 | }; |
| 799 | |
| 800 | static inline enum invoice_status invoice_status_in_db(enum invoice_status s) |
| 801 | { |
| 802 | switch (s) { |
| 803 | case UNPAID: |
| 804 | BUILD_ASSERT(UNPAID == 0); |
| 805 | return s; |
| 806 | case PAID: |
| 807 | BUILD_ASSERT(PAID == 1); |
| 808 | return s; |
| 809 | case EXPIRED: |
| 810 | BUILD_ASSERT(EXPIRED == 2); |
| 811 | return s; |
| 812 | } |
| 813 | fatal("%s: %u is invalid", __func__, s); |
| 814 | } |
| 815 | |
| 816 | /* The information about an invoice */ |
| 817 | struct invoice_details { |
no test coverage detected