Parcourir la source

bugfix

master
Daniel il y a 1 mois
Parent
révision
0683acf451
5 fichiers modifiés avec 55 ajouts et 159 suppressions
  1. +0
    -1
      export/openapi.json
  2. +1
    -0
      openapi.json
  3. +46
    -146
      openapi.yaml
  4. +2
    -2
      src/ApiResource/SaleApi.php
  5. +6
    -10
      src/Entity/Sale.php

+ 0
- 1
export/openapi.json
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 1
- 0
openapi.json
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


export/openapi.yaml → openapi.yaml Voir le fichier

@@ -8,6 +8,42 @@ servers:
url: / url: /
description: '' description: ''
paths: paths:
/api/auth:
post:
operationId: login_check_post
tags:
- 'Login Check'
responses:
200:
description: 'User token created'
content:
application/json:
schema:
type: object
properties:
token: { readOnly: true, type: string, nullable: false }
required:
- token
summary: 'Creates a user token.'
description: 'Creates a user token.'
requestBody:
description: 'The login data'
content:
application/json:
schema:
type: object
properties:
email:
type: string
nullable: false
password:
type: string
nullable: false
required:
- email
- password
required: true
parameters: []
/api/comments: /api/comments:
get: get:
operationId: api_comments_get_collection operationId: api_comments_get_collection
@@ -774,22 +810,6 @@ paths:
type: array type: array
items: items:
$ref: '#/components/schemas/DocumentObject-document_object.read' $ref: '#/components/schemas/DocumentObject-document_object.read'
text/html:
schema:
type: array
items:
$ref: '#/components/schemas/DocumentObject-document_object.read'
application/hal+json:
schema:
type: object
properties:
_embedded: { type: array, items: { $ref: '#/components/schemas/DocumentObject.jsonhal-document_object.read' } }
totalItems: { type: integer, minimum: 0 }
itemsPerPage: { type: integer, minimum: 0 }
_links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } }
required:
- _links
- _embedded
summary: 'Retrieves the collection of DocumentObject resources.' summary: 'Retrieves the collection of DocumentObject resources.'
description: 'Retrieves the collection of DocumentObject resources.' description: 'Retrieves the collection of DocumentObject resources.'
parameters: parameters:
@@ -830,18 +850,12 @@ paths:
201: 201:
description: 'DocumentObject resource created' description: 'DocumentObject resource created'
content: content:
application/ld+json:
schema:
$ref: '#/components/schemas/DocumentObject.jsonld-document_object.read'
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/DocumentObject-document_object.read' $ref: '#/components/schemas/DocumentObject-document_object.read'
text/html:
schema:
$ref: '#/components/schemas/DocumentObject-document_object.read'
application/hal+json:
application/ld+json:
schema: schema:
$ref: '#/components/schemas/DocumentObject.jsonhal-document_object.read'
$ref: '#/components/schemas/DocumentObject.jsonld-document_object.read'
links: { } links: { }
400: 400:
description: 'Invalid input' description: 'Invalid input'
@@ -878,12 +892,6 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/DocumentObject-document_object.read' $ref: '#/components/schemas/DocumentObject-document_object.read'
text/html:
schema:
$ref: '#/components/schemas/DocumentObject-document_object.read'
application/hal+json:
schema:
$ref: '#/components/schemas/DocumentObject.jsonhal-document_object.read'
404: 404:
description: 'Resource not found' description: 'Resource not found'
summary: 'Retrieves a DocumentObject resource.' summary: 'Retrieves a DocumentObject resource.'
@@ -1269,22 +1277,6 @@ paths:
type: array type: array
items: items:
$ref: '#/components/schemas/MediaObject-media_object.read' $ref: '#/components/schemas/MediaObject-media_object.read'
text/html:
schema:
type: array
items:
$ref: '#/components/schemas/MediaObject-media_object.read'
application/hal+json:
schema:
type: object
properties:
_embedded: { type: array, items: { $ref: '#/components/schemas/MediaObject.jsonhal-media_object.read' } }
totalItems: { type: integer, minimum: 0 }
itemsPerPage: { type: integer, minimum: 0 }
_links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } }
required:
- _links
- _embedded
summary: 'Retrieves the collection of MediaObject resources.' summary: 'Retrieves the collection of MediaObject resources.'
description: 'Retrieves the collection of MediaObject resources.' description: 'Retrieves the collection of MediaObject resources.'
parameters: parameters:
@@ -1325,18 +1317,12 @@ paths:
201: 201:
description: 'MediaObject resource created' description: 'MediaObject resource created'
content: content:
application/ld+json:
schema:
$ref: '#/components/schemas/MediaObject.jsonld-media_object.read'
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/MediaObject-media_object.read' $ref: '#/components/schemas/MediaObject-media_object.read'
text/html:
schema:
$ref: '#/components/schemas/MediaObject-media_object.read'
application/hal+json:
application/ld+json:
schema: schema:
$ref: '#/components/schemas/MediaObject.jsonhal-media_object.read'
$ref: '#/components/schemas/MediaObject.jsonld-media_object.read'
links: { } links: { }
400: 400:
description: 'Invalid input' description: 'Invalid input'
@@ -1373,12 +1359,6 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/MediaObject-media_object.read' $ref: '#/components/schemas/MediaObject-media_object.read'
text/html:
schema:
$ref: '#/components/schemas/MediaObject-media_object.read'
application/hal+json:
schema:
$ref: '#/components/schemas/MediaObject.jsonhal-media_object.read'
404: 404:
description: 'Resource not found' description: 'Resource not found'
summary: 'Retrieves a MediaObject resource.' summary: 'Retrieves a MediaObject resource.'
@@ -4467,42 +4447,6 @@ paths:
allowReserved: false allowReserved: false
deprecated: false deprecated: false
parameters: [] parameters: []
/auth:
post:
operationId: login_check_post
tags:
- 'Login Check'
responses:
200:
description: 'User token created'
content:
application/json:
schema:
type: object
properties:
token: { readOnly: true, type: string, nullable: false }
required:
- token
summary: 'Creates a user token.'
description: 'Creates a user token.'
requestBody:
description: 'The login data'
content:
application/json:
schema:
type: object
properties:
email:
type: string
nullable: false
password:
type: string
nullable: false
required:
- email
- password
required: true
parameters: []
components: components:
schemas: schemas:
Comment: Comment:
@@ -5237,28 +5181,6 @@ components:
type: type:
- string - string
- 'null' - 'null'
DocumentObject.jsonhal-document_object.read:
type: object
description: ''
deprecated: false
externalDocs:
url: 'https://schema.org/MediaObject'
properties:
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
format: iri-reference
contentUrl:
externalDocs:
url: 'https://schema.org/contentUrl'
type:
- string
- 'null'
DocumentObject.jsonld-document_object.read: DocumentObject.jsonld-document_object.read:
type: object type: object
description: '' description: ''
@@ -5308,28 +5230,6 @@ components:
type: type:
- string - string
- 'null' - 'null'
MediaObject.jsonhal-media_object.read:
type: object
description: ''
deprecated: false
externalDocs:
url: 'https://schema.org/MediaObject'
properties:
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
format: iri-reference
contentUrl:
externalDocs:
url: 'https://schema.org/contentUrl'
type:
- string
- 'null'
MediaObject.jsonld-media_object.read: MediaObject.jsonld-media_object.read:
type: object type: object
description: '' description: ''
@@ -6698,11 +6598,11 @@ components:
example: 'https://example.com/' example: 'https://example.com/'
turnover: turnover:
type: type:
- integer
- number
- 'null' - 'null'
profit: profit:
type: type:
- integer
- number
- 'null' - 'null'
quantity: quantity:
type: type:
@@ -6764,11 +6664,11 @@ components:
example: 'https://example.com/' example: 'https://example.com/'
turnover: turnover:
type: type:
- integer
- number
- 'null' - 'null'
profit: profit:
type: type:
- integer
- number
- 'null' - 'null'
quantity: quantity:
type: type:
@@ -6844,11 +6744,11 @@ components:
example: 'https://example.com/' example: 'https://example.com/'
turnover: turnover:
type: type:
- integer
- number
- 'null' - 'null'
profit: profit:
type: type:
- integer
- number
- 'null' - 'null'
quantity: quantity:
type: type:

