From d2c1968aa435befb5629d6ad2904a6254df234f3 Mon Sep 17 00:00:00 2001 From: Grant Kinney Date: Thu, 5 Oct 2017 17:29:54 -0500 Subject: [PATCH] Refactors lottery and lottery results --- swagger/swagger-listing+prefrefact.yaml | 158 ++++++++++++------------ 1 file changed, 80 insertions(+), 78 deletions(-) diff --git a/swagger/swagger-listing+prefrefact.yaml b/swagger/swagger-listing+prefrefact.yaml index 3f0fd84..a87e122 100644 --- a/swagger/swagger-listing+prefrefact.yaml +++ b/swagger/swagger-listing+prefrefact.yaml @@ -163,19 +163,12 @@ paths: description: An array of listing schema: $ref: '#/definitions/ListingResult' - '/Listing/LotteryResult/{listingID}/{lotteryNumber}': + '/LotteryResult/{lotteryNumber}': get: description: >- - This returns the Listing result - with 1 applicationResult inside this - is the Application with the appropriate lottery number. If no - lotteryNumber fits, applicationsResult will be empty. If listing - isIncorrect it will error. + This returns lottery results for a lottery number. If no lottery number + is found it will return a not found response. parameters: - - name: listingID - in: path - description: listingID for lottery - required: true - type: string - name: lotteryNumber in: path description: lottery number to look up @@ -185,16 +178,16 @@ paths: - Listing responses: '200': - description: An array of listing + description: Lottery results for an application schema: $ref: '#/definitions/LotteryResult' - '/Listing/LotteryResult/{listingID}': + '404': + description: Lottery number not found + '/Listing/Lottery/{listingID}': get: description: >- - This returns the Listing result - with 1 applicationResult inside this - is the Application with the appropriate lottery number. If no - lotteryNumber fits, applicationsResult will be empty. If listing - isIncorrect it will error. + This returns the lottery information for a listing. If listingID is + incorrect it will error. parameters: - name: listingID in: path @@ -207,7 +200,7 @@ paths: '200': description: An array of listing schema: - $ref: '#/definitions/LotteryResult' + $ref: '#/definitions/Lottery' '/ListingDetails/{sfdcid}': get: description: This returns the Listing information and its summary information. @@ -1315,84 +1308,127 @@ definitions: hasDevelopmentalDisability: type: string description: 'Answer to question about disability: "Yes" or "No", defaults to blank.' - LotteryResult: + Lottery: type: object description: lottery result properties: listingID: type: string - description: listing ID - LotteryBuckets: + description: Listing ID + preferences: type: array items: - $ref: '#/definitions/LotteryBucket' + $ref: '#/definitions/ListingPreference' + generalPool: + type: object + description: General lottery pool information + properties: + totalSubmittedApps: + type: integer + description: Total number of applications in the general lottery bucket + unitsAvailable: + type: integer + description: Total units availble for general lottery URL: type: string - description: randome.org url + description: Is this used? lotteryResultsURL: type: string - description: link to a file + description: Location of lottery results PDF lotteryAppTotal: - type: number - description: total applications for lottery + type: integer + description: Total number of applications in lottery lotteryCity: type: string - description: listing lottery City + description: City where the lottery is run lotteryDate: type: string format: date - description: 'lottery date ' + description: Date of the lottery lotteryEndTime: type: string format: date - description: 'lottery date ' + description: Is this used? lotteryPreferences: type: string - description: preferences + description: Is this used? lotteryResults: type: boolean - description: lotteryResults + description: If the lottery has results officeHours: type: string - description: office hours + description: Is this used? + LotteryResult: + type: object + description: Lottery result for a lottery number + properties: + applicationID: + type: string + description: Id of application + lotteryNumber: + type: string + description: Lottery number + lotteryRank: + type: integer + format: int32 + description: Unfiltered lottery rank returned from drawing + lotteryPreferences: + type: array + items: + type: object + description: 'Preferences the applicant qualified for with rankings, if available' + properties: + listingPreferenceId: + type: string + preferenceName: + type: string + preferenceRank: + type: integer + generalPoolRank: + type: integer + description: >- + Rank in general lottery if applicant did not qualify or claim any + preferences ListingPreference: type: object description: Listing preference properties: listingPreferenceID: type: string - description: salesforce ID + description: Salesforce ID listingID: type: string - description: listing salesforce ID + description: Listing Salesforce ID name: type: string - description: preference + description: Listing preference number preferenceName: type: string - description: preference name + description: Name of preference order: type: number - description: order to display in + description: Order to display in list of preferences pdfUrl: type: string - description: pdf url + description: >- + Location of PDF with which lottery numbers that qualified for + preference description: type: string - description: description + description: Listing preference description readMoreUrl: type: string format: url - description: readMore Url - NRHP District: + description: Location of more information about preference + NRHPDistrict: type: string - description: 'neighborhood district ' - appTotal: + description: Neighborhood district used for pre-qualifying addresses for preference + totalSubmittedApps: type: number - description: 'total number of people who have applied ' + description: Total number of applications that have claimed preference unitsAvailable: type: number - description: 'total units available ' + description: Total units available for preference ShortFormPreference: type: object description: Application preference @@ -1499,40 +1535,6 @@ definitions: incomeMatch: type: boolean description: does income match passed criteria - LotteryBucket: - type: object - description: list of application results by preference - properties: - PreferenceName: - type: string - description: 'Preference name, (liveWork,COP,DCP,Neighborhood)' - TotalSubmitted: - type: number - description: total applications for preference - UnitsAvailable: - type: number - description: total slots for preference - PreferenceResults: - type: array - items: - $ref: '#/definitions/PreferenceResult' - PreferenceResult: - type: object - description: ApplicationResult - properties: - applicationID: - type: string - description: ApplicationID ID - lotteryNumber: - type: string - description: 'the lottery number ' - preferenceRank: - type: number - description: raw rank for this live work - which are treated as one preference - lotteryRank: - type: integer - format: int32 - description: raw lottery rank returned form drawing PreferenceBucket: type: object description: 'list of application results by preference ( deprecated) '