feat(fontend,backend): Add createdBy and lastModifiedBy fields
This commit is contained in:
@@ -678,6 +678,8 @@ components:
|
||||
- name
|
||||
- formElements
|
||||
- isTemplate
|
||||
- createdBy
|
||||
- lastModifiedBy
|
||||
- createdAt
|
||||
- modifiedAt
|
||||
properties:
|
||||
@@ -692,6 +694,10 @@ components:
|
||||
$ref: "#/components/schemas/FormElementDto"
|
||||
isTemplate:
|
||||
type: boolean
|
||||
createdBy:
|
||||
type: string
|
||||
lastModifiedBy:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
@@ -704,6 +710,8 @@ components:
|
||||
- name
|
||||
- formElements
|
||||
- isTemplate
|
||||
- createdBy
|
||||
- lastModifiedBy
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
@@ -715,6 +723,10 @@ components:
|
||||
isTemplate:
|
||||
type: boolean
|
||||
default: false
|
||||
createdBy:
|
||||
type: string
|
||||
lastModifiedBy:
|
||||
type: string
|
||||
|
||||
PagedApplicationFormDto:
|
||||
type: object
|
||||
|
||||
@@ -30,6 +30,12 @@ class ApplicationForm(
|
||||
@Column(nullable = false)
|
||||
var isTemplate: Boolean,
|
||||
|
||||
@Column(nullable = false)
|
||||
var createdBy: String = "",
|
||||
|
||||
@Column(nullable = false)
|
||||
var lastModifiedBy: String = "",
|
||||
|
||||
@CreatedDate
|
||||
@Column(nullable = false)
|
||||
var createdAt: LocalDateTime? = null,
|
||||
@@ -37,6 +43,4 @@ class ApplicationForm(
|
||||
@LastModifiedDate
|
||||
@Column(nullable = false)
|
||||
var modifiedAt: LocalDateTime? = null
|
||||
|
||||
// TODO LastModifiedBy User einfügen
|
||||
)
|
||||
|
||||
@@ -13,6 +13,8 @@ class ApplicationFormMapper(private val formElementMapper: FormElementMapper) {
|
||||
name = applicationForm.name,
|
||||
formElements = applicationForm.formElements.map { formElementMapper.toFormElementDto(it) },
|
||||
isTemplate = applicationForm.isTemplate,
|
||||
createdBy = applicationForm.createdBy,
|
||||
lastModifiedBy = applicationForm.lastModifiedBy,
|
||||
createdAt = applicationForm.createdAt ?: LocalDateTime.now(),
|
||||
modifiedAt = applicationForm.modifiedAt ?: LocalDateTime.now()
|
||||
)
|
||||
@@ -24,6 +26,8 @@ class ApplicationFormMapper(private val formElementMapper: FormElementMapper) {
|
||||
name = applicationForm.name,
|
||||
formElements = applicationForm.formElements.map { formElementMapper.toFormElement(it) }.toMutableList(),
|
||||
isTemplate = applicationForm.isTemplate,
|
||||
createdBy = applicationForm.createdBy,
|
||||
lastModifiedBy = applicationForm.lastModifiedBy,
|
||||
createdAt = applicationForm.createdAt,
|
||||
modifiedAt = applicationForm.modifiedAt
|
||||
)
|
||||
@@ -32,7 +36,9 @@ class ApplicationFormMapper(private val formElementMapper: FormElementMapper) {
|
||||
fun toApplicationForm(createApplicationFormDto: CreateApplicationFormDto): ApplicationForm {
|
||||
val applicationForm = ApplicationForm(
|
||||
name = createApplicationFormDto.name,
|
||||
isTemplate = createApplicationFormDto.isTemplate
|
||||
isTemplate = createApplicationFormDto.isTemplate,
|
||||
createdBy = createApplicationFormDto.createdBy,
|
||||
lastModifiedBy = createApplicationFormDto.lastModifiedBy
|
||||
)
|
||||
applicationForm.formElements = createApplicationFormDto.formElements
|
||||
.map { formElementMapper.toFormElement(it, applicationForm) }
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
create table application_form
|
||||
(
|
||||
is_template boolean not null,
|
||||
created_at timestamp(6) not null,
|
||||
modified_at timestamp(6) not null,
|
||||
id uuid not null,
|
||||
name varchar(255) not null,
|
||||
is_template boolean not null,
|
||||
created_at timestamp(6) not null,
|
||||
modified_at timestamp(6) not null,
|
||||
id uuid not null,
|
||||
created_by varchar(255) not null,
|
||||
last_modified_by varchar(255) not null,
|
||||
name varchar(255) not null,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user