diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/README.md b/README.md index 58d2986..28833f1 100644 --- a/README.md +++ b/README.md @@ -1 +1,14 @@ # API de déclaration d'Anomalie Adresse + +## Modèle de données + +![](image/model.png) + +## Description d'une séquence d'appels + +![](image/sequence.png) + +## Description du cycle de vie d'un ticket (API Ticketing) rattaché à une anomalie d'adresse + +![](image/lifecycle.png) + diff --git a/image/lifecycle.png b/image/lifecycle.png new file mode 100644 index 0000000..dbdcaff Binary files /dev/null and b/image/lifecycle.png differ diff --git a/image/model.png b/image/model.png new file mode 100644 index 0000000..b1bd106 Binary files /dev/null and b/image/model.png differ diff --git a/image/sequence.png b/image/sequence.png new file mode 100644 index 0000000..da5e5f7 Binary files /dev/null and b/image/sequence.png differ diff --git a/lifecycle.puml b/lifecycle.puml new file mode 100644 index 0000000..b9fe339 --- /dev/null +++ b/lifecycle.puml @@ -0,0 +1,48 @@ +@startuml +header Interop Trouble Ticket Lifecycle \nbased on TMF 621\n"Anomalie Adresse" Use Case + + +state acknowledged #palegreen +state inProgress #palegreen +state closed #palegreen +state rejected #palegreen +state cancelled #palegreen +state resolved #palegreen +state choice <> +state held #palegreen +state pending #palegreen + +[*] --> acknowledged: Controle de base. \n Syntaxe Ok +[*] --> [*]: Erreur Http. \n Requête invalide ou syntaxe KO + +acknowledged -[#green]-> inProgress: Affectation d'une ressource (humaine ou si) +acknowledged -[bold,#green]-> rejected: Validation KO +acknowledged -[bold,#blue]-> cancelled: Ticket annulé par l'OC + +inProgress -[#green]-> pending: l'Oi a besoin d'informations supplémentaires\n pour traiter le ticket +pending -right[#green]-> cancelled: Informations supplémentaires \n non fournies par l'OC +pending -[#blue]-> cancelled: Ticket annulé \n par l'OC +pending -[#blue]-> inProgress: Informations supplémentaires \nfournies par l'OC +inProgress -[bold,#green]-> cancelled: Ticket annulé par l'OI \n ou doublon \n(rattachement du ticket doublon dans les relationShip) +inProgress -[bold,#blue]-> cancelled: Ticket annulé \n par l'OC +inProgress -[bold,#green]-> resolved: Ticket résolu +inProgress -up[#green]-> held: affichage d'un gel interne OI +inProgress -[#green]-> inProgress : Complexity et expectedResolutiondate sont renseignées +held -[#green]-> inProgress: Changement de la date de résolution\n et complexité si nécessaire + +resolved -[bold,#blue]-> choice +resolved -[bold,#green]-> closed: Cloture par l'OI si besoin +choice -[bold,#blue]-> inProgress: Oc refuse la résolution +choice -[bold,#blue]-> closed: Résolution acceptée + +closed -[bold,#black]-> [*]: Fin du processus +cancelled -[bold,#black]-> [*]: Fin du processus +rejected -[bold,#black]-> [*]: Fin du processus + +legend + |= Color |= Type |= Description | + |<#blue>| <&arrow-right> | Changement d'état à la demande de l'OC| + |<#green>| <&arrow-right> | Changement d'état à la demande de l'OI | +endlegend + +@enduml diff --git a/model.puml b/model.puml new file mode 100644 index 0000000..75f9392 --- /dev/null +++ b/model.puml @@ -0,0 +1,104 @@ +@startuml +hide circle +hide methods +hide stereotype +show <> stereotype +skinparam class { + BackgroundColor<> #Thistle + BackgroundColor<> #LightGrey + BackgroundColor<> #FFFFFFF + BackgroundColor #Grey + BorderColor #Black + ArrowColor #Black +} + +class Anomalie <> { + id: String + href: String + commentaire_oc: String + commande_client_final_oc: String + creationDate: Datetime + type: String +} + +class Creation <> { + adresse: Adresse +} +Anomalie <|-- Creation +Creation *-- "1" Adresse + +class CreationImmeubleNeuf <> { + adresse: AdresseComplementsSpecifiques +} +note left: Une creation d'imb neuf aura une adresse de creation \net des complements +CreationImmeubleNeuf *-- "1" AdresseComplementsSpecifiques +Creation <|-- CreationImmeubleNeuf + +class Modification <> { + adresse_initiale: AdresseRef + adresse_cible: Adresse +} +Anomalie <|-- Modification +Modification *-- "1" Adresse +Modification *-- "1" AdresseRef + +class Adresse { + code_adresse: String + code_insee: String + code_voie_rivoli: String + numero_voie: integer + complement_numero_voie: String + type_voie: String + nom_voie: String + code_postal: String + commune: String + batiment: String + nombre_logements_adresse_ipe: integer + type_immeuble: String + type_projection_geographique: String + coordonnees: CoordonnesXY + immeuble_neuf: integer + reference_pm: String + code_ban: String + code_hexacle_voie: String + information_complementaire_adresse: String +} +Adresse *--"1" CoordonnesXY + +class AdresseRef { + identifiant_immeuble: String +} +note right of AdresseRef: Seul l'identifiant d'immeuble\n est obligatoire sur \n l'adresse initiale + +class AdresseComplementsSpecifiques { + promoteur: String + organisme_bailleur: String + adresse_bailleur: String + cp_bailleur: Integer + ville_bailleur: String + tel_bailleur: String + siret_bailleur: String + signature_convention: String + date_signature_convention: Datetime + reference_pbo: String + adresse_pm: String + coordonnees_pm: CoordonnesXY +} +Adresse <|-- AdresseComplementsSpecifiques +AdresseComplementsSpecifiques *--"1" CoordonnesXY + +class CoordonnesXY { + x: String + y: String + type: projection +} + +legend + |= Color |= Description | + |<#Thistle>| Enumération de constantes| + |<#FFFFFF>| Ressource exposée par l'API | + |<#LightGrey>| Objet pointant vers une API (via id et href) | + |<#Grey>| Objet propre à l'API | +endlegend + +@enduml diff --git a/sequence.puml b/sequence.puml new file mode 100644 index 0000000..6c93f79 --- /dev/null +++ b/sequence.puml @@ -0,0 +1,15 @@ +@startuml +'https://plantuml.com/sequence-diagram + +autonumber + +Customer -> "AnomalieIPE API" : **POST /anomalieIpe** Création de l'anomalie souhaitée +"AnomalieIPE API" --> Customer : **HTTP 201** Identifiant de l'anomalie +... ... +Customer -> "AnomalieIPE API" : **GET /anomalieIpe/{id}** Récupération de l'anomalie\n et de ses informations +"AnomalieIPE API" --> Customer : **HTTP 200** Anomalie +... ... +Customer -> "AnomalieIPE API" : **GET /anomalieIpe?type=Creation** Recherche des anomalieIpe de Creation +"AnomalieIPE API" --> Customer : **HTTP 200** Liste des tickets + +@enduml \ No newline at end of file diff --git a/swagger.yaml b/swagger.yaml new file mode 100644 index 0000000..69d0666 --- /dev/null +++ b/swagger.yaml @@ -0,0 +1,555 @@ +openapi: 3.0.0 +info: + title: Interop Anomalie Adresse + version: 1.0.0 +tags: + - name: AnomalieAdresse +servers: + - url: https://serverRoot/api/anomalieAdresse/v1 +paths: + /anomalieAdresse: + get: + operationId: listAnomalie + summary: List or find Anomalie objects + description: This operation list or find Anomalie entities + tags: + - AnomalieAdresse + parameters: + - name: fields + description: Comma-separated properties to be provided in response + required: false + in: query + schema: + type: string + - name: "@type" + in: query + description: Filter type + schema: + type: string + style: form + - name: creationDate + in: query + description: Filter creationDate + schema: + type: string + style: form + - name: creationDate.lte + in: query + description: Filter creationDate before + schema: + type: string + style: form + - name: creationDate.lt + in: query + description: Filter creationDate strictly_before + schema: + type: string + style: form + - name: creationDate.gte + in: query + description: Filter creationDate after + schema: + type: string + style: form + - name: creationDate.gt + in: query + description: Filter creationDate strictly_after + schema: + type: string + style: form + - name: offset + description: Requested index for start of resources to be provided in response + required: false + in: query + schema: + type: integer + - name: limit + description: Requested number of resources to be provided in response + required: false + in: query + schema: + type: integer + responses: + "200": + description: Success + headers: + X-Result-Count: + description: Actual number of items returned in the response body + schema: + type: integer + X-Total-Count: + description: Total number of items matching criteria + schema: + type: integer + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Anomalie" + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: Not Found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "405": + description: Method Not allowed + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + operationId: createAnomalie + summary: Creates an Anomalie + description: This operation creates a Anomalie entity. + tags: + - AnomalieAdresse + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Anomalie-Create" + description: The Anomalie to be created + required: true + responses: + "201": + description: Created + headers: + Location: + schema: + type: string + description: "URI of the newly created resource" + content: + application/json: + schema: + $ref: "#/components/schemas/Anomalie" + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "405": + description: Method Not allowed + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "/anomalieAdresse/{id}": + get: + operationId: retrieveAnomalie + summary: Retrieves a Anomalie by ID + description: This operation retrieves a Anomalie entity. Attribute selection is + enabled for all first level attributes. + tags: + - AnomalieAdresse + parameters: + - name: id + description: Identifier of the Anomalie + required: true + in: path + schema: + type: string + - name: fields + description: Comma-separated properties to provide in response + required: false + in: query + schema: + type: string + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/Anomalie" + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "401": + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "403": + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: Not Found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "405": + description: Method Not allowed + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" +components: + schemas: + Anomalie-Create: + type: object + properties: + commentaire_oc: + type: string + commande_client_final_oc: + type: boolean + description: Si 1, signalement suite à une demande client final + "@type": + type: string + creationDate: + type: string + format: date-time + discriminator: + propertyName: "@type" + + Anomalie: + type: object + required: + - id + - href + properties: + id: + type: string + description: Unique-Identifier for this Anomalie + href: + type: string + description: URL serving as reference for this Anomalie + commentaire_oc: + type: string + commande_client_final_oc: + type: boolean + description: Si 1, signalement suite à une demande client final + "@type": + type: string + creationDate: + type: string + format: date-time + discriminator: + propertyName: "@type" + + Creation: + type: object + description: L'adresse cible correspond à une adresse simple à créer + required: + - "@type" + properties: + "@type": + type: string + adresse: + $ref: "#/components/schemas/Adresse" + + Creation-Get: + allOf: + - $ref: "#/components/schemas/Anomalie" + - $ref: "#/components/schemas/Creation" + + Creation-Create: + allOf: + - $ref: "#/components/schemas/Anomalie-Create" + - $ref: "#/components/schemas/Creation" + + CreationImmeubleNeuf: + allOf: + - $ref: '#/components/schemas/Creation' + - type: object + description: L'adresse cible correspond à un immeuble neuf à créer + required: + - "@type" + properties: + "@type": + type: string + adresse: + $ref: "#/components/schemas/AdresseComplementsSpecifiques" + + CreationImmeubleNeuf-Get: + allOf: + - $ref: "#/components/schemas/Anomalie" + - $ref: "#/components/schemas/CreationImmeubleNeuf" + + CreationImmeubleNeuf-Create: + allOf: + - $ref: "#/components/schemas/Anomalie-Create" + - $ref: "#/components/schemas/CreationImmeubleNeuf" + + Modification: + type: object + description: L'adresse cible peut décrire une modification simple d'adresse, ou avec compléments + required: + - "@type" + properties: + "@type": + type: string + adresse_initiale: + $ref: "#/components/schemas/AdresseRef" + adresse_cible: + $ref: "#/components/schemas/Adresse" + + Modification-Get: + allOf: + - $ref: "#/components/schemas/Anomalie" + - $ref: "#/components/schemas/Modification" + + Modification-Create: + allOf: + - $ref: "#/components/schemas/Anomalie-Create" + - $ref: "#/components/schemas/Modification" + + Adresse: + type: object + properties: + code_adresse: + type: string + maxLength: 10 + description: Code hexacle numero. + code_insee: + type: string + maxLength: 5 + description: Code Insee Immeuble. + code_voie_rivoli: + type: string + maxLength: 4 + description: Code Rivoli Immeuble. + numero_voie: + type: integer + minimum: 0 + maximum: 99999 + description: Numero Voie Immeuble. + complement_numero_voie: + type: string + maxLength: 2 + description: Complement du Numero Voie Immeuble. + type_voie: + type: string + maxLength: 255 + description: Type Voie Immeuble. + nom_voie: + type: string + maxLength: 255 + description: Nom Voie Immeuble. + code_postal: + type: string + maxLength: 5 + description: Code Postal Immeuble. + commune: + type: string + maxLength: 255 + description: Commune Immeuble. + batiment: + type: string + maxLength: 255 + description: Batiment Immeuble. + nombre_logements: + type: integer + description: Nombre Locaux Immeuble. + type_immeuble: + type: string + maxLength: 20 + description: Type Immeuble. + enum: [PAVILLON,IMMEUBLE,LOTISSEMENT] + coordonnees: + $ref: "#/components/schemas/CoordonnesXY" + immeuble_neuf: + type: integer + description: Caractere neuf Immeuble.\nObligatoire\nA remplir avec la valeur cible si type_demande = CREATION, sinon 0\nExplication des valeurs 0=Ne sait pas ; 1=Oui (avec cuivre) ; 2=Oui (ZLIN=sans cuivre) ; 3=Non + enum: [0,1,2,3] + default: 0 + reference_pm: + type: string + maxLength: 20 + description: PM Immmeuble. + code_ban: + type: string + maxLength: 30 + description: Code BAN Immeuble. + code_hexacle_voie: + type: string + maxLength: 10 + description: Code Hexacle du 0 de la voie. + information_complementaire: + type: string + maxLength: 255 + description: ligne 5 du SNA par exemple. + "@type": + type: string + discriminator: + propertyName: "@type" + + AdresseRef: + type: object + properties: + identifiant_immeuble: + type: string + maxLength: 30 + + AdresseComplementsSpecifiques: + allOf: + - $ref: "#/components/schemas/Adresse" + - type: object + properties: + promoteur: + type: string + maxLength: 255 + description: Informations a fournir si possible pour les immeubles neufs. + organisme_bailleur: + type: string + maxLength: 255 + description: Informations a fournir si possible pour les immeubles neufs. + adresse_bailleur: + type: string + maxLength: 255 + description: Informations a fournir si possible pour les immeubles neufs. + cp_bailleur: + type: integer + maxLength: 5 + description: Informations a fournir si possible pour les immeubles neufs. + ville_bailleur: + type: string + maxLength: 255 + description: Informations a fournir si possible pour les immeubles neufs. + tel_bailleur: + type: string + maxLength: 255 + description: Informations a fournir si possible pour les immeubles neufs. + siret_bailleur: + type: string + maxLength: 14 + description: Siret du bailleur à fournir si possible pour les immeubles neufs. + signature_convention: + type: string + maxLength: 255 + description: Informations a fournir si possible pour les immeubles neufs. + date_signature_convention: + type: string + format: date + maxLength: 255 + description: Informations a fournir si possible pour les immeubles neufs. + reference_pbo: + type: string + maxLength: 255 + description: Informations a fournir si possible pour les immeubles neufs. + adresse_pm: + type: string + maxLength: 255 + description: Informations a fournir si possible pour les immeubles neufs. + coordonnees_pm: + $ref: "#/components/schemas/CoordonnesXY" + + CoordonnesXY: + required: + - x + - y + - projection + type: "object" + description: Coordonnées géographiques avec le type de projection + properties: + x: + type: number + y: + type: number + projection: + type: string + maxLength: 10 + description: Type Projection geographique.\nExplication des valeurs + - RGF93 (Lambert93) = métropole + - WGS84 (UTM 20N) =Guadeloupe, Martinique + - RGFG95 (UTM 22N) = Guyane + - RGR92 (UTM 40S) = Réunion + - RGM 04 (UTM 38 S) = Mayotte + - RGSPM 06 (UTM 21 N) = Saint Pierre et Miquelon + enum: [RGF93,WGS84,RGFG95,RGR92,RGM,RGSPM] + + Error: + description: Used when an API throws an Error, typically with a HTTP error + response-code (3xx, 4xx, 5xx) + type: object + required: + - code + - reason + properties: + code: + type: string + description: Application relevant detail, defined in the API or a common list. + reason: + type: string + description: Explanation of the reason for the error which can be shown to a + client user. + message: + type: string + description: More details and corrective actions related to the error which can + be shown to a client user. + status: + type: string + description: HTTP Error code extension + referenceError: + type: string + format: uri + description: URI of documentation describing the error. + "@baseType": + type: string + description: When sub-classing, this defines the super-class. + "@schemaLocation": + type: string + format: uri + description: A URI to a JSON-Schema file that defines additional attributes and + relationships + "@type": + type: string + description: When sub-classing, this defines the sub-class entity name.