Coder Social home page Coder Social logo

ancar_pdf_generator's Introduction

ANCAR (Refazer esse README)


Middleware


User Authentication


Create User (HOSTNAME/user/register)


Method: POST


Request Body:

{
    "name": "Mario Oliveira",
    "userName": "mjoribeiro",
    "email": "[email protected]",
    "password": "MJ_O_123@Triscal"
}


Response Body:


Create User - Success ( Created [201] )

{
    "message": "User successfully created",
    "user": {
        "name": "Mario Oliveira",
        "userName": "mjoribeiro",
        "email": "[email protected]",
        "isActive": true,
        "dataCadastro": "2023-01-19T14:56:41.871Z",
        "dataAtualizacao": "2023-01-19T14:56:41.871Z",
        "id": "63c95a295712bac11bc11ae1"
    }
}


Create User - Error ( Conflict [409] )

{
    "statusCode": 409,
    "errorMessage": "An error occurred creating user",
    "error": "TR_JSON_ERROR: User already exists with this username"
}


Update User (HOSTNAME/user/update)


Method: PUT


Request Body:

{
    "Id": "63c8840480579bd93c0025b2",
    "name": "Mario Ribeiro",
    "userName": "mjribeiro",
    "password": "MJ_123@Triscal",
    "isActive": true
}


Response Body:

Update User - Success ( Created [201] )

{
    "message": "User successfully updated",
    "user": {
        "name": "Mario Ribeiro",
        "userName": "mjribeiro",
        "email": "[email protected]",
        "dataCadastro": "2023-01-18T23:43:00.288Z",
        "dataAtualizacao": "2023-01-19T14:54:18.433Z",
        "isActive": true,
        "Id": "63c8840480579bd93c0025b2"
    }
}


Update User - Error ( Conflict [409] )

{
    "statusCode": 409,
    "errorMessage": "An error occurred updating user",
    "error": "TR_JSON_ERROR: Invalid User Id"
}


Delete User (HOSTNAME/user/delete?user_id=63c958cc5712bac11bc11ad6)


Method: DELETE


Response Body:


Delete User - Success ( Accepted [202] )

{
    "message": "User successfully deleted",
    "info": {
        "acknowledged": true,
        "deletedCount": 1
    }
}


Delete User - Error ( Bad Request [400] )

{
    "statusCode": 400,
    "errorMessage": "An error occurred deleting user",
    "error": "TR_ID_ERROR: Invalid User Id (User Rule)"
}


Guests


Get Guest (HOSTNAME/getGuest?guest_id=63cea2a2e0fa4b97f3aea1db)


Method: GET


Response Body:


Get Guest - Error ( Bad Request [400] )

{
    "statusCode": 400,
    "errorMessage": "An error occurred Getting Guest",
    "error": "CastError: Cast to ObjectId failed for value \"ABC\" (type string) at path \"_id\" for model \"GuestData\""
}


Get Guest - Success ( OK [200] )

[
    {
        "skyfiiId": "String 16",
        "modified": 12345678910,
        "created": 12345678910,
        "name": "String 256",
        "firstName": "String 128",
        "lastName": "String 128",
        "gender": "String 10",
        "relationship": "String 50",
        "email": "String 512",
        "phone": "String 32",
        "facebookId": "String 128",
        "googleId": "String 128",
        "linkedinId": "String 128",
        "twitterId": "String 128",
        "externalId": "String 256",
        "dobMin": "String 10",
        "dobMax": "String 10",
        "address": "String 256",
        "suburb": "String 128",
        "district": "String 255",
        "state": "String 255",
        "postcode": "String 255",
        "country": "String 100",
        "venueId": 12345678910,
        "networkId": "String 20",
        "marketingLists": [
            {
                "id": 12345678910,
                "status": "String 255"
            }
        ],
        "nationalId": "String 20",
        "marketingOptIn": false,
        "termsAcceptanceVersion": 40,
        "termsAcceptanceDate": 12345678910,
        "operation": "String 20",
        "locale": "String 16",
        "facebookLink": "String 255",
        "venueName": "String 255",
        "verifiedEmail": true,
        "verifiedPhoneNumber": true,
        "devices": [
            {
                "deviceId": 12345678910,
                "clientMacAddress": "String 17",
                "brand": "String 255",
                "model": "String 255",
                "type": "String()",
                "os": "String 255",
                "userAgent": "String 4096",
                "lastActive": 12345678910
            }
        ],
        "custom": [
            {
                "key": "String 255",
                "value": [
                    "String 255"
                ]
            }
        ],
        "status": "String 255"
    }
]


Get Guest Ids (HOSTNAME/getGuestIds?startDate=2023-01-23T00:00:00.000Z&endDate=2023-01-23T23:59:00.000Z)


Method: GET


Response Body:


Get Guest Ids - Success ( OK [200] )

