Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.entity.fofo;

import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * One failed approval attempt on a return whose credit note NIC refused because the buyer's GSTIN
 * is cancelled or invalid. Written in its own transaction so it outlives the rollback of the
 * approval it records; the latest row for a return decides whether Finance may refund it as B2C
 * today.
 */
@Entity
@Table(name = "fofo.return_irn_failure")
public class ReturnIrnFailure {

        public static final String FLOW_INVOICE_RETURN = "INVOICE_RETURN";
        public static final String FLOW_DEBIT_NOTE_RETURN = "DEBIT_NOTE_RETURN";

        /** NIC refused the original invoice itself, so no credit note could reference it. */
        public static final String STAGE_INVOICE_IRN = "INVOICE_IRN";
        /** The invoice had an IRN; NIC refused the credit note raised against it. */
        public static final String STAGE_CREDIT_NOTE_IRN = "CREDIT_NOTE_IRN";

        @Id
        @Column(name = "id")
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private int id;

        @Column(name = "purchase_return_order_id")
        private int purchaseReturnOrderId;

        @Column(name = "invoice_number")
        private String invoiceNumber;

        @Column(name = "flow")
        private String flow;

        @Column(name = "stage")
        private String stage;

        @Column(name = "reason")
        private String reason;

        @Column(name = "attempted_by")
        private String attemptedBy;

        @Convert(converter = LocalDateTimeAttributeConverter.class)
        @Column(name = "attempted_at")
        private LocalDateTime attemptedAt;

        public int getId() {
                return id;
        }

        public void setId(int id) {
                this.id = id;
        }

        public int getPurchaseReturnOrderId() {
                return purchaseReturnOrderId;
        }

        public void setPurchaseReturnOrderId(int purchaseReturnOrderId) {
                this.purchaseReturnOrderId = purchaseReturnOrderId;
        }

        public String getInvoiceNumber() {
                return invoiceNumber;
        }

        public void setInvoiceNumber(String invoiceNumber) {
                this.invoiceNumber = invoiceNumber;
        }

        public String getFlow() {
                return flow;
        }

        public void setFlow(String flow) {
                this.flow = flow;
        }

        public String getStage() {
                return stage;
        }

        public void setStage(String stage) {
                this.stage = stage;
        }

        public String getReason() {
                return reason;
        }

        public void setReason(String reason) {
                this.reason = reason;
        }

        public String getAttemptedBy() {
                return attemptedBy;
        }

        public void setAttemptedBy(String attemptedBy) {
                this.attemptedBy = attemptedBy;
        }

        public LocalDateTime getAttemptedAt() {
                return attemptedAt;
        }

        public void setAttemptedAt(LocalDateTime attemptedAt) {
                this.attemptedAt = attemptedAt;
        }
}