création CreateShowEndpoint.cs et rectification quelque chemin
This commit is contained in:
1
AP-WEB-PF3
Submodule
1
AP-WEB-PF3
Submodule
Submodule AP-WEB-PF3 added at 4a0d74b34d
@@ -8,5 +8,5 @@ public class CreateShowDto
|
|||||||
public string? Place { get; set; }
|
public string? Place { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public string? PyrotechnicImplementationPlan { get; set; }
|
public string? PyrotechnicImplementationPlan { get; set; }
|
||||||
public DateTime? Date { get; set; }
|
public DateOnly? Date { get; set; }
|
||||||
}
|
}
|
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
namespace PF3.DTO.Sound.Request;
|
||||||
|
|
||||||
namespace PF3.DTO.SoundCategory.Request;
|
|
||||||
|
|
||||||
public class CreateSoundDto
|
public class CreateSoundDto
|
||||||
{
|
{
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
namespace PF3.DTO.SoundCategory.Request;
|
namespace PF3.DTO.Sound.Request;
|
||||||
|
|
||||||
public class IdSoundto
|
public class IdSoundto
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
namespace PF3.DTO.Sound.Request;
|
||||||
|
|
||||||
namespace PF3.DTO.SoundCategory.Request;
|
|
||||||
|
|
||||||
public class UpdateSoundDto
|
public class UpdateSoundDto
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
namespace PF3.DTO.Sound.Response;
|
||||||
|
|
||||||
namespace PF3.DTO.SoundCategory.Response;
|
|
||||||
|
|
||||||
public class ReadSoundDto
|
public class ReadSoundDto
|
||||||
{
|
{
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
using FastEndpoints;
|
using FastEndpoints;
|
||||||
|
using PF3.DTO.Show.Request;
|
||||||
using PF3.DTO.Show.Response;
|
using PF3.DTO.Show.Response;
|
||||||
|
using PF3.Migrations;
|
||||||
using PyroFetes;
|
using PyroFetes;
|
||||||
|
|
||||||
namespace PF3.Endpoint.Show;
|
namespace PF3.Endpoint.Show;
|
||||||
|
|
||||||
public class CreateShowEndpoint(PyroFetesDbContext pyroFetesDbContext):Endpoint<CreateShowEndpoint, ReadShowDto>
|
public class CreateShowEndpoint(PyroFetesDbContext pyroFetesDbContext):Endpoint<CreateShowDto, ReadShowDto>
|
||||||
{
|
{
|
||||||
public override void Configure()
|
public override void Configure()
|
||||||
{
|
{
|
||||||
@@ -12,8 +14,29 @@ public class CreateShowEndpoint(PyroFetesDbContext pyroFetesDbContext):Endpoint<
|
|||||||
AllowAnonymous();
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
|
|||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using PF3.Migrations;
|
||||||
using PyroFetes;
|
using PyroFetes;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using PyroFetes.Models;
|
using PF3.Models;
|
||||||
using ServiceProvider = PyroFetes.Models.ServiceProvider;
|
using ServiceProvider = PF3.Models.ServiceProvider;
|
||||||
|
|
||||||
namespace PyroFetes;
|
namespace PF3.Migrations;
|
||||||
|
|
||||||
public class PyroFetesDbContext : DbContext
|
public class PyroFetesDbContext : DbContext
|
||||||
{
|
{
|
||||||
|
@@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using PF3.Migrations;
|
||||||
using PyroFetes;
|
using PyroFetes;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Availability
|
public class Availability
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Brand
|
public class Brand
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class City
|
public class City
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Classification
|
public class Classification
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Color
|
public class Color
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Communication
|
public class Communication
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Contact
|
public class Contact
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ContactId), nameof(ServiceProviderId))]
|
[PrimaryKey(nameof(ContactId), nameof(ServiceProviderId))]
|
||||||
public class ContactServiceProvider
|
public class ContactServiceProvider
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ShowId), nameof(ServiceProviderId))]
|
[PrimaryKey(nameof(ShowId), nameof(ServiceProviderId))]
|
||||||
public class Contract
|
public class Contract
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Customer
|
public class Customer
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class CustomerType
|
public class CustomerType
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Deliverer
|
public class Deliverer
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class DeliveryNote
|
public class DeliveryNote
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Effect
|
public class Effect
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class ExperienceLevel
|
public class ExperienceLevel
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class HistoryOfApproval
|
public class HistoryOfApproval
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Material
|
public class Material
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(MaterialId), nameof(WarehouseId))]
|
[PrimaryKey(nameof(MaterialId), nameof(WarehouseId))]
|
||||||
public class MaterialWarehouse
|
public class MaterialWarehouse
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Movement
|
public class Movement
|
||||||
{
|
{
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ProductId), nameof(SupplierId))]
|
[PrimaryKey(nameof(ProductId), nameof(SupplierId))]
|
||||||
public class Price
|
public class Price
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models
|
namespace PF3.Models
|
||||||
{
|
{
|
||||||
public class Product
|
public class Product
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class ProductCategory
|
public class ProductCategory
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ProductId), nameof(ColorId))]
|
[PrimaryKey(nameof(ProductId), nameof(ColorId))]
|
||||||
public class ProductColor
|
public class ProductColor
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ProductId), nameof(DeliveryNoteId))]
|
[PrimaryKey(nameof(ProductId), nameof(DeliveryNoteId))]
|
||||||
public class ProductDelivery
|
public class ProductDelivery
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ProductId), nameof(EffectId))]
|
[PrimaryKey(nameof(ProductId), nameof(EffectId))]
|
||||||
public class ProductEffect
|
public class ProductEffect
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ProductId), nameof(ShowId))]
|
[PrimaryKey(nameof(ProductId), nameof(ShowId))]
|
||||||
public class ProductTimecode
|
public class ProductTimecode
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ContactId), nameof(ProviderId))]
|
[PrimaryKey(nameof(ContactId), nameof(ProviderId))]
|
||||||
public class ProviderContact
|
public class ProviderContact
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class ProviderType
|
public class ProviderType
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class PurchaseOrder
|
public class PurchaseOrder
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ProductId), nameof(PurchaseOrderId))]
|
[PrimaryKey(nameof(ProductId), nameof(PurchaseOrderId))]
|
||||||
public class PurchaseProduct
|
public class PurchaseProduct
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Quotation
|
public class Quotation
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ProductId), nameof(QuotationId))]
|
[PrimaryKey(nameof(ProductId), nameof(QuotationId))]
|
||||||
public class QuotationProduct
|
public class QuotationProduct
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class ServiceProvider
|
public class ServiceProvider
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Setting
|
public class Setting
|
||||||
{
|
{
|
||||||
|
25
PF3/Models/Show.cs
Normal file
25
PF3/Models/Show.cs
Normal file
@@ -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<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; }
|
||||||
|
}
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ShowId), nameof(MaterialId))]
|
[PrimaryKey(nameof(ShowId), nameof(MaterialId))]
|
||||||
public class ShowMaterial
|
public class ShowMaterial
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class ShowServiceProvider
|
public class ShowServiceProvider
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(StaffId), nameof(ShowId))]
|
[PrimaryKey(nameof(StaffId), nameof(ShowId))]
|
||||||
public class ShowStaff
|
public class ShowStaff
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ShowId), nameof(TruckId))]
|
[PrimaryKey(nameof(ShowId), nameof(TruckId))]
|
||||||
public class ShowTruck
|
public class ShowTruck
|
||||||
|
20
PF3/Models/Sound.cs
Normal file
20
PF3/Models/Sound.cs
Normal file
@@ -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<SoundTimecode>? SoundTimecodes { get; set; }
|
||||||
|
}
|
11
PF3/Models/SoundCategory.cs
Normal file
11
PF3/Models/SoundCategory.cs
Normal file
@@ -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<Sound>? Sounds { get; set; }
|
||||||
|
}
|
16
PF3/Models/SoundTimecode.cs
Normal file
16
PF3/Models/SoundTimecode.cs
Normal file
@@ -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; }
|
||||||
|
}
|
20
PF3/Models/Staff.cs
Normal file
20
PF3/Models/Staff.cs
Normal file
@@ -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<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; }
|
||||||
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(AvailabilityId), nameof(StaffId))]
|
[PrimaryKey(nameof(AvailabilityId), nameof(StaffId))]
|
||||||
public class StaffAvailability
|
public class StaffAvailability
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ContactId), nameof(StaffId))]
|
[PrimaryKey(nameof(ContactId), nameof(StaffId))]
|
||||||
public class StaffContact
|
public class StaffContact
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(HistoryOfApprovalId), nameof(StaffId))]
|
[PrimaryKey(nameof(HistoryOfApprovalId), nameof(StaffId))]
|
||||||
public class StaffHistoryOfApproval
|
public class StaffHistoryOfApproval
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Supplier
|
public class Supplier
|
||||||
{
|
{
|
||||||
|
14
PF3/Models/Truck.cs
Normal file
14
PF3/Models/Truck.cs
Normal file
@@ -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<ShowTruck>? ShowTrucks { get; set; }
|
||||||
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class User
|
public class User
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
public class Warehouse
|
public class Warehouse
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace PyroFetes.Models;
|
namespace PF3.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ProductId), nameof(WarehouseId))]
|
[PrimaryKey(nameof(ProductId), nameof(WarehouseId))]
|
||||||
public class WarehouseProduct
|
public class WarehouseProduct
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
using PF3;
|
||||||
using System.Linq;
|
|
||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
@@ -44,7 +40,10 @@ app.MapGet("/weatherforecast", () =>
|
|||||||
|
|
||||||
app.Run();
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user