"""General constants for lambda create_vectorapi_access_tokens functions.""" CONTACT_ID = 173351 CLIENT_ID = 5656789871 # get vendor contact query GET_VENDOR_CONTACT_SQL = f""" SELECT id FROM vend_contact WHERE vendor_id = %(vendor_id)s AND contact_id = {CONTACT_ID}; """ # create vendor contact query CREATE_VENDOR_CONTACT_SQL = f""" INSERT INTO vend_contact (vendor_id, contact_id) VALUES (%(vendor_id)s, {CONTACT_ID}); """ # get access token query # user_id is the id from vend_contact table of vendor contact GET_ACCESS_TOKEN_SQL = """ SELECT * FROM vectorapi_access_tokens WHERE user_id = %(user_id)s and user_type = 'alw'; """ # create access token query # user_id is the id from vend_contact table of vendor contact CREATE_ACCESS_TOKEN_SQL = f""" INSERT INTO vectorapi_access_tokens (oauth_token, client_id, user_id, user_type, expires_REMOVE) VALUES (LEFT(MD5(RAND()), 33), {CLIENT_ID}, %(user_id)s, 'alw', 0); """