aboutsummaryrefslogtreecommitdiff
path: root/src/transaction.h
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-10 08:29:58 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-10 08:33:56 +0000
commit776276d5c7e67356a880f3e31076d32cdc1c1882 (patch)
treecbde131f3d46338adee9c67ac0f988295736bdd4 /src/transaction.h
downloadcoursework-master.tar.gz
publishHEADmaster
Diffstat (limited to 'src/transaction.h')
-rw-r--r--src/transaction.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/transaction.h b/src/transaction.h
new file mode 100644
index 0000000..709b242
--- /dev/null
+++ b/src/transaction.h
@@ -0,0 +1,26 @@
1// transaction.h
2#ifndef INCLUDED_TRANSACTION_H
3#define INCLUDED_TRANSACTION_H
4
5#include <stdint.h>
6
7typedef uint32_t merchant_city_id_t;
8
9struct transaction {
10 union transaction_key {
11 uint64_t packed;
12 struct {
13 uint32_t merchant_city_id;
14 uint16_t client_id;
15 uint16_t year_month; // year << 4 + month
16 };
17 } key;
18 union {
19 int32_t value;
20 int32_t sum;
21 float normalized;
22 };
23};
24
25#endif // INCLUDED_TRANSACTION_H
26// transaction.h ends here