OpenBCca / airbnb-regulation

Airbnb Regulation Project
MIT License
1 stars 0 forks source link

[MVP] Mock policies for registration number #17

Open nam-m opened 10 months ago

nam-m commented 10 months ago

Description

Listings on Airbnb in Vancouver may include Registration number. Example listing

Image

The MVP policies should verify these number to make sure they are valid. For example, the number from a Vancouver listing should exist in Vancouver Open Data Portal Business licenses

Tasks

  1. Create policy methods

    • Registration number follows the format of yy-123456, where yy is last 2 digits of the expiry year, followed by -, and 6 digits. Can assume that the listings expiry is from 2000 onward.
    • Registration number exists in JSON results from API request to Vancouver Open Data Portal Business licenses. Check API tab in the database for expected JSON result. No need to deal with API here.
    • Return status by listing address and registration number in JSON results from API request to Vancouver Open Data Portal Business licenses. Check API tab in the database for expected JSON result. No need to deal with API here.
  2. Create unit tests for the methods in task 1

    • Make sure to include a range of inputs (valid, invalid, missing numbers) and suitable expected outputs
    • It is recommended to write tests first 😄

    Links