| Line 106... |
Line 106... |
| 106 |
agentId = Field(Integer, primary_key=True)
|
106 |
agentId = Field(Integer, primary_key=True)
|
| 107 |
warehouseId = Field(Integer, primary_key=True)
|
107 |
warehouseId = Field(Integer, primary_key=True)
|
| 108 |
using_options(shortnames = True)
|
108 |
using_options(shortnames = True)
|
| 109 |
using_table_options(mysql_engine = "InnoDB")
|
109 |
using_table_options(mysql_engine = "InnoDB")
|
| 110 |
|
110 |
|
| - |
|
111 |
class UserSms(Entity):
|
| - |
|
112 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
| - |
|
113 |
user_id = Field(Integer)
|
| - |
|
114 |
mobileNumber = Field(String(20))
|
| - |
|
115 |
smsText = Field(String(200))
|
| - |
|
116 |
type = Field(Enum('TRANSACTIONAL','PROMOTIONAL','SERVICE_ALERT'))
|
| - |
|
117 |
status = Field(Enum('IN_PROCESS','DELIVERED','UNDELIVERED','SERVICE_ERROR','UNVALID_NUMBER'))
|
| - |
|
118 |
attempts = Field(Integer)
|
| - |
|
119 |
createdTimestamp = Field(DateTime)
|
| - |
|
120 |
responseId = Field(String(30))
|
| - |
|
121 |
responseText = Field(String(150))
|
| - |
|
122 |
deliveryStatus = Field(Enum('NOT_SENT','SENT_TO_OPERATOR','SUBMITTED_TO_SMSC','GOT_STATUS_CODE'))
|
| - |
|
123 |
using_options(shortnames = True)
|
| - |
|
124 |
using_table_options(mysql_engine = "InnoDB")
|
| - |
|
125 |
|
| - |
|
126 |
class UserSmsInfo(Entity):
|
| - |
|
127 |
userId = Field(Integer, primary_key=True, autoincrement=False)
|
| - |
|
128 |
mobileNo = Field(String(20))
|
| - |
|
129 |
dailyCount = Field(Integer)
|
| - |
|
130 |
weeklyCount = Field(Integer)
|
| - |
|
131 |
dndStatus = Field(Boolean)
|
| - |
|
132 |
smsSubscribed = Field(Boolean)
|
| - |
|
133 |
createdTimestamp = Field(DateTime)
|
| - |
|
134 |
updateTimestamp = Field(DateTime)
|
| - |
|
135 |
using_options(shortnames = True)
|
| - |
|
136 |
using_table_options(mysql_engine = "InnoDB")
|
| - |
|
137 |
|
| - |
|
138 |
class UserSmsArchive(Entity):
|
| - |
|
139 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
| - |
|
140 |
user_id = Field(Integer)
|
| - |
|
141 |
mobileNumber = Field(String(20))
|
| - |
|
142 |
smsText = Field(String(200))
|
| - |
|
143 |
type = Field(Enum('TRANSACTIONAL','PROMOTIONAL','SERVICE_ALERT'))
|
| - |
|
144 |
status = Field(Enum('IN_PROCESS','DELIVERED','UNDELIVERED','SERVICE_ERROR','UNVALID_NUMBER'))
|
| - |
|
145 |
attempts = Field(Integer)
|
| - |
|
146 |
createdTimestamp = Field(DateTime)
|
| - |
|
147 |
responseId = Field(String(30))
|
| - |
|
148 |
responseText = Field(String(150))
|
| - |
|
149 |
deliveryStatus = Field(Enum('NOT_SENT','SENT_TO_OPERATOR','SUBMITTED_TO_SMSC','GOT_STATUS_CODE'))
|
| - |
|
150 |
using_options(shortnames = True)
|
| - |
|
151 |
using_table_options(mysql_engine = "InnoDB")
|
| - |
|
152 |
|
| - |
|
153 |
|
| 111 |
def initialize(dbname='helper', db_hostname='localhost'):
|
154 |
def initialize(dbname='helper', db_hostname='localhost'):
|
| 112 |
#metadata.bind = "sqlite:///message.sqlite" #need to read it from configserver.
|
155 |
#metadata.bind = "sqlite:///message.sqlite" #need to read it from configserver.
|
| 113 |
engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
156 |
engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
| 114 |
metadata.bind = engine
|
157 |
metadata.bind = engine
|
| 115 |
metadata.bind.echo = True
|
158 |
metadata.bind.echo = True
|