Prechádzať zdrojové kódy

feat: user get update and delete, and cpr basis

Fernando 1 mesiac pred
rodič
commit
022ecad59a

+ 331 - 0
src/main/java/com/platform2easy/genesis/domain/model/Cpr.java

@@ -0,0 +1,331 @@
+package com.platform2easy.genesis.domain.model;
+
+import jakarta.persistence.*;
+import lombok.*;
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+
+@Entity
+@Table(name = "cpr")
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(onlyExplicitlyIncluded = true)
+public class Cpr {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @EqualsAndHashCode.Include
+    @Column(name = "cpr_id")
+    private Long id;
+
+    @Column(name = "cpr_additive", nullable = false)
+    private String additive;
+
+    @Column(name = "cpr_agents_sender_phone", nullable = false)
+    private String senderPhone;
+
+    @Column(name = "cpr_agents_sender_cep", nullable = false)
+    private String senderCep;
+
+    @Column(name = "cpr_agents_creditor_document_number", nullable = false)
+    private String creditorDocumentNumber;
+
+    @Column(name = "cpr_agents_creditor_status", nullable = false)
+    private Boolean creditorStatus;
+
+    @Column(name = "cpr_agents_creditor_person_type", nullable = false)
+    private Integer creditorPersonType;
+
+    @Column(name = "cpr_agents_endorsement_date", nullable = false)
+    private String endorsementDate;
+
+    @Column(name = "cpr_agents_endorser", nullable = false)
+    private Boolean endorser;
+
+    @Column(name = "cpr_agents_creditor_id", nullable = false)
+    private Integer creditorId;
+
+    @Column(name = "cpr_agents_wallet_holder", nullable = false)
+    private String walletHolder;
+
+    @Column(name = "cpr_agents_cnpj_holder", nullable = false)
+    private String cnpjHolder;
+
+    @Column(name = "cpr_agents_debtor_cep", nullable = false)
+    private String debtorCep;
+
+    @Column(name = "cpr_agents_debtor_email", nullable = false)
+    private String debtorEmail;
+
+    @Column(name = "cpr_agents_debtor_name_corporate_name", nullable = false)
+    private String debtorNameCorporateName;
+
+    @Column(name = "cpr_agents_debtor_phone_number", nullable = false)
+    private String debtorPhoneNumber;
+
+    @Column(name = "cpr_agents_debtor_document_number", nullable = false)
+    private String debtorDocumentNumber;
+
+    @Column(name = "cpr_agents_debtor_status", nullable = false)
+    private Boolean debtorStatus;
+
+    @Column(name = "cpr_agents_debtor_person_type", nullable = false)
+    private Integer debtorPersonType;
+
+    @Column(name = "cpr_agents_debtor_id", nullable = false)
+    private Integer debtorId;
+
+    @Column(name = "cpr_agents_sender_email", nullable = false)
+    private String senderEmail;
+
+    @Column(name = "cpr_agents_sender_credit_agency", nullable = false)
+    private String senderCreditAgency;
+
+    @Column(name = "cpr_agents_sender_credit_bank", nullable = false)
+    private String senderCreditBank;
+
+    @Column(name = "cpr_agents_sender_credit_checking_account", nullable = false)
+    private String senderCreditCheckingAccount;
+
+    @Column(name = "cpr_agents_guarantor_phone", nullable = false)
+    private String guarantorPhone;
+
+    @Column(name = "cpr_agents_guarantor_email", nullable = false)
+    private String guarantorEmail;
+
+    @Column(name = "cpr_agents_guarantor_cep", nullable = false)
+    private String guarantorCep;
+
+    @Column(name = "cpr_agents_guarantor_document_number", nullable = false)
+    private String guarantorDocumentNumber;
+
+    @Column(name = "cpr_agents_guarantor_status", nullable = false)
+    private Boolean guarantorStatus;
+
+    @Column(name = "cpr_agents_guarantor_person_type", nullable = false)
+    private Integer guarantorPersonType;
+
+    @Column(name = "cpr_agents_guarantor_id", nullable = false)
+    private Integer guarantorId;
+
+    @Column(name = "cpr_agents_guarantor_type", nullable = false)
+    private Integer guarantorType;
+
+    @Column(name = "cpr_agents_sender_document_number", nullable = false)
+    private String senderDocumentNumber;
+
+    @Column(name = "cpr_agents_sender_person_type", nullable = false)
+    private Integer senderPersonType;
+
+    @Column(name = "cpr_area_total", nullable = false)
+    private Double areaTotal;
+
+    @Column(name = "cpr_area_registry", nullable = false)
+    private String areaRegistry;
+
+    @Column(name = "cpr_area_cep", nullable = false)
+    private String areaCep;
+
+    @Column(name = "cpr_area_address", nullable = false)
+    private String areaAddress;
+
+    @Column(name = "cpr_area_property_unitary_fraction", nullable = false)
+    private String areaPropertyUnitaryFraction;
+
+    @Column(name = "cpr_area_id", nullable = false)
+    private Integer areaId;
+
+    @Column(name = "cpr_area_latitude", nullable = false)
+    private Double areaLatitude;
+
+    @Column(name = "cpr_area_logitude", nullable = false)
+    private Double areaLongitude;
+
+    @Column(name = "cpr_area_registration", nullable = false)
+    private String areaRegistration;
+
+    @Column(name = "cpr_area_farm_name", nullable = false)
+    private String areaFarmName;
+
+    @Column(name = "cpr_area_product_cpr_necessery_area", nullable = false)
+    private Double productCprNecesseryArea;
+
+    @Column(name = "cpr_area_product_total_productive_area", nullable = false)
+    private Double productTotalProductiveArea;
+
+    @Column(name = "cpr_area_product_class_type_ph", nullable = false)
+    private String productClassTypePh;
+
+    @Column(name = "cpr_area_product_culture", nullable = false)
+    private String productCulture;
+
+    @Column(name = "cpr_area_product_culture_specificity", nullable = false)
+    private String productCultureSpecificity;
+
+    @Column(name = "cpr_area_product_packaging_method", nullable = false)
+    private String productPackagingMethod;
+
+    @Column(name = "cpr_area_product_id", nullable = false)
+    private Integer productId;
+
+    @Column(name = "cpr_area_product_assessment_index", nullable = false)
+    private String productAssessmentIndex;
+
+    @Column(name = "cpr_area_product_institution_responsible_index", nullable = false)
+    private String productInstitutionResponsibleIndex;
+
+    @Column(name = "cpr_area_product_delivery_location_city", nullable = false)
+    private String productDeliveryLocationCity;
+
+    @Column(name = "cpr_area_product_delivery_location_regional", nullable = false)
+    private String productDeliveryLocationRegional;
+
+    @Column(name = "cpr_area_product_delivery_location_fu", nullable = false)
+    private String productDeliveryLocationFu;
+
+    @Column(name = "cpr_area_product_volume_price", nullable = false)
+    private Double productVolumePrice;
+
+    @Column(name = "cpr_area_product_production", nullable = false)
+    private String productProduction;
+
+    @Column(name = "cpr_area_product_productivity", nullable = false)
+    private String productProductivity;
+
+    @Column(name = "cpr_area_product_harvest", nullable = false)
+    private String productHarvest;
+
+    @Column(name = "cpr_area_product_situation", nullable = false)
+    private String productSituation;
+
+    @Column(name = "cpr_area_product_status", nullable = false)
+    private Boolean productStatus;
+
+    @Column(name = "cpr_area_product_volume_mesuring_unit", nullable = false)
+    private String productVolumeMesuringUnit;
+
+    @Column(name = "cpr_area_product_register_value", nullable = false)
+    private String productRegisterValue;
+
+    @Column(name = "cpr_area_product_volume_quantity", nullable = false)
+    private String productVolumeQuantity;
+
+    @Column(name = "cpr_area_owner", nullable = false)
+    private String areaOwner;
+
+    @Column(name = "cpr_area_legal_reserve", nullable = false)
+    private Double areaLegalReserve;
+
+    @Column(name = "cpr_area_status", nullable = false)
+    private Boolean areaStatus;
+
+    @Column(name = "cpr_contracts_registration_authorized_and_clear_fi_record", nullable = false)
+    private Boolean contractsRegistrationAuthorizedAndClearFiRecord;
+
+    @Column(name = "cpr_contracts_credit_operation_contract_code", nullable = false)
+    private String contractsCreditOperationContractCode;
+
+    @Column(name = "cpr_contracts_contract_scr", nullable = false)
+    private String contractsContractScr;
+
+    @Column(name = "cpr_contracts_coin_code", nullable = false)
+    private String contractsCoinCode;
+
+    @Column(name = "cpr_contracts_other_fi_discharge_date", nullable = false)
+    private OffsetDateTime contractsOtherFiDischargeDate;
+
+    @Column(name = "cpr_contracts_fi_hiring_date", nullable = false)
+    private OffsetDateTime contractsFiHiringDate;
+
+    @Column(name = "cpr_contracts_original_register_date", nullable = false)
+    private OffsetDateTime contractsOriginalRegisterDate;
+
+    @Column(name = "cpr_contracts_transaction_date", nullable = false)
+    private LocalDate contractsTransactionDate;
+
+    @Column(name = "cpr_contracts_scr_standardized_identification", nullable = false)
+    private String contractsScrStandardizedIdentification;
+
+    @Column(name = "cpr_contracts_indexation", nullable = false)
+    private String contractsIndexation;
+
+    @Column(name = "cpr_contracts_operation_nature", nullable = false)
+    private String contractsOperationNature;
+
+    @Column(name = "cpr_contracts_indexing_percentage", nullable = false)
+    private Double contractsIndexingPercentage;
+
+    @Column(name = "cpr_contracts_installments_quantity_contracted", nullable = false)
+    private Integer contractsInstallmentsQuantityContracted;
+
+    @Column(name = "cpr_contracts_extern_reference", nullable = false)
+    private String contractsExternReference;
+
+    @Column(name = "cpr_contracts_operation_interest_rate", nullable = false)
+    private Double contractsOperationInterestRate;
+
+    @Column(name = "cpr_contracts_asset_type", nullable = false)
+    private String contractsAssetType;
+
+    @Column(name = "cpr_contracts_contract_financed_value", nullable = false)
+    private Double contractsContractFinancedValue;
+
+    @Column(name = "cpr_contracts_credit_liquid_value", nullable = false)
+    private Double contractsCreditLiquidValue;
+
+    @Column(name = "cpr_contracts_credit_total_value", nullable = false)
+    private Double contractsCreditTotalValue;
+
+    @Column(name = "cpr_emission_delivery_date", nullable = false)
+    private LocalDate emissionDeliveryDate;
+
+    @Column(name = "cpr_emission_id", nullable = false)
+    private Integer emissionId;
+
+    @Column(name = "cpr_emission_location", nullable = false)
+    private String emissionLocation;
+
+    @Column(name = "cpr_emission_issuer_corporate_name", nullable = false)
+    private String emissionIssuerCorporateName;
+
+    @Column(name = "cpr_emission_cpr_type", nullable = false)
+    private String emissionCprType;
+
+    @Column(name = "cpr_guarantee_status", nullable = false)
+    private Boolean guaranteeStatus;
+
+    @Column(name = "cpr_guarantee_id", nullable = false)
+    private Integer guaranteeId;
+
+    @Column(name = "cpr_guarantee_type", nullable = false)
+    private String guaranteeType;
+
+    @Column(name = "cpr_installment_control_code", nullable = false)
+    private String installmentControlCode;
+
+    @Column(name = "cpr_installment_due_date", nullable = false)
+    private String installmentDueDate;
+
+    @Column(name = "cpr_installment_register_id", nullable = false)
+    private Integer installmentRegisterId;
+
+    @Column(name = "cpr_installment_number", nullable = false)
+    private Integer installmentNumber;
+
+    @Column(name = "cpr_installment_assignment_price", nullable = false)
+    private Integer installmentAssignmentPrice;
+
+    @Column(name = "cpr_installment_status", nullable = false)
+    private Integer installmentStatus;
+
+    @Column(name = "cpr_installment_value", nullable = false)
+    private Double installmentValue;
+
+    @Column(name = "cpr_installment_main_value", nullable = false)
+    private Double installmentMainValue;
+
+    @Column(name = "cpr_status", nullable = false)
+    private String status;
+}

