diff --git a/AP-WEB-PF3 b/AP-WEB-PF3 new file mode 160000 index 0000000..4a0d74b --- /dev/null +++ b/AP-WEB-PF3 @@ -0,0 +1 @@ +Subproject commit 4a0d74b34dbcdb7cf018753a641b1dca7874db47 diff --git a/PF3/DTO/Show/Request/CreateShowDto.cs b/PF3/DTO/Show/Request/CreateShowDto.cs index 8e8a759..cb88062 100644 --- a/PF3/DTO/Show/Request/CreateShowDto.cs +++ b/PF3/DTO/Show/Request/CreateShowDto.cs @@ -8,5 +8,5 @@ public class CreateShowDto public string? Place { get; set; } public string? Description { get; set; } public string? PyrotechnicImplementationPlan { get; set; } - public DateTime? Date { get; set; } + public DateOnly? Date { get; set; } } \ No newline at end of file diff --git a/PF3/DTO/Sound/Request/CreateSoundDto.cs b/PF3/DTO/Sound/Request/CreateSoundDto.cs index 9c39955..b6a2a5d 100644 --- a/PF3/DTO/Sound/Request/CreateSoundDto.cs +++ b/PF3/DTO/Sound/Request/CreateSoundDto.cs @@ -1,6 +1,4 @@ -using System; - -namespace PF3.DTO.SoundCategory.Request; +namespace PF3.DTO.Sound.Request; public class CreateSoundDto { diff --git a/PF3/DTO/Sound/Request/IdSoundto.cs b/PF3/DTO/Sound/Request/IdSoundto.cs index 41bad0b..54f39ac 100644 --- a/PF3/DTO/Sound/Request/IdSoundto.cs +++ b/PF3/DTO/Sound/Request/IdSoundto.cs @@ -1,4 +1,4 @@ -namespace PF3.DTO.SoundCategory.Request; +namespace PF3.DTO.Sound.Request; public class IdSoundto { diff --git a/PF3/DTO/Sound/Request/UpdateSoundDto.cs b/PF3/DTO/Sound/Request/UpdateSoundDto.cs index 11f252c..e6221fa 100644 --- a/PF3/DTO/Sound/Request/UpdateSoundDto.cs +++ b/PF3/DTO/Sound/Request/UpdateSoundDto.cs @@ -1,6 +1,4 @@ -using System; - -namespace PF3.DTO.SoundCategory.Request; +namespace PF3.DTO.Sound.Request; public class UpdateSoundDto { diff --git a/PF3/DTO/Sound/Response/ReadSoundDto.cs b/PF3/DTO/Sound/Response/ReadSoundDto.cs index 0081ad0..78c3d92 100644 --- a/PF3/DTO/Sound/Response/ReadSoundDto.cs +++ b/PF3/DTO/Sound/Response/ReadSoundDto.cs @@ -1,6 +1,4 @@ -using System; - -namespace PF3.DTO.SoundCategory.Response; +namespace PF3.DTO.Sound.Response; public class ReadSoundDto { diff --git a/PF3/Endpoint/Show/CreateShowEndpoint.cs b/PF3/Endpoint/Show/CreateShowEndpoint.cs index 42ab954..a89df07 100644 --- a/PF3/Endpoint/Show/CreateShowEndpoint.cs +++ b/PF3/Endpoint/Show/CreateShowEndpoint.cs @@ -1,10 +1,12 @@ using FastEndpoints; +using PF3.DTO.Show.Request; using PF3.DTO.Show.Response; +using PF3.Migrations; using PyroFetes; namespace PF3.Endpoint.Show; -public class CreateShowEndpoint(PyroFetesDbContext pyroFetesDbContext):Endpoint +public class CreateShowEndpoint(PyroFetesDbContext pyroFetesDbContext):Endpoint { public override void Configure() { @@ -12,8 +14,29 @@ public class CreateShowEndpoint(PyroFetesDbContext pyroFetesDbContext):Endpoint< AllowAnonymous(); } - public override Task HandleAsync(CreateShowEndpoint req, CancellationToken ct) + public override async Task HandleAsync(CreateShowDto req, CancellationToken ct) { + var show = new Models.Show + { + Name = req.Name, + Place = req.Place, + Description = req.Description, + Date = req.Date, + PyrotechnicImplementationPlan = req.PyrotechnicImplementationPlan + }; + pyroFetesDbContext.Shows.Add(show); + await pyroFetesDbContext.SaveChangesAsync(ct); + + ReadShowDto readShowDto = new ReadShowDto() + { + Id = show.Id, + Name = show.Name, + Place = show.Place, + Description = show.Description, + PyrotechnicImplementationPlan = show.PyrotechnicImplementationPlan + }; + + await Send.OkAsync(readShowDto, ct); } } \ No newline at end of file diff --git a/PF3/Migrations/20251008103414_InitialDatabase.Designer.cs b/PF3/Migrations/20251008103414_InitialDatabase.Designer.cs index 8e971b2..23c570f 100644 --- a/PF3/Migrations/20251008103414_InitialDatabase.Designer.cs +++ b/PF3/Migrations/20251008103414_InitialDatabase.Designer.cs @@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using PF3.Migrations; using PyroFetes; #nullable disable diff --git a/PF3/Migrations/PyroFetesDbContext.cs b/PF3/Migrations/PyroFetesDbContext.cs index b5ce8c7..3030b6d 100644 --- a/PF3/Migrations/PyroFetesDbContext.cs +++ b/PF3/Migrations/PyroFetesDbContext.cs @@ -1,8 +1,8 @@ using Microsoft.EntityFrameworkCore; -using PyroFetes.Models; -using ServiceProvider = PyroFetes.Models.ServiceProvider; +using PF3.Models; +using ServiceProvider = PF3.Models.ServiceProvider; -namespace PyroFetes; +namespace PF3.Migrations; public class PyroFetesDbContext : DbContext { diff --git a/PF3/Migrations/PyroFetesDbContextModelSnapshot.cs b/PF3/Migrations/PyroFetesDbContextModelSnapshot.cs index 1f414fb..3639d31 100644 --- a/PF3/Migrations/PyroFetesDbContextModelSnapshot.cs +++ b/PF3/Migrations/PyroFetesDbContextModelSnapshot.cs @@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using PF3.Migrations; using PyroFetes; #nullable disable diff --git a/PF3/Models/Availability.cs b/PF3/Models/Availability.cs index 47b0f1c..50b7c41 100644 --- a/PF3/Models/Availability.cs +++ b/PF3/Models/Availability.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Availability { diff --git a/PF3/Models/Brand.cs b/PF3/Models/Brand.cs index 49016ca..3b43f5a 100644 --- a/PF3/Models/Brand.cs +++ b/PF3/Models/Brand.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Brand { diff --git a/PF3/Models/City.cs b/PF3/Models/City.cs index 04dc24e..a3879be 100644 --- a/PF3/Models/City.cs +++ b/PF3/Models/City.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class City { diff --git a/PF3/Models/Classification.cs b/PF3/Models/Classification.cs index bd3685b..9b1c1bd 100644 --- a/PF3/Models/Classification.cs +++ b/PF3/Models/Classification.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Classification { diff --git a/PF3/Models/Color.cs b/PF3/Models/Color.cs index acfe830..2c467fc 100644 --- a/PF3/Models/Color.cs +++ b/PF3/Models/Color.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Color { diff --git a/PF3/Models/Communication.cs b/PF3/Models/Communication.cs index a3dd0d2..c2804ca 100644 --- a/PF3/Models/Communication.cs +++ b/PF3/Models/Communication.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Communication { diff --git a/PF3/Models/Contact.cs b/PF3/Models/Contact.cs index e1573ad..32d3182 100644 --- a/PF3/Models/Contact.cs +++ b/PF3/Models/Contact.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Contact { diff --git a/PF3/Models/ContactServiceProvider.cs b/PF3/Models/ContactServiceProvider.cs index cc9cd1b..8eaa466 100644 --- a/PF3/Models/ContactServiceProvider.cs +++ b/PF3/Models/ContactServiceProvider.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ContactId), nameof(ServiceProviderId))] public class ContactServiceProvider diff --git a/PF3/Models/Contract.cs b/PF3/Models/Contract.cs index 97cd821..1f401e6 100644 --- a/PF3/Models/Contract.cs +++ b/PF3/Models/Contract.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ShowId), nameof(ServiceProviderId))] public class Contract diff --git a/PF3/Models/Customer.cs b/PF3/Models/Customer.cs index da6dbba..b97b73f 100644 --- a/PF3/Models/Customer.cs +++ b/PF3/Models/Customer.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Customer { diff --git a/PF3/Models/CustomerType.cs b/PF3/Models/CustomerType.cs index 197ad09..f7bd5b8 100644 --- a/PF3/Models/CustomerType.cs +++ b/PF3/Models/CustomerType.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class CustomerType { diff --git a/PF3/Models/Deliverer.cs b/PF3/Models/Deliverer.cs index 34e708c..5aa11ba 100644 --- a/PF3/Models/Deliverer.cs +++ b/PF3/Models/Deliverer.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Deliverer { diff --git a/PF3/Models/DeliveryNote.cs b/PF3/Models/DeliveryNote.cs index 21e873e..1c37647 100644 --- a/PF3/Models/DeliveryNote.cs +++ b/PF3/Models/DeliveryNote.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class DeliveryNote { diff --git a/PF3/Models/Effect.cs b/PF3/Models/Effect.cs index 0dcb87c..c33a27d 100644 --- a/PF3/Models/Effect.cs +++ b/PF3/Models/Effect.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Effect { diff --git a/PF3/Models/ExperienceLevel.cs b/PF3/Models/ExperienceLevel.cs index 923f757..53ce9b9 100644 --- a/PF3/Models/ExperienceLevel.cs +++ b/PF3/Models/ExperienceLevel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class ExperienceLevel { diff --git a/PF3/Models/HistoryOfApproval.cs b/PF3/Models/HistoryOfApproval.cs index c8fd073..166337f 100644 --- a/PF3/Models/HistoryOfApproval.cs +++ b/PF3/Models/HistoryOfApproval.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class HistoryOfApproval { diff --git a/PF3/Models/Material.cs b/PF3/Models/Material.cs index 224e5d5..8279b45 100644 --- a/PF3/Models/Material.cs +++ b/PF3/Models/Material.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Material { diff --git a/PF3/Models/MaterialWarehouse.cs b/PF3/Models/MaterialWarehouse.cs index 4f49ba9..d3f688a 100644 --- a/PF3/Models/MaterialWarehouse.cs +++ b/PF3/Models/MaterialWarehouse.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(MaterialId), nameof(WarehouseId))] public class MaterialWarehouse diff --git a/PF3/Models/Movement.cs b/PF3/Models/Movement.cs index fe26f18..02d4aed 100644 --- a/PF3/Models/Movement.cs +++ b/PF3/Models/Movement.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Movement { diff --git a/PF3/Models/Price.cs b/PF3/Models/Price.cs index 2ee597e..ddabce9 100644 --- a/PF3/Models/Price.cs +++ b/PF3/Models/Price.cs @@ -1,8 +1,7 @@ using System.ComponentModel.DataAnnotations; -using System.Runtime.CompilerServices; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ProductId), nameof(SupplierId))] public class Price diff --git a/PF3/Models/Product.cs b/PF3/Models/Product.cs index b0f0d7f..bbdf68e 100644 --- a/PF3/Models/Product.cs +++ b/PF3/Models/Product.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models +namespace PF3.Models { public class Product { diff --git a/PF3/Models/ProductCategory.cs b/PF3/Models/ProductCategory.cs index 79bd67f..12b92a0 100644 --- a/PF3/Models/ProductCategory.cs +++ b/PF3/Models/ProductCategory.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class ProductCategory { diff --git a/PF3/Models/ProductColor.cs b/PF3/Models/ProductColor.cs index f93d964..a0ff59c 100644 --- a/PF3/Models/ProductColor.cs +++ b/PF3/Models/ProductColor.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ProductId), nameof(ColorId))] public class ProductColor diff --git a/PF3/Models/ProductDelivery.cs b/PF3/Models/ProductDelivery.cs index bfbae68..1b28eb5 100644 --- a/PF3/Models/ProductDelivery.cs +++ b/PF3/Models/ProductDelivery.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ProductId), nameof(DeliveryNoteId))] public class ProductDelivery diff --git a/PF3/Models/ProductEffect.cs b/PF3/Models/ProductEffect.cs index 3f269d6..b8f5f82 100644 --- a/PF3/Models/ProductEffect.cs +++ b/PF3/Models/ProductEffect.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ProductId), nameof(EffectId))] public class ProductEffect diff --git a/PF3/Models/ProductTimecode.cs b/PF3/Models/ProductTimecode.cs index a4ad826..ff78cf1 100644 --- a/PF3/Models/ProductTimecode.cs +++ b/PF3/Models/ProductTimecode.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ProductId), nameof(ShowId))] public class ProductTimecode diff --git a/PF3/Models/ProviderContact.cs b/PF3/Models/ProviderContact.cs index 8d21d35..56e466d 100644 --- a/PF3/Models/ProviderContact.cs +++ b/PF3/Models/ProviderContact.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ContactId), nameof(ProviderId))] public class ProviderContact diff --git a/PF3/Models/ProviderType.cs b/PF3/Models/ProviderType.cs index 0871b8a..c67085d 100644 --- a/PF3/Models/ProviderType.cs +++ b/PF3/Models/ProviderType.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class ProviderType { diff --git a/PF3/Models/PurchaseOrder.cs b/PF3/Models/PurchaseOrder.cs index 815f5a0..4bf7fbc 100644 --- a/PF3/Models/PurchaseOrder.cs +++ b/PF3/Models/PurchaseOrder.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class PurchaseOrder { diff --git a/PF3/Models/PurchaseProduct.cs b/PF3/Models/PurchaseProduct.cs index c335ede..c46cdc6 100644 --- a/PF3/Models/PurchaseProduct.cs +++ b/PF3/Models/PurchaseProduct.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ProductId), nameof(PurchaseOrderId))] public class PurchaseProduct diff --git a/PF3/Models/Quotation.cs b/PF3/Models/Quotation.cs index 569c271..3ece535 100644 --- a/PF3/Models/Quotation.cs +++ b/PF3/Models/Quotation.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Quotation { diff --git a/PF3/Models/QuotationProduct.cs b/PF3/Models/QuotationProduct.cs index 8e2f3bb..eb31085 100644 --- a/PF3/Models/QuotationProduct.cs +++ b/PF3/Models/QuotationProduct.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ProductId), nameof(QuotationId))] public class QuotationProduct diff --git a/PF3/Models/ServiceProvider.cs b/PF3/Models/ServiceProvider.cs index b91e0d7..0cba0d7 100644 --- a/PF3/Models/ServiceProvider.cs +++ b/PF3/Models/ServiceProvider.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class ServiceProvider { diff --git a/PF3/Models/Setting.cs b/PF3/Models/Setting.cs index 0759032..3ffcdec 100644 --- a/PF3/Models/Setting.cs +++ b/PF3/Models/Setting.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Setting { diff --git a/PF3/Models/Show.cs b/PF3/Models/Show.cs new file mode 100644 index 0000000..0dab28f --- /dev/null +++ b/PF3/Models/Show.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; + +namespace PF3.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? ShowStaffs { get; set; } + public List? ShowTrucks { get; set; } + public List? SoundTimecodes { get; set; } + public List? ProductTimecodes { get; set; } + public List? Contracts { get; set; } + public List? ShowMaterials { get; set; } +} \ No newline at end of file diff --git a/PF3/Models/ShowMaterial.cs b/PF3/Models/ShowMaterial.cs index 81cc82a..264edb2 100644 --- a/PF3/Models/ShowMaterial.cs +++ b/PF3/Models/ShowMaterial.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ShowId), nameof(MaterialId))] public class ShowMaterial diff --git a/PF3/Models/ShowServiceProvider.cs b/PF3/Models/ShowServiceProvider.cs index 351c9fc..4ee169c 100644 --- a/PF3/Models/ShowServiceProvider.cs +++ b/PF3/Models/ShowServiceProvider.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class ShowServiceProvider { diff --git a/PF3/Models/ShowStaff.cs b/PF3/Models/ShowStaff.cs index 60a7215..b83ee5a 100644 --- a/PF3/Models/ShowStaff.cs +++ b/PF3/Models/ShowStaff.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(StaffId), nameof(ShowId))] public class ShowStaff diff --git a/PF3/Models/ShowTruck.cs b/PF3/Models/ShowTruck.cs index 9f39f8a..0166c03 100644 --- a/PF3/Models/ShowTruck.cs +++ b/PF3/Models/ShowTruck.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ShowId), nameof(TruckId))] public class ShowTruck diff --git a/PF3/Models/Sound.cs b/PF3/Models/Sound.cs new file mode 100644 index 0000000..eda2f78 --- /dev/null +++ b/PF3/Models/Sound.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; + +namespace PF3.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? SoundTimecodes { get; set; } +} \ No newline at end of file diff --git a/PF3/Models/SoundCategory.cs b/PF3/Models/SoundCategory.cs new file mode 100644 index 0000000..95c4514 --- /dev/null +++ b/PF3/Models/SoundCategory.cs @@ -0,0 +1,11 @@ +using System.ComponentModel.DataAnnotations; + +namespace PF3.Models; + +public class SoundCategory +{ + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string Name { get; set; } = null!; + + public List? Sounds { get; set; } +} \ No newline at end of file diff --git a/PF3/Models/SoundTimecode.cs b/PF3/Models/SoundTimecode.cs new file mode 100644 index 0000000..fe5de73 --- /dev/null +++ b/PF3/Models/SoundTimecode.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace PF3.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; } +} \ No newline at end of file diff --git a/PF3/Models/Staff.cs b/PF3/Models/Staff.cs new file mode 100644 index 0000000..2755e01 --- /dev/null +++ b/PF3/Models/Staff.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; + +namespace PF3.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? ShowStaffs { get; set; } + public List? ExperienceLevels { get; set; } + public List? StaffAvailabilities { get; set; } + public List? StaffHistoryOfApprovals { get; set; } + public List? StaffContacts { get; set; } +} \ No newline at end of file diff --git a/PF3/Models/StaffAvailability.cs b/PF3/Models/StaffAvailability.cs index 3ba0732..ec8bfc5 100644 --- a/PF3/Models/StaffAvailability.cs +++ b/PF3/Models/StaffAvailability.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(AvailabilityId), nameof(StaffId))] public class StaffAvailability diff --git a/PF3/Models/StaffContact.cs b/PF3/Models/StaffContact.cs index 18ab5a9..90e23df 100644 --- a/PF3/Models/StaffContact.cs +++ b/PF3/Models/StaffContact.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ContactId), nameof(StaffId))] public class StaffContact diff --git a/PF3/Models/StaffHistoryOfApproval.cs b/PF3/Models/StaffHistoryOfApproval.cs index 3937064..1404a8f 100644 --- a/PF3/Models/StaffHistoryOfApproval.cs +++ b/PF3/Models/StaffHistoryOfApproval.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(HistoryOfApprovalId), nameof(StaffId))] public class StaffHistoryOfApproval diff --git a/PF3/Models/Supplier.cs b/PF3/Models/Supplier.cs index f131804..fa4f654 100644 --- a/PF3/Models/Supplier.cs +++ b/PF3/Models/Supplier.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Supplier { diff --git a/PF3/Models/Truck.cs b/PF3/Models/Truck.cs new file mode 100644 index 0000000..1d36a66 --- /dev/null +++ b/PF3/Models/Truck.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; + +namespace PF3.Models; + +public class Truck +{ + [Key] public int Id { get; set; } + [Required, MaxLength(40)] public string Type { get; set; } = null!; + [Required] public double? MaxExplosiveCapacity { get; set; } + [Required, MaxLength(80)] public string? Sizes { get; set; } + [Required, MaxLength(40)] public string? Status { get; set; } + + public List? ShowTrucks { get; set; } +} \ No newline at end of file diff --git a/PF3/Models/User.cs b/PF3/Models/User.cs index 8baaa1c..478b1b7 100644 --- a/PF3/Models/User.cs +++ b/PF3/Models/User.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class User { diff --git a/PF3/Models/Warehouse.cs b/PF3/Models/Warehouse.cs index 8d014e7..c214707 100644 --- a/PF3/Models/Warehouse.cs +++ b/PF3/Models/Warehouse.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace PyroFetes.Models; +namespace PF3.Models; public class Warehouse { diff --git a/PF3/Models/WarehouseProduct.cs b/PF3/Models/WarehouseProduct.cs index fe89d36..58e12f7 100644 --- a/PF3/Models/WarehouseProduct.cs +++ b/PF3/Models/WarehouseProduct.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; -namespace PyroFetes.Models; +namespace PF3.Models; [PrimaryKey(nameof(ProductId), nameof(WarehouseId))] public class WarehouseProduct diff --git a/PF3/Program.cs b/PF3/Program.cs index ec8fcbb..82a3ca4 100644 --- a/PF3/Program.cs +++ b/PF3/Program.cs @@ -1,8 +1,4 @@ -using System; -using System.Linq; -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; +using PF3; var builder = WebApplication.CreateBuilder(args); @@ -44,7 +40,10 @@ app.MapGet("/weatherforecast", () => app.Run(); -record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) +namespace PF3 { - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) + { + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + } } \ No newline at end of file