+ 2
- 2
src/ApiResource/SaleApi.php Voir le fichier

@@ -122,10 +122,10 @@ class SaleApi implements OwnerInterface
public ?ProductApi $productIri = null; public ?ProductApi $productIri = null;


#[NotBlank] #[NotBlank]
public ?int $turnover = null;
public ?float $turnover = null;


#[NotBlank] #[NotBlank]
public ?int $profit = null;
public ?float $profit = null;


#[NotBlank] #[NotBlank]
public ?int $quantity = null; public ?int $quantity = null;


+ 6
- 10
src/Entity/Sale.php Voir le fichier

@@ -29,10 +29,10 @@ class Sale
private ?Product $product = null; private ?Product $product = null;


#[ORM\Column] #[ORM\Column]
private ?int $turnover = null;
private ?float $turnover = null;


#[ORM\Column(nullable: true)] #[ORM\Column(nullable: true)]
private ?int $profit = null;
private ?float $profit = null;


#[ORM\Column(type: "integer", nullable: false, options: ["unsigned" => true])] #[ORM\Column(type: "integer", nullable: false, options: ["unsigned" => true])]
protected int $quantity; protected int $quantity;
@@ -96,28 +96,24 @@ class Sale
return $this; return $this;
} }


public function getTurnover(): ?int
public function getTurnover(): ?float
{ {
return $this->turnover; return $this->turnover;
} }


public function setTurnover(int $turnover): static
public function setTurnover(?float $turnover): void
{ {
$this->turnover = $turnover; $this->turnover = $turnover;

return $this;
} }


public function getProfit(): ?int
public function getProfit(): ?float
{ {
return $this->profit; return $this->profit;
} }


public function setProfit(?int $profit): static
public function setProfit(?float $profit): void
{ {
$this->profit = $profit; $this->profit = $profit;

return $this;
} }


public function getQuantity(): int public function getQuantity(): int


Chargement…
Annuler
Enregistrer