Skip to content

Instantly share code, notes, and snippets.

@alex-quiterio
Last active October 21, 2022 14:03
Show Gist options
  • Save alex-quiterio/463d4ce37922d7a5f6b2ee780df15a0d to your computer and use it in GitHub Desktop.
Save alex-quiterio/463d4ce37922d7a5f6b2ee780df15a0d to your computer and use it in GitHub Desktop.
WasteSaver Audit: Stream Configurations endpoint

WasteSaver Audit: Index - StreamConfiguration endpoint:

  • OLD ENDPOINT: GET /api/store/locations/:org_location_id/streams
  • NEW ENDPOINT: GET /api/store/locations/:org_location_id/waste-stream-configurations

Payload proposal:

{
  "waste_stream_configurations": [
    {
      "id": "8bf886ac-e975-46f5-8289-7aae693f018a",
      "status": "NEW | PENDING | APPROVED | IN_REVIEW",
      "is_cancellable": true,
      "hardware_products_available": true,
      "quantity": 2,
      "size": "60L",
      "schedule": {
        "type": "SINGLE | WEEKLY | EVERY_TWO_WEEKS | EVERY_THREE_WEEKS | EVERY_FOUR_WEEKS | EVERY_SIX_WEEKS | EVERY_TWELVE_WEEKS",
        "days": [
          {
            "day": 5,
            "time_end": "23:59",
            "time_start": "09:30"
          }
        ]
      },
      "waste_stream": {
        "name": { 
          "de-de": "Restmüll",
          "en-gb": "Residual Waste",
          "fr-fr": "Déchets résiduels",
          "nl-nl": "Restafval"
        },
        "image_url": "https://d39t4x71zbx2q8.cloudfront.net/streams/v2/RESTAFVAL.png",
        "background_color": "#625F63",
        "text_color": "#ffffff"
      },
      "pickup_point": {
        "id": "259196f2-287b-4a99-a731-e716398d1eae",
        "name": "Pickup Point",
        "address": {
          "street_name": "Keizersgracht",
          "house_number": "359",
          "postal_code": "1016 EJ",
          "town": "Amsterdam",
          "country_code": "NL",
          "lat": 52.3687078,
          "lon": 4.8849146
        }
      },
      "created_at": "2022-10-19 12:52:46.682394",
      "updated_at": "2022-10-19 12:52:46.682394"
    }
  ]
}
@johadi
Copy link

johadi commented Oct 21, 2022

as Stephanie mentioned in the Doc, we can add is_deletable to this object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment