コード例 #1
0
ファイル: setup.py プロジェクト: lvercelli/pymmp
def setup(stdout, **kwargs):
    utils.install_entity_types([
        {"code": consts.ENTITY_TYPE_TOKEN, "description": "Authorization token"},
    ])
    utils.install_entity_statuses([
        {"entity_type_id": consts.ENTITY_TYPE_TOKEN,
         "code": consts.ENTITY_STATUS_TOKEN_ACTIVE, "description": "Token active"},
    ])
    utils.install_entity_status_transition_inputs([
        {"entity_type_id": mmp_consts.ENTITY_TYPE_USER,
         "code": consts.TRANSITION_INPUT_USER_CREATION, "description": "User creation"},
    ])
    utils.install_entity_status_transitions([
        {
            "entity_type_id": mmp_consts.ENTITY_TYPE_USER,
            "transition_input_id": consts.TRANSITION_INPUT_USER_CREATION,
            "prev_status_id": None, "post_status_id": mmp_consts.ENTITY_STATUS_USER_ACTIVE
        },
    ])
    utils.install_operations([
        {"code": consts.OPERATION_SIGNUP, "description": "New user registration"},
        {"code": consts.OPERATION_AUTH_TOKEN_GENERATION, "description": "New user registration"},
    ])
    utils.install_operation_results([
        {"operation_id": consts.OPERATION_SIGNUP,
         "code": consts.OPERATION_RESULT_SIGNUP_USER_ALREADY_EXISTS, "description": "User already exists"},
        {"operation_id": consts.OPERATION_AUTH_TOKEN_GENERATION,
         "code": consts.OPERATION_RESULT_AUTH_TOKEN_GENERATION_FAILED, "description": "Token generation failed"},
    ])
コード例 #2
0
ファイル: __init__.py プロジェクト: lvercelli/pymmp
def setup(stdout, **kwargs):
    utils.install_entity_types([
        {"code": consts.ENTITY_TYPE_USER, "description": "User"},
    ])
    utils.install_entity_statuses([
        {"entity_type_id": consts.ENTITY_TYPE_USER,
         "code": consts.ENTITY_STATUS_USER_ACTIVE, "description": "User active"},
    ])
    utils.install_operation_results([
        {"code": consts.OPERATION_RESULT_SUCCESS, "description":'Success'},
        {"code": consts.OPERATION_RESULT_EXCEPTION, "description":'Exception'},
    ])
    _setup_users(stdout)
コード例 #3
0
ファイル: setup.py プロジェクト: lvercelli/pymmp
def setup(stdout, **kwargs):
    utils.install_entity_types([
        {"code": consts.ENTITY_TYPE_MERCHANT, "description": "Merchant"},
    ])
    utils.install_entity_statuses([
        {"entity_type_id": consts.ENTITY_TYPE_MERCHANT,
         "code": consts.ENTITY_STATUS_MERCHANT_ACTIVE, "description": "Merchant active"},
    ])
    utils.install_entity_status_transition_inputs([
        {"entity_type_id": consts.ENTITY_TYPE_MERCHANT,
         "code": consts.TRANSITION_INPUT_MERCHANT_CREATION, "description": "Merchant creation"},
    ])
    utils.install_entity_status_transitions([
        {
            "entity_type_id": consts.ENTITY_TYPE_MERCHANT,
            "transition_input_id": consts.TRANSITION_INPUT_MERCHANT_CREATION,
            "prev_status_id": None, "post_status_id": consts.ENTITY_STATUS_MERCHANT_ACTIVE
        },
    ])
    utils.install_operations([
        {"code": consts.OPERATION_MERCHANT_REGISTRATION, "description": "Merchant registration"},
    ])