First Commit 09/10
This commit is contained in:
4
PyroFetes/.idea/.idea.PyroFetes/.idea/encodings.xml
generated
Normal file
4
PyroFetes/.idea/.idea.PyroFetes/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
||||
8
PyroFetes/.idea/.idea.PyroFetes/.idea/indexLayout.xml
generated
Normal file
8
PyroFetes/.idea/.idea.PyroFetes/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
8
PyroFetes/.idea/.idea.PyroFetes/.idea/projectSettingsUpdater.xml
generated
Normal file
8
PyroFetes/.idea/.idea.PyroFetes/.idea/projectSettingsUpdater.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RiderProjectSettingsUpdater">
|
||||
<option name="singleClickDiffPreview" value="1" />
|
||||
<option name="unhandledExceptionsIgnoreList" value="1" />
|
||||
<option name="vcsConfiguration" value="3" />
|
||||
</component>
|
||||
</project>
|
||||
66
PyroFetes/.idea/.idea.PyroFetes/.idea/workspace.xml
generated
Normal file
66
PyroFetes/.idea/.idea.PyroFetes/.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="d96e474d-65b4-4ba3-b29a-8b061521ff58" name="Changes" comment="" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ProblemsViewState">
|
||||
<option name="selectedTabId" value="Toolset" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo"><![CDATA[{
|
||||
"associatedIndex": 5
|
||||
}]]></component>
|
||||
<component name="ProjectId" id="33pVanUBtZaJBGFUWpQVCbSMGAe" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"last_opened_file_path": "/home/carteronm@stsio.lan/Documents/Projet4/PyroFetes.sln",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="d96e474d-65b4-4ba3-b29a-8b061521ff58" name="Changes" comment="" />
|
||||
<created>1760014067675</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1760014067675</updated>
|
||||
<workItem from="1760014069254" duration="39000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="UnityProjectConfiguration" hasMinimizedUI="false" />
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<breakpoint enabled="true" type="DotNet_Exception_Breakpoints">
|
||||
<properties exception="System.OperationCanceledException" breakIfHandledByOtherCode="false" displayValue="System.OperationCanceledException" />
|
||||
<option name="timeStamp" value="1" />
|
||||
</breakpoint>
|
||||
<breakpoint enabled="true" type="DotNet_Exception_Breakpoints">
|
||||
<properties exception="System.Threading.Tasks.TaskCanceledException" breakIfHandledByOtherCode="false" displayValue="System.Threading.Tasks.TaskCanceledException" />
|
||||
<option name="timeStamp" value="2" />
|
||||
</breakpoint>
|
||||
<breakpoint enabled="true" type="DotNet_Exception_Breakpoints">
|
||||
<properties exception="System.Threading.ThreadAbortException" breakIfHandledByOtherCode="false" displayValue="System.Threading.ThreadAbortException" />
|
||||
<option name="timeStamp" value="3" />
|
||||
</breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace PyroFetes.DTO.Availability.Request;
|
||||
|
||||
public class CreateAvailabilityDto
|
||||
{
|
||||
public DateOnly AvailabilityDate { get; set; }
|
||||
public DateOnly DeliveryDate { get; set; }
|
||||
public DateOnly ExpirationDate { get; set; }
|
||||
public DateOnly RenewalDate { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.DTO.Availability.Request;
|
||||
|
||||
public class GetAvailabilityRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
10
PyroFetes/DTO/Availability/Request/UpdateAvailabilityDto.cs
Normal file
10
PyroFetes/DTO/Availability/Request/UpdateAvailabilityDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace PyroFetes.DTO.Availability.Request;
|
||||
|
||||
public class UpdateAvailabilityDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateOnly AvailabilityDate { get; set; }
|
||||
public DateOnly DeliveryDate { get; set; }
|
||||
public DateOnly ExpirationDate { get; set; }
|
||||
public DateOnly RenewalDate { get; set; }
|
||||
}
|
||||
10
PyroFetes/DTO/Availability/Response/GetAvailabilityDto.cs
Normal file
10
PyroFetes/DTO/Availability/Response/GetAvailabilityDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace PyroFetes.DTO.Availability.Response;
|
||||
|
||||
public class GetAvailabilityDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateOnly AvailabilityDate { get; set; }
|
||||
public DateOnly DeliveryDate { get; set; }
|
||||
public DateOnly ExpirationDate { get; set; }
|
||||
public DateOnly RenewalDate { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.DTO.Communication.Request;
|
||||
|
||||
public class CreateCommunicationDto
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.DTO.Communication.Request;
|
||||
|
||||
public class GetCommunicationRequest
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.DTO.Communication.Request;
|
||||
|
||||
public class UpdateCommunicationDto
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace PyroFetes.DTO.Communication.Response;
|
||||
|
||||
public class GetCommunicationRequest
|
||||
{
|
||||
public string? Calling { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? Meeting { get; set; }
|
||||
}
|
||||
11
PyroFetes/DTO/Contact/Request/CreateContactDto.cs
Normal file
11
PyroFetes/DTO/Contact/Request/CreateContactDto.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace PyroFetes.DTO.Contact.Request;
|
||||
|
||||
public class CreateContactDto
|
||||
{
|
||||
public string? LastName { get; set; }
|
||||
public string? FirstName { get; set; }
|
||||
public string? PhoneNumber { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public string? Role { get; set; }
|
||||
}
|
||||
6
PyroFetes/DTO/Contact/Request/GetContactRequest.cs
Normal file
6
PyroFetes/DTO/Contact/Request/GetContactRequest.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.DTO.Contact.Request;
|
||||
|
||||
public class GetContactRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
12
PyroFetes/DTO/Contact/Request/UpdateContactDto.cs
Normal file
12
PyroFetes/DTO/Contact/Request/UpdateContactDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace PyroFetes.DTO.Contact.Request;
|
||||
|
||||
public class UpdateContactDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? LastName { get; set; }
|
||||
public string? FirstName { get; set; }
|
||||
public string? PhoneNumber { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public string? Role { get; set; }
|
||||
}
|
||||
12
PyroFetes/DTO/Contact/Response/GetContactDto.cs
Normal file
12
PyroFetes/DTO/Contact/Response/GetContactDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace PyroFetes.DTO.Contact.Response;
|
||||
|
||||
public class GetContactDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? LastName { get; set; }
|
||||
public string? FirstName { get; set; }
|
||||
public string? PhoneNumber { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public string? Role { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.DTO.ExperienceLevel.Request;
|
||||
|
||||
public class CreateExperienceLevelDto
|
||||
{
|
||||
public string? Label { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.DTO.ExperienceLevel.Request;
|
||||
|
||||
public class GetExperienceLevelRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.ExperienceLevel.Request;
|
||||
|
||||
public class UpdateExperienceLevelDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Label { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.ExperienceLevel.Response;
|
||||
|
||||
public class GetExperienceLevelDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Label { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.HistoryOfApproval.Request;
|
||||
|
||||
public class CreateHistoryOfApprovalDto
|
||||
{
|
||||
public DateOnly DeliveryDate { get; set; }
|
||||
public DateOnly ExpirationDate { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.DTO.HistoryOfApproval.Request;
|
||||
|
||||
public class GetHistoryOfApprovalRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace PyroFetes.DTO.HistoryOfApproval.Request;
|
||||
|
||||
public class UpdateHistoryOfApprovalDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateOnly DeliveryDate { get; set; }
|
||||
public DateOnly ExpirationDate { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace PyroFetes.DTO.HistoryOfApproval.Response;
|
||||
|
||||
public class GetHistoryOfApprovalDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateOnly DeliveryDate { get; set; }
|
||||
public DateOnly ExpirationDate { get; set; }
|
||||
}
|
||||
7
PyroFetes/DTO/Staff/Request/CreateStaffDto.cs
Normal file
7
PyroFetes/DTO/Staff/Request/CreateStaffDto.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PyroFetes.DTO.Staff.Request;
|
||||
|
||||
public class CreateStaffDto
|
||||
{
|
||||
public string? F4T2NumberApproval { get; set; }
|
||||
public string? F4T2ExpirationDate { get; set; }
|
||||
}
|
||||
6
PyroFetes/DTO/Staff/Request/GetStaffRequest.cs
Normal file
6
PyroFetes/DTO/Staff/Request/GetStaffRequest.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.DTO.Staff.Request;
|
||||
|
||||
public class GetStaffRequest
|
||||
{
|
||||
public string? Label { get; set; }
|
||||
}
|
||||
8
PyroFetes/DTO/Staff/Request/UpdateStaffDto.cs
Normal file
8
PyroFetes/DTO/Staff/Request/UpdateStaffDto.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace PyroFetes.DTO.Staff.Request;
|
||||
|
||||
public class UpdateStaffDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? F4T2NumberApproval { get; set; }
|
||||
public string? F4T2ExpirationDate { get; set; }
|
||||
}
|
||||
6
PyroFetes/DTO/Staff/Response/GetStaffDto.cs
Normal file
6
PyroFetes/DTO/Staff/Response/GetStaffDto.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.DTO.Staff.Response;
|
||||
|
||||
public class GetStaffDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using FastEndpoints;
|
||||
using PyroFetes.DTO.Availability.Request;
|
||||
using PyroFetes.DTO.Availability.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Availability;
|
||||
|
||||
public class CreateAvailabilityEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint<CreateAvailabilityDto, GetAvailabilityDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/api/availabilities");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
|
||||
public override async Task HandleAsync(CreateAvailabilityDto req, CancellationToken ct)
|
||||
{
|
||||
Models.Availability availability = new()
|
||||
{
|
||||
AvailabilityDate = req.AvailabilityDate,
|
||||
DeliveryDate = req.DeliveryDate,
|
||||
ExpirationDate = req.ExpirationDate,
|
||||
RenewallDate = req.RenewalDate,
|
||||
};
|
||||
pyroFetesDbContext.Add(availability);
|
||||
await pyroFetesDbContext.SaveChangesAsync(ct);
|
||||
|
||||
GetAvailabilityDto response = new()
|
||||
{
|
||||
AvailabilityDate = availability.AvailabilityDate,
|
||||
DeliveryDate = availability.DeliveryDate,
|
||||
ExpirationDate = availability.ExpirationDate,
|
||||
RenewalDate = availability.RenewallDate
|
||||
};
|
||||
|
||||
await Send.OkAsync(response, ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.Availability.Request;
|
||||
using PyroFetes.DTO.Availability.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Availability;
|
||||
|
||||
public class DeleteAvailabilityEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint <GetAvailabilityRequest, GetAvailabilityDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Delete ("/api/availabilities/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetAvailabilityRequest req, CancellationToken ct)
|
||||
{
|
||||
Models.Availability? databaseAvailability = await pyroFetesDbContext.Availabilities.SingleOrDefaultAsync(x => x.Id == req.Id, cancellationToken: ct);
|
||||
|
||||
if (databaseAvailability == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
pyroFetesDbContext.Availabilities.Remove(databaseAvailability);
|
||||
await pyroFetesDbContext.SaveChangesAsync(ct);
|
||||
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.Availability.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Availability;
|
||||
|
||||
public class GetAllAvailabilityxuest(PyroFetesDbContext pyroFetesDbContext) : EndpointWithoutRequest<List<GetAvailabilityDto>>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get ("/api/availabilities");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
{
|
||||
List<GetAvailabilityDto> availabilities = await pyroFetesDbContext.Availabilities.Select(x => new GetAvailabilityDto()
|
||||
{
|
||||
Id = x.Id,
|
||||
AvailabilityDate = x.AvailabilityDate,
|
||||
DeliveryDate = x.DeliveryDate,
|
||||
ExpirationDate = x.ExpirationDate,
|
||||
RenewalDate = x.RenewallDate
|
||||
}).ToListAsync(ct);
|
||||
|
||||
await Send.OkAsync(availabilities, ct);
|
||||
}
|
||||
}
|
||||
37
PyroFetes/Endpoints/Availability/GetAvailabilityEndpoint.cs
Normal file
37
PyroFetes/Endpoints/Availability/GetAvailabilityEndpoint.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.Availability.Request;
|
||||
using PyroFetes.DTO.Availability.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Availability;
|
||||
|
||||
public class GetAvailabilityEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint <GetAvailabilityRequest, GetAvailabilityDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get ("/api/availabilities/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetAvailabilityRequest database, CancellationToken ct)
|
||||
{
|
||||
Models.Availability? databaseAvailability = await pyroFetesDbContext.Availabilities.SingleOrDefaultAsync(x => x.Id == database.Id, cancellationToken: ct);
|
||||
|
||||
if (databaseAvailability == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
GetAvailabilityDto dto = new()
|
||||
{
|
||||
Id = databaseAvailability.Id,
|
||||
AvailabilityDate = databaseAvailability.AvailabilityDate,
|
||||
DeliveryDate = databaseAvailability.DeliveryDate,
|
||||
ExpirationDate = databaseAvailability.ExpirationDate,
|
||||
RenewalDate = databaseAvailability.RenewallDate
|
||||
};
|
||||
|
||||
await Send.OkAsync(dto, ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.Availability.Request;
|
||||
using PyroFetes.DTO.Availability.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Availability;
|
||||
|
||||
public class UpdateAvailabilityEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint <UpdateAvailabilityDto, GetAvailabilityDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Put ("/api/availabilities/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(UpdateAvailabilityDto req, CancellationToken ct)
|
||||
{
|
||||
Models.Availability? databaseAvailability = await pyroFetesDbContext.Availabilities.SingleOrDefaultAsync(x => x.Id == req.Id, cancellationToken: ct);
|
||||
|
||||
if (databaseAvailability == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
databaseAvailability.AvailabilityDate = req.AvailabilityDate;
|
||||
databaseAvailability.DeliveryDate = req.DeliveryDate;
|
||||
databaseAvailability.ExpirationDate = req.ExpirationDate;
|
||||
databaseAvailability.RenewallDate = req.RenewalDate;
|
||||
}
|
||||
await pyroFetesDbContext.SaveChangesAsync(ct);
|
||||
|
||||
GetAvailabilityDto dto = new()
|
||||
{
|
||||
Id = databaseAvailability.Id,
|
||||
AvailabilityDate = req.AvailabilityDate,
|
||||
DeliveryDate = req.DeliveryDate,
|
||||
ExpirationDate = req.ExpirationDate,
|
||||
RenewalDate = req.RenewalDate,
|
||||
};
|
||||
|
||||
await Send.OkAsync(dto, ct);
|
||||
}
|
||||
}
|
||||
42
PyroFetes/Endpoints/Contact/CreateContactEndpoint.cs
Normal file
42
PyroFetes/Endpoints/Contact/CreateContactEndpoint.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using FastEndpoints;
|
||||
using PyroFetes.DTO.Contact.Request;
|
||||
using PyroFetes.DTO.Contact.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Contact;
|
||||
|
||||
public class CreateContactEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint<CreateContactDto, GetContactDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/api/contacts");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
|
||||
public override async Task HandleAsync(CreateContactDto req, CancellationToken ct)
|
||||
{
|
||||
Models.Contact contact = new()
|
||||
{
|
||||
LastName = req.LastName,
|
||||
FirstName = req.FirstName,
|
||||
PhoneNumber = req.PhoneNumber,
|
||||
Email = req.Email,
|
||||
Address = req.Address,
|
||||
Role = req.Role,
|
||||
};
|
||||
pyroFetesDbContext.Add(contact);
|
||||
await pyroFetesDbContext.SaveChangesAsync(ct);
|
||||
|
||||
GetContactDto response = new()
|
||||
{
|
||||
LastName = contact.LastName,
|
||||
FirstName = contact.FirstName,
|
||||
PhoneNumber = contact.PhoneNumber,
|
||||
Email = contact.Email,
|
||||
Address = contact.Address,
|
||||
Role = contact.Role,
|
||||
};
|
||||
|
||||
await Send.OkAsync(response, ct);
|
||||
}
|
||||
}
|
||||
30
PyroFetes/Endpoints/Contact/DeleteContactEndpoint.cs
Normal file
30
PyroFetes/Endpoints/Contact/DeleteContactEndpoint.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.Contact.Request;
|
||||
using PyroFetes.DTO.Contact.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Contact;
|
||||
|
||||
public class DeleteContactEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint <GetContactRequest, GetContactDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Delete ("/api/Contacts/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetContactRequest req, CancellationToken ct)
|
||||
{
|
||||
Models.Contact? databaseContact = await pyroFetesDbContext.Contacts.SingleOrDefaultAsync(x => x.Id == req.Id, cancellationToken: ct);
|
||||
|
||||
if (databaseContact == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
pyroFetesDbContext.Contacts.Remove(databaseContact);
|
||||
await pyroFetesDbContext.SaveChangesAsync(ct);
|
||||
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
||||
30
PyroFetes/Endpoints/Contact/GetAllContactsEndpoint.cs
Normal file
30
PyroFetes/Endpoints/Contact/GetAllContactsEndpoint.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.Contact.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Contact;
|
||||
|
||||
public class GetAllContactxuest(PyroFetesDbContext pyroFetesDbContext) : EndpointWithoutRequest<List<GetContactDto>>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get ("/api/contacts");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
{
|
||||
List<GetContactDto> contacts = await pyroFetesDbContext.Contacts.Select(x => new GetContactDto()
|
||||
{
|
||||
Id = x.Id,
|
||||
LastName = x.LastName,
|
||||
FirstName = x.FirstName,
|
||||
PhoneNumber = x.PhoneNumber,
|
||||
Email = x.Email,
|
||||
Address = x.Address,
|
||||
Role = x.Role,
|
||||
}).ToListAsync(ct);
|
||||
|
||||
await Send.OkAsync(contacts, ct);
|
||||
}
|
||||
}
|
||||
39
PyroFetes/Endpoints/Contact/GetContactEndpoint.cs
Normal file
39
PyroFetes/Endpoints/Contact/GetContactEndpoint.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.Contact.Request;
|
||||
using PyroFetes.DTO.Contact.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Contact;
|
||||
|
||||
public class GetContactEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint <GetContactRequest, GetContactDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get ("/api/contacts/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetContactRequest database, CancellationToken ct)
|
||||
{
|
||||
Models.Contact? databaseContact = await pyroFetesDbContext.Contacts.SingleOrDefaultAsync(x => x.Id == database.Id, cancellationToken: ct);
|
||||
|
||||
if (databaseContact == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
GetContactDto dto = new()
|
||||
{
|
||||
Id = databaseContact.Id,
|
||||
LastName = databaseContact.LastName,
|
||||
FirstName = databaseContact.FirstName,
|
||||
PhoneNumber = databaseContact.PhoneNumber,
|
||||
Email = databaseContact.Email,
|
||||
Address = databaseContact.Address,
|
||||
Role = databaseContact.Role,
|
||||
};
|
||||
|
||||
await Send.OkAsync(dto, ct);
|
||||
}
|
||||
}
|
||||
49
PyroFetes/Endpoints/Contact/UpdateContactRequest.cs
Normal file
49
PyroFetes/Endpoints/Contact/UpdateContactRequest.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.Contact.Request;
|
||||
using PyroFetes.DTO.Contact.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.Contact;
|
||||
|
||||
public class UpdateContactRequest(PyroFetesDbContext pyroFetesDbContext) : Endpoint <UpdateContactDto, GetContactDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Put ("/api/contacts/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(UpdateContactDto req, CancellationToken ct)
|
||||
{
|
||||
Models.Contact? databaseContact = await pyroFetesDbContext.Contacts.SingleOrDefaultAsync(x => x.Id == req.Id, cancellationToken: ct);
|
||||
|
||||
if (databaseContact == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
databaseContact.LastName = req.LastName;
|
||||
databaseContact.FirstName = req.FirstName;
|
||||
databaseContact.PhoneNumber = req.PhoneNumber;
|
||||
databaseContact.Email = req.Email;
|
||||
databaseContact.Address = req.Address;
|
||||
databaseContact.Role = req.Role;
|
||||
}
|
||||
await pyroFetesDbContext.SaveChangesAsync(ct);
|
||||
|
||||
GetContactDto dto = new()
|
||||
{
|
||||
Id = databaseContact.Id,
|
||||
LastName = req.LastName,
|
||||
FirstName = req.FirstName,
|
||||
PhoneNumber = req.PhoneNumber,
|
||||
Email = req.Email,
|
||||
Address = req.Address,
|
||||
Role = req.Role,
|
||||
};
|
||||
|
||||
await Send.OkAsync(dto, ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
using FastEndpoints;
|
||||
using PyroFetes.DTO.ExperienceLevel.Response;
|
||||
using PyroFetes.DTO.ExperienceLevel.Request;
|
||||
|
||||
namespace PyroFetes.Endpoints.ExperienceLevel;
|
||||
|
||||
public class CreateExperienceLevelEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint<CreateExperienceLevelDto, GetExperienceLevelDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/api/ExperienceLevels");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CreateExperienceLevelDto req, CancellationToken ct)
|
||||
{
|
||||
Models.ExperienceLevel experienceLevel = new()
|
||||
{
|
||||
Label = req.Label
|
||||
};
|
||||
pyroFetesDbContext.Add(experienceLevel);
|
||||
await pyroFetesDbContext.SaveChangesAsync(ct);
|
||||
|
||||
GetExperienceLevelDto response = new()
|
||||
{
|
||||
Id = experienceLevel.Id,
|
||||
Label = experienceLevel.Label,
|
||||
};
|
||||
|
||||
await Send.OkAsync(response, ct);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.ExperienceLevel.Request;
|
||||
using PyroFetes.DTO.ExperienceLevel.Response;
|
||||
using FastEndpoints;
|
||||
|
||||
namespace PyroFetes.Endpoints.ExperienceLevel;
|
||||
|
||||
public class DeleteExerienceLevelEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint <GetExperienceLevelRequest, GetExperienceLevelDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Delete ("/api/ExperienceLevels/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetExperienceLevelRequest req, CancellationToken ct)
|
||||
{
|
||||
Models.ExperienceLevel? databaseExperienceLevel = await pyroFetesDbContext.ExperienceLevels.SingleOrDefaultAsync(x => x.Id == req.Id, cancellationToken: ct);
|
||||
|
||||
if (databaseExperienceLevel == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
pyroFetesDbContext.ExperienceLevels.Remove(databaseExperienceLevel);
|
||||
await pyroFetesDbContext.SaveChangesAsync(ct);
|
||||
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.ExperienceLevel.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.ExperienceLevel;
|
||||
using FastEndpoints;
|
||||
|
||||
public class GetAllExperienceLevelsEndpoint(PyroFetesDbContext pyroFetesDbContext) : EndpointWithoutRequest<List<GetExperienceLevelDto>>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get ("/api/experienceLevels");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
{
|
||||
List<GetExperienceLevelDto> experienceLevels= await pyroFetesDbContext.ExperienceLevels.Select(x => new GetExperienceLevelDto()
|
||||
{
|
||||
Id = x.Id,
|
||||
}).ToListAsync(ct);
|
||||
|
||||
await Send.OkAsync(experienceLevels, ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.Endpoints.ExperienceLevel;
|
||||
|
||||
public class GetExperienceLevelEndpoint
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace PyroFetes.Endpoints.ExperienceLevel;
|
||||
|
||||
public class UpdateExperienceLevelEndpoint
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using FastEndpoints;
|
||||
using PyroFetes.DTO.HistoryOfApproval.Request;
|
||||
using PyroFetes.DTO.HistoryOfApproval.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.HistoryOfApproval;
|
||||
|
||||
public class CreateHistoryOfApprovalEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint<CreateHistoryOfApprovalDto, GetHistoryOfApprovalDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/api/HistoryOfApprovals");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
|
||||
public override async Task HandleAsync(CreateHistoryOfApprovalDto req, CancellationToken ct)
|
||||
{
|
||||
Models.HistoryOfApproval historyOfApproval = new()
|
||||
{
|
||||
DeliveryDate = req.DeliveryDate,
|
||||
ExpirationDate = req.ExpirationDate
|
||||
};
|
||||
pyroFetesDbContext.Add(historyOfApproval);
|
||||
await pyroFetesDbContext.SaveChangesAsync(ct);
|
||||
|
||||
GetHistoryOfApprovalDto response = new()
|
||||
{
|
||||
Id = historyOfApproval.Id,
|
||||
DeliveryDate = historyOfApproval.DeliveryDate,
|
||||
ExpirationDate = historyOfApproval.ExpirationDate
|
||||
};
|
||||
|
||||
await Send.OkAsync(response, ct);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.HistoryOfApproval.Request;
|
||||
using PyroFetes.DTO.HistoryOfApproval.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.HistoryOfApproval;
|
||||
|
||||
public class DeleteHistoryOfApprovalEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint <GetHistoryOfApprovalRequest, GetHistoryOfApprovalDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Delete ("/api/HistoryOfApprovals/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetHistoryOfApprovalRequest req, CancellationToken ct)
|
||||
{
|
||||
Models.HistoryOfApproval? databaseHistoryOfApproval = await pyroFetesDbContext.HistoryOfApprovals.SingleOrDefaultAsync(x => x.Id == req.Id, cancellationToken: ct);
|
||||
|
||||
if (databaseHistoryOfApproval == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
pyroFetesDbContext.HistoryOfApprovals.Remove(databaseHistoryOfApproval);
|
||||
await pyroFetesDbContext.SaveChangesAsync(ct);
|
||||
|
||||
await Send.NoContentAsync(ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.HistoryOfApproval.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.HistoryOfApproval;
|
||||
|
||||
public class GetAllHistoryOfApprovalEndpoint(PyroFetesDbContext pyroFetesDbContext) : EndpointWithoutRequest<List<GetHistoryOfApprovalDto>>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get ("/api/HistoryOfApprovals");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(CancellationToken ct)
|
||||
{
|
||||
List<GetHistoryOfApprovalDto> historyOfApprovals= await pyroFetesDbContext.HistoryOfApprovals.Select(x => new GetHistoryOfApprovalDto()
|
||||
{
|
||||
Id = x.Id,
|
||||
DeliveryDate = x.DeliveryDate,
|
||||
ExpirationDate = x.ExpirationDate,
|
||||
}).ToListAsync(ct);
|
||||
|
||||
await Send.OkAsync(historyOfApprovals, ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.HistoryOfApproval.Request;
|
||||
using PyroFetes.DTO.HistoryOfApproval.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.HistoryOfApproval;
|
||||
|
||||
public class GetHistoryOfApprovalEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint <GetHistoryOfApprovalRequest, GetHistoryOfApprovalDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get ("/api/HistoryOfApprovals/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetHistoryOfApprovalRequest req, CancellationToken ct)
|
||||
{
|
||||
Models.HistoryOfApproval? databaseHistoryOfApproval = await pyroFetesDbContext.HistoryOfApprovals.SingleOrDefaultAsync(x => x.Id == req.Id, cancellationToken: ct);
|
||||
|
||||
if (databaseHistoryOfApproval == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
|
||||
GetHistoryOfApprovalDto dto = new()
|
||||
{
|
||||
Id = databaseHistoryOfApproval.Id,
|
||||
DeliveryDate = databaseHistoryOfApproval.DeliveryDate,
|
||||
ExpirationDate = databaseHistoryOfApproval.ExpirationDate
|
||||
};
|
||||
|
||||
await Send.OkAsync(dto, ct);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using FastEndpoints;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PyroFetes.DTO.HistoryOfApproval.Request;
|
||||
using PyroFetes.DTO.HistoryOfApproval.Response;
|
||||
|
||||
namespace PyroFetes.Endpoints.HistoryOfApproval;
|
||||
|
||||
public class UpdateHistoryOfApprovalEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint <UpdateHistoryOfApprovalDto, GetHistoryOfApprovalDto>
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Put ("/api/HistoryOfApprovals/{@Id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(UpdateHistoryOfApprovalDto req, CancellationToken ct)
|
||||
{
|
||||
Models.HistoryOfApproval? databaseHistoryOfApproval = await pyroFetesDbContext.HistoryOfApprovals.SingleOrDefaultAsync(x => x.Id == req.Id, cancellationToken: ct);
|
||||
|
||||
if (databaseHistoryOfApproval == null)
|
||||
{
|
||||
await Send.NotFoundAsync(ct);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
databaseHistoryOfApproval.DeliveryDate = req.DeliveryDate;
|
||||
databaseHistoryOfApproval.ExpirationDate = req.ExpirationDate;
|
||||
}
|
||||
await pyroFetesDbContext.SaveChangesAsync(ct);
|
||||
|
||||
GetHistoryOfApprovalDto dto = new()
|
||||
{
|
||||
Id = databaseHistoryOfApproval.Id,
|
||||
DeliveryDate = req.DeliveryDate,
|
||||
ExpirationDate = req.ExpirationDate
|
||||
};
|
||||
|
||||
await Send.OkAsync(dto, ct);
|
||||
}
|
||||
}
|
||||
1951
PyroFetes/Migrations/20251008103414_InitialDatabase.Designer.cs
generated
Normal file
1951
PyroFetes/Migrations/20251008103414_InitialDatabase.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
1392
PyroFetes/Migrations/20251008103414_InitialDatabase.cs
Normal file
1392
PyroFetes/Migrations/20251008103414_InitialDatabase.cs
Normal file
File diff suppressed because it is too large
Load Diff
1948
PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs
Normal file
1948
PyroFetes/Migrations/PyroFetesDbContextModelSnapshot.cs
Normal file
File diff suppressed because it is too large
Load Diff
13
PyroFetes/Models/.idea/.gitignore
generated
vendored
Normal file
13
PyroFetes/Models/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/.idea.Models.iml
|
||||
/modules.xml
|
||||
/contentModel.xml
|
||||
/projectSettingsUpdater.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
4
PyroFetes/Models/.idea/encodings.xml
generated
Normal file
4
PyroFetes/Models/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
||||
8
PyroFetes/Models/.idea/indexLayout.xml
generated
Normal file
8
PyroFetes/Models/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
14
PyroFetes/Models/Availability.cs
Normal file
14
PyroFetes/Models/Availability.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Availability
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public DateOnly AvailabilityDate { get; set; }
|
||||
[Required] public DateOnly DeliveryDate { get; set; }
|
||||
[Required] public DateOnly ExpirationDate { get; set; }
|
||||
[Required] public DateOnly RenewallDate { get; set; }
|
||||
|
||||
public List<StaffAvailability>? StaffAvailabilities { get; set; }
|
||||
}
|
||||
12
PyroFetes/Models/Brand.cs
Normal file
12
PyroFetes/Models/Brand.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Brand
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Name { get; set; }
|
||||
|
||||
[Required] public int ProductId { get; set; }
|
||||
[Required] public Product? Product { get; set; }
|
||||
}
|
||||
12
PyroFetes/Models/City.cs
Normal file
12
PyroFetes/Models/City.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class City
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Name { get; set; }
|
||||
[Required] public int ZipCode { get; set; }
|
||||
|
||||
public List<Show>? Shows { get; set; }
|
||||
}
|
||||
11
PyroFetes/Models/Classification.cs
Normal file
11
PyroFetes/Models/Classification.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Classification
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Label { get; set; }
|
||||
|
||||
public List<Product>? Products { get; set; }
|
||||
}
|
||||
11
PyroFetes/Models/Color.cs
Normal file
11
PyroFetes/Models/Color.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Color
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Label { get; set; }
|
||||
|
||||
public List<ProductColor>? ProductColors { get; set; }
|
||||
}
|
||||
14
PyroFetes/Models/Communication.cs
Normal file
14
PyroFetes/Models/Communication.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Communication
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Calling { get; set; }
|
||||
[Required, MaxLength(100)] public string? Email { get; set; }
|
||||
[Required, MaxLength(300)] public string? Meeting { get; set; }
|
||||
|
||||
[Required] public int ContactId { get; set; }
|
||||
public Contact? Contact { get; set; }
|
||||
}
|
||||
23
PyroFetes/Models/Contact.cs
Normal file
23
PyroFetes/Models/Contact.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Contact
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? LastName { get; set; }
|
||||
[Required, MaxLength(100)] public string? FirstName { get; set; }
|
||||
[Required, MaxLength(100)] public string? Email { get; set; }
|
||||
[Required, MaxLength(30)] public string? PhoneNumber { get; set; }
|
||||
[Required, MaxLength(100)] public string? Address { get; set; }
|
||||
[Required] public int ZipCode { get; set; }
|
||||
[Required, MaxLength(100)] public string? City { get; set; }
|
||||
[Required, MaxLength(100)] public string? Role { get; set; }
|
||||
|
||||
public Customer? Customer { get; set; }
|
||||
[Required] public int CustomerId { get; set; }
|
||||
|
||||
public List<Communication>? Communications { get; set; }
|
||||
public List<StaffContact>? StaffContacts { get; set; }
|
||||
public List<ContactServiceProvider>? ContactServiceProviders { get; set; }
|
||||
}
|
||||
14
PyroFetes/Models/ContactServiceProvider.cs
Normal file
14
PyroFetes/Models/ContactServiceProvider.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ContactId), nameof(ServiceProviderId))]
|
||||
public class ContactServiceProvider
|
||||
{
|
||||
[Required] public int ContactId { get; set; }
|
||||
[Required] public int ServiceProviderId { get; set; }
|
||||
|
||||
public Contact? Contact { get; set; }
|
||||
public ServiceProvider? ServiceProvider { get; set; }
|
||||
}
|
||||
15
PyroFetes/Models/Contract.cs
Normal file
15
PyroFetes/Models/Contract.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ShowId), nameof(ServiceProviderId))]
|
||||
public class Contract
|
||||
{
|
||||
[Required] public int ShowId { get; set; }
|
||||
[Required] public int ServiceProviderId { get; set; }
|
||||
[Required] public string? TermsAndConditions { get; set; }
|
||||
|
||||
public Show? Show { get; set; }
|
||||
public ServiceProvider? ServiceProvider { get; set; }
|
||||
}
|
||||
16
PyroFetes/Models/Customer.cs
Normal file
16
PyroFetes/Models/Customer.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Customer
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(200)] public string? Note { get; set; }
|
||||
|
||||
//Relations
|
||||
[Required] public int CustomerTypeId { get; set; }
|
||||
public CustomerType? CustomerType { get; set; }
|
||||
|
||||
public List<Contact>? Contacts { get; set; }
|
||||
public List<Quotation>? Quotations { get; set; }
|
||||
}
|
||||
11
PyroFetes/Models/CustomerType.cs
Normal file
11
PyroFetes/Models/CustomerType.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class CustomerType
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Label { get; set; }
|
||||
|
||||
public List<Customer>? Customers { get; set; }
|
||||
}
|
||||
11
PyroFetes/Models/Deliverer.cs
Normal file
11
PyroFetes/Models/Deliverer.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Deliverer
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Transporter { get; set; }
|
||||
|
||||
public List<DeliveryNote>? DeliveryNotes { get; set; }
|
||||
}
|
||||
16
PyroFetes/Models/DeliveryNote.cs
Normal file
16
PyroFetes/Models/DeliveryNote.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class DeliveryNote
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? TrackingNumber { get; set; }
|
||||
public int DelivererId { get; set; }
|
||||
[Required] public DateOnly EstimateDeliveryDate { get; set; }
|
||||
[Required] public DateOnly ExpeditionDate { get; set; }
|
||||
[Required] public DateOnly RealDeliveryDate { get; set; }
|
||||
|
||||
public Deliverer? Deliverer { get; set; }
|
||||
public List<ProductDelivery>? ProductDeliveries { get; set; }
|
||||
}
|
||||
11
PyroFetes/Models/Effect.cs
Normal file
11
PyroFetes/Models/Effect.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Effect
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(200)] public string? Label { get; set; }
|
||||
|
||||
public List<ProductEffect>? ProductEffects { get; set; }
|
||||
}
|
||||
12
PyroFetes/Models/ExperienceLevel.cs
Normal file
12
PyroFetes/Models/ExperienceLevel.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class ExperienceLevel
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Label { get; set; }
|
||||
|
||||
public Staff? Staff { get; set; }
|
||||
[Required] public int StaffId { get; set; }
|
||||
}
|
||||
12
PyroFetes/Models/HistoryOfApproval.cs
Normal file
12
PyroFetes/Models/HistoryOfApproval.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class HistoryOfApproval
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public DateOnly DeliveryDate { get; set; }
|
||||
[Required] public DateOnly ExpirationDate { get; set; }
|
||||
|
||||
public List<StaffHistoryOfApproval>? StaffHistoryOfApprovals { get; set; }
|
||||
}
|
||||
16
PyroFetes/Models/Material.cs
Normal file
16
PyroFetes/Models/Material.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Material
|
||||
{
|
||||
[Key] public int Id {get; set;}
|
||||
[Required, MaxLength(100)] public string? Name {get; set;}
|
||||
[Required] public int Quantity {get; set;}
|
||||
|
||||
[Required] public int WarehouseId {get; set;}
|
||||
public Warehouse? Warehouse {get; set;}
|
||||
|
||||
public List<ShowMaterial>? ShowMaterials {get; set;}
|
||||
public List<MaterialWarehouse>? MaterialWarehouses {get; set;}
|
||||
}
|
||||
14
PyroFetes/Models/MaterialWarehouse.cs
Normal file
14
PyroFetes/Models/MaterialWarehouse.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(MaterialId), nameof(WarehouseId))]
|
||||
public class MaterialWarehouse
|
||||
{
|
||||
[Required] public int MaterialId { get; set; }
|
||||
[Required] public int WarehouseId { get; set; }
|
||||
|
||||
public Material? Material { get; set; }
|
||||
public Warehouse? Warehouse { get; set; }
|
||||
}
|
||||
19
PyroFetes/Models/Movement.cs
Normal file
19
PyroFetes/Models/Movement.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Movement
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public DateTime Date { get; set; }
|
||||
[Required] public DateTime Start {get; set;}
|
||||
[Required] public DateTime Arrival {get; set;}
|
||||
[Required] public int Quantity {get; set;}
|
||||
|
||||
public List<Product>? Products { get; set; }
|
||||
|
||||
public int? SourceWarehouseId {get; set;}
|
||||
public Warehouse? SourceWarehouse {get; set;}
|
||||
public int? DestinationWarehouseId {get; set;}
|
||||
public Warehouse? DestinationWarehouse {get; set;}
|
||||
}
|
||||
16
PyroFetes/Models/Price.cs
Normal file
16
PyroFetes/Models/Price.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(SupplierId))]
|
||||
public class Price
|
||||
{
|
||||
[Required] public int ProductId { get; set; }
|
||||
[Required] public int SupplierId { get; set; }
|
||||
[Required] public decimal SellingPrice { get; set; }
|
||||
|
||||
public Product? Product { get; set; }
|
||||
public Supplier? Supplier { get; set; }
|
||||
}
|
||||
42
PyroFetes/Models/Product.cs
Normal file
42
PyroFetes/Models/Product.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models
|
||||
{
|
||||
public class Product
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public int References { get; set; }
|
||||
[Required, MaxLength(100)] public string? Name { get; set; }
|
||||
[Required] public decimal Duration {get; set;}
|
||||
[Required] public decimal Caliber { get; set; }
|
||||
[Required] public int ApprovalNumber { get; set; }
|
||||
[Required] public decimal Weight { get; set; }
|
||||
[Required] public decimal Nec { get; set; }
|
||||
[Required] public decimal SellingPrice { get; set; }
|
||||
[Required] public string? Image { get; set; }
|
||||
[Required, MaxLength(200)] public string? Link { get; set; }
|
||||
[Required] public int MinimalQuantity { get; set; }
|
||||
|
||||
// Relations
|
||||
[Required] public int ClassificationId { get; set; }
|
||||
public Classification? Classification { get; set; }
|
||||
|
||||
[Required] public int ProductCategoryId { get; set; }
|
||||
public ProductCategory? ProductCategory { get; set; }
|
||||
|
||||
[Required] public int MovementId {get; set;}
|
||||
public Movement? Movement {get; set;}
|
||||
|
||||
public List<ProductDelivery>? ProductDeliveries { get; set; }
|
||||
public List<Brand>? Brands { get; set; }
|
||||
public List<ProductEffect>? ProductEffects { get; set; }
|
||||
public List<ProductColor>? ProductColors { get; set; }
|
||||
public List<PurchaseProduct>? PurchaseProducts { get; set; }
|
||||
public List<Price>? Prices { get; set; }
|
||||
public List<QuotationProduct>? QuotationProducts { get; set; }
|
||||
public List<WarehouseProduct>? WarehouseProducts { get; set; }
|
||||
public List<ProductTimecode>? ProductTimecodes { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
11
PyroFetes/Models/ProductCategory.cs
Normal file
11
PyroFetes/Models/ProductCategory.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class ProductCategory
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Label { get; set; }
|
||||
|
||||
public List<Product>? Products { get; set; }
|
||||
}
|
||||
14
PyroFetes/Models/ProductColor.cs
Normal file
14
PyroFetes/Models/ProductColor.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(ColorId))]
|
||||
public class ProductColor
|
||||
{
|
||||
public Product? Product { get; set; }
|
||||
[Required] public int ProductId { get; set; }
|
||||
|
||||
public Color? Color { get; set; }
|
||||
[Required] public int ColorId { get; set; }
|
||||
}
|
||||
15
PyroFetes/Models/ProductDelivery.cs
Normal file
15
PyroFetes/Models/ProductDelivery.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(DeliveryNoteId))]
|
||||
public class ProductDelivery
|
||||
{
|
||||
[Required] public int ProductId { get; set; }
|
||||
[Required] public int DeliveryNoteId { get; set; }
|
||||
[Required] public int Quantity { get; set; }
|
||||
|
||||
public Product? Product { get; set; }
|
||||
public DeliveryNote? DeliveryNote { get; set; }
|
||||
}
|
||||
15
PyroFetes/Models/ProductEffect.cs
Normal file
15
PyroFetes/Models/ProductEffect.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(EffectId))]
|
||||
public class ProductEffect
|
||||
{
|
||||
[Required] public Product? Product { get; set; }
|
||||
[Required] public int ProductId { get; set; }
|
||||
|
||||
public Effect? Effect { get; set; }
|
||||
[Required] public int EffectId { get; set; }
|
||||
|
||||
}
|
||||
17
PyroFetes/Models/ProductTimecode.cs
Normal file
17
PyroFetes/Models/ProductTimecode.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(ShowId))]
|
||||
public class ProductTimecode
|
||||
{
|
||||
public Product? Product { get; set; }
|
||||
[Required] public int ProductId { get; set; }
|
||||
|
||||
public Show? Show { get; set; }
|
||||
[Required] public int ShowId { get; set; }
|
||||
|
||||
[Required] public decimal Start { get; set; }
|
||||
[Required] public decimal End { get; set; }
|
||||
}
|
||||
12
PyroFetes/Models/ProviderContact.cs
Normal file
12
PyroFetes/Models/ProviderContact.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ContactId), nameof(ProviderId))]
|
||||
public class ProviderContact
|
||||
{
|
||||
public int ProviderId { get; set; }
|
||||
public ServiceProvider? Provider { get; set; }
|
||||
public int ContactId { get; set; }
|
||||
public Contact? Contact { get; set; }
|
||||
}
|
||||
11
PyroFetes/Models/ProviderType.cs
Normal file
11
PyroFetes/Models/ProviderType.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class ProviderType
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Label { get; set; }
|
||||
|
||||
public List<ServiceProvider>? ServiceProviders { get; set; }
|
||||
}
|
||||
11
PyroFetes/Models/PurchaseOrder.cs
Normal file
11
PyroFetes/Models/PurchaseOrder.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class PurchaseOrder
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(300)] public string? PurchaseConditions { get; set; }
|
||||
|
||||
public List<PurchaseProduct>? PurchaseProducts { get; set; }
|
||||
}
|
||||
16
PyroFetes/Models/PurchaseProduct.cs
Normal file
16
PyroFetes/Models/PurchaseProduct.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(PurchaseOrderId))]
|
||||
public class PurchaseProduct
|
||||
{
|
||||
public Product? Product { get; set; }
|
||||
[Required] public int ProductId { get; set; }
|
||||
|
||||
public PurchaseOrder? PurchaseOrder { get; set; }
|
||||
[Required] public int PurchaseOrderId { get; set; }
|
||||
|
||||
[Required] public int Quantity { get; set; }
|
||||
}
|
||||
15
PyroFetes/Models/Quotation.cs
Normal file
15
PyroFetes/Models/Quotation.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Quotation
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(200)] public string? Message { get; set; }
|
||||
[Required, MaxLength(300)] public string? ConditionsSale { get; set; }
|
||||
|
||||
[Required] public int CustomerId { get; set; }
|
||||
public Customer? Customer { get; set; }
|
||||
|
||||
public List<QuotationProduct>? QuotationProducts { get; set; }
|
||||
}
|
||||
15
PyroFetes/Models/QuotationProduct.cs
Normal file
15
PyroFetes/Models/QuotationProduct.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(QuotationId))]
|
||||
public class QuotationProduct
|
||||
{
|
||||
[Required] public int ProductId { get; set; }
|
||||
[Required] public int QuotationId { get; set; }
|
||||
[Required] public int Quantity { get; set; }
|
||||
|
||||
public Product? Product { get; set; }
|
||||
public Quotation? Quotation { get; set; }
|
||||
}
|
||||
16
PyroFetes/Models/ServiceProvider.cs
Normal file
16
PyroFetes/Models/ServiceProvider.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class ServiceProvider
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public decimal Price { get; set; }
|
||||
|
||||
//Relations
|
||||
[Required] public int ProviderTypeId { get; set; }
|
||||
public ProviderType? ProviderType { get; set; }
|
||||
|
||||
public List<Contract>? Contracts { get; set; }
|
||||
public List<ContactServiceProvider>? ContactServiceProviders { get; set; }
|
||||
}
|
||||
10
PyroFetes/Models/Setting.cs
Normal file
10
PyroFetes/Models/Setting.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Setting
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public string? Logo { get; set; }
|
||||
[Required] public string? ElectronicSignature { get; set; }
|
||||
}
|
||||
25
PyroFetes/Models/Show.cs
Normal file
25
PyroFetes/Models/Show.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Show
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Name { get; set; }
|
||||
[Required, MaxLength(120)] public string? Place { get; set; }
|
||||
[MaxLength(500)] public string? Description { get; set; }
|
||||
public DateOnly? Date { get; set; }
|
||||
|
||||
// Link (path/URL/file name) to the pyrotechnic implementation plan
|
||||
[Required, MaxLength(500)] public string? PyrotechnicImplementationPlan { get; set; }
|
||||
|
||||
[Required] public int CityId { get; set; }
|
||||
public City? City { get; set; }
|
||||
|
||||
public List<ShowStaff>? ShowStaffs { get; set; }
|
||||
public List<ShowTruck>? ShowTrucks { get; set; }
|
||||
public List<SoundTimecode>? SoundTimecodes { get; set; }
|
||||
public List<ProductTimecode>? ProductTimecodes { get; set; }
|
||||
public List<Contract>? Contracts { get; set; }
|
||||
public List<ShowMaterial>? ShowMaterials { get; set; }
|
||||
}
|
||||
15
PyroFetes/Models/ShowMaterial.cs
Normal file
15
PyroFetes/Models/ShowMaterial.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ShowId), nameof(MaterialId))]
|
||||
public class ShowMaterial
|
||||
{
|
||||
[Required] public Show? Show { get; set; }
|
||||
[Required] public int ShowId { get; set; }
|
||||
|
||||
public Material? Material { get; set; }
|
||||
[Required] public int MaterialId { get; set; }
|
||||
|
||||
}
|
||||
9
PyroFetes/Models/ShowServiceProvider.cs
Normal file
9
PyroFetes/Models/ShowServiceProvider.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class ShowServiceProvider
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
|
||||
}
|
||||
14
PyroFetes/Models/ShowStaff.cs
Normal file
14
PyroFetes/Models/ShowStaff.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(StaffId), nameof(ShowId))]
|
||||
public class ShowStaff
|
||||
{
|
||||
public Staff? Staff { get; set; }
|
||||
[Required] public int StaffId { get; set; }
|
||||
|
||||
public Show? Show { get; set; }
|
||||
[Required] public int ShowId { get; set; }
|
||||
}
|
||||
14
PyroFetes/Models/ShowTruck.cs
Normal file
14
PyroFetes/Models/ShowTruck.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ShowId), nameof(TruckId))]
|
||||
public class ShowTruck
|
||||
{
|
||||
public Show? Show { get; set; }
|
||||
[Required] public int ShowId { get; set; }
|
||||
|
||||
public Truck? Truck { get; set; }
|
||||
[Required] public int TruckId { get; set; }
|
||||
}
|
||||
20
PyroFetes/Models/Sound.cs
Normal file
20
PyroFetes/Models/Sound.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Sound
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(120)] public string Name { get; set; } = null!;
|
||||
[Required, MaxLength(60)] public string? Type { get; set; }
|
||||
[Required, MaxLength(120)] public string? Artist { get; set; }
|
||||
[Required, Range(0, int.MaxValue)] public int? Duration { get; set; }
|
||||
[Required, MaxLength(40)] public string? Kind { get; set; }
|
||||
[Required, MaxLength(40)] public string? Format { get; set; }
|
||||
public DateTime? CreationDate { get; set; }
|
||||
|
||||
[Required] public int SoundCategoryId { get; set; }
|
||||
public SoundCategory? SoundCategory { get; set; }
|
||||
|
||||
public List<SoundTimecode>? SoundTimecodes { get; set; }
|
||||
}
|
||||
11
PyroFetes/Models/SoundCategory.cs
Normal file
11
PyroFetes/Models/SoundCategory.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class SoundCategory
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string Name { get; set; } = null!;
|
||||
|
||||
public List<Sound>? Sounds { get; set; }
|
||||
}
|
||||
16
PyroFetes/Models/SoundTimecode.cs
Normal file
16
PyroFetes/Models/SoundTimecode.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ShowId), nameof(SoundId))]
|
||||
public class SoundTimecode
|
||||
{
|
||||
[Required] public int ShowId { get; set; }
|
||||
public Show? Show { get; set; }
|
||||
[Required] public int SoundId { get; set; }
|
||||
public Sound? Sound { get; set; }
|
||||
|
||||
[Required] public decimal Start { get; set; }
|
||||
[Required] public decimal End { get; set; }
|
||||
}
|
||||
20
PyroFetes/Models/Staff.cs
Normal file
20
PyroFetes/Models/Staff.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Staff
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(60)] public string FirstName { get; set; } = null!;
|
||||
[Required, MaxLength(60)] public string LastName { get; set; } = null!;
|
||||
[Required, MaxLength(100)] public string? Profession { get; set; }
|
||||
[Required, MaxLength(120)] public string? Email { get; set; }
|
||||
[Required, MaxLength(100)] public string? F4T2NumberApproval { get; set; }
|
||||
[Required] public DateOnly F4T2ExpirationDate { get; set; }
|
||||
|
||||
public List<ShowStaff>? ShowStaffs { get; set; }
|
||||
public List<ExperienceLevel>? ExperienceLevels { get; set; }
|
||||
public List<StaffAvailability>? StaffAvailabilities { get; set; }
|
||||
public List<StaffHistoryOfApproval>? StaffHistoryOfApprovals { get; set; }
|
||||
public List<StaffContact>? StaffContacts { get; set; }
|
||||
}
|
||||
12
PyroFetes/Models/StaffAvailability.cs
Normal file
12
PyroFetes/Models/StaffAvailability.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(AvailabilityId), nameof(StaffId))]
|
||||
public class StaffAvailability
|
||||
{
|
||||
public int StaffId { get; set; }
|
||||
public Staff? Staff { get; set; }
|
||||
public int AvailabilityId { get; set; }
|
||||
public Availability? Availability { get; set; }
|
||||
}
|
||||
13
PyroFetes/Models/StaffContact.cs
Normal file
13
PyroFetes/Models/StaffContact.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ContactId), nameof(StaffId))]
|
||||
public class StaffContact
|
||||
{
|
||||
[Required] public int StaffId { get; set; }
|
||||
public Staff? Staff { get; set; }
|
||||
[Required] public int ContactId { get; set; }
|
||||
public Contact? Contact { get; set; }
|
||||
}
|
||||
12
PyroFetes/Models/StaffHistoryOfApproval.cs
Normal file
12
PyroFetes/Models/StaffHistoryOfApproval.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(HistoryOfApprovalId), nameof(StaffId))]
|
||||
public class StaffHistoryOfApproval
|
||||
{
|
||||
public int StaffId { get; set; }
|
||||
public Staff? Staff { get; set; }
|
||||
public int HistoryOfApprovalId { get; set; }
|
||||
public HistoryOfApproval? HistoryOfApproval { get; set; }
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user