+ 7 - 0
src/main/java/com/platform2easy/genesis/domain/repository/CprRepository.java

@@ -0,0 +1,7 @@
+package com.platform2easy.genesis.domain.repository;
+
+import com.platform2easy.genesis.domain.model.Cpr;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface CprRepository extends JpaRepository<Commoditiy, Long> {
+}

+ 15 - 0
src/main/java/com/platform2easy/genesis/domain/service/UserService.java

@@ -27,7 +27,22 @@ public class UserService implements UserDetailsService {
                 Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER")));
     }
 
+    @Transactional
+    public AppUser salvar(AppUser user) {
+
+        appUserRepository.save(user);
+        return user;
+    }
+
+    public AppUser buscarPorEmpresa(Integer companyId) {
+        return appUserRepository.findByCompanyId(companyId).orElseThrow();
+    }
+
     public List<AppUser> listAll(){
         return appUserRepository.findAll();
     }
+
+    public void deletarPorId(Long id) {
+        appUserRepository.deleteById(id);
+    }
 }

+ 4 - 0
src/main/java/com/platform2easy/genesis/domain/service/WalletService.java

@@ -28,6 +28,10 @@ public class WalletService {
         return repository.findById(id).orElseThrow();
     }
 
+    public Wallet buscarPorEmpresa(Integer companyId) {
+        return repository.findByCompanyId(companyId).orElseThrow();
+    }
+
     public void deletarPorId(Long id) {
         repository.deleteById(id);
     }

