From 5b3ec77f8537e40621b143d1060c06991d850ce8 Mon Sep 17 00:00:00 2001 From: Mia Bennett Date: Wed, 18 Jan 2023 12:47:02 +0930 Subject: [PATCH 1/9] feat(survey): add building_id to survey --- OPENAPI_DOC.yml | 3 +++ src/controllers/surveys.cr | 4 ++-- src/migrations/0027_add_building_id_to_surveys.cr | 15 +++++++++++++++ src/models/survey.cr | 8 ++++++-- 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 src/migrations/0027_add_building_id_to_surveys.cr diff --git a/OPENAPI_DOC.yml b/OPENAPI_DOC.yml index af28d4a4..89295c69 100644 --- a/OPENAPI_DOC.yml +++ b/OPENAPI_DOC.yml @@ -9740,6 +9740,9 @@ components: zone_id: type: string nullable: true + building_id: + type: string + nullable: true pages: type: array items: diff --git a/src/controllers/surveys.cr b/src/controllers/surveys.cr index 1ee3ced2..d965b61a 100644 --- a/src/controllers/surveys.cr +++ b/src/controllers/surveys.cr @@ -19,7 +19,7 @@ class Surveys < Application # returns a list of surveys @[AC::Route::GET("/")] def index : Array(Survey::Responder) - Survey.query.select("id, title, description, trigger, zone_id, pages").to_a.map(&.as_json) + Survey.query.select("id, title, description, trigger, zone_id, building_id, pages").to_a.map(&.as_json) end # creates a new survey @@ -36,7 +36,7 @@ class Surveys < Application def update(survey_body : Survey::Responder) : Survey::Responder changes = survey_body.to_survey(update: true) - {% for key in [:title, :description, :trigger, :zone_id, :pages] %} + {% for key in [:title, :description, :trigger, :zone_id, :building_id, :pages] %} begin survey.{{key.id}} = changes.{{key.id}} if changes.{{key.id}}_column.defined? rescue NilAssertionError diff --git a/src/migrations/0027_add_building_id_to_surveys.cr b/src/migrations/0027_add_building_id_to_surveys.cr new file mode 100644 index 00000000..fafde4af --- /dev/null +++ b/src/migrations/0027_add_building_id_to_surveys.cr @@ -0,0 +1,15 @@ +class AddBuildingIdToSurveys + include Clear::Migration + + def change(dir) + dir.up do + # Add the new columns + execute("ALTER TABLE surveys ADD COLUMN building_id text") + end + + dir.down do + # remove the new columns + execute("ALTER TABLE surveys DROP COLUMN building_id") + end + end +end diff --git a/src/models/survey.cr b/src/models/survey.cr index a7d1887c..6f0f285f 100644 --- a/src/models/survey.cr +++ b/src/models/survey.cr @@ -11,6 +11,7 @@ class Survey column description : String? column trigger : TriggerType, presence: false column zone_id : String? + column building_id : String? column pages : Array(Survey::Page) = [] of Survey::Page has_many answers : Survey::Answer, foreign_key: "survey_id" @@ -25,14 +26,15 @@ class Survey getter description : String? = nil getter trigger : TriggerType? = nil getter zone_id : String? = nil + getter building_id : String? = nil getter pages : Array(Survey::Page)? = nil - def initialize(@id, @title = nil, @description = nil, @trigger = nil, @zone_id = nil, @pages = nil) + def initialize(@id, @title = nil, @description = nil, @trigger = nil, @zone_id = nil, @building_id = nil, @pages = nil) end def to_survey(update : Bool = false) survey = Survey.new - {% for key in [:title, :description, :trigger, :zone_id] %} + {% for key in [:title, :description, :trigger, :zone_id, :building_id] %} survey.{{key.id}} = self.{{key.id}}.not_nil! unless self.{{key.id}}.nil? {% end %} @@ -50,6 +52,7 @@ class Survey self.description = description_column.defined? ? self.description : "" self.trigger = trigger_column.defined? ? self.trigger : TriggerType::NONE self.zone_id = zone_id_column.defined? ? self.zone_id : "" + self.building_id = building_id_column.defined? ? self.building_id : "" self.pages = pages_column.defined? ? self.pages : [] of Survey::Page Responder.new( @@ -58,6 +61,7 @@ class Survey description: self.description, trigger: self.trigger, zone_id: self.zone_id, + building_id: self.building_id, pages: self.pages, ) end From ee4007f5fb71e0c3d2d9cf470603985021e8146c Mon Sep 17 00:00:00 2001 From: Mia Bennett Date: Wed, 18 Jan 2023 13:04:27 +0930 Subject: [PATCH 2/9] feat(survey): filter on zone_id and building_id --- spec/controllers/helpers/survey_helper.cr | 6 ++++-- spec/controllers/surveys_spec.cr | 9 +++++++++ src/controllers/surveys.cr | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/spec/controllers/helpers/survey_helper.cr b/spec/controllers/helpers/survey_helper.cr index 56be9926..ce3ae4ad 100644 --- a/spec/controllers/helpers/survey_helper.cr +++ b/spec/controllers/helpers/survey_helper.cr @@ -38,10 +38,12 @@ module SurveyHelper question_responders.map { |q| q.to_question.save! } end - def survey_responder(question_order = [] of Int64) + def survey_responder(question_order = [] of Int64, zone_id = nil, building_id = nil) Survey::Responder.from_json({ title: "New Survey", description: "This is a new survey", + zone_id: zone_id, + building_id: building_id, pages: [{ title: "Page 1", description: "This is page 1", @@ -50,7 +52,7 @@ module SurveyHelper }.to_json) end - def create_survey(question_order = [] of Int64) + def create_survey(question_order = [] of Int64, zone_id = nil, building_id = nil) survey_responder(question_order).to_survey.save! end end diff --git a/spec/controllers/surveys_spec.cr b/spec/controllers/surveys_spec.cr index 51670dd3..04ee7824 100644 --- a/spec/controllers/surveys_spec.cr +++ b/spec/controllers/surveys_spec.cr @@ -14,6 +14,15 @@ describe Surveys do response.status_code.should eq(200) response.body.should eq([survey.as_json].to_json) end + + it "should return a list of surveys filtered by zone_id", focus: true do + survey1 = SurveyHelper.create_survey(zone_id: "1") + survey2 = SurveyHelper.create_survey(zone_id: "2") + + response = client.get("#{SURVEY_BASE}?zone_id=2", headers: headers) + response.status_code.should eq(200) + response.body.should eq([survey2.as_json].to_json) + end end describe "#create" do diff --git a/src/controllers/surveys.cr b/src/controllers/surveys.cr index d965b61a..dded05e8 100644 --- a/src/controllers/surveys.cr +++ b/src/controllers/surveys.cr @@ -18,8 +18,18 @@ class Surveys < Application # returns a list of surveys @[AC::Route::GET("/")] - def index : Array(Survey::Responder) - Survey.query.select("id, title, description, trigger, zone_id, building_id, pages").to_a.map(&.as_json) + def index( + @[AC::Param::Info(name: "zone_id", description: "filters surveys by zone_id", example: "zone1234")] + zone_id : String? = nil, + @[AC::Param::Info(name: "building_id", description: "filters surveys by building_id", example: "building1234")] + building_id : String? = nil + ) : Array(Survey::Responder) + query = Survey.query.select("id, title, description, trigger, zone_id, building_id, pages") + + query = query.where(zone_id: zone_id) if zone_id + query = query.where(building_id: building_id) if building_id + + query.to_a.map(&.as_json) end # creates a new survey From 714b3f9b41dee6640962d15ec606fb7a77ae31e9 Mon Sep 17 00:00:00 2001 From: Mia Bennett Date: Wed, 18 Jan 2023 13:15:58 +0930 Subject: [PATCH 3/9] test(survey): survey filter --- OPENAPI_DOC.yml | 18 +++++++++++++++++- spec/controllers/helpers/survey_helper.cr | 2 +- spec/controllers/surveys_spec.cr | 11 ++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/OPENAPI_DOC.yml b/OPENAPI_DOC.yml index 89295c69..f4239678 100644 --- a/OPENAPI_DOC.yml +++ b/OPENAPI_DOC.yml @@ -4641,7 +4641,23 @@ paths: tags: - Surveys operationId: Surveys#index - parameters: [] + parameters: + - name: zone_id + in: query + description: filters surveys by zone_id + example: zone1234 + required: false + schema: + type: string + nullable: true + - name: building_id + in: query + description: filters surveys by building_id + example: building1234 + required: false + schema: + type: string + nullable: true responses: 200: description: OK diff --git a/spec/controllers/helpers/survey_helper.cr b/spec/controllers/helpers/survey_helper.cr index ce3ae4ad..7d3b27ad 100644 --- a/spec/controllers/helpers/survey_helper.cr +++ b/spec/controllers/helpers/survey_helper.cr @@ -53,6 +53,6 @@ module SurveyHelper end def create_survey(question_order = [] of Int64, zone_id = nil, building_id = nil) - survey_responder(question_order).to_survey.save! + survey_responder(question_order, zone_id, building_id).to_survey.save! end end diff --git a/spec/controllers/surveys_spec.cr b/spec/controllers/surveys_spec.cr index 04ee7824..40fd873b 100644 --- a/spec/controllers/surveys_spec.cr +++ b/spec/controllers/surveys_spec.cr @@ -15,7 +15,7 @@ describe Surveys do response.body.should eq([survey.as_json].to_json) end - it "should return a list of surveys filtered by zone_id", focus: true do + it "should return a list of surveys filtered by zone_id" do survey1 = SurveyHelper.create_survey(zone_id: "1") survey2 = SurveyHelper.create_survey(zone_id: "2") @@ -23,6 +23,15 @@ describe Surveys do response.status_code.should eq(200) response.body.should eq([survey2.as_json].to_json) end + + it "should return a list of surveys filtered by building_id" do + survey1 = SurveyHelper.create_survey(building_id: "1") + survey2 = SurveyHelper.create_survey(building_id: "2") + + response = client.get("#{SURVEY_BASE}?building_id=1", headers: headers) + response.status_code.should eq(200) + response.body.should eq([survey1.as_json].to_json) + end end describe "#create" do From 24392656df589e2acdb6511fcefae2835dee4e07 Mon Sep 17 00:00:00 2001 From: Mia Bennett Date: Wed, 18 Jan 2023 15:53:12 +0930 Subject: [PATCH 4/9] fix(survey): invitations token and table --- src/models/survey/invitation.cr | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/models/survey/invitation.cr b/src/models/survey/invitation.cr index 08c3ca23..39ceca4f 100644 --- a/src/models/survey/invitation.cr +++ b/src/models/survey/invitation.cr @@ -3,10 +3,10 @@ require "ulid" class Survey class Invitation include Clear::Model - self.table = "invitations" + self.table = "survey_invitations" column id : Int64, primary: true, presence: false - column token : String + column token : String, presence: false column email : String column sent : Bool, presence: false @@ -58,7 +58,6 @@ class Survey private def validate_columns add_error("survey_id", "must be defined") unless survey_id_column.defined? - add_error("token", "must be defined") unless token_column.defined? add_error("email", "must be defined") unless email_column.defined? end end From 9cf924b6657095437b84a29ba716db304824bf45 Mon Sep 17 00:00:00 2001 From: Mia Bennett Date: Wed, 18 Jan 2023 15:55:10 +0930 Subject: [PATCH 5/9] test(bookings): move bookings helper to helpers folder --- spec/controllers/bookings_spec.cr | 99 +------------------- spec/controllers/guests_spec.cr | 1 + spec/controllers/helpers/booking_helper.cr | 100 +++++++++++++++++++++ 3 files changed, 102 insertions(+), 98 deletions(-) create mode 100644 spec/controllers/helpers/booking_helper.cr diff --git a/spec/controllers/bookings_spec.cr b/spec/controllers/bookings_spec.cr index 1c654e86..e0267b64 100644 --- a/spec/controllers/bookings_spec.cr +++ b/spec/controllers/bookings_spec.cr @@ -1,5 +1,6 @@ require "../spec_helper" require "./helpers/spec_clean_up" +require "./helpers/booking_helper" describe Bookings do Spec.before_each { Booking.query.each(&.delete) } @@ -1139,101 +1140,3 @@ describe Bookings do end BOOKINGS_BASE = Bookings.base_route - -module BookingsHelper - extend self - - def create_booking(tenant_id, user_email) - user_name = Faker::Internet.user_name - zones = ["zone-#{Random.new.rand(500)}", "zone-#{Random.new.rand(500)}", "zone-#{Random.new.rand(500)}"] - Booking.create!( - tenant_id: tenant_id, - user_id: user_email, - user_email: PlaceOS::Model::Email.new(user_email), - user_name: user_name, - asset_id: "asset-#{Random.new.rand(500)}", - zones: zones, - booking_type: "desk", - booking_start: Random.new.rand(5..19).minutes.from_now.to_unix, - booking_end: Random.new.rand(25..79).minutes.from_now.to_unix, - checked_in: false, - approved: false, - rejected: false, - booked_by_email: PlaceOS::Model::Email.new(user_email), - booked_by_id: user_email, - booked_by_name: user_name, - utm_source: "desktop", - history: [] of Booking::History, - ) - end - - def create_booking(tenant_id, booking_start, booking_end) - booking = create_booking(tenant_id) - booking.booking_start = booking_start - booking.booking_end = booking_end - booking.save! - end - - def create_booking(tenant_id, booking_start, booking_end, asset_id) - booking = create_booking(tenant_id) - booking.booking_start = booking_start - booking.booking_end = booking_end - booking.asset_id = asset_id - booking.save! - end - - def create_booking(tenant_id) - user_email = Faker::Internet.email - create_booking(tenant_id: tenant_id, user_email: user_email) - end - - def http_create_booking( - user_id = "jon@example.com", - user_email = "jon@example.com", - user_name = "Jon Smith", - asset_id = "asset-1", - zones = ["zone-1234", "zone-4567", "zone-890"], - booking_type = "desk", - booking_start = 5.minutes.from_now.to_unix, - booking_end = 1.hour.from_now.to_unix, - booked_by_email = "jon@example.com", - booked_by_id = "jon@example.com", - booked_by_name = "Jon Smith", - history = nil, - utm_source = nil, - department = nil, - limit_override = nil - ) - body = { - user_id: user_id, - user_email: user_email ? PlaceOS::Model::Email.new(user_email) : nil, - user_name: user_name, - asset_id: asset_id, - zones: zones, - booking_type: booking_type, - booking_start: booking_start, - booking_end: booking_end, - booked_by_email: booked_by_email ? PlaceOS::Model::Email.new(booked_by_email) : nil, - booked_by_id: booked_by_id, - booked_by_name: booked_by_name, - history: history, - department: department, - }.to_h.compact!.to_json - - client = AC::SpecHelper.client - - param = URI::Params.new - param.add("utm_source", utm_source) if utm_source - param.add("limit_override", limit_override) if limit_override - uri = URI.new(path: BOOKINGS_BASE, query: param) - response = client.post(uri.to_s, - body: body, - headers: Mock::Headers.office365_guest - ) - if response.success? - {response.status_code, JSON.parse(response.body).as_h} - else - {response.status_code, {} of String => JSON::Any} - end - end -end diff --git a/spec/controllers/guests_spec.cr b/spec/controllers/guests_spec.cr index 1e60bfa2..8af1c9c5 100644 --- a/spec/controllers/guests_spec.cr +++ b/spec/controllers/guests_spec.cr @@ -1,5 +1,6 @@ require "../spec_helper" require "./helpers/spec_clean_up" +require "./helpers/booking_helper" require "../../src/constants" describe Guests do diff --git a/spec/controllers/helpers/booking_helper.cr b/spec/controllers/helpers/booking_helper.cr new file mode 100644 index 00000000..669c023d --- /dev/null +++ b/spec/controllers/helpers/booking_helper.cr @@ -0,0 +1,100 @@ +module BookingsHelper + extend self + + def random_zones : Array(String) + ["zone-#{Random.new.rand(500)}", "zone-#{Random.new.rand(500)}", "zone-#{Random.new.rand(500)}"] + end + + def create_booking(tenant_id : Int64, user_email : String, zones : Array(String) = random_zones) + user_name = Faker::Internet.user_name + Booking.create!( + tenant_id: tenant_id, + user_id: user_email, + user_email: PlaceOS::Model::Email.new(user_email), + user_name: user_name, + asset_id: "asset-#{Random.new.rand(500)}", + zones: zones, + booking_type: "desk", + booking_start: Random.new.rand(5..19).minutes.from_now.to_unix, + booking_end: Random.new.rand(25..79).minutes.from_now.to_unix, + checked_in: false, + approved: false, + rejected: false, + booked_by_email: PlaceOS::Model::Email.new(user_email), + booked_by_id: user_email, + booked_by_name: user_name, + utm_source: "desktop", + history: [] of Booking::History, + ) + end + + def create_booking(tenant_id : Int64, booking_start : Int64, booking_end : Int64) + booking = create_booking(tenant_id) + booking.booking_start = booking_start + booking.booking_end = booking_end + booking.save! + end + + def create_booking(tenant_id : Int64, booking_start : Int64, booking_end : Int64, asset_id : String) + booking = create_booking(tenant_id) + booking.booking_start = booking_start + booking.booking_end = booking_end + booking.asset_id = asset_id + booking.save! + end + + def create_booking(tenant_id) + user_email = Faker::Internet.email + create_booking(tenant_id: tenant_id, user_email: user_email) + end + + def http_create_booking( + user_id = "jon@example.com", + user_email = "jon@example.com", + user_name = "Jon Smith", + asset_id = "asset-1", + zones = ["zone-1234", "zone-4567", "zone-890"], + booking_type = "desk", + booking_start = 5.minutes.from_now.to_unix, + booking_end = 1.hour.from_now.to_unix, + booked_by_email = "jon@example.com", + booked_by_id = "jon@example.com", + booked_by_name = "Jon Smith", + history = nil, + utm_source = nil, + department = nil, + limit_override = nil + ) + body = { + user_id: user_id, + user_email: user_email ? PlaceOS::Model::Email.new(user_email) : nil, + user_name: user_name, + asset_id: asset_id, + zones: zones, + booking_type: booking_type, + booking_start: booking_start, + booking_end: booking_end, + booked_by_email: booked_by_email ? PlaceOS::Model::Email.new(booked_by_email) : nil, + booked_by_id: booked_by_id, + booked_by_name: booked_by_name, + history: history, + department: department, + }.to_h.compact!.to_json + + client = AC::SpecHelper.client + + param = URI::Params.new + param.add("utm_source", utm_source) if utm_source + param.add("limit_override", limit_override) if limit_override + uri = URI.new(path: BOOKINGS_BASE, query: param) + response = client.post(uri.to_s, + body: body, + headers: Mock::Headers.office365_guest + ) + if response.success? + {response.status_code, JSON.parse(response.body).as_h} + else + {response.status_code, {} of String => JSON::Any} + end + end +end From e12ed7a370e527d0081845048b89a4ecc4f2ed35 Mon Sep 17 00:00:00 2001 From: Mia Bennett Date: Wed, 18 Jan 2023 15:55:51 +0930 Subject: [PATCH 6/9] test(survey): set trigger in survey helper --- spec/controllers/helpers/survey_helper.cr | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/controllers/helpers/survey_helper.cr b/spec/controllers/helpers/survey_helper.cr index 7d3b27ad..df417bb4 100644 --- a/spec/controllers/helpers/survey_helper.cr +++ b/spec/controllers/helpers/survey_helper.cr @@ -38,12 +38,13 @@ module SurveyHelper question_responders.map { |q| q.to_question.save! } end - def survey_responder(question_order = [] of Int64, zone_id = nil, building_id = nil) + def survey_responder(question_order = [] of Int64, zone_id = nil, building_id = nil, trigger = nil) Survey::Responder.from_json({ title: "New Survey", description: "This is a new survey", zone_id: zone_id, building_id: building_id, + trigger: trigger, pages: [{ title: "Page 1", description: "This is page 1", @@ -52,7 +53,7 @@ module SurveyHelper }.to_json) end - def create_survey(question_order = [] of Int64, zone_id = nil, building_id = nil) - survey_responder(question_order, zone_id, building_id).to_survey.save! + def create_survey(question_order = [] of Int64, zone_id = nil, building_id = nil, trigger = nil) + survey_responder(question_order, zone_id, building_id, trigger).to_survey.save! end end From 4c8c97ea5514182b08e04ddc237bfb733d0e8ed6 Mon Sep 17 00:00:00 2001 From: Mia Bennett Date: Thu, 19 Jan 2023 09:35:05 +0930 Subject: [PATCH 7/9] feat(survey): update TriggerTypes for the types we can trigger on --- src/models/survey.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/survey.cr b/src/models/survey.cr index 6f0f285f..b0957d83 100644 --- a/src/models/survey.cr +++ b/src/models/survey.cr @@ -1,6 +1,6 @@ require "./survey/*" -Clear.enum TriggerType, "NONE", "RESERVED", "CHECKEDIN", "CHECKEDOUT", "NOSHOW", "REJECTED", "CANCELLED", "ENDED" +Clear.enum TriggerType, "NONE", "RESERVED", "CHECKEDIN", "CHECKEDOUT", "REJECTED", "CANCELLED" class Survey include Clear::Model From 544cdd301c9baaf7b2d80f965a4fb0220d1e7ad2 Mon Sep 17 00:00:00 2001 From: Mia Bennett Date: Thu, 19 Jan 2023 11:05:00 +0930 Subject: [PATCH 8/9] feat(survey): trigger on booking states --- src/migrations/0026_change_survey_tables.cr | 6 +++++- src/models/booking.cr | 19 +++++++++++++++++++ src/models/survey.cr | 3 ++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/migrations/0026_change_survey_tables.cr b/src/migrations/0026_change_survey_tables.cr index 10bd3479..adbbbf46 100644 --- a/src/migrations/0026_change_survey_tables.cr +++ b/src/migrations/0026_change_survey_tables.cr @@ -9,7 +9,11 @@ class ChangeSurveyTables execute("ALTER TABLE questions ADD COLUMN max_rating integer") execute("ALTER TABLE questions ADD COLUMN tags text[] DEFAULT '{}'") - create_enum(:survey_trigger_type, TriggerType) + # create_enum(:survey_trigger_type, TriggerType) + # changed to explicitly define enum values to avoid future issues + # that may arise from changing the TriggerType enum but not the database, + # if using the TriggerType enum directly then those issues would not be caught in dev/test + create_enum(:survey_trigger_type, %w(NONE RESERVED CHECKEDIN CHECKEDOUT NOSHOW REJECTED CANCELLED ENDED)) execute("ALTER TABLE surveys ADD COLUMN trigger survey_trigger_type DEFAULT 'NONE'") execute("ALTER TABLE surveys ADD COLUMN zone_id text") diff --git a/src/models/booking.cr b/src/models/booking.cr index 7b348ffd..4b384420 100644 --- a/src/models/booking.cr +++ b/src/models/booking.cr @@ -137,6 +137,25 @@ class Booking message: "History contains more than 3 events.", id: booking_model.id, } } if booking_model.history.size > 3 + booking_model.survey_trigger + end + + def survey_trigger + return unless history_column.changed? + state = history.last.state.to_s.upcase + + query = Survey.query.select("id").where(trigger: state) + if (zone_list = zones) && !zone_list.empty? + query = query.where { var("zone_id").in?(zone_list) & var("building_id").in?(zone_list) } + end + + surveys = query.to_a + surveys.each do |survey| + Survey::Invitation.create!( + survey_id: survey.id, + email: user_email.to_s, + ) + end end def current_history : Array(History) diff --git a/src/models/survey.cr b/src/models/survey.cr index b0957d83..cca0a585 100644 --- a/src/models/survey.cr +++ b/src/models/survey.cr @@ -1,6 +1,6 @@ require "./survey/*" -Clear.enum TriggerType, "NONE", "RESERVED", "CHECKEDIN", "CHECKEDOUT", "REJECTED", "CANCELLED" +Clear.enum TriggerType, "NONE", "RESERVED", "CHECKEDIN", "CHECKEDOUT", "NOSHOW", "REJECTED", "CANCELLED", "ENDED" class Survey include Clear::Model @@ -24,6 +24,7 @@ class Survey getter id : Int64? getter title : String? = nil getter description : String? = nil + @[JSON::Field(description: "Triggers on booking states: RESERVED, CHECKEDIN, CHECKEDOUT, REJECTED, CANCELLED")] getter trigger : TriggerType? = nil getter zone_id : String? = nil getter building_id : String? = nil From b5ab2934558d2ad41ee628964131382f8907919b Mon Sep 17 00:00:00 2001 From: Mia Bennett Date: Thu, 19 Jan 2023 11:08:09 +0930 Subject: [PATCH 9/9] docs(openapi): openapi doc gen --- OPENAPI_DOC.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OPENAPI_DOC.yml b/OPENAPI_DOC.yml index f4239678..5887a296 100644 --- a/OPENAPI_DOC.yml +++ b/OPENAPI_DOC.yml @@ -9752,6 +9752,8 @@ components: nullable: true trigger: type: object + description: 'Triggers on booking states: RESERVED, CHECKEDIN, CHECKEDOUT, + REJECTED, CANCELLED' nullable: true zone_id: type: string