{
    "total": 2,
    "guests": [
        {
            "dataRecebimento": "2023-01-17T18:19:44.918Z",
            "id": "63c6e6c06f0acbec5c9b85d1"
        },
        {
            "dataRecebimento": "2023-01-17T18:21:34.533Z",
            "id": "63c6e72e39e812f2daa52c8e"
        }
    ]
}

Get Guest Ids - Error ( Bad Request [400] )

{
    "statusCode": 400,
    "errorMessage": "An error occurred Getting Guest Ids",
    "error": "TR_DATE_ERROR: \"Start Date\" can not be greater than \"End Date\" (Date Rule)"
}

Save Guests (HOSTNAME/createGuests)


Method: POST


Request Body:

[
    {
        "skyfiiId": "String 16",
        "modified": 12345678910,
        "created": 12345678910,
        "name": "String 256",
        "firstName": "String 128",
        "lastName": "String 128",
        "gender": "String 10",
        "relationship": "String 50",
        "email": "String 512",
        "phone": "String 32",
        "facebookId": "String 128",
        "googleId": "String 128",
        "linkedinId": "String 128",
        "twitterId": "String 128",
        "externalId": "String 256",
        "dobMin": "String 10",
        "dobMax": "String 10",
        "address": "String 256",
        "suburb": "String 128",
        "district": "String 255",
        "state": "String 255",
        "postcode": "String 255",
        "country": "String 100",
        "venueId": 12345678910,
        "networkId": "String 20",
        "marketingLists": [
            {
                "id": 12345678910,
                "status": "String 255"
            }
        ],
        "nationalId": "String 20",
        "marketingOptIn": false,
        "termsAcceptanceVersion": 40,
        "termsAcceptanceDate": 12345678910,
        "operation": "String 20",
        "locale": "String 16",
        "facebookLink": "String 255",
        "venueName": "String 255",
        "verifiedEmail": true,
        "verifiedPhoneNumber": true,
        "devices": [
            {
                "deviceId": 12345678910,
                "clientMacAddress": "String 17",
                "brand": "String 255",
                "model": "String 255",
                "type": "String()",
                "os": "String 255",
                "userAgent": "String 4096",
                "lastActive": 12345678910
            }
        ],
        "custom": [
            {
                "key": "String 255",
                "value": [
                    "String 255"
                ]
            }
        ],
        "status": "String 255"
    }
]


Response Body:


Save Guests - Success ( Created [201] )

{
    "objectData": "[{\"skyfiiId\":\"String 16\",\"modified\":12345678910,\"created\":12345678910,\"name\":\"String 256\",\"firstName\":\"String 128\",\"lastName\":\"String 128\",\"gender\":\"String 10\",\"relationship\":\"String 50\",\"email\":\"String 512\",\"phone\":\"String 32\",\"facebookId\":\"String 128\",\"googleId\":\"String 128\",\"linkedinId\":\"String 128\",\"twitterId\":\"String 128\",\"externalId\":\"String 256\",\"dobMin\":\"String 10\",\"dobMax\":\"String 10\",\"address\":\"String 256\",\"suburb\":\"String 128\",\"district\":\"String 255\",\"state\":\"String 255\",\"postcode\":\"String 255\",\"country\":\"String 100\",\"venueId\":12345678910,\"networkId\":\"String 20\",\"marketingLists\":[{\"id\":12345678910,\"status\":\"String 255\"}],\"nationalId\":\"String 20\",\"marketingOptIn\":false,\"termsAcceptanceVersion\":40,\"termsAcceptanceDate\":12345678910,\"operation\":\"String 20\",\"locale\":\"String 16\",\"facebookLink\":\"String 255\",\"venueName\":\"String 255\",\"verifiedEmail\":true,\"verifiedPhoneNumber\":true,\"devices\":[{\"deviceId\":12345678910,\"clientMacAddress\":\"String 17\",\"brand\":\"String 255\",\"model\":\"String 255\",\"type\":\"String()\",\"os\":\"String 255\",\"userAgent\":\"String 4096\",\"lastActive\":12345678910}],\"custom\":[{\"key\":\"String 255\",\"value\":[\"String 255\"]}],\"status\":\"String 255\"}]",
    "isDeletable": false,
    "dataRecebimento": "2023-01-19T15:03:28.789Z",
    "id": "63c95bc05712bac11bc11af0"
}


Access


Get Access (HOSTNAME/getAccess?access_id=63cea324e0fa4b97f3aea1ef)


Method: GET


Response Body:


Get Access Ids (HOSTNAME/getAccessIds?startDate=2023-01-23T00:00:00.000Z&endDate=2023-01-23T23:59:00.000Z)


Method: GET


Response Body:


Get Access Ids - Error ( Bad Request [400] )

{
    "statusCode": 400,
    "errorMessage": "An error occurred Getting Access Ids",
    "error": "TR_DATE_ERROR: \"Start Date\" can not be greater than \"End Date\" (Date Rule)"
}


