{"openapi":"3.0.3","info":{"title":"KSFDC Mock API Server","description":"Production-ready mock server for KSFDC — IDP, PMU, and Theatre Management integration and frontend testing.","version":"1.0.0"},"servers":[{"url":"/api/idp","description":"IDP Module"},{"url":"/api/theatre-applications","description":"Theatre Management — Applications"},{"url":"/api/screens","description":"Theatre Management — Screens & Layouts"}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer access token or admin_access_token."},"CsrfToken":{"type":"apiKey","in":"header","name":"X-CSRF-Token","description":"Mock CSRF Token (e.g. csrf-token)."},"ApiVersion":{"type":"apiKey","in":"header","name":"API-Version","description":"Required on every request. Value: 1.0"}},"schemas":{"GenericError":{"type":"object","properties":{"errorCode":{"type":"string","nullable":true},"message":{"type":"string"},"data":{"type":"array","items":{}}}},"TheatreError":{"type":"object","properties":{"status":{"type":"string","enum":["FAILURE"]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}},"traceId":{"type":"string"}}},"TheatreSuccess":{"type":"object","properties":{"status":{"type":"string","enum":["SUCCESS"]},"data":{"type":"object"}}},"ApiVersionHeader":{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]},"description":"Must be 1.0"}}},"paths":{"/users/register":{"post":{"tags":["IDP — Registration & Consent"],"summary":"Register User","description":"Registers a public or official user.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userCategory","accountType","email","fullName","clientId","dataProcessingConsent","mobileNumber","password"],"properties":{"userCategory":{"type":"string","enum":["PUBLIC","OFFICIAL"]},"accountType":{"type":"string","enum":["INDIVIDUAL","ORGANIZATION"]},"email":{"type":"string","format":"email"},"fullName":{"type":"string"},"clientId":{"type":"string"},"dataProcessingConsent":{"type":"boolean","enum":[true]},"emailVerified":{"type":"boolean"},"mobileVerified":{"type":"boolean"},"mobileNumber":{"type":"string"},"displayName":{"type":"string"},"password":{"type":"string"},"createdBy":{"type":"string","nullable":true},"intervalDays":{"type":"number","default":180}}}}}},"responses":{"200":{"description":"Successful registration"},"400":{"description":"Validation / User already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericError"}}}}}}},"/consent/message":{"get":{"tags":["IDP — Registration & Consent"],"summary":"Get Consent Message","description":"Fetches consent text for PUBLIC or OFFICIAL users.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}},{"name":"userCategory","in":"query","required":true,"schema":{"type":"string","enum":["PUBLIC","OFFICIAL"]}}],"responses":{"200":{"description":"Consent message details"}}}},"/auth/check-user-otp":{"post":{"tags":["IDP — Authentication & OTP"],"summary":"Check User for OTP","description":"Verifies user existence and checks if OTP sending is allowed.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["otpType","identifier","clientId"],"properties":{"otpType":{"type":"string","enum":["EMAIL_OTP","MOBILE_OTP"]},"identifier":{"type":"string"},"clientId":{"type":"string"}}}}}},"responses":{"200":{"description":"OTP delivery allowed"}}}},"/":{"get":{"tags":["Theatre — Applications"],"summary":"List Theatre Applications","description":"Returns all theatre applications for the authenticated user. Sorted by most recently updated.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Bearer <access_token>"},{"name":"status","in":"query","required":false,"schema":{"type":"integer","enum":[1,2,3,4,5,6]},"description":"1=IN_PROGRESS, 2=SUBMITTED, 3=RETURNED, 4=RESUBMITTED, 5=APPROVED, 6=REJECTED"}],"responses":{"200":{"description":"List of theatre applications","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreSuccess"}}}},"400":{"description":"VALIDATION_ERROR — invalid status param","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}}}}},"/profile":{"put":{"tags":["Theatre — Applications"],"summary":"Upsert Profile","description":"Creates a new theatre application or updates the profile + address + contacts tab of an existing one.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["theatreName","registeredName","lsgdLicenseNo","noOfScreens","address","contacts"],"properties":{"theatreId":{"type":"string","format":"uuid","nullable":true},"theatreName":{"type":"string"},"registeredName":{"type":"string"},"theatreType":{"type":"string","enum":["MULTIPLEX","SINGLE_SCREEN","DRIVE_IN","MINI_THEATRE"],"nullable":true},"lsgdLicenseNo":{"type":"string"},"noOfScreens":{"type":"integer","minimum":0},"chainAffiliation":{"type":"string","nullable":true},"address":{"type":"object"},"contacts":{"type":"array","items":{"type":"object"},"minItems":1}}}}}},"responses":{"200":{"description":"Profile saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreSuccess"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"409":{"description":"DUPLICATE_LICENSE_NUMBER or INVALID_STATE_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}}}}},"/{theatreId}":{"get":{"tags":["Theatre — Applications"],"summary":"Get Full Application","description":"Returns the complete snapshot of a single theatre application including all sub-sections.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"theatreId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Full application snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreSuccess"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"404":{"description":"THEATRE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}}}}},"/{theatreId}/facilities":{"put":{"tags":["Theatre — Applications"],"summary":"Upsert Facilities","description":"Saves or updates the facilities tab. One row per theatre; repeated calls overwrite all fields.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"theatreId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["parkingAvailable","fbCounters","outsideFoodAllowed","freeDrinkingWater","onlineQrEntry","firstAidMedical","dedicatedSecurity","wheelchairAccessibleScreens","accessibleRestrooms","numWheelchairSeats"],"properties":{"parkingAvailable":{"type":"boolean"},"fbCounters":{"type":"boolean"},"outsideFoodAllowed":{"type":"boolean"},"freeDrinkingWater":{"type":"boolean"},"onlineQrEntry":{"type":"boolean"},"firstAidMedical":{"type":"boolean"},"dedicatedSecurity":{"type":"boolean"},"wheelchairAccessibleScreens":{"type":"boolean"},"accessibleRestrooms":{"type":"boolean"},"numWheelchairSeats":{"type":"integer","minimum":0}}}}}},"responses":{"200":{"description":"Facilities saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreSuccess"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"404":{"description":"THEATRE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"409":{"description":"INVALID_STATE_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}}}}},"/{theatreId}/legal":{"put":{"tags":["Theatre — Applications"],"summary":"Upsert Legal + Documents","description":"Saves or updates the legal tab including tax details, certificates, and uploaded documents.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"theatreId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"taxLegal":{"type":"object"},"documents":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"200":{"description":"Legal tab saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreSuccess"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"404":{"description":"THEATRE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"409":{"description":"INVALID_STATE_TRANSITION or DUPLICATE_RESOURCE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}}}}},"/{theatreId}/screens":{"post":{"tags":["Theatre — Screens"],"summary":"Upsert Screen","description":"Creates a new screen or fully updates an existing screen’s technical specifications.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"theatreId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["screenName","screenType"],"properties":{"screenId":{"type":"string","format":"uuid","nullable":true},"screenName":{"type":"string"},"screenType":{"type":"string","enum":["STANDARD","PREMIUM","IMAX","3D","4DX"]},"projection":{"type":"object","nullable":true},"audio":{"type":"object","nullable":true},"geometry":{"type":"object","nullable":true},"aspectRatios":{"type":"array","items":{"type":"string"}},"frameRates":{"type":"array","items":{"type":"string"}},"formats":{"type":"array","items":{"type":"string"}},"audioCerts":{"type":"array","items":{"type":"string"}},"maskingTypes":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Screen created/updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreSuccess"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"404":{"description":"THEATRE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"409":{"description":"INVALID_STATE_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}}}}},"/{theatreId}/submit":{"post":{"tags":["Theatre — Applications"],"summary":"Submit Application","description":"Submits a fully completed theatre application for approval. Transitions status to SUBMITTED or RESUBMITTED.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"theatreId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["infoTrueConfirmed","termsAccepted","integrationConsent"],"properties":{"infoTrueConfirmed":{"type":"boolean","enum":[true]},"termsAccepted":{"type":"boolean","enum":[true]},"integrationConsent":{"type":"boolean","enum":[true]}}}}}},"responses":{"200":{"description":"Application submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreSuccess"}}}},"400":{"description":"VALIDATION_ERROR — consent fields missing or false","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"404":{"description":"THEATRE_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"409":{"description":"INVALID_STATE_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"422":{"description":"INCOMPLETE_APPLICATION — not all tabs/screens complete","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}}}}},"/{screenId}":{"delete":{"tags":["Theatre — Screens"],"summary":"Delete Screen","description":"Permanently deletes a screen and its seat layout. Only allowed when parent theatre is IN_PROGRESS / RETURNED / RESUBMITTED.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"screenId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Screen deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreSuccess"}}}},"404":{"description":"SCREEN_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"409":{"description":"INVALID_STATE_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}}}}},"/{screenId}/layout":{"put":{"tags":["Theatre — Screens"],"summary":"Upsert Seat Layout","description":"Creates or fully replaces the seat layout for a screen. Processes rows into individual seat records; SPACEs are skipped.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","enum":["1.0"]}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"screenId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["zones","rows"],"properties":{"layoutId":{"type":"string","format":"uuid","nullable":true},"screenPosition":{"type":"string","enum":["CENTER","LEFT","RIGHT"]},"flipHorizontal":{"type":"boolean"},"flipVertical":{"type":"boolean"},"zones":{"type":"array","minItems":1,"items":{"type":"object","required":["zoneId","zoneName","zoneType"],"properties":{"zoneId":{"type":"string","format":"uuid"},"zoneName":{"type":"string"},"zoneType":{"type":"string","enum":["STANDARD","PREMIUM","VIP","ACCESSIBLE"]}}}},"rows":{"type":"array","minItems":1,"items":{"type":"object","required":["rowLabel","rowOrder","seats"],"properties":{"rowLabel":{"type":"string"},"rowOrder":{"type":"integer"},"isEmpty":{"type":"boolean"},"seats":{"type":"array","items":{"type":"object"}}}}},"seatGroups":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"200":{"description":"Layout saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreSuccess"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"404":{"description":"SCREEN_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}},"409":{"description":"INVALID_STATE_TRANSITION","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TheatreError"}}}}}}}}}