{"openapi":"3.0.0","info":{"description":"This is the REST contract for the BloodBank System","version":"1.0.0","title":"(21W) Group Project - BloodBank System","contact":{"name":"(21W) CST8277","email":"emamis@algonquincollege.com","url":"https://brightspace.algonquincollege.com/d2l/home/314057"}},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/AlgonquinCollege/21W-Group_Project-BloodBank/1.0.0"},{"url":"http://localhost:{port}/{contextRoot}/{basePath}","variables":{"port":{"default":"8080"},"contextRoot":{"default":"rest-bloodbank"},"basePath":{"default":"api/v1"}}}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}},"parameters":{"idPathParam":{"in":"path","name":"id","required":true,"schema":{"type":"integer","format":"int64","description":"a resource's id","example":1}},"id2PathParam":{"in":"path","name":"id2","required":true,"schema":{"type":"integer","format":"int64","description":"a resource's id","example":1}}},"responses":{"ForbiddenError":{"description":"Access to the specified resource has been forbidden"},"UnauthorizedAdminError":{"description":"request requires HTTP authentication for ADMIN_ROLE"},"UnauthorizedUserError":{"description":"request requires HTTP authentication for USER_ROLE"},"NotFound":{"description":"The specified resource was not found"}},"schemas":{"PojoBase":{"type":"object","required":["id","version"],"properties":{"id":{"description":"id of entity","type":"integer"},"version":{"description":"version (OptLock) of entity","type":"integer"},"created":{"description":"creation timestamp of entity","type":"string","format":"date-time"},"updated":{"description":"last-updatd timestamp of entity","type":"string","format":"date-time"}}},"Person":{"description":"(21W) Group Project - Person entity","type":"object","allOf":[{"$ref":"#/components/schemas/PojoBase"}],"properties":{"firstName":{"type":"string","description":"First Name of the Person","example":"John"},"lastName":{"type":"string","description":"Last Name of the Person","example":"Doe"},"email":{"type":"string","description":"Email of the Person","example":"John.Doe@gmail.com"},"phoneNumber":{"type":"string","description":"Phone number of the Person","example":"+1.613.555.1212"},"billingAddress":{"$ref":"#/components/schemas/BillingAddress"},"shippingAddress":{"$ref":"#/components/schemas/ShippingAddress"}}},"PersonsList":{"description":"list of Person","type":"array","items":{"$ref":"#/components/schemas/Person"}},"Address":{"description":"(20W) Group Project - Address entity","discriminator":{"propertyName":"type"},"required":["type"],"type":"object","allOf":[{"$ref":"#/components/schemas/PojoBase"}],"properties":{"type":{"type":"string","description":"type of Address","example":"B for BillingAddress"},"street":{"type":"string","description":"Location of Address (street)","example":"1385 Woodroffe Avenue"},"city":{"type":"string","description":"Location of Address (city)","example":"Ottawa"},"state":{"type":"string","description":"Location of Address (State/Province)","example":true},"country":{"type":"string","description":"Location of Address (country)","example":"Canada"},"postal":{"type":"string","description":"Postal Code","example":"K2G 1V8"}}},"BillingAddress":{"type":"object","allOf":[{"$ref":"#/components/schemas/Address"}],"properties":{"alsoShipping":{"type":"boolean","description":"indicates that this BillingAddress is also the Person's ShippingAddress"},"type":{"type":"string","description":"address type","example":"B"}}},"ShippingAddress":{"type":"object","allOf":[{"$ref":"#/components/schemas/Address"}],"properties":{"type":{"type":"string","description":"address type","example":"S"}}},"Order":{"description":"(21W) Group Project - Order entity","type":"object","allOf":[{"$ref":"#/components/schemas/PojoBase"}],"properties":{"description":{"type":"string","description":"Description of the order","example":"Long Shirt"},"owningPerson":{"$ref":"#/components/schemas/Person"},"orderLines":{"$ref":"#/components/schemas/OrderLinesList"}}},"OrderList":{"description":"list of orders","type":"array","items":{"$ref":"#/components/schemas/Order"}},"OrderLine":{"description":"(21W) Group Project - OrderLine entity","type":"object","allOf":[{"$ref":"#/components/schemas/PojoBase"}],"properties":{"orderLineNo":{"type":"number","description":"OrderLine number","example":2},"amount":{"type":"number","description":"amount of the related Product","example":1.5},"price":{"type":"number","description":"price of the related Product","example":123.45},"product":{"$ref":"#/components/schemas/Product"}}},"OrderLinesList":{"description":"list of OrderLines","type":"array","items":{"$ref":"#/components/schemas/OrderLine"}},"Product":{"description":"(21W) Group Project - Product entity","type":"object","allOf":[{"$ref":"#/components/schemas/PojoBase"}],"properties":{"description":{"type":"string","description":"Description of the product","example":"Shirt"},"serialNo":{"type":"string","description":"serialNo of the product","example":"Abc123"}}},"ProductsList":{"description":"list of products","type":"array","items":{"$ref":"#/components/schemas/Product"}},"Store":{"description":"(21W) Group Project - Store entity","type":"object","allOf":[{"$ref":"#/components/schemas/PojoBase"}],"properties":{"storeName":{"type":"string","description":"Store Name","example":"Hudson Bay"},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}},"StoresList":{"description":"list of stores","type":"array","items":{"$ref":"#/components/schemas/Store"}}}},"paths":{"/customer":{"get":{"summary":"Retrieves the list of Persons","responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonsList"}}}},"401":{"$ref":"#/components/responses/UnauthorizedAdminError"}}},"post":{"summary":"Adds a new Person","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Person"}}}},"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonsList"}}}},"401":{"$ref":"#/components/responses/UnauthorizedAdminError"}}}},"/customer/{id}":{"get":{"summary":"Retrieves the specified Person (by id)","parameters":[{"$ref":"#/components/parameters/idPathParam"}],"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Person"}}}},"401":{"$ref":"#/components/responses/UnauthorizedUserError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"summary":"Removes the specified Person (by id)","parameters":[{"$ref":"#/components/parameters/idPathParam"}],"responses":{"204":{"description":"Ok (successful operation, no content)"},"401":{"$ref":"#/components/responses/UnauthorizedUserError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"summary":"Update the specified Person (by id)","parameters":[{"$ref":"#/components/parameters/idPathParam"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Person"}}}},"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonsList"}}}}}}},"/customer/{id}/orders":{"get":{"summary":"Retrieve the list of Orders for the specified Person (by id)","parameters":[{"$ref":"#/components/parameters/idPathParam"}],"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderList"}}}},"401":{"$ref":"#/components/responses/UnauthorizedAdminError"}}},"post":{"summary":"Add a new Order for the specified Person (by id)","parameters":[{"$ref":"#/components/parameters/idPathParam"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderList"}}}}}}},"/customer/{id}/orders/{id2}":{"get":{"summary":"Retrieve the specific Order (by id2) for the specified Person (by id)","parameters":[{"$ref":"#/components/parameters/idPathParam"},{"$ref":"#/components/parameters/id2PathParam"}],"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"$ref":"#/components/responses/UnauthorizedAdminError"}}}},"/product":{"get":{"summary":"Retrieves all Products","responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductsList"}}}},"401":{"$ref":"#/components/responses/UnauthorizedAdminError"}}},"post":{"summary":"Add a new Product","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductsList"}}}}}}},"/product/{id}":{"get":{"summary":"Retrieves the specified Product (by id)","parameters":[{"$ref":"#/components/parameters/idPathParam"}],"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"$ref":"#/components/responses/UnauthorizedUserError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"summary":"Update the specified Product (by id)","parameters":[{"$ref":"#/components/parameters/idPathParam"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductsList"}}}}}}},"/store":{"get":{"summary":"Retrieves all Stores","responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoresList"}}}},"401":{"$ref":"#/components/responses/UnauthorizedAdminError"}}},"post":{"summary":"Add a new Store","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoresList"}}}},"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoresList"}}}}}}},"/store/{id}":{"get":{"summary":"Retrieves the specified Store (by id)","parameters":[{"$ref":"#/components/parameters/idPathParam"}],"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"401":{"$ref":"#/components/responses/UnauthorizedUserError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"summary":"Removes the specified Store (by id)","parameters":[{"$ref":"#/components/parameters/idPathParam"}],"responses":{"204":{"description":"Ok (successful operation, no content)"},"401":{"$ref":"#/components/responses/UnauthorizedUserError"},"403":{"$ref":"#/components/responses/ForbiddenError"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"summary":"Updates the specified Store (by id)","parameters":[{"$ref":"#/components/parameters/idPathParam"}],"requestBody":{"description":"update store to Db","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"responses":{"200":{"description":"Ok (Successful operation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoresList"}}}}}}}}}