Save Access (HOSTNAME/createAccess)


Method: POST


Request Body:

[
    {
        "timestamp": 12345678910,
        "duration": 12345678910,
        "deviceId": 12345678910,
        "skyfiiId": 12345678910,
        "venueId": 12345678910,
        "venueName": "String de 255 caracteres",
        "zones": [
            {
                "zoneId": 12345678910,
                "timestamp": 12345678910,
                "duration": 12345678910,
                "zoneName": "String de 255 caracteres"
            }
        ],
        "precincts": [
            {
                "smartzoneId": 12345678910,
                "timestamp": 12345678910,
                "duration": 12345678910,
                "smartzoneName": "String de 255 caracteres"
            }
        ],
        "spaces": [
            {
                "smartzoneId": 12345678910,
                "timestamp": 12345678910,
                "duration": 12345678910,
                "smartzoneName": "String de 255 caracteres"
            }
        ]
    }
]


Response Body:


Save Access - Success ( Created [201] )

{
    "objectData": "[{\"timestamp\":12345678910,\"duration\":12345678910,\"deviceId\":12345678910,\"skyfiiId\":12345678910,\"venueId\":12345678910,\"venueName\":\"String de 255 caracteres\",\"zones\":[{\"zoneId\":12345678910,\"timestamp\":12345678910,\"duration\":12345678910,\"zoneName\":\"String de 255 caracteres\"}],\"precincts\":[{\"smartzoneId\":12345678910,\"timestamp\":12345678910,\"duration\":12345678910,\"smartzoneName\":\"String de 255 caracteres\"}],\"spaces\":[{\"smartzoneId\":12345678910,\"timestamp\":12345678910,\"duration\":12345678910,\"smartzoneName\":\"String de 255 caracteres\"}]}]",
    "isDeletable": false,
    "dataRecebimento": "2023-01-23T17:39:07.097Z",
    "id": "63cec63be0fa4b97f3aea61b"
}


GuestsData


Flag Records (HOSTNAME/flagRecords)


Method: PUT


Request Body:

[
	"63cecb6fe0fa4b97f3aea626",
	"63c95bda5712bac11bc11af2",
	"63c6a9dd1cdd3d8a76a1f942",
	"63c593e6ffcf8d4381454d26",
	"63c6ab2788d2cf1618a0e108",
	"63c5b67e88d3c0e5cea0bb39"
]


Response Body:


Flag Records - Success ( OK [200] )

{
    "acknowledged": true,
    "modifiedCount": 2,
    "upsertedId": null,
    "upsertedCount": 0,
    "matchedCount": 2,
    "guestData": [
        "63c95be35712bac11bc11af4",
        "63c95bda5712bac11bc11af2",
        "63c6a9dd1cdd3d8a76a1f942",
        "63c593e6ffcf8d4381454d26",
        "63c6ab2788d2cf1618a0e108",
        "63c5b67e88d3c0e5cea0bb39"
    ]
}


Flag Records - Error ( Bad Request [400] )

{
    "statusCode": 400,
    "errorMessage": "An error occurred flagging records",
    "error": "TR_JSON_ERROR: Invalid or Null request Body"
}


Schedule


GuestData Deletion Schedule (HOSTNAME/getScheduledDeletions?schedule_type=all)


Method: GET


Response Body:


GuestData Deletion Schedule - Success ( OK [200] )

[
    {
        "jobId": "1674140844383_197713660",
        "scheduleType": "secondSchedule",
        "schedulePeriod": "0,10,20,30,40,50"
    }
]


GuestData Deletion Schedule - Error ( Bad Request [400] )

{
    "statusCode": 400,
    "errorMessage": "An error occurred Scheduling GuestData deletion",
    "error": "TR_TYPE_ERROR: \"Schedule Type\" can not be \"second\" (Schedule Rule)"
}


GuestData Deletion Schedule (HOSTNAME/deleteGuestDataSchedule?schedule_type=secondSchedule&schedule_period=0,10,20,30,40,50)


Method: PUT


Response Body:


GuestData Deletion Schedule - Success ( OK [200] )

{
    "message": "GuestData deletion successfully schehduled",
    "jobId": "1674140844383_197713660"
}


GuestData Deletion Schedule - Error ( Bad Request [400] )

{
    "statusCode": 400,
    "errorMessage": "An error occurred Scheduling GuestData deletion",
    "error": "TR_TYPE_ERROR: \"Schedule Type\" can not be \"second\" (Schedule Rule)"
}


Cancel Scheduled Deletions (HOSTNAME/cancelScheduledDeletions?schedule_id=1674172496851_135544877)


Method: PUT


Response Body:


Cancel Scheduled Deletions - Success ( OK [200] )

{
    "message": "GuestData schehdule was successfully canceled"
}

ancar_pdf_generator's People

Contributors

mariojgmaster avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.