+ 24 - 0
src/main/java/com/platform2easy/genesis/web/controller/AuthenticationController.java

@@ -2,6 +2,7 @@ package com.platform2easy.genesis.web.controller;
 
 import com.platform2easy.genesis.domain.model.AppUser;
 import com.platform2easy.genesis.domain.repository.AppUserRepository;
+import com.platform2easy.genesis.domain.service.UserService;
 import com.platform2easy.genesis.infra.security.TokenService;
 import com.platform2easy.genesis.web.dto.AuthenticationDTO;
 import com.platform2easy.genesis.web.dto.RegisterDTO;
@@ -21,6 +22,7 @@ import java.util.Optional;
 @RequestMapping("/auth")
 public class AuthenticationController {
 
+    private final UserService service;
     private final AppUserRepository appUserRepository;
     private final PasswordEncoder passwordEncoder;
     private final TokenService tokenService;
@@ -31,6 +33,13 @@ public class AuthenticationController {
         this.tokenService = tokenService;
     }
 
+    // GET /api/auth/{companyId}: Busca por ID da Empresa
+    @GetMapping("/{companyId}")
+    @ResponseStatus(HttpStatus.OK)
+    public AppUser getByCompanyId(@PathVariable Integer companyId) {
+        return service.buscarPorEmpresa(companyId);
+    }
+
     @PostMapping("/register")
     public ResponseEntity<?> register(@Valid @RequestBody RegisterDTO dto) {
         Optional<AppUser> existing = appUserRepository.findByUserEmail(dto.getEmail());
@@ -106,4 +115,19 @@ public class AuthenticationController {
         String token = tokenService.generateToken(user);
         return ResponseEntity.status(status).body(new TokenDTO(token));
     }
+
+    // PUT /api/auth/register/{id}: Atualiza um registro existente
+    @PutMapping("/{id}")
+    @ResponseStatus(HttpStatus.OK)
+    public AppUser update(@PathVariable Long id, @RequestBody AppUser user) {
+        user.setId(id);
+        return service.salvar(user);
+    }
+
+    // DELETE /api/auth/register/{id}: Deleta um registro
+    @DeleteMapping("/{id}")
+    @ResponseStatus(HttpStatus.NO_CONTENT)
+    public void delete(@PathVariable Long id) {
+        service.deletarPorId(id);
+    }
 }

+ 3 - 0
src/main/java/com/platform2easy/genesis/web/controller/CprController.java

@@ -0,0 +1,3 @@
+public class CprController {
+    
+}

+ 6 - 0
src/main/java/com/platform2easy/genesis/web/controller/WalletController.java

@@ -27,6 +27,12 @@ public class WalletController {
         return service.buscarPorId(id);
     }
 
+    @GetMapping("/{companyId}")
+    @ResponseStatus(HttpStatus.OK)
+    public AppUser getByCompanyId(@PathVariable Integer companyId) {
+        return service.buscarPorEmpresa(companyId);
+    }
+
     @PostMapping
     @ResponseStatus(HttpStatus.CREATED)
     public Wallet create(@RequestBody Wallet wallet) {

+ 105 - 1
src/main/resources/db/migration/postgresql/V1__init.sql

@@ -25,7 +25,111 @@ CREATE TABLE "status" (
 );
 
 CREATE TABLE "cpr" (
-    "cpr_id" SERIAL PRIMARY KEY
+    "cpr_id" SERIAL PRIMARY KEY,
+    "cpr_additive" TEXT NOT NULL,
+    "cpr_agents_sender_phone" TEXT NOT NULL,
+    "cpr_agents_sender_cep" TEXT NOT NULL,
+    "cpr_agents_creditor_document_number" TEXT NOT NULL,
+    "cpr_agents_creditor_status" BOOLEAN NOT NULL,
+    "cpr_agents_creditor_person_type" INTEGER NOT NULL,
+    "cpr_agents_endorsement_date" TEXT NOT NULL,
+    "cpr_agents_endorser" BOOLEAN NOT NULL,
+    "cpr_agents_creditor_id" INTEGER NOT NULL,
+    "cpr_agents_wallet_holder" TEXT NOT NULL,
+    "cpr_agents_cnpj_holder" TEXT NOT NULL,
+    "cpr_agents_debtor_cep" TEXT NOT NULL,
+    "cpr_agents_debtor_email" TEXT NOT NULL,
+    "cpr_agents_debtor_name_corporate_name" TEXT NOT NULL,
+    "cpr_agents_debtor_phone_number" TEXT NOT NULL,
+    "cpr_agents_debtor_document_number" TEXT NOT NULL,
+    "cpr_agents_debtor_status" BOOLEAN NOT NULL,
+    "cpr_agents_debtor_person_type" INTEGER NOT NULL,
+    "cpr_agents_debtor_id" INTEGER NOT NULL,
+    "cpr_agents_sender_email" TEXT NOT NULL,
+    "cpr_agents_sender_credit_agency" TEXT NOT NULL,
+    "cpr_agents_sender_credit_bank" TEXT NOT NULL,
+    "cpr_agents_sender_credit_checking_account" TEXT NOT NULL,
+    "cpr_agents_guarantor_phone" TEXT NOT NULL,
+    "cpr_agents_guarantor_email" TEXT NOT NULL,
+    "cpr_agents_guarantor_cep" TEXT NOT NULL,
+    "cpr_agents_guarantor_document_number" TEXT NOT NULL,
+    "cpr_agents_guarantor_status" BOOLEAN NOT NULL,
+    "cpr_agents_guarantor_person_type" INTEGER NOT NULL,
+    "cpr_agents_guarantor_id" INTEGER NOT NULL,
+    "cpr_agents_guarantor_type" INTEGER NOT NULL,
+    "cpr_agents_sender_document_number" TEXT NOT NULL,
+    "cpr_agents_sender_person_type" INTEGER NOT NULL,
+    "cpr_area_total" NUMBER NOT NULL,
+    "cpr_area_registry" TEXT NOT NULL,
+    "cpr_area_cep" TEXT NOT NULL,
+    "cpr_area_address" TEXT NOT NULL,
+    "cpr_area_property_unitary_fraction" TEXT NOT NULL,
+    "cpr_area_id" INTEGER NOT NULL,
+    "cpr_area_latitude" NUMBER NOT NULL,
+    "cpr_area_logitude" NUMBER NOT NULL,
+    "cpr_area_registration" TEXT NOT NULL,
+    "cpr_area_farm_name" TEXT NOT NULL,
+    "cpr_area_product_cpr_necessery_area" NUMBER NOT NULL,
+    "cpr_area_product_total_productive_area" NUMBER NOT NULL,
+    "cpr_area_product_class_type_ph" TEXT NOT NULL,
+    "cpr_area_product_culture" TEXT NOT NULL,
+    "cpr_area_product_culture_specificity" TEXT NOT NULL,
+    "cpr_area_product_packaging_method" TEXT NOT NULL,
+    "cpr_area_product_id" INTEGER NOT NULL,
+    "cpr_area_product_assessment_index" TEXT NOT NULL,
+    "cpr_area_product_institution_responsible_index" TEXT NOT NULL,
+    "cpr_area_product_assessment_index" TEXT NOT NULL,
+    "cpr_area_product_delivery_location_city" TEXT NOT NULL,
+    "cpr_area_product_delivery_location_regional" TEXT NOT NULL,
+    "cpr_area_product_delivery_location_fu" TEXT NOT NULL,
+    "cpr_area_product_volume_price" NUMBER NOT NULL,
+    "cpr_area_product_production" TEXT NOT NULL,
+    "cpr_area_product_productivity" TEXT NOT NULL,
+    "cpr_area_product_harvest" TEXT NOT NULL,
+    "cpr_area_product_situation" TEXT NOT NULL,
+    "cpr_area_product_status" BOOLEAN NOT NULL,
+    "cpr_area_product_volume_mesuring_unit" TEXT NOT NULL,
+    "cpr_area_product_register_value" TEXT NOT NULL,
+    "cpr_area_product_volume_quantity" TEXT NOT NULL,
+    "cpr_area_owner" TEXT NOT NULL,
+    "cpr_area_legal_reserve" NUMBER NOT NULL,
+    "cpr_area_status" BOOLEAN NOT NULL,
+    "cpr_contracts_registration_authorized_and_clear_fi_record" BOOLEAN NOT NULL, --autorizo_registro_e_declaro_que_foi_dado_baixa_no_registro_em_quaisquer_outras_if
+    "cpr_contracts_credit_operation_contract_code" TEXT NOT NULL,
+    "cpr_contracts_contract_scr" TEXT NOT NULL,
+    "cpr_contracts_coin_code" TEXT NOT NULL,
+    "cpr_contracts_other_fi_discharge_date" TIMESTAMPTZ NOT NULL,
+    "cpr_contracts_fi_hiring_date" TIMESTAMPTZ NOT NULL,
+    "cpr_contracts_original_register_date" TIMESTAMPTZ NOT NULL,
+    "cpr_contracts_transaction_date" DATE NOT NULL,
+    "cpr_contracts_scr_standardized_identification" TEXT NOT NULL,
+    "cpr_contracts_indexation" TEXT NOT NULL,
+    "cpr_contracts_operation_nature" TEXT NOT NULL,
+    "cpr_contracts_indexing_percentage" NUMBER NOT NULL,
+    "cpr_contracts_installments_quantity_contracted" INTEGER NOT NULL,
+    "cpr_contracts_extern_reference" TEXT NOT NULL,
+    "cpr_contracts_operation_interest_rate" NUMBER NOT NULL,
+    "cpr_contracts_asset_type" TEXT NOT NULL,
+    "cpr_contracts_contract_financed_value" NUMBER NOT NULL,
+    "cpr_contracts_credit_liquid_value" NUMBER NOT NULL,
+    "cpr_contracts_credit_total_value" NUMBER NOT NULL,
+    "cpr_emission_delivery_date" DATE NOT NULL,
+    "cpr_emission_id" INTEGER NOT NULL,
+    "cpr_emission_location" TEXT NOT NULL,
+    "cpr_emission_issuer_corporate_name" TEXT NOT NULL,
+    "cpr_emission_cpr_type" TEXT NOT NULL, --fisico, financeiro
+    "cpr_guarantee_status" BOOLEAN NOT NULL,
+    "cpr_guarantee_id" INTEGER NOT NULL,
+    "cpr_guarantee_type" TEXT NOT NULL,
+    "cpr_installment_control_code" TEXT NOT NULL,
+    "cpr_installment_due_date" TEXT NOT NULL,
+    "cpr_installment_register_id" INTEGER NOT NULL,
+    "cpr_installment_number" INTEGER NOT NULL,
+    "cpr_installment_assignment_price" INTEGER NOT NULL,
+    "cpr_installment_status" INTEGER NOT NULL,
+    "cpr_installment_value" NUMBER NOT NULL,
+    "cpr_installment_main_value" NUMBER NOT NULL,
+    "cpr_status" TEXT NOT NULL --1 - ACEITO, 2 - LIQUIDADO, 3 - RECUSADO, 4 - CANCELADO
 );
 
 CREATE TABLE "commodities" (