package org.estatio.dom.numerator;

import javax.jdo.annotations.Discriminator;
import javax.jdo.annotations.DiscriminatorStrategy;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.PersistenceCapable;

import org.estatio.dom.invoice.Invoice;

import org.apache.isis.applib.annotation.ActionSemantics;
import org.apache.isis.applib.annotation.ActionSemantics.Of;
import org.apache.isis.applib.annotation.Hidden;
import org.apache.isis.applib.annotation.MemberOrder;

@PersistenceCapable(/*serializeRead = "true"*/)
@Inheritance(strategy = InheritanceStrategy.SUPERCLASS_TABLE)
@Discriminator(strategy = DiscriminatorStrategy.CLASS_NAME)
public class NumeratorForInvoiceNumber extends Numerator {

    public String iconName() {
        return "Numerator";
    }

    @ActionSemantics(Of.NON_IDEMPOTENT)
    @Hidden
    public boolean assign(Invoice invoice){
        if (invoice.getInvoiceNumber() != null) {
            return false;
        } 
        invoice.setInvoiceNumber(String.format("INV-%05d", increment()));
        return true;
    }
    
    // {{ Dummy (property)
    private String dummy;

    @MemberOrder(sequence = "1")
    public String getDummy() {
        return dummy;
    }

    public void setDummy(final String dummy) {
        this.dummy = dummy;
    }
    // }}


}

@@ -271,49 +271,8 @@
 e;%0A%0A
-import org.estatio.dom.invoice.Invoice;%0A%0A
 impo
@@ -450,49 +450,35 @@
 org.
-apache.isis.applib.annotation.MemberOrder
+estatio.dom.invoice.Invoice
 ;%0A%0A@
@@ -498,16 +498,17 @@
 pable(/*
+ 
 serializ
@@ -521,16 +521,17 @@
 = %22true%22
+ 
 */)%0A@Inh
@@ -868,16 +868,17 @@
 invoice)
+ 
 %7B%0A      
@@ -956,17 +956,16 @@
        %7D
- 
 %0A       
@@ -1062,251 +1062,7 @@
   %7D%0A
-    %0A    // %7B%7B Dummy (property)%0A    private String dummy;%0A%0A    @MemberOrder(sequence = %221%22)%0A    public String getDummy() %7B%0A        return dummy;%0A    %7D%0A%0A    public void setDummy(final String dummy) %7B%0A        this.dummy = dummy;%0A    %7D%0A    // %7D%7D%0A%0A
 %0A%7D%0A

remove dummy field from numerator