models.py
3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
from sqlalchemy import (
Column,
Integer,
Float,
DateTime,
String,
ForeignKey,
func,
JSON,
)
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Rpc(Base):
__tablename__ = 'linkaja_trx'
id = Column(Integer, primary_key=True) # Bill Ref
created = Column(
DateTime(timezone=True), nullable=False, server_default=func.now())
ip = Column(String(15), nullable=False)
conf_name = Column(String(16), nullable=False)
merchant = Column(String(100), nullable=False)
terminal = Column(String(100), nullable=False)
trx_type = Column(String(3), nullable=False)
msisdn = Column(String(20), nullable=False)
# Invoice ID = SPPT ID di PBB
acc_no = Column(String(64), nullable=False)
msg = Column(String(100))
trx_date = Column(DateTime(timezone=True), nullable=False)
# Dari inquiry response
amount = Column(Float)
# Dari inquiry response (Bill Ref),
# diisi saat payment request (bill_ref)
inquiry_id = Column(Integer, ForeignKey('linkaja_trx.id'))
# Dari payment request (trx_id)
ntb = Column(String(32))
# Penerjemahan bit 39
resp_code = Column(String(2))
# Penjelasan resp_code untuk pelanggan
resp_msg = Column(String(100))
# Penjelasan resp_code untuk audit sistem
resp_orig_msg = Column(String(100))
# Nama wajib pajak
biller_name = Column(String(100))
# Dari payment response (Transaction ID)
ntp = Column(String(32))
# Dari bit 11, dibutuhkan untuk reversal
stan = Column(String(6))
class Log(Base):
__tablename__ = 'log_iso'
id = Column(Integer, primary_key=True)
created = Column(
DateTime(timezone=True), nullable=False, server_default=func.now())
rpc_id = Column(Integer, ForeignKey(Rpc.id), nullable=False)
ip = Column(String(15))
conf_name = Column(String(16), nullable=False)
mti = Column(String(4), nullable=False)
bit_002 = Column(String(99))
bit_003 = Column(String(6))
bit_004 = Column(String(12))
bit_007 = Column(String(10))
bit_011 = Column(String(6))
bit_012 = Column(String(6))
bit_013 = Column(String(4))
bit_015 = Column(String(4))
bit_018 = Column(String(4))
bit_022 = Column(String(3))
bit_032 = Column(String(4))
bit_033 = Column(String(10))
bit_035 = Column(String(99))
bit_037 = Column(String(12))
bit_039 = Column(String(2))
bit_041 = Column(String(8))
bit_042 = Column(String(15))
bit_043 = Column(String(40))
bit_047 = Column(String(99))
bit_048 = Column(String(99))
bit_049 = Column(String(3))
bit_059 = Column(String(16))
bit_060 = Column(String(3))
bit_061 = Column(String(22))
bit_062 = Column(String(512))
bit_063 = Column(String(255))
bit_102 = Column(String(32))
bit_107 = Column(String(8))
bit_062_data = Column(JSON)
class LogSam(Base):
__tablename__ = 'log_sam'
id = Column(Integer, primary_key=True)
created = Column(
DateTime(timezone=True), nullable=False, server_default=func.now())
rpc_id = Column(Integer, ForeignKey(Rpc.id), nullable=False)
ip = Column(String(15))
conf_name = Column(String(16), nullable=False)
message = Column(JSON)
mti = Column(String(4), nullable=False)
bit_003 = Column(String(6)) # Processing Code
bit_062_data = Column